Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
Go to the source code of this file.
Classes | |
struct | btn_callback_info |
Callbacks and associated timers for the buttons. More... | |
Macros | |
#define | NUM_LEDBTN 4 |
#define | BTN_MIN_PRESS_TIME 5 |
#define | BTN_SHARED_SENSE_DELAY 2 |
Typedefs | |
typedef void(* | btn_callback) (void *context) |
typedef struct btn_callback_info | btn_callback_info |
Callbacks and associated timers for the buttons. More... | |
Enumerations | |
enum | btn_shortpress_mode { BTN_SHORTPRESS_PRESSED = 0 , BTN_SHORTPRESS_RELEASED = 1 } |
enum | btn_button_state { BTN_PRESSED = 0 , BTN_RELEASED = 1 } |
enum | btn_pin_type { PINTYPE_NONE = 0 , PINTYPE_LED = 1 , PINTYPE_BTN = 2 , PINTYPE_SHARED = 3 } |
enum | btn_pin_int { PIN_NO_INTERRUPT = 0 , PIN_INTERRUPT = 1 } |
Functions | |
ca_error | Btn_RegisterLEDOutput (uint8_t ledBtn) |
Register LED output (open drain) More... | |
ca_error | Btn_RegisterButtonInput (uint8_t ledBtn) |
Register button input. More... | |
ca_error | Btn_RegisterButtonIRQInput (uint8_t ledBtn) |
Register button input with interrupt (for sleepy devices) More... | |
ca_error | Btn_RegisterSharedButtonLED (uint8_t ledBtn) |
Register button as shared input/output. More... | |
ca_error | Btn_RegisterSharedIRQButtonLED (uint8_t ledBtn) |
Register button as shared input/output with interrupt (for sleepy devices) More... | |
ca_error | Btn_DeRegister (uint8_t ledBtn) |
De-Register an LED or Button Pin. More... | |
ca_error | Btn_SetButtonShortPressCallback (uint8_t ledBtn, btn_callback callback, void *context, uint8_t shortPressMode) |
Set a callback function to a button when it is short pressed. More... | |
ca_error | Btn_SetButtonLongPressCallback (uint8_t ledBtn, btn_callback callback, void *context, uint32_t timeThreshold) |
Set a callback function to a button when it is long pressed. More... | |
ca_error | Btn_SetButtonHoldCallback (uint8_t ledBtn, btn_callback callback, void *context, uint32_t TimeInterval) |
Set a callback function to a button when it is held. More... | |
ca_error | Btn_SetLED (uint8_t ledBtn, uint8_t val) |
Set the state of the LED. More... | |
ca_error | Btn_Sense (uint8_t ledBtn, uint8_t *val) |
Get the state of the LED/Button. More... | |
ca_error | Btn_SenseOutput (uint8_t ledBtn, uint8_t *val) |
Get the output state of the LED. More... | |
ca_error | Btn_PollButtons (void) |
Main polling function to activate callbacks for any buttons that are currently being pressed. More... | |
ca_error | Btn_HandleButtonCallbacks (btn_callback_info *callback, uint8_t pressed) |
Process the button callbacks and timing. More... | |
void | Btn_IncrementGPIOWakeup (void) |
One additional GPIO is now being used for wakeup. More... | |
ca_error | Btn_DecrementGPIOWakeup (void) |
One fewer GPIO is now being used for wakeup. More... | |
void | Btn_SetSleepPermanently (void) |
Register that the device will be put to sleep permanently. More... | |
bool | Btn_CanSleep (void) |
Check if all buttons have been handled. More... | |
ca_error | Btn_DevboardSleep (uint32_t aSleepTime, struct ca821x_dev *pDeviceRef) |
Put board to sleep / powerdown. More... | |
Variables | |
uint8_t | registeredPinMappings [] |
#define BTN_MIN_PRESS_TIME 5 |
#define BTN_SHARED_SENSE_DELAY 2 |
#define NUM_LEDBTN 4 |
typedef void(* btn_callback) (void *context) |
typedef struct btn_callback_info btn_callback_info |
Callbacks and associated timers for the buttons.
enum btn_button_state |
enum btn_pin_int |
enum btn_pin_type |
enum btn_shortpress_mode |
bool Btn_CanSleep | ( | void | ) |
Check if all buttons have been handled.
ca_error Btn_DecrementGPIOWakeup | ( | void | ) |
One fewer GPIO is now being used for wakeup.
ca_error Btn_DeRegister | ( | uint8_t | ledBtn | ) |
De-Register an LED or Button Pin.
ledBtn | - reference to LED/Button |
ca_error Btn_DevboardSleep | ( | uint32_t | aSleepTime, |
struct ca821x_dev * | pDeviceRef | ||
) |
Put board to sleep / powerdown.
ca_error Btn_HandleButtonCallbacks | ( | btn_callback_info * | callback, |
uint8_t | pressed | ||
) |
Process the button callbacks and timing.
callback | - callback info struct for button |
pressed | - the state of the Button |
void Btn_IncrementGPIOWakeup | ( | void | ) |
One additional GPIO is now being used for wakeup.
ca_error Btn_PollButtons | ( | void | ) |
Main polling function to activate callbacks for any buttons that are currently being pressed.
ca_error Btn_RegisterButtonInput | ( | uint8_t | ledBtn | ) |
Register button input.
ledBtn | - reference to button |
ca_error Btn_RegisterButtonIRQInput | ( | uint8_t | ledBtn | ) |
Register button input with interrupt (for sleepy devices)
ledBtn | - reference to button |
ca_error Btn_RegisterLEDOutput | ( | uint8_t | ledBtn | ) |
Register LED output (open drain)
ledBtn | - reference to LED |
ca_error Btn_RegisterSharedButtonLED | ( | uint8_t | ledBtn | ) |
Register button as shared input/output.
ledBtn | - reference to button |
ca_error Btn_RegisterSharedIRQButtonLED | ( | uint8_t | ledBtn | ) |
Register button as shared input/output with interrupt (for sleepy devices)
ledBtn | - reference to button |
ca_error Btn_Sense | ( | uint8_t | ledBtn, |
uint8_t * | val | ||
) |
Get the state of the LED/Button.
ledBtn | - reference to LED/Button |
val | - the state of the LED/Button |
ca_error Btn_SenseOutput | ( | uint8_t | ledBtn, |
uint8_t * | val | ||
) |
Get the output state of the LED.
ledBtn | - reference to LED |
val | - the state of the LED |
ca_error Btn_SetButtonHoldCallback | ( | uint8_t | ledBtn, |
btn_callback | callback, | ||
void * | context, | ||
uint32_t | TimeInterval | ||
) |
Set a callback function to a button when it is held.
ledBtn | - reference to LED/Button |
callback | - function to call |
context | - context for the callback, should be set to NULL if not context is needed. |
TimeInterval | - time interval in [ms] in which callback function is called |
ca_error Btn_SetButtonLongPressCallback | ( | uint8_t | ledBtn, |
btn_callback | callback, | ||
void * | context, | ||
uint32_t | timeThreshold | ||
) |
Set a callback function to a button when it is long pressed.
ledBtn | - reference to LED/Button |
callback | - function to call |
context | - context for the callback, should be set to NULL if not context is needed. |
timeThreshold | - time above which a button press is considered a long press |
ca_error Btn_SetButtonShortPressCallback | ( | uint8_t | ledBtn, |
btn_callback | callback, | ||
void * | context, | ||
uint8_t | shortPressMode | ||
) |
Set a callback function to a button when it is short pressed.
ledBtn | - reference to LED/Button |
callback | - function to call |
context | - context for the callback, should be set to NULL if no context is needed. |
shortPressMode | - short press mode (when pressed or when released). |
ca_error Btn_SetLED | ( | uint8_t | ledBtn, |
uint8_t | val | ||
) |
Set the state of the LED.
ledBtn | - reference to LED |
val | - the state of the LED |
void Btn_SetSleepPermanently | ( | void | ) |
Register that the device will be put to sleep permanently.
|
extern |