Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
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"
 

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...
 

Functions

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

Variables

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

Detailed Description

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

Macro Definition Documentation

◆ CA_TARGET_NAME

#define CA_TARGET_NAME   "UNKNOWN-TARGET"

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)

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()

void 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()

void EVBME_PowerDown ( enum powerdown_mode  mode,
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
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_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

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.