Userled driver: Add option to check actual pin state with getall

This commit is contained in:
Jari van Ewijk
2021-10-18 10:03:33 +02:00
committed by David Sidrane
parent 9a0146f15f
commit b1d5eff52d
5 changed files with 69 additions and 1 deletions
+22
View File
@@ -673,6 +673,28 @@ void board_userled(int led, bool ledon);
void board_userled_all(uint32_t ledset);
#endif
/****************************************************************************
* Name: board_userled_getall
*
* Description:
* This interface may be used by application specific logic to read the
* state of all board LEDs. Definitions for the led set member
* identification is provided in the board-specific board.h header file
* that may be included like:
*
* #included <arch/board/board.h>
*
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then this interfaces may be
* available to check the LEDs directly from user board logic or indirectly
* user applications (via the common LED character driver).
*
****************************************************************************/
#if defined(CONFIG_ARCH_HAVE_LEDS) && defined(CONFIG_USERLED_LOWER_READSTATE)
void board_userled_getall(uint32_t *ledset);
#endif
/****************************************************************************
* Name: board_button_initialize
*
+7
View File
@@ -126,6 +126,13 @@ struct userled_lowerhalf_s
CODE void (*ll_setall)(FAR const struct userled_lowerhalf_s *lower,
userled_set_t ledset);
#ifdef CONFIG_USERLED_LOWER_READSTATE
/* Get the state of all LEDs */
CODE void (*ll_getall)(FAR const struct userled_lowerhalf_s *lower,
userled_set_t *ledset);
#endif
};
/****************************************************************************