Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
Loading...
Searching...
No Matches
Baremetal EVBME abstraction

Evaluation Board Management Entity (EVBME) for core application-platform interactions. More...

Collaboration diagram for Baremetal EVBME abstraction:

Macros

#define CA_TARGET_NAME   "UNKNOWN-TARGET"
#define CAX_WAKEUP_TIME   100

Enumerations

enum  powerdown_mode {
  PDM_ALLON = 0 , PDM_ACTIVE = 1 , PDM_STANDBY = 2 , PDM_POWERDOWN = 3 ,
  PDM_POWEROFF = 4 , PDM_DPD = 5 , PDM_DPD_MCU_ONLY = 6
}
 Definitions for Powerdown Modes. More...
enum  wakeup_mode { WUP_WAKEUP_ALL = 0 , WUP_KEEP_RADIO_OFF = 1 }
 Definitions for Wakeup after Powerdown. More...

Functions

ca_error EVBMEInitialise (const char *aAppName, struct ca821x_dev *dev)
 Initialises EVBME after Reset.
const char * EVBME_GetAppName (void)
 Returns the app name string.
ca_error EVBME_NotHandled (const struct MAC_Message *msg, struct ca821x_dev *pDeviceRef)
 Sends DownStream Command from API UpStream to Serial.
void cascoda_io_handler (struct ca821x_dev *pDeviceRef)
 Processes messages received over available interfaces.
ca_error EVBME_PowerDown (enum powerdown_mode mode, enum wakeup_mode keep_radio_off_on_wakeup, u32_t sleeptime_ms, struct ca821x_dev *pDeviceRef)
 Put the system into a state of power-down for a given time.
ca_error EVBME_PowerUpRadio (struct ca821x_dev *pDeviceRef)
 Powers Up CA821x if it is sleeping to be used for PDM_POWERDOWN or PDM_STANDBY only.
void EVBME_SwitchClock (struct ca821x_dev *pDeviceRef, u8_t useExternalClock)
 System Clock Switch.
ca_error EVBME_CAX_Restart (struct ca821x_dev *pDeviceRef)
 Restarts Air Interface.
ca_error EVBME_GET_OT_Attrib (enum evbme_attribute aAttrib, uint8_t *aOutBufLen, uint8_t *aOutBuf)
 Get an openthread-specific EVBME attribute.

Variables

u8_t EVBME_HasReset
 Used to notify apps that radio has been reset.
u8_t EVBME_UseMAC
 Use MAC functionality during phy tests.
void(* EVBME_Message )(char *message, size_t len)
 Function pointer for sending ASCII reporting messages upstream.
void(* MAC_Message )(u8_t CommandId, u8_t Count, const u8_t *pBuffer)
 Function pointer for sending API commands upstream.
int(* cascoda_reinitialise )(struct ca821x_dev *pDeviceRef)
 re-initialises CA821x / MAC PIB after powerdown.

Detailed Description

Evaluation Board Management Entity (EVBME) for core application-platform interactions.

Macro Definition Documentation

◆ CA_TARGET_NAME

#define CA_TARGET_NAME   "UNKNOWN-TARGET"

◆ CAX_WAKEUP_TIME

#define CAX_WAKEUP_TIME   100

Enumeration Type Documentation

◆ powerdown_mode

Definitions for Powerdown Modes.

Enumerator
PDM_ALLON 

Mainly for Testing.

PDM_ACTIVE 

CAX Full Data Retention, MAC Running.

PDM_STANDBY 

CAX Full Data Retention.

PDM_POWERDOWN 

No CAX Retention, PIB has to be re-initialised.

PDM_POWEROFF 

No CAX Retention, PIB has to be re-initialised.

Timer-Wakeup only

PDM_DPD 

No CAX Retention or MCU Retention (Data saved in NVM).

PDM_DPD_MCU_ONLY 

No CAX Retention or MCU Retention (Data saved in NVM).

◆ wakeup_mode

Definitions for Wakeup after Powerdown.

Enumerator
WUP_WAKEUP_ALL 

restart micro and CAX

WUP_KEEP_RADIO_OFF 

keep CAX off when waking up

Function Documentation

◆ cascoda_io_handler()

void cascoda_io_handler ( struct ca821x_dev * pDeviceRef)

Processes messages received over available interfaces.

This function should be called regularly from application context eg the main loop. Alternatively, you may use cascoda_io_signal() to notify the application that it must call cascoda_io_handler().

◆ EVBME_CAX_Restart()

ca_error EVBME_CAX_Restart ( struct ca821x_dev * pDeviceRef)

Restarts Air Interface.

Resets and re-initialises CAX

◆ EVBME_GET_OT_Attrib()

ca_error EVBME_GET_OT_Attrib ( enum evbme_attribute aAttrib,
uint8_t * aOutBufLen,
uint8_t * aOutBuf )

Get an openthread-specific EVBME attribute.

Only valid when openthread is being used, otherwise will return CA_ERROR_UNKNOWN.

Parameters
aAttribThe attribute to get
[in,out]aOutBufLenout:The length of the attribute data in octets, in: the maximum length of the attribute value in octets
[out]aOutBufThe buffer to fill with attribute data
Returns
Status of the command
Return values
CA_ERROR_SUCCESSThe output buffer is filled with the attribute data
CA_ERROR_UNKNOWNThe attribute was not recognised for this system
CA_ERROR_NO_BUFFERThe output buffer isn't big enough to store the attribute

◆ EVBME_GetAppName()

const char * EVBME_GetAppName ( void )

Returns the app name string.

Returns
app_name

◆ EVBME_NotHandled()

ca_error EVBME_NotHandled ( const struct MAC_Message * msg,
struct ca821x_dev * pDeviceRef )

Sends DownStream Command from API UpStream to Serial.

Parameters
msg- Message to send upstream
pDeviceRef- Cascoda device reference

◆ EVBME_PowerDown()

ca_error EVBME_PowerDown ( enum powerdown_mode mode,
enum wakeup_mode keep_radio_off_on_wakeup,
u32_t sleeptime_ms,
struct ca821x_dev * pDeviceRef )

Put the system into a state of power-down for a given time.

Parameters
mode- Power-Down Mode
sleeptime_ms- milliseconds to sleep for
keep_radio_off_on_wakeup- keep radio in power-down mode when waking up
pDeviceRef- Pointer to initialised ca821x_device_ref struct

Power-Down Modes

Enum MCU CAX Notes
PDM_ALLON Active Active Mainly for Testing
PDM_ACTIVE Power-Down Active CAX Full Data Retention, MAC Running
PDM_STANDBY Power-Down Standby CAX Full Data Retention
PDM_POWERDOWN Power-Down Power-Down 0 No CAX Retention, PIB has to be re-initialised
PDM_POWEROFF Power-Down Power-Down 1 No CAX Retention, PIB has to be re-initialised. Timer-Wakeup only
PDM_DPD Deep-Power-Down Power-Down 1 No CAX Retention or MCU Retention (Data saved in NVM)
PDM_DPD_MCU_ONLY Deep-Power-Down Power-Down 0 No CAX Retention or MCU Retention (Data saved in NVM). MCU-Wakeup only

◆ EVBME_PowerUpRadio()

ca_error EVBME_PowerUpRadio ( struct ca821x_dev * pDeviceRef)

Powers Up CA821x if it is sleeping to be used for PDM_POWERDOWN or PDM_STANDBY only.

◆ EVBME_SwitchClock()

void EVBME_SwitchClock ( struct ca821x_dev * pDeviceRef,
u8_t useExternalClock )

System Clock Switch.

Parameters
pDeviceRef- a pointer to the ca821x_dev struct
useExternalClock- boolean (1: use external clock from ca821x, 0: use internal clock)

◆ EVBMEInitialise()

ca_error EVBMEInitialise ( const char * aAppName,
struct ca821x_dev * dev )

Initialises EVBME after Reset.

Initialises low level interfaces, resets and initialises CA-8210.

Parameters
aAppName- App name string
dev- Pointer to initialised ca821x_device_ref struct
Returns
Status of initialisation

Variable Documentation

◆ cascoda_reinitialise

int(* cascoda_reinitialise) (struct ca821x_dev *pDeviceRef) ( struct ca821x_dev * pDeviceRef)
extern

re-initialises CA821x / MAC PIB after powerdown.

The function pointer should be populated at the top level

WARNING: This function will not be called on Wakeup if the device wakes up without CA821x radio (when keep_radio_off_on_wakeup is set to WUP_KEEP_RADIO_OFF in function EVBME_PowerDown()). So this function should only be used to re-initialise the CA821X (802.15.4 PIB parameters etc.), and not the application level.

re-initialises CA821x / MAC PIB after powerdown.

◆ EVBME_HasReset

u8_t EVBME_HasReset
extern

Used to notify apps that radio has been reset.

◆ EVBME_Message

void(* EVBME_Message) (char *message, size_t len) ( char * message,
size_t len )
extern

Function pointer for sending ASCII reporting messages upstream.

◆ EVBME_UseMAC

u8_t EVBME_UseMAC
extern

Use MAC functionality during phy tests.

◆ MAC_Message

void(* MAC_Message) (u8_t CommandId, u8_t Count, const u8_t *pBuffer) ( u8_t CommandId,
u8_t Count,
const u8_t * pBuffer )
extern

Function pointer for sending API commands upstream.