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

Internal functions used by ca821x-api to handle messages going to and from the CA-821x. More...

Collaboration diagram for Baremetal CA-821x Dispatch:

Functions

ca_error DISPATCH_ToCA821x (const uint8_t *buf, u8_t *response, struct ca821x_dev *pDeviceRef)
 Send Request to CA-821x over SPI.
ca_error DISPATCH_FromCA821x (struct ca821x_dev *pDeviceRef)
 process and dispatch on any received SPI messages from the ca821x
void DISPATCH_ReadCA821x (struct ca821x_dev *pDeviceRef)
 Read SPI messages from the ca821x.
ca_mac_status DISPATCH_SetCurrentTxPower (struct ca821x_dev *pDeviceRef)
 Set current transmit power.

Detailed Description

Internal functions used by ca821x-api to handle messages going to and from the CA-821x.

Function Documentation

◆ DISPATCH_FromCA821x()

ca_error DISPATCH_FromCA821x ( struct ca821x_dev * pDeviceRef)

process and dispatch on any received SPI messages from the ca821x

This function is not re-entrant - i.e. you cannot call DISPATCH_FromCA821x while already in a callback that DISPATCH_FromCA821x has called. If you try to do this, the function will fail the second call and return CA_ERROR_INVALID_STATE

Return values
CMB_SUCCESS,CA_ERROR_INVALID_STATE

◆ DISPATCH_ReadCA821x()

void DISPATCH_ReadCA821x ( struct ca821x_dev * pDeviceRef)

Read SPI messages from the ca821x.

This function should be called by the BSP on the falling edge of the RFIRQ signal from the CA821x.

◆ DISPATCH_SetCurrentTxPower()

ca_mac_status DISPATCH_SetCurrentTxPower ( struct ca821x_dev * pDeviceRef)

Set current transmit power.

Sets/restores the current tx power setting after power-up/wakeup

◆ DISPATCH_ToCA821x()

ca_error DISPATCH_ToCA821x ( const uint8_t * buf,
u8_t * response,
struct ca821x_dev * pDeviceRef )

Send Request to CA-821x over SPI.

This function is the system-specific definition of ca821x_api_downstream. It transmits a SAP command and if applicable, waits for a synchronous confirm and stores it in the 'response' buffer.

Parameters
buf- Message to transmit, length is encoded in Cascoda TLV format
response- Buffer to fill with response
pDeviceRef- Pointer to initialised ca821x_dev struct
Returns
Status