Browse Source

nanofury: Add NANOFURY_GP_PIN_PWR_EN0 (inverted PWR_EN) - support for power management (hardware) optimizations

nanofury 11 years ago
parent
commit
a65cdff0b8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      driver-nanofury.c

+ 5 - 0
driver-nanofury.c

@@ -27,6 +27,7 @@
 #define NANOFURY_GP_PIN_LED 0
 #define NANOFURY_GP_PIN_LED 0
 #define NANOFURY_GP_PIN_SCK_OVR 5
 #define NANOFURY_GP_PIN_SCK_OVR 5
 #define NANOFURY_GP_PIN_PWR_EN 6
 #define NANOFURY_GP_PIN_PWR_EN 6
+#define NANOFURY_GP_PIN_PWR_EN0 7
 
 
 #define NANOFURY_MAX_BYTES_PER_SPI_TRANSFER 60			// due to MCP2210 limitation
 #define NANOFURY_MAX_BYTES_PER_SPI_TRANSFER 60			// due to MCP2210 limitation
 
 
@@ -165,6 +166,10 @@ bool nanofury_checkport(struct mcp2210_device * const mcp, const unsigned long b
 	if (!mcp2210_set_gpio_output(mcp, NANOFURY_GP_PIN_PWR_EN, MGV_HIGH))
 	if (!mcp2210_set_gpio_output(mcp, NANOFURY_GP_PIN_PWR_EN, MGV_HIGH))
 		goto fail;
 		goto fail;
 	
 	
+	// PWR_EN0
+	if (!mcp2210_set_gpio_output(mcp, NANOFURY_GP_PIN_PWR_EN0, MGV_LOW))
+		goto fail;
+	
 	// cancel any outstanding SPI transfers
 	// cancel any outstanding SPI transfers
 	mcp2210_spi_cancel(mcp);
 	mcp2210_spi_cancel(mcp);