How to implement FPGA SPI driver

FPGA_SPI.c file need to be customized with platform SPI functions.

  1. Replace the call to spi_master_setup_device in FPGA_Init with initialization code for platform SPI interface
  2. Provide and implementation for spi_select_device, spi_write_packet, spi_read_packet and spi_deselect_device

spi_select_device shall put the FPGA CS to low state
spi_deselect_device shall put the FPGA CS to high state

FPGA relies on CS to reset its internal receive state to it is important that spi_write_packet and spi_read_packet do not move the FPGA CS pin.

spi_write_packet shall write the specified amount of data to SPI port, data from MISO shall be ignored
spi_read_packet shall read the specified amount of data from SPI port, data from MOSI will be ignored by FPGA

 

 

Sorry, comments are closed for this post.