Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
Baremetal Core platform abstraction

Platform abstraction for core SDK functionality, see Baremetal platform abstraction for extended functionality. More...

Collaboration diagram for Baremetal Core platform abstraction:

Functions

void BSP_WaitUs (u32_t us)
 Wait for specified Time in Microseconds (max. More...
 
void BSP_Waiting (void)
 This function will be called repeatedly when the Baremetal drivers are blocking & waiting (eg. More...
 
u32_t BSP_ReadAbsoluteTime (void)
 Get the number of milliseconds since program start. More...
 
void BSP_WaitTicks (u32_t ticks)
 Wait for specified Time in Milliseconds. More...
 
void BSP_ResetRF (u8_t ms)
 Reset CAX RF Chip. More...
 
u8_t BSP_SenseRFIRQ (void)
 Sense whether SPI IRQ is high or low. More...
 
void BSP_DisableRFIRQ (void)
 Inhibit SPI IRQ, suppresses interrupt but still latches it. More...
 
void BSP_EnableRFIRQ (void)
 Allow SPI IRQ, re-enabling interrupt after BSP_DisableRFIRQ() More...
 
void BSP_SetRFSSBHigh (void)
 Put SPI Select (SSB) Pin high. More...
 
void BSP_SetRFSSBLow (void)
 Put SPI Select (SSB) Pin low. More...
 
void BSP_SPIInit (void)
 Initialise GPIO and SPI Pins for Comms with CA-821X. More...
 
void BSP_SPIExchange (u8_t *RxBuf, const u8_t *TxBuf, u8_t RxLen, u8_t TxLen)
 Exchange bytes over SPI, receiving into RxBuf and transferring from TxBuf. More...
 
bool BSP_IsInsideInterrupt (void)
 Is the code running in an interrupt context? More...
 
void BSP_SetSPIMOSIOutput (void)
 Connect MOSI port to SPI MOSI and disable pull-up. More...
 
void BSP_SetSPIMOSITristate (void)
 Disconnect MOSI port from SPI MOSI and put to tristate with pull-up. More...
 
void BSP_MicroTimerStart (void)
 start microseconds timer More...
 
u32_t BSP_MicroTimerStop (void)
 stop microseconds timer More...
 
u32_t BSP_MicroTimerGet (void)
 get microseconds timer while running More...
 
bool BSP_IsCommsInterfaceEnabled (void)
 check if comms interface is connected More...
 

Detailed Description

Platform abstraction for core SDK functionality, see Baremetal platform abstraction for extended functionality.

Function Documentation

◆ BSP_DisableRFIRQ()

void BSP_DisableRFIRQ ( void  )

Inhibit SPI IRQ, suppresses interrupt but still latches it.

◆ BSP_EnableRFIRQ()

void BSP_EnableRFIRQ ( void  )

Allow SPI IRQ, re-enabling interrupt after BSP_DisableRFIRQ()

◆ BSP_IsCommsInterfaceEnabled()

bool BSP_IsCommsInterfaceEnabled ( void  )

check if comms interface is connected

Returns
true if comms are enabled

◆ BSP_IsInsideInterrupt()

bool BSP_IsInsideInterrupt ( void  )

Is the code running in an interrupt context?

Returns
true if in interrupt context

◆ BSP_MicroTimerGet()

u32_t BSP_MicroTimerGet ( void  )

get microseconds timer while running

Returns
time since start in [us]

◆ BSP_MicroTimerStart()

void BSP_MicroTimerStart ( void  )

start microseconds timer

◆ BSP_MicroTimerStop()

u32_t BSP_MicroTimerStop ( void  )

stop microseconds timer

Returns
time since start in [us]

◆ BSP_ReadAbsoluteTime()

u32_t BSP_ReadAbsoluteTime ( void  )

Get the number of milliseconds since program start.

Returns
The number of milliseconds since program start

◆ BSP_ResetRF()

void BSP_ResetRF ( u8_t  ms)

Reset CAX RF Chip.

Parameters
ms- Reset Low Time in [ms]

◆ BSP_SenseRFIRQ()

u8_t BSP_SenseRFIRQ ( void  )

Sense whether SPI IRQ is high or low.

Returns
State of IRQ pin of the CA821x

◆ BSP_SetRFSSBHigh()

void BSP_SetRFSSBHigh ( void  )

Put SPI Select (SSB) Pin high.

◆ BSP_SetRFSSBLow()

void BSP_SetRFSSBLow ( void  )

Put SPI Select (SSB) Pin low.

◆ BSP_SetSPIMOSIOutput()

void BSP_SetSPIMOSIOutput ( void  )

Connect MOSI port to SPI MOSI and disable pull-up.

◆ BSP_SetSPIMOSITristate()

void BSP_SetSPIMOSITristate ( void  )

Disconnect MOSI port from SPI MOSI and put to tristate with pull-up.

◆ BSP_SPIExchange()

void BSP_SPIExchange ( u8_t RxBuf,
const u8_t TxBuf,
u8_t  RxLen,
u8_t  TxLen 
)

Exchange bytes over SPI, receiving into RxBuf and transferring from TxBuf.

Any bytes received after a count of RxLen MUST be discarded. Any bytes sent after a count of TxLen MUST have the value 0xFF. A total of MAX(RxLen, TxLen) bytes MUST be exchanged. When the exchange is complete, the BSP MUST call the SPI_ExchangeComplete function.

RFIRQ will be disabled before this function is called.

Parameters
RxBufBuffer to fill with received bytes. Must be at least RxLen big.
TxBufBuffer to send bytes from. Must be at least TxLen big.
RxLenCount of bytes to receive before dumping all future bytes.
TxLenCount of bytes to transmit before sending all 0xFF bytes.

◆ BSP_SPIInit()

void BSP_SPIInit ( void  )

Initialise GPIO and SPI Pins for Comms with CA-821X.

◆ BSP_Waiting()

void BSP_Waiting ( void  )

This function will be called repeatedly when the Baremetal drivers are blocking & waiting (eg.

WAIT_ms or WAIT_Callback), in case the BSP needs to do any system maintenance or wants to reduce power consumption.

◆ BSP_WaitTicks()

void BSP_WaitTicks ( u32_t  ticks)

Wait for specified Time in Milliseconds.

Parameters
ticks- Time in milliseconds

◆ BSP_WaitUs()

void BSP_WaitUs ( u32_t  us)

Wait for specified Time in Microseconds (max.

999)

Parameters
us- Time in microseconds