summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-03-31 15:00:23 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-03-31 15:00:23 -0600
commit494dfe2ae6157348956b941eb7a1f57b66181a56 (patch)
tree7201b16b309f34b73f46936ed1980c0ef0b8154a /nuttx/include
parent49a7570f92a3ae31838f2eea2fa71354361f2881 (diff)
downloadpx4-nuttx-494dfe2ae6157348956b941eb7a1f57b66181a56.tar.gz
px4-nuttx-494dfe2ae6157348956b941eb7a1f57b66181a56.tar.bz2
px4-nuttx-494dfe2ae6157348956b941eb7a1f57b66181a56.zip
Rename adc_devinit() to board_adc_setup(). Add support to the boardctl() interface so that it can call board_adc_setup() on behalf of an application. Change apps/examples/adc to that is now calls boardctl() instead of adc_devinit() in order to initalize the ADC device.
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/board.h26
-rw-r--r--nuttx/include/sys/boardctl.h17
2 files changed, 43 insertions, 0 deletions
diff --git a/nuttx/include/nuttx/board.h b/nuttx/include/nuttx/board.h
index 2942b0217..80ec312c6 100644
--- a/nuttx/include/nuttx/board.h
+++ b/nuttx/include/nuttx/board.h
@@ -197,6 +197,32 @@ int board_tsc_setup(int minor);
void board_tsc_teardown(void);
/****************************************************************************
+ * Name: board_adc_setup
+ *
+ * Description:
+ * All architectures must provide the following interface in order to
+ * work with examples/adc.
+ *
+ ****************************************************************************/
+
+int board_adc_setup(void);
+
+/****************************************************************************
+ * Name: board_ioctl
+ *
+ * Description:
+ * If CONFIG_LIB_BOARDCTL=y, boards may also select CONFIG_BOARDCTL_IOCTL=y
+ * enable board specific commands. In this case, all commands not
+ * recognized by boardctl() will be forwarded to the board-provided
+ * board_ioctl() function.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_BOARDCTL_IOCTL
+int board_ioctl(unsigned int cmd, uintptr_t arg);
+#endif
+
+/****************************************************************************
* Name: board_led_initialize
*
* Description:
diff --git a/nuttx/include/sys/boardctl.h b/nuttx/include/sys/boardctl.h
index 675daa802..8da574ec3 100644
--- a/nuttx/include/sys/boardctl.h
+++ b/nuttx/include/sys/boardctl.h
@@ -69,11 +69,28 @@
* ARG: None
* CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST
* DEPENDENCIES: Board logic must provide board_tsc_teardown()
+ *
+ * CMD: BOARDIOC_ADCTEST_SETUP
+ * DESCRIPTION: ADC controller test configuration
+ * ARG: None
+ * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_ADCTEST
+ * DEPENDENCIES: Board logic must provide board_adc_setup()
+ *
*/
#define BOARDIOC_INIT _BOARDIOC(0x0001)
#define BOARDIOC_TSCTEST_SETUP _BOARDIOC(0x0002)
#define BOARDIOC_TSCTEST_TEARDOWN _BOARDIOC(0x0003)
+#define BOARDIOC_ADCTEST_SETUP _BOARDIOC(0x0004)
+
+/* If CONFIG_BOARDCTL_IOCTL=y, then boad-specific commands will be support.
+ * In this case, all commands not recognized by boardctl() will be forwarded
+ * to the board-provided board_ioctl() function.
+ *
+ * User defined board commands may begin with this value:
+ */
+
+#define BOARDIOC_USER _BOARDIOC(0x0005)
/****************************************************************************
* Public Type Definitions