raiden00pl commented on a change in pull request #1662:
URL: https://github.com/apache/incubator-nuttx/pull/1662#discussion_r479904588
##########
File path: arch/arm/src/nrf52/nrf52_gpiote.c
##########
@@ -285,3 +290,79 @@ int nrf52_gpiote_init(void)
return OK;
}
+
+/****************************************************************************
+ * Name: nrf52_gpiotaskset
+ *
+ * Description:
+ * Configure GPIO in TASK mode (to be controlled via tasks).
+ * Note that a pin can only be either in TASK or EVENT mode (set by
+ * nrf52_gpiosetevent with event set to true). Also, once set to TASK mode,
+ * pin control is only possible via tasks on the via nrf52_gpio_write and
+ * will automatically set the output mode.
+ * Finally, a given pin should only be assigned to a given channel.
+ *
+ * Input Parameters:
+ * - pinset: gpio pin configuration (only port + pin is important here)
+ * - channel: the GPIOTE channel used to control the given pin
+ * - output_high: set pin initially to output HIGH or LOW.
+ * - outcfg: configure pin behavior one OUT task is triggered
+ *
+ * Returned Value:
+ * Zero (OK) on success; a negated errno value on failure indicating the
+ * nature of the failure.
+ *
+ ****************************************************************************/
+
+int nrf52_gpiotaskset(uint32_t pinset, int channel,
+ bool output_high, enum nrf52_gpiote_outcfg_e outcfg)
+{
+ uint32_t regval;
+ int pin;
+
Review comment:
```suggestion
#ifdef CONFIG_NRF52_HAVE_PORT1
int port = 0;
#endif
```
Just what I noticed :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]