SBAU412A November 2022 – May 2024 AFE7900 , AFE7903 , AFE7906 , AFE7920 , AFE7921 , AFE7950
The AXI SPI instance in TI AFE SPI IP is used in Standard Mode.
Peripherals select 0 and select 1 are used as chip selects for AFE and LMK clocking device, respectively
SCL frequency is hard coded to 10 MHz within TI IP
Key commands for SPI initialization and usage in Vitis are as explained below:
Initialize a pointer (ConfigPtr).
Refer ‘Xparameters.h’ to find the correct AXI QUAD SPI DEVICE ID.
Initialize a new instance of SPI (Spidev).
Set the Spidev instance to be in Controller mode.
Select Peripheral: AFE.
Select Peripheral: LMK.
Second argument WrBufdev is an array with 3 bytes (24-bit data to be transmitted on SPI).
Third argument RdBufdev is an array with 3 bytes, the last byte has the SPI read value.
Fourth argument is number of bytes to be transmitted/received...3 in our case.
The D23 is the MSB bit of the 24-bit data because the D23 indicates whether it is a Read or a Write SPI operation: