summaryrefslogtreecommitdiff
path: root/nuttx/configs/stm3240g-eval/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-05 16:58:18 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-05 16:58:18 +0000
commit7dcb0729864fa8f28f5e9a217a2b79141aeae3a2 (patch)
treec67455478d70f198818b1d52ca222c2f315a70ca /nuttx/configs/stm3240g-eval/include
parentd7fadacd141270fc041f9cae09eb40fbd8ee7bce (diff)
downloadpx4-nuttx-7dcb0729864fa8f28f5e9a217a2b79141aeae3a2.tar.gz
px4-nuttx-7dcb0729864fa8f28f5e9a217a2b79141aeae3a2.tar.bz2
px4-nuttx-7dcb0729864fa8f28f5e9a217a2b79141aeae3a2.zip
Add APIs to support user access to the STM3240G-EVAL LEDs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4263 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/stm3240g-eval/include')
-rwxr-xr-xnuttx/configs/stm3240g-eval/include/board.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/nuttx/configs/stm3240g-eval/include/board.h b/nuttx/configs/stm3240g-eval/include/board.h
index 6c3b32497..80ac9a809 100755
--- a/nuttx/configs/stm3240g-eval/include/board.h
+++ b/nuttx/configs/stm3240g-eval/include/board.h
@@ -212,7 +212,28 @@
#endif
/* LED definitions ******************************************************************/
-/* The STM3240G-EVAL board has 4 LEDs that we will encode as: */
+/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any
+ * way. The following definitions are used to access individual LEDs.
+ */
+
+/* LED index values for use with stm32_setled() */
+
+#define BOARD_LED1 0
+#define BOARD_LED2 1
+#define BOARD_LED3 2
+#define BOARD_LED4 3
+#define BOARD_NLEDS 4
+
+/* LED bits for use with stm32_setleds() */
+
+#define BOARD_LED1_BIT (1 << BOARD_LED1)
+#define BOARD_LED2_BIT (1 << BOARD_LED2)
+#define BOARD_LED3_BIT (1 << BOARD_LED3)
+#define BOARD_LED4_BIT (1 << BOARD_LED4)
+
+/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 4 LEDs on board the
+ * STM3240G-EVAL. The following definitions describe how NuttX controls the LEDs:
+ */
#define LED_STARTED 0 /* LED1 */
#define LED_HEAPALLOCATE 1 /* LED2 */
@@ -357,6 +378,22 @@ extern "C" {
EXTERN void stm32_boardinitialize(void);
/************************************************************************************
+ * Name: stm32_ledinit, stm32_setled, and stm32_setleds
+ *
+ * Description:
+ * If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board LEDs. If
+ * CONFIG_ARCH_LEDS is not defined, then the following interfacesare available to
+ * control the LEDs from user applications.
+ *
+ ************************************************************************************/
+
+#ifndef CONFIG_ARCH_LEDS
+EXTERN void stm32_ledinit(void);
+EXTERN void stm32_setled(int led, bool ledon);
+EXTERN void stm32_setleds(uint8_t ledset);
+#endif
+
+/************************************************************************************
* Button support.
*
* Description: