This file contains the EZRadio communication layer. More...
#include <stdint.h>
#include <stdarg.h>
#include "em_gpio.h"
#include "gpiointerrupt.h"
#include "ezradio_hal.h"
#include "ezradio_comm.h"
Go to the source code of this file.
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) |
void | ezradio_comm_ClearCTS () |
Clears the CTS state variable. | |
uint8_t | ezradio_comm_SendCmdGetResp (uint8_t cmdByteCount, uint8_t *pCmdData, uint8_t respByteCount, uint8_t *pRespData) |
Variables | |
uint8_t | ezradio_comm_CtsWentHigh = 0 |
Can be used to prevent CTS check before any communication command. |
This file contains the EZRadio communication layer.
(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.c.
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().
uint8_t ezradio_comm_GetResp | ( | uint8_t | byteCount, | |
uint8_t * | pData | |||
) |
Gets a command response from the radio chip
byteCount | Number of bytes to get from the radio chip | |
pData | Pointer to where to put the data |
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().
uint8_t ezradio_comm_PollCTS | ( | void | ) |
Waits for CTS to be high
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().
void ezradio_comm_ReadData | ( | uint8_t | cmd, | |
uint8_t | pollCts, | |||
uint8_t | byteCount, | |||
uint8_t * | pData | |||
) |
Gets a command response from the radio chip
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().
void ezradio_comm_SendCmd | ( | uint8_t | byteCount, | |
uint8_t * | pData | |||
) |
Sends a command to the radio chip
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().
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
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 |
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().
void ezradio_comm_WriteData | ( | uint8_t | cmd, | |
uint8_t | pollCts, | |||
uint8_t | byteCount, | |||
uint8_t * | pData | |||
) |
Gets a command response from the radio chip
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().
uint8_t ezradio_comm_CtsWentHigh = 0 |
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().