50 #if CCX_LOG_ERRORS || defined(__DOXYGEN__) 61 # define CCX_STATUS_LOG(_STATUS) _CCX_STATUS_LOG(_STATUS, __FILE__, __LINE__) 64 # define CCX_STATUS_LOG(_STATUS) 72 #define __CCX_STATUS_LOG(_STATUS, F, L) ccxErrorLog(_STATUS, F, #L) 79 #define _CCX_STATUS_LOG(_STATUS, F, L) __CCX_STATUS_LOG(_STATUS, F, L) 89 #define CCX_STATUS_CHECK(_STATEMENT, _STATUS) \ 91 _STATUS = (_STATEMENT); \ 92 if ((_STATUS) != CCX_OK) \ 94 CCX_STATUS_LOG(_STATUS); \ 109 #define CCX_STATUS_CHECK_CLEANUP(_STATEMENT, _STATUS, _CLEANUP) \ 111 _STATUS = (_STATEMENT); \ 112 if ((_STATUS) != CCX_OK) \ 114 CCX_STATUS_LOG(_STATUS); \ 148 void ccxErrorLog(uint8_t status,
char *file,
char *line);
174 const uint8_t *writeBuffer,
175 uint8_t writeBufferLength);
187 uint8_t
ccxStrobe(uint8_t strobeAddress);
196 uint8_t
ccxReadByte(uint8_t address, uint8_t *readByte);
216 uint8_t readBufferLength);
233 uint8_t *readStatus);
Internal, unexpected error detected.
Definition: ccx_api.h:129
void ccxErrorLog(uint8_t status, char *file, char *line)
Optional error logging function.
uint8_t ccxInit(void)
Initialise the ccx module. This must be called prior to using any other function in this library...
Contains CCxxxx register and bitfield values See Registers: Normal, Registers: Status, Registers: Multibyte, Registers: Strobe Command.
CcxStatus
List of possible error return codes.
Definition: ccx_api.h:126
uint8_t ccxWriteBytes(uint8_t address, const uint8_t *writeBuffer, uint8_t writeBufferLength)
Write multiple bytes (oxtets) to the CCxxxx.
uint8_t ccxDelay25us(void)
Initiate a busy, blocking wait of 25 us.
uint8_t ccxStrobe(uint8_t strobeAddress)
Send a strobe to the CCxxx.
uint8_t ccxReadByte(uint8_t address, uint8_t *readByte)
Read a single byte from specified register.
No error, operational as expected.
Definition: ccx_api.h:127
One or more of the FIFOs are in error.
Definition: ccx_api.h:134
uint8_t ccxShutdown(void)
Shutdown the module. Can optionally be called when finished with using the module.
Device was in an unexpected state.
Definition: ccx_api.h:133
Communications timed out.
Definition: ccx_api.h:130
Sanity assert failed.
Definition: ccx_api.h:135
uint8_t ccxReset(void)
Initiate a software reset of the radio.
SPI error.
Definition: ccx_api.h:131
Bad value passed by API.
Definition: ccx_api.h:128
Received CRC was incorrect.
Definition: ccx_api.h:132
uint8_t ccxRunTests(void)
Run basic sanity tests to ensure communications between MCU and CCxxxx module are operating as expect...
uint8_t ccxReadBytes(uint8_t startAddress, uint8_t *readBuffer, uint8_t readBufferLength)
Read multiple bytes beginning at the specified register.
uint8_t ccxWriteByte(uint8_t address, uint8_t value)
Write a single byte (octet) to the CCxxxx.
uint8_t ccxReadStatusRegister(uint8_t address, uint8_t *readStatus)
Read a single byte from a status register.