SPI#
Basic Serial Peripheral Interface Driver.
Simple, blocking SPI controller implementation for communication with external devices.
Functions#
Initialize a USART peripheral for SPI.
De-initialize a USART peripheral for SPI.
Write a single byte discarding the received byte.
Write two bytes discarding the received bytes.
Write three bytes discarding the received bytes.
Read a byte by sending a 0xFF byte.
Read two bytes by sending two 0xFF bytes.
Assert the peripheral select line.
Dessert the peripheral select line.
Get PPUSATD word of the (E)USART in use.
Function Documentation#
spi_init#
void spi_init (void )
Initialize a USART peripheral for SPI.
N/A |
34
of file platform/bootloader/driver/btl_driver_spi_controller.h
spi_deinit#
void spi_deinit (void )
De-initialize a USART peripheral for SPI.
N/A |
39
of file platform/bootloader/driver/btl_driver_spi_controller.h
spi_writeByte#
void spi_writeByte (uint8_t data)
Write a single byte discarding the received byte.
[in] | data | The byte to send |
46
of file platform/bootloader/driver/btl_driver_spi_controller.h
spi_writeHalfword#
void spi_writeHalfword (uint16_t data)
Write two bytes discarding the received bytes.
[in] | data | The bytes to send, most significant byte first |
53
of file platform/bootloader/driver/btl_driver_spi_controller.h
spi_write3Byte#
void spi_write3Byte (uint32_t data)
Write three bytes discarding the received bytes.
[in] | data | The bytes to send, most significant byte first |
60
of file platform/bootloader/driver/btl_driver_spi_controller.h
spi_readByte#
uint8_t spi_readByte (void )
Read a byte by sending a 0xFF byte.
N/A |
Returns
The received byte
67
of file platform/bootloader/driver/btl_driver_spi_controller.h
spi_readHalfword#
uint16_t spi_readHalfword (void )
Read two bytes by sending two 0xFF bytes.
N/A |
Returns
The received bytes, most significant byte first
74
of file platform/bootloader/driver/btl_driver_spi_controller.h
spi_setCsActive#
void spi_setCsActive (void )
Assert the peripheral select line.
N/A |
Polarity is configured by spi_init.
79
of file platform/bootloader/driver/btl_driver_spi_controller.h
spi_setCsInactive#
void spi_setCsInactive (void )
Dessert the peripheral select line.
N/A |
Polarity is configured by spi_init.
84
of file platform/bootloader/driver/btl_driver_spi_controller.h
spi_getUsartPPUSATD#
uint32_t spi_getUsartPPUSATD (uint32_t * ppusatdNr)
Get PPUSATD word of the (E)USART in use.
[out] | ppusatdNr | PPUSATD register number |
Returns
The PPUSATD word of the (E)USART in use
93
of file platform/bootloader/driver/btl_driver_spi_controller.h