3.2.1 Hardware Interface Function (dpDUTspi.c)

do_SPI_SCAN_in and do_SPI_SCAN_out functions are used to interface with the SPI port to clock data into and out of the target device.
Note: These functions must use the SPI driver API available for the targeted device processor.

dp_SPI_SCAN_in Function

This function takes three arguments:
  • Command: 8-bit variable holding the command value.
  • Data_bits: The number of bits to clock into the device.
  • input_buffer: Pointer to the buffer which holds valid data to be clocked into the device.

dp_SPI_SCAN_OUT Function

This function takes four arguments:

  • Command bits: The number of bits to clock in for the command portion of the frame. This value must be 8 as all SPI commands are 8 bit long.
  • Command: 8-bit variable holding the command value
  • Data_bits: The number of bits to read from the device.
  • Ouput_buffer: Pointer to the buffer to hold the data read from the targeted device.