ESOS32
ESOSOn32-bitProcessors
|
Files | |
file | esos_hwxxxx_sui.c |
Template for creating hardware-specific support for the ESOS32 watchdog service. | |
Data Structures | |
struct | _st_esos_sui_Switch |
struct | _st_esos_sui_LED |
Macros | |
#define | ESOS_SUI_NUM_MAX_SWITCHES 32 |
#define | ESOS_SUI_NUM_MAX_LEDS 32 |
#define | CLICK_TICK 200 |
#define | DOUBLE_CLICK_TICK 200 |
#define | HOLD_TICK 500 |
#define | SWITCH_SINGLE_PRESS_LATENCY 100 |
#define | SWITCH_DOUBLE_PRESS_MAX_LATENCY 200 |
#define | __ESOS_SUI_TASK_PERIOD (25*MILLISECONDS) |
#define | ESOS_TASK_WAIT_UNTIL_SUI_SW_PRESSED(x) ESOS_TASK_WAIT_UNTIL( esos_sui_isSWPressed((x)) ) |
#define | ESOS_TASK_WAIT_UNTIL_SUI_SW_RELEASED(x) ESOS_TASK_WAIT_UNTIL( esos_sui_isSWReleased((x)) ) |
#define | ESOS_TASK_WAIT_UNTIL_SUI_SW_PRESSED_AND_RELEASED(x) |
#define | ESOS_TASK_WAIT_UNTIL_SUI_SW_PRESSED_TWICE(x) |
#define | ESOS_TASK_WAIT_UNTIL_SUI_SW_EVENT(x) ESOS_TASK_WAIT_WHILE( esos_sui_getSwitchLastEvent((x)) == ESOS_SUI_SWITCH_EVENT_NULL ) |
#define | ESOS_TASK_WAIT_UNTIL_SUI_SW_HOLD_EVENT(x) ESOS_TASK_WAIT_UNTIL( esos_sui_getSwitchLastEvent((x)) == ESOS_SUI_SWITCH_EVENT_HOLD ) |
#define | ESOS_TASK_WAIT_UNTIL_SUI_SW_CLICK_EVENT(x) ESOS_TASK_WAIT_UNTIL( esos_sui_getSwitchLastEvent((x)) == ESOS_SUI_SWITCH_EVENT_CLICK ) |
#define | ESOS_TASK_WAIT_UNTIL_SUI_SW_DOUBLE_CLICK_EVENT(x) ESOS_TASK_WAIT_UNTIL( esos_sui_getSwitchLastEvent((x)) == ESOS_SUI_SWITCH_EVENT_DOUBLE_CLICK ) |
Typedefs | |
typedef uint8_t | ESOS_SUI_LED_HANDLE |
typedef uint8_t | ESOS_SUI_SWITCH_HANDLE |
Functions | |
uint8_t | esos_sui_getNumberOfSwitches (void) |
uint8_t | esos_sui_getNumberOfLEDs (void) |
BOOL | esos_sui_isSWPressed (ESOS_SUI_SWITCH_HANDLE h_sw) |
BOOL | esos_sui_isSWReleased (ESOS_SUI_SWITCH_HANDLE h_sw) |
BOOL | esos_sui_isSWDoublePressed (ESOS_SUI_SWITCH_HANDLE h_sw) |
uint8_t | esos_sui_getSwitchLastEvent (ESOS_SUI_SWITCH_HANDLE h_sw) |
uint32_t | esos_sui_getSwitchLastEventTime (ESOS_SUI_SWITCH_HANDLE h_sw) |
uint32_t | esos_sui_getSwitchUserData1 (ESOS_SUI_SWITCH_HANDLE h_sw) |
uint32_t | esos_sui_getSwitchUserData2 (ESOS_SUI_SWITCH_HANDLE h_sw) |
BOOL | esos_sui_isLEDOn (ESOS_SUI_LED_HANDLE h_led) |
BOOL | esos_sui_isLEDOff (ESOS_SUI_LED_HANDLE h_led) |
BOOL | esos_sui_isLEDFlashing (ESOS_SUI_LED_HANDLE h_led) |
BOOL | esos_sui_isLEDOneShot (ESOS_SUI_LED_HANDLE h_led) |
uint16_t | esos_sui_getLEDFlashPeriod (ESOS_SUI_LED_HANDLE h_led) |
uint32_t | esos_sui_getLEDLastEventTime (ESOS_SUI_LED_HANDLE h_led) |
uint32_t | esos_sui_getLEDUserData1 (ESOS_SUI_LED_HANDLE h_led) |
uint32_t | esos_sui_getLEDUserData2 (ESOS_SUI_LED_HANDLE h_led) |
void | esos_sui_turnLEDOn (ESOS_SUI_LED_HANDLE h_led) |
void | esos_sui_turnLEDOff (ESOS_SUI_LED_HANDLE h_led) |
void | esos_sui_toggleLED (ESOS_SUI_LED_HANDLE h_led) |
void | esos_sui_oneshotLED (ESOS_SUI_LED_HANDLE h_led, uint16_t u16_period) |
void | esos_sui_flashLED (ESOS_SUI_LED_HANDLE h_led, uint16_t u16_period) |
void | esos_sui_stopFlashLED (ESOS_SUI_LED_HANDLE h_led) |
ESOS_SUI_LED_HANDLE | esos_sui_registerLED (uint32_t u32_d1, uint32_t u32_d2) |
ESOS_SUI_SWITCH_HANDLE | esos_sui_registerSwitch (uint32_t u32_d1, uint32_t u32_d2) |
ESOS_USER_TASK (__esos_sui_task) | |
void | __esos_InitSUI (void) |
void | esos_hw_sui_configLED (ESOS_SUI_LED_HANDLE h_led) |
void | esos_hw_sui_turnLEDOn (ESOS_SUI_LED_HANDLE h_led) |
void | esos_hw_sui_turnLEDOff (ESOS_SUI_LED_HANDLE h_led) |
void | esos_hw_sui_configSwitch (ESOS_SUI_SWITCH_HANDLE h_sw) |
BOOL | esos_hw_sui_isSwitchPressed (ESOS_SUI_SWITCH_HANDLE h_sw) |
BOOL | esos_hw_sui_isSwitchReleased (ESOS_SUI_SWITCH_HANDLE h_sw) |
Variables | |
volatile uint8_t | __u8_esosSuiNumLEDs = 0 |
volatile uint8_t | __u8_esosSuiNumSWs = 0 |
volatile _st_esos_sui_Switch | __ast_esosSuiSwitches [ESOS_SUI_NUM_MAX_SWITCHES] |
volatile _st_esos_sui_LED | __ast_esosSuiLEDs [ESOS_SUI_NUM_MAX_LEDS] |
BOOL | _st_esos_sui_Switch::b_pressed |
BOOL | _st_esos_sui_Switch::b_doublePressed |
uint8_t | _st_esos_sui_Switch::u8_lastEvent |
uint32_t | _st_esos_sui_Switch::u32_lastEventTime |
uint8_t | _st_esos_sui_Switch::_u8_state |
uint32_t | _st_esos_sui_Switch::_u32_nextTickTime |
uint32_t | _st_esos_sui_Switch::u32_userData1 |
uint32_t | _st_esos_sui_Switch::u32_userData2 |
BOOL | _st_esos_sui_LED::b_LEDOn |
uint8_t | _st_esos_sui_LED::_u8_state |
uint16_t | _st_esos_sui_LED::u16_LEDFlashPeriod |
uint8_t | _st_esos_sui_LED::u8_lastEvent |
uint32_t | _st_esos_sui_LED::u32_lastEventTime |
uint32_t | _st_esos_sui_LED::u32_userData1 |
uint32_t | _st_esos_sui_LED::u32_userData2 |
#define ESOS_TASK_WAIT_UNTIL_SUI_SW_PRESSED_AND_RELEASED | ( | x | ) |
Definition at line 156 of file esos_sui.h.
#define ESOS_TASK_WAIT_UNTIL_SUI_SW_PRESSED_TWICE | ( | x | ) |
Definition at line 160 of file esos_sui.h.
void __esos_InitSUI | ( | void | ) |
ESOS system call to initialize the SUI element
Definition at line 741 of file esos_sui.c.
void esos_hw_sui_configLED | ( | ESOS_SUI_LED_HANDLE | h_led | ) |
ESOS callback to user to perform hardware initialization for connected LEDs
h_LED | ESOS_SUI_LED_HANDLE to switch that was returned to user when the LED was registered |
Definition at line 65 of file esos_hwxxxx_sui.c.
void esos_hw_sui_configSwitch | ( | ESOS_SUI_SWITCH_HANDLE | h_sw | ) |
ESOS callback to user to perform hardware initialization for switches
h_sw | ESOS_SUI_SWITCH_HANDLE to switch that was returned to user when the switch was registered |
Definition at line 116 of file esos_hwxxxx_sui.c.
BOOL esos_hw_sui_isSwitchPressed | ( | ESOS_SUI_SWITCH_HANDLE | h_sw | ) |
ESOS callback to user to answer whether switch is pressed
h_sw | ESOS_SUI_SWITCH_HANDLE to switch that was returned to user when the switch was registered |
TRUE | if switch is pressed, FALSE if it is not pressed |
Definition at line 132 of file esos_hwxxxx_sui.c.
BOOL esos_hw_sui_isSwitchReleased | ( | ESOS_SUI_SWITCH_HANDLE | h_sw | ) |
ESOS callback to user to answer whether switch is pressed
h_sw | ESOS_SUI_SWITCH_HANDLE to switch that was returned to user when the switch was registered |
TRUE | if switch is released (not pressed), FALSE if it is pressed |
Definition at line 148 of file esos_hwxxxx_sui.c.
void esos_hw_sui_turnLEDOff | ( | ESOS_SUI_LED_HANDLE | h_led | ) |
ESOS callback to user to do whatever hardware gymnastics is required to turn "OFF" a connected LED
h_led | ESOS_SUI_LED_HANDLE to switch that was returned to user when the LED was registered |
Definition at line 100 of file esos_hwxxxx_sui.c.
void esos_hw_sui_turnLEDOn | ( | ESOS_SUI_LED_HANDLE | h_led | ) |
ESOS callback to user to do whatever hardware gymnastics is required to turn "ON" a connected LED
h_LED | ESOS_SUI_LED_HANDLE to switch that was returned to user when the LED was registered |
Definition at line 83 of file esos_hwxxxx_sui.c.
|
inline |
called by user application to flash/toggle a given LED every u16_period ticks
h_led | "LED handle" to switch that was returned to user when the LED was registered |
u16_period | uint16 value (in ticks) that represents the flash period of the LED |
Definition at line 432 of file esos_sui.c.
|
inline |
Returns the LED flashing period (in ticks) as uint16 associated with a given LED
h_led | "LED handle" to switch that was returned to user when the LED was registered |
uint16_t | number of ticks = h_LED's flashing period |
Definition at line 289 of file esos_sui.c.
|
inline |
Returns the system tick value that corresponds to the most recent event associated with a given LED
h_LED | "LED handle" to switch that was returned to user when the LED was registered |
uint32_t | system tick value when the last LED event occured |
Definition at line 303 of file esos_sui.c.
|
inline |
Returns the first user data word associated with this LED
h_led | "LED handle" to switch that was returned to user when the LED was registered |
uint32 | the LED's user data word #1 |
Definition at line 320 of file esos_sui.c.
|
inline |
Returns the second user data word associated with this LED
h_led | "LED handle" to switch that was returned to user when the LED was registered |
uint32 | the LED's user data word #2 |
Definition at line 337 of file esos_sui.c.
|
inline |
Returns the number of LEDs being managed by ESOS SUI service
uint8_t | number of LEDs currently registered in the ESOS SUI service |
Definition at line 75 of file esos_sui.c.
|
inline |
Returns the number of switches being managed by ESOS SUI service
uint8_t | number of switches currently registered in the ESOS SUI service |
Definition at line 61 of file esos_sui.c.
|
inline |
Returns the most recent event (as opposed to the current state) of a given switch
h_sw | "switch handle" to switch that was returned to user when the switch was registered |
ESOS_SUI_SWITCH_STATE | the most recent switch event to occur based on h_sw actions |
Definition at line 139 of file esos_sui.c.
|
inline |
Returns the system tick value that corresponds to the most recent event (as opposed to the current state) of a given switch
h_sw | "switch handle" to switch that was returned to user when the switch was registered |
uint32_t | system tick value when the last event occured |
Definition at line 161 of file esos_sui.c.
|
inline |
Returns the first user data word associated with this switch
h_sw | "switch handle" to switch that was returned to user when the switch was registered |
uint32 | the value of user data word #1 |
Definition at line 178 of file esos_sui.c.
|
inline |
Returns the second user data word associated with this switch
h_sw | "switch handle" to switch that was returned to user when the switch was registered |
uint32 | the value of user data word #2 |
Definition at line 195 of file esos_sui.c.
|
inline |
Returns whether the associated LED is "flashing"
h_led | "LED handle" to switch that was returned to user when the LED was registered |
BOOL | TRUE if LED is currently flashing, FALSE otherwise |
Definition at line 244 of file esos_sui.c.
|
inline |
Returns the current state of the associated LED
h_led | "LED handle" to switch that was returned to user when the LED was registered |
BOOL | TRUE if LED is OFF, FALSE otherwise |
Definition at line 229 of file esos_sui.c.
|
inline |
Returns the current state of the associated LED
h_led | "LED handle" to switch that was returned to user when the LED was registered |
BOOL | TRUE if LED is ON, FALSE otherwise |
Definition at line 213 of file esos_sui.c.
|
inline |
Returns whether the associated LED is in a one-shot state
h_led | "LED handle" to switch that was returned to user when the LED was registered |
BOOL | TRUE if LED is currently flashing, FALSE otherwise |
Definition at line 264 of file esos_sui.c.
|
inline |
Returns the state of the swtich
h_sw | "switch handle" to switch that was returned to user when the switch was registered |
BOOL | TRUE if switch is double-pressed, FALSE otherwise |
Definition at line 121 of file esos_sui.c.
|
inline |
Returns the state of the swtich
h_sw | a "switch handle" to switch that was returned to user when the switch was registered |
BOOL | TRUE if switch is pressed, FALSE otherwise |
Definition at line 91 of file esos_sui.c.
|
inline |
Returns the state of the swtich
h_sw | "switch handle" to switch that was returned to user when the switch was registered |
BOOL | TRUE if switch is released, FALSE otherwise |
Definition at line 106 of file esos_sui.c.
|
inline |
called by user application to start a one-shot flash (illuminate) the given LED for the next u16_period ticks
h_led | "LED handle" to switch that was returned to user when the LED was registered |
u16_period | value (in ticks) that represents how long the single illumination of the LED |
Definition at line 409 of file esos_sui.c.
ESOS_SUI_LED_HANDLE esos_sui_registerLED | ( | uint32_t | u32_d1, |
uint32_t | u32_d2 | ||
) |
called by user application code to "register" a new LED with the ESOS SUI service
u32_d1 | uint32 for user data 1 |
u32_d2 | uint32 for user data 2 |
ESOS_SUI_LED_HANDLE | that can be used to reference the LED with ESOS SUI service going foward |
Definition at line 479 of file esos_sui.c.
ESOS_SUI_SWITCH_HANDLE esos_sui_registerSwitch | ( | uint32_t | u32_d1, |
uint32_t | u32_d2 | ||
) |
called by user application code to "register" a new switch with the ESOS SUI service
u32_d1 | uint32 for user data 1 |
u32_d2 | uint32 for user data 2 |
ESOS_SUI_SWITCH_HANDLE | that can be used to reference the switch with ESOS SUI service going foward |
Definition at line 517 of file esos_sui.c.
|
inline |
called by user application to toggle a given LED
h_led | "LED handle" to switch that was returned to user when the LED was registered |
Definition at line 450 of file esos_sui.c.
|
inline |
called by user application to toggle a given LED ESOS_TASK_BEGIN();
h_led | "LED handle" to switch that was returned to user when the LED was registered |
Definition at line 388 of file esos_sui.c.
|
inline |
called by user application to turn a given LED off
h_led | "LED handle" to switch that was returned to user when the LED was registered |
Definition at line 371 of file esos_sui.c.
|
inline |
called by user application to turn a given LED on
h_led | "LED handle" to switch that was returned to user when the LED was registered |
Definition at line 355 of file esos_sui.c.
ESOS_USER_TASK | ( | __esos_sui_task | ) |
A "hidden" (system task) that manages the LEDs and switches for the ESOS SUI service
Definition at line 543 of file esos_sui.c.