Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
devboard_btn.h File Reference
#include "cascoda-bm/cascoda_types.h"
#include "ca821x_api.h"
#include "ca821x_error.h"
#include "cascoda_btn.h"
Include dependency graph for devboard_btn.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DVBD_SetLED   Btn_SetLED
 
#define DVBD_SetGPIOWakeup   Btn_IncrementGPIOWakeup
 
#define DVBD_SetSleepPermanently   Btn_SetSleepPermanently
 
#define DVBD_Sense   Btn_Sense
 
#define DVBD_SenseOutput   Btn_SenseOutput
 
#define DVBD_SetButtonShortPressCallback   Btn_SetButtonShortPressCallback
 
#define DVBD_SetButtonLongPressCallback   Btn_SetButtonLongPressCallback
 
#define DVBD_SetButtonHoldCallback   Btn_SetButtonHoldCallback
 
#define DVBD_PollButtons   Btn_PollButtons
 
#define DVBD_CanSleep   Btn_CanSleep
 
#define DVBD_DevboardSleep   Btn_DevboardSleep
 

Typedefs

typedef enum dvbd_led_btn_jumper_position dvbd_led_btn_jumper_position
 Jumper position controls which module pin is used for the LED/Button. More...
 
typedef enum dvbd_led_btn dvbd_led_btn
 Number of the LED/Button. More...
 

Enumerations

enum  dvbd_led_btn_jumper_position { JUMPER_POS_1 = 0 , JUMPER_POS_2 = 1 }
 Jumper position controls which module pin is used for the LED/Button. More...
 
enum  dvbd_led_btn { DEV_SWITCH_1 = 0 , DEV_SWITCH_2 = 1 , DEV_SWITCH_3 = 2 , DEV_SWITCH_4 = 3 }
 Number of the LED/Button. More...
 

Functions

ca_error DVBD_RegisterLEDOutput (dvbd_led_btn ledBtn, dvbd_led_btn_jumper_position jumperPos)
 Register LED output (open drain) More...
 
ca_error DVBD_RegisterButtonInput (dvbd_led_btn ledBtn, dvbd_led_btn_jumper_position jumperPos)
 Register button input. More...
 
ca_error DVBD_RegisterButtonIRQInput (dvbd_led_btn ledBtn, dvbd_led_btn_jumper_position jumperPos)
 Register button input with interrupt (for sleepy devices) More...
 
ca_error DVBD_RegisterSharedButtonLED (dvbd_led_btn ledBtn, dvbd_led_btn_jumper_position jumperPos)
 Register button as shared input/output. More...
 
ca_error DVBD_RegisterSharedIRQButtonLED (dvbd_led_btn ledBtn, dvbd_led_btn_jumper_position jumperPos)
 Set the functionality of a button to be shared interrupt input/output. More...
 
ca_error DVBD_DeRegister (dvbd_led_btn ledBtn, dvbd_led_btn_jumper_position jumperPos)
 De-Register an LED or Button Pin. More...
 
ca_error DVBD_modifyPinMappings (dvbd_led_btn ledBtn, dvbd_led_btn_jumper_position jumperPos, u8_t new_pin)
 Modify possible pin mappings. More...
 

Macro Definition Documentation

◆ DVBD_CanSleep

#define DVBD_CanSleep   Btn_CanSleep

◆ DVBD_DevboardSleep

#define DVBD_DevboardSleep   Btn_DevboardSleep

◆ DVBD_PollButtons

#define DVBD_PollButtons   Btn_PollButtons

◆ DVBD_Sense

#define DVBD_Sense   Btn_Sense

◆ DVBD_SenseOutput

#define DVBD_SenseOutput   Btn_SenseOutput

◆ DVBD_SetButtonHoldCallback

#define DVBD_SetButtonHoldCallback   Btn_SetButtonHoldCallback

◆ DVBD_SetButtonLongPressCallback

#define DVBD_SetButtonLongPressCallback   Btn_SetButtonLongPressCallback

◆ DVBD_SetButtonShortPressCallback

#define DVBD_SetButtonShortPressCallback   Btn_SetButtonShortPressCallback

◆ DVBD_SetGPIOWakeup

#define DVBD_SetGPIOWakeup   Btn_IncrementGPIOWakeup

◆ DVBD_SetLED

#define DVBD_SetLED   Btn_SetLED

◆ DVBD_SetSleepPermanently

#define DVBD_SetSleepPermanently   Btn_SetSleepPermanently

Typedef Documentation

◆ dvbd_led_btn

typedef enum dvbd_led_btn dvbd_led_btn

Number of the LED/Button.

◆ dvbd_led_btn_jumper_position

Jumper position controls which module pin is used for the LED/Button.

Enumeration Type Documentation

◆ dvbd_led_btn

Number of the LED/Button.

Enumerator
DEV_SWITCH_1 
DEV_SWITCH_2 
DEV_SWITCH_3 
DEV_SWITCH_4 

◆ dvbd_led_btn_jumper_position

Jumper position controls which module pin is used for the LED/Button.

Enumerator
JUMPER_POS_1 

Jumper connects pins 1 and 2.

JUMPER_POS_2 

Jumper connects pins 2 and 3.

Function Documentation

◆ DVBD_DeRegister()

ca_error DVBD_DeRegister ( dvbd_led_btn  ledBtn,
dvbd_led_btn_jumper_position  jumperPos 
)

De-Register an LED or Button Pin.

Parameters
ledBtn- reference to LED/Button
jumperPos- position of the jumper
Returns
status

◆ DVBD_modifyPinMappings()

ca_error DVBD_modifyPinMappings ( dvbd_led_btn  ledBtn,
dvbd_led_btn_jumper_position  jumperPos,
u8_t  new_pin 
)

Modify possible pin mappings.

Returns
status

◆ DVBD_RegisterButtonInput()

ca_error DVBD_RegisterButtonInput ( dvbd_led_btn  ledBtn,
dvbd_led_btn_jumper_position  jumperPos 
)

Register button input.

Parameters
ledBtn- reference to button
jumperPos- posititon of the jumper
Returns
status

◆ DVBD_RegisterButtonIRQInput()

ca_error DVBD_RegisterButtonIRQInput ( dvbd_led_btn  ledBtn,
dvbd_led_btn_jumper_position  jumperPos 
)

Register button input with interrupt (for sleepy devices)

Parameters
ledBtn- reference to button
jumperPos- posititon of the jumper
Returns
status

◆ DVBD_RegisterLEDOutput()

ca_error DVBD_RegisterLEDOutput ( dvbd_led_btn  ledBtn,
dvbd_led_btn_jumper_position  jumperPos 
)

Register LED output (open drain)

Parameters
ledBtn- reference to LED
jumperPos- posititon of the jumper
Returns
status

◆ DVBD_RegisterSharedButtonLED()

ca_error DVBD_RegisterSharedButtonLED ( dvbd_led_btn  ledBtn,
dvbd_led_btn_jumper_position  jumperPos 
)

Register button as shared input/output.

Parameters
ledBtn- reference to button
jumperPos- posititon of the jumper
Returns
status

◆ DVBD_RegisterSharedIRQButtonLED()

ca_error DVBD_RegisterSharedIRQButtonLED ( dvbd_led_btn  ledBtn,
dvbd_led_btn_jumper_position  jumperPos 
)

Set the functionality of a button to be shared interrupt input/output.

Parameters
ledBtn- reference to button
jumperPos- posititon of the jumper
Returns
status