Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Since more than one device with different SPI communication settings may share the same SPI bus, this function must reconfigure the SPI controller following the device’s SPI communication setting each time the device driver must access the SPI bus. If the SPI bus is not shared with other devices, it’s recommended that NetDev_SPI_Cfg() configures the SPI controller following the SPI’s communication setting of the wireless device and to keep this function empty.

See  See NetDev_WiFi_SPI_Cfg  for for more information.

Locking and Unlocking SPI Bus

NetDev_WiFi_SPI_Lock() acquires a specific network device's SPI bus access. This function will be called before the device driver begins to access the SPI. The application should not use the same bus to access another device until the matching call to NetDev_WiFI_SPI_Unlock() has been made. If no other SPI device shares the same SPI bus, it's recommended to keep this function empty.

See function NetDev_WiFi_SPI_Lock for more information.

Enabling and Disabling SPI Chip select

NetDev_WiFi_SPI_ChipSelEn() enables the chip select pin of the wireless device. This function is called before the device driver begins to access the SPI. The chip select pin should stay enabled until the matching call to NetDev_WiFi_SPI_ChipSelDis() has been made. The chip select pin is typically “active low.” To enable the device, the chip select pin should be cleared; to disable the device, the chip select pin should be set.

See function NetDev_WiFi_SPI_ChipSelEn for more information.

Writing and Reading to the SPI Bus

NetDev_WiFi_SPI_WrRd() writes and reads data to and from the SPI bus. This function is called each time the device driver accesses the SPI bus. NetDev_WiFi_SPI_WrRd() must not return until the write/read operation is complete. Writing and reading to the SPI bus by using DMA is possible, but the BSP layer must implement a notification mechanism to return from this function only when the write and read operations are entirely completed. See function NetDev_WiFi_SPI_WrRd for more information.