Go to the documentation of this file.
25 #define SPIARRAYSIZE 1024
28 #define SPIARRAYTRIPSIZE ((SPIARRAYSIZE / 3) * 3)
94 uint8_t *data, uint32_t count);
98 uint8_t field_val, uint8_t mask,
101 uint8_t *field_val, uint8_t mask,
115 uint32_t errorCode,
const char *comment);
ADI_ERR
Definition: common.h:34
@ ADIERR_OK
Definition: common.h:35
@ COMMONERR_OK
Definition: common.h:42
commonErr_t CMB_setSPIChannel(uint16_t chipSelectIndex)
Definition: common.c:168
commonErr_t CMB_wait_us(uint32_t time_us)
Definition: common.c:294
@ ADIHAL_LOG_ERROR
Definition: common.h:51
uint8_t chipSelectIndex
valid 1~8
Definition: common.h:62
uint8_t MSBFirst
1 = MSBFirst, 0 = LSBFirst
Definition: common.h:65
@ ADIERR_INV_PARM
Definition: common.h:36
commonErr_t CMB_regWrite(uint32_t offset, uint32_t data)
Definition: common.c:335
commonErr_t CMB_flushLog(void)
Definition: common.c:282
@ ADIHAL_LOG_MESSAGE
Definition: common.h:49
@ ADIERR_FAILED
Definition: common.h:37
commonErr_t CMB_SPIWriteByte(spiSettings_t *spiSettings, uint16_t addr, uint8_t data)
Definition: common.c:173
int32_t platform_remove(void)
Definition: common.c:115
commonErr_t CMB_setTimeout_us(uint32_t timeOut_us)
Definition: common.c:312
commonErr_t
Definition: common.h:41
commonErr_t CMB_closeHardware(void)
Definition: common.c:128
@ ADIHAL_LOG_SPI
Definition: common.h:52
commonErr_t CMB_memRead(uint32_t offset, uint32_t *data, uint32_t len)
Definition: common.c:340
commonErr_t CMB_setSPIOptions(spiSettings_t *spiSettings)
Definition: common.c:163
Data structure to hold SPI settings for all system device types.
Definition: common.h:61
commonErr_t CMB_regRead(uint32_t offset, uint32_t *data)
Definition: common.c:330
uint8_t writeBitPolarity
the level of the write bit of a SPI write instruction word, value is inverted for SPI read operation
Definition: common.h:63
commonErr_t CMB_SPIWriteBytes(spiSettings_t *spiSettings, uint16_t *addr, uint8_t *data, uint32_t count)
Definition: common.c:189
int32_t platform_init(void)
Initialize the power controller and set the core and peripherals clock divider.
Definition: platform_init.c:44
@ ADIHAL_LOG_AXI_MEM
Definition: common.h:54
ADI_LOGLEVEL CMB_LOGLEVEL
Definition: common.c:33
commonErr_t CMB_wait_ms(uint32_t time_ms)
Definition: common.c:287
@ ADIHAL_LOG_AXI_REG
Definition: common.h:53
commonErr_t CMB_memWrite(uint32_t offset, uint32_t *data, uint32_t len)
Definition: common.c:345
@ ADIHAL_LOG_WARNING
Definition: common.h:50
uint8_t longInstructionWord
1 = 16bit instruction word, 0 = 8bit instruction word
Definition: common.h:64
commonErr_t CMB_setGPIO(uint32_t GPIO)
Definition: common.c:133
commonErr_t CMB_openLog(const char *filename)
Definition: common.c:272
commonErr_t CMB_writeToLog(ADI_LOGLEVEL level, uint8_t deviceIndex, uint32_t errorCode, const char *comment)
Definition: common.c:250
ADI_LOGLEVEL
Definition: common.h:47
uint8_t autoIncAddrUp
Not implemented. For SPI Streaming, set address increment direction. 1= next addr = addr+1,...
Definition: common.h:69
uint8_t enSpiStreaming
Not implemented. SW feature to improve SPI throughput.
Definition: common.h:68
@ ADIHAL_LOG_NONE
Definition: common.h:48
commonErr_t CMB_SPIWriteField(spiSettings_t *spiSettings, uint16_t addr, uint8_t field_val, uint8_t mask, uint8_t start_bit)
Definition: common.c:219
uint8_t CPHA
clock phase, sets which clock edge the data updates (valid 0 or 1)
Definition: common.h:66
uint8_t fourWireMode
1: Use 4-wire SPI, 0: 3-wire SPI (SDIO pin is bidirectional). NOTE: ADI's FPGA platform always uses 4...
Definition: common.h:70
commonErr_t CMB_closeLog(void)
Definition: common.c:277
commonErr_t CMB_setTimeout_ms(uint32_t timeOut_ms)
Definition: common.c:301
commonErr_t CMB_SPIReadField(spiSettings_t *spiSettings, uint16_t addr, uint8_t *field_val, uint8_t mask, uint8_t start_bit)
Definition: common.c:236
@ ADIHAL_LOG_ALL
Definition: common.h:55
commonErr_t CMB_hasTimeoutExpired()
Definition: common.c:319
@ COMMONERR_FAILED
Definition: common.h:43
commonErr_t CMB_hardReset(uint8_t spiChipSelectIndex)
Definition: common.c:138
commonErr_t CMB_SPIReadByte(spiSettings_t *spiSettings, uint16_t addr, uint8_t *readdata)
Definition: common.c:202
uint32_t spiClkFreq_Hz
SPI Clk frequency in Hz (default 25000000), platform will use next lowest frequency that it's baud ra...
Definition: common.h:71
uint8_t CPOL
clock polarity 0 = clock starts low, 1 = clock starts high
Definition: common.h:67