ezradio_comm.h File Reference

This file contains the EZRadio communication layer. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define EZRADIO_CTS_TIMEOUT   10000
 Radio CTS timeout.

Functions

uint8_t ezradio_comm_GetResp (uint8_t byteCount, uint8_t *pData)
void ezradio_comm_SendCmd (uint8_t byteCount, uint8_t *pData)
void ezradio_comm_ReadData (uint8_t cmd, uint8_t pollCts, uint8_t byteCount, uint8_t *pData)
void ezradio_comm_WriteData (uint8_t cmd, uint8_t pollCts, uint8_t byteCount, uint8_t *pData)
uint8_t ezradio_comm_PollCTS (void)
uint8_t ezradio_comm_SendCmdGetResp (uint8_t cmdByteCount, uint8_t *pCmdData, uint8_t respByteCount, uint8_t *pRespData)
void ezradio_comm_ClearCTS (void)
 Clears the CTS state variable.

Variables

uint8_t ezradio_comm_CtsWentHigh
 Can be used to prevent CTS check before any communication command.

Detailed Description

This file contains the EZRadio communication layer.

Version:
4.0.0

License

(C) Copyright 2015 Silicon Labs, http://www.silabs.com

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution.

DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no obligation to support this Software. Silicon Labs is providing the Software "AS IS", with no express or implied warranties of any kind, including, but not limited to, any implied warranties of merchantability or fitness for any particular purpose or warranties against infringement of any proprietary rights of a third party.

Silicon Labs will not be liable for any consequential, incidental, or special damages, or any other relief, or for any claim by any third party, arising from your use of this Software.

Definition in file ezradio_comm.h.


Define Documentation

#define EZRADIO_CTS_TIMEOUT   10000

Radio CTS timeout.

Definition at line 41 of file ezradio_comm.h.

Referenced by ezradio_comm_GetResp().


Function Documentation

void ezradio_comm_ClearCTS ( void   ) 

Clears the CTS state variable.

Definition at line 183 of file ezradio_comm.c.

References ezradio_comm_CtsWentHigh.

Referenced by ezradio_reset().

Here is the caller graph for this function:

uint8_t ezradio_comm_GetResp ( uint8_t  byteCount,
uint8_t *  pData 
)

Gets a command response from the radio chip

Parameters:
byteCount Number of bytes to get from the radio chip
pData Pointer to where to put the data
Returns:
CTS value

Definition at line 52 of file ezradio_comm.c.

References ezradio_comm_CtsWentHigh, EZRADIO_CTS_TIMEOUT, ezradio_hal_ClearNsel(), ezradio_hal_SetNsel(), ezradio_hal_SpiReadByte(), ezradio_hal_SpiReadData(), and ezradio_hal_SpiWriteByte().

Referenced by ezradio_comm_PollCTS(), and ezradio_comm_SendCmdGetResp().

Here is the call graph for this function:

Here is the caller graph for this function:

uint8_t ezradio_comm_PollCTS ( void   ) 

Waits for CTS to be high

Returns:
CTS value

Definition at line 166 of file ezradio_comm.c.

References ezradio_comm_CtsWentHigh, and ezradio_comm_GetResp().

Referenced by ezradio_comm_ReadData(), ezradio_comm_SendCmd(), and ezradio_comm_WriteData().

Here is the call graph for this function:

Here is the caller graph for this function:

void ezradio_comm_ReadData ( uint8_t  cmd,
uint8_t  pollCts,
uint8_t  byteCount,
uint8_t *  pData 
)

Gets a command response from the radio chip

Parameters:
cmd Command ID
pollCts Set to poll CTS
byteCount Number of bytes to get from the radio chip.
pData Pointer to where to put the data.

Definition at line 120 of file ezradio_comm.c.

References ezradio_comm_CtsWentHigh, ezradio_comm_PollCTS(), ezradio_hal_ClearNsel(), ezradio_hal_SetNsel(), ezradio_hal_SpiReadData(), and ezradio_hal_SpiWriteByte().

Here is the call graph for this function:

void ezradio_comm_SendCmd ( uint8_t  byteCount,
uint8_t *  pData 
)

Sends a command to the radio chip

Parameters:
byteCount Number of bytes in the command to send to the radio device
pData Pointer to the command to send.

Definition at line 100 of file ezradio_comm.c.

References ezradio_comm_CtsWentHigh, ezradio_comm_PollCTS(), ezradio_hal_ClearNsel(), ezradio_hal_SetNsel(), and ezradio_hal_SpiWriteData().

Referenced by ezradio_change_state(), ezradio_comm_SendCmdGetResp(), ezradio_power_up(), ezradio_set_property(), ezradio_start_rx(), and ezradio_start_tx().

Here is the call graph for this function:

Here is the caller graph for this function:

uint8_t ezradio_comm_SendCmdGetResp ( uint8_t  cmdByteCount,
uint8_t *  pCmdData,
uint8_t  respByteCount,
uint8_t *  pRespData 
)

Sends a command to the radio chip and gets a response

Parameters:
cmdByteCount Number of bytes in the command to send to the radio device
pCmdData Pointer to the command data
respByteCount Number of bytes in the response to fetch
pRespData Pointer to where to put the response data
Returns:
CTS value

Definition at line 198 of file ezradio_comm.c.

References ezradio_comm_GetResp(), and ezradio_comm_SendCmd().

Referenced by ezradio_get_int_status(), ezradio_gpio_pin_cfg(), and ezradio_part_info().

Here is the call graph for this function:

Here is the caller graph for this function:

void ezradio_comm_WriteData ( uint8_t  cmd,
uint8_t  pollCts,
uint8_t  byteCount,
uint8_t *  pData 
)

Gets a command response from the radio chip

Parameters:
cmd Command ID
pollCts Set to poll CTS
byteCount Number of bytes to get from the radio chip
pData Pointer to where to put the data

Definition at line 145 of file ezradio_comm.c.

References ezradio_comm_CtsWentHigh, ezradio_comm_PollCTS(), ezradio_hal_ClearNsel(), ezradio_hal_SetNsel(), ezradio_hal_SpiWriteByte(), and ezradio_hal_SpiWriteData().

Here is the call graph for this function:


Variable Documentation

Can be used to prevent CTS check before any communication command.

Definition at line 42 of file ezradio_comm.c.

Referenced by ezradio_comm_ClearCTS(), ezradio_comm_GetResp(), ezradio_comm_PollCTS(), ezradio_comm_ReadData(), ezradio_comm_SendCmd(), and ezradio_comm_WriteData().