rusEFI
The most advanced open source ECU
|
Functions | |
static int32_t | spi_detectPCS (bool isMaster, ioportid_t ssport, uint16_t sspad, int *alt) |
static int32_t | spi_detectBaudRate (SPIDriver *spip) |
void | spi_lld_master_callback (LPSPI_Type *base, lpspi_master_handle_t *handle, status_t status, void *userData) |
void | spi_lld_slave_callback (LPSPI_Type *base, lpspi_slave_handle_t *handle, status_t status, void *userData) |
Variables | |
SPIDriver | SPID1 |
SPI0 driver identifier. | |
SPIDriver | SPID2 |
SPI1 driver identifier. | |
Configuration options | |
typedef void(* | spicallback_t) (SPIDriver *spip) |
SPI notification callback type. | |
SPIDriver | SPID1 |
SPI0 driver identifier. | |
SPIDriver | SPID2 |
SPI1 driver identifier. | |
void | spi_lld_init (void) |
Low level SPI driver initialization. | |
void | spi_lld_start (SPIDriver *spip) |
Configures and activates the SPI peripheral. | |
void | spi_lld_stop (SPIDriver *spip) |
Deactivates the SPI peripheral. | |
void | spi_lld_select (SPIDriver *spip) |
Asserts the slave select signal and prepares for transfers. | |
void | spi_lld_unselect (SPIDriver *spip) |
Deasserts the slave select signal. | |
void | spi_lld_ignore (SPIDriver *spip, size_t n) |
Ignores data on the SPI bus. | |
void | spi_lld_exchange (SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) |
Exchanges data on the SPI bus. | |
void | spi_lld_send (SPIDriver *spip, size_t n, const void *txbuf) |
Sends data over the SPI bus. | |
void | spi_lld_receive (SPIDriver *spip, size_t n, void *rxbuf) |
Receives data from the SPI bus. | |
void | spi_lld_abort (SPIDriver *spip) |
Aborts the ongoing SPI operation, if any. | |
uint16_t | spi_lld_polled_exchange (SPIDriver *spip, uint16_t frame) |
Exchanges one frame using a polled wait. | |
typedef void(* spicallback_t) (SPIDriver *spip) |
SPI notification callback type.
[in] | spip | pointer to the SPIDriver object triggering the callback |
Definition at line 123 of file hal_spi_lld.h.
|
static |
Definition at line 90 of file hal_spi_lld.c.
Referenced by spi_lld_start().
|
static |
Definition at line 58 of file hal_spi_lld.c.
Referenced by spi_lld_start().
void spi_lld_abort | ( | SPIDriver * | spip | ) |
Aborts the ongoing SPI operation, if any.
[in] | spip | pointer to the SPIDriver object |
@notapi
Definition at line 390 of file hal_spi_lld.c.
void spi_lld_exchange | ( | SPIDriver * | spip, |
size_t | n, | ||
const void * | txbuf, | ||
void * | rxbuf | ||
) |
Exchanges data on the SPI bus.
This asynchronous function starts a simultaneous transmit/receive operation.
[in] | spip | pointer to the SPIDriver object |
[in] | n | number of words to be exchanged |
[in] | txbuf | the pointer to the transmit buffer |
[out] | rxbuf | the pointer to the receive buffer |
@notapi
Definition at line 314 of file hal_spi_lld.c.
void spi_lld_ignore | ( | SPIDriver * | spip, |
size_t | n | ||
) |
Ignores data on the SPI bus.
This asynchronous function starts the transmission of a series of idle words on the SPI bus and ignores the received data.
[in] | spip | pointer to the SPIDriver object |
[in] | n | number of words to be ignored |
@notapi
Definition at line 289 of file hal_spi_lld.c.
void spi_lld_init | ( | void | ) |
Low level SPI driver initialization.
@notapi
Definition at line 135 of file hal_spi_lld.c.
void spi_lld_master_callback | ( | LPSPI_Type * | base, |
lpspi_master_handle_t * | handle, | ||
status_t | status, | ||
void * | userData | ||
) |
Definition at line 110 of file hal_spi_lld.c.
Referenced by spi_lld_start().
uint16_t spi_lld_polled_exchange | ( | SPIDriver * | spip, |
uint16_t | frame | ||
) |
Exchanges one frame using a polled wait.
This synchronous function exchanges one frame using a polled synchronization method. This function is useful when exchanging small amount of data on high speed channels, usually in this situation is much more efficient just wait for completion using polling than suspending the thread waiting for an interrupt.
[in] | spip | pointer to the SPIDriver object |
[in] | frame | the data frame to send over the SPI bus |
Definition at line 412 of file hal_spi_lld.c.
void spi_lld_receive | ( | SPIDriver * | spip, |
size_t | n, | ||
void * | rxbuf | ||
) |
Receives data from the SPI bus.
This asynchronous function starts a receive operation.
[in] | spip | pointer to the SPIDriver object |
[in] | n | number of words to receive |
[out] | rxbuf | the pointer to the receive buffer |
@notapi
Definition at line 368 of file hal_spi_lld.c.
void spi_lld_select | ( | SPIDriver * | spip | ) |
Asserts the slave select signal and prepares for transfers.
[in] | spip | pointer to the SPIDriver object |
@notapi
Definition at line 258 of file hal_spi_lld.c.
void spi_lld_send | ( | SPIDriver * | spip, |
size_t | n, | ||
const void * | txbuf | ||
) |
Sends data over the SPI bus.
This asynchronous function starts a transmit operation.
[in] | spip | pointer to the SPIDriver object |
[in] | n | number of words to send |
[in] | txbuf | the pointer to the transmit buffer |
@notapi
Definition at line 341 of file hal_spi_lld.c.
void spi_lld_slave_callback | ( | LPSPI_Type * | base, |
lpspi_slave_handle_t * | handle, | ||
status_t | status, | ||
void * | userData | ||
) |
Definition at line 118 of file hal_spi_lld.c.
Referenced by spi_lld_start().
void spi_lld_start | ( | SPIDriver * | spip | ) |
Configures and activates the SPI peripheral.
[in] | spip | pointer to the SPIDriver object |
@notapi
Definition at line 151 of file hal_spi_lld.c.
void spi_lld_stop | ( | SPIDriver * | spip | ) |
Deactivates the SPI peripheral.
[in] | spip | pointer to the SPIDriver object |
@notapi
Definition at line 230 of file hal_spi_lld.c.
void spi_lld_unselect | ( | SPIDriver * | spip | ) |
Deasserts the slave select signal.
The previously selected peripheral is unselected.
[in] | spip | pointer to the SPIDriver object |
@notapi
Definition at line 272 of file hal_spi_lld.c.
SPIDriver SPID1 |
SPI0 driver identifier.
Definition at line 42 of file hal_spi_lld.c.
Referenced by getAfListForSpi(), getSpiAf(), getSpiAf(), getSpiDevice(), spi_detectBaudRate(), spi_lld_init(), spi_lld_start(), spi_lld_stop(), spiGetBaseClock(), and turnOnSpi().
|
extern |
SPI0 driver identifier.
Definition at line 42 of file hal_spi_lld.c.
Referenced by getAfListForSpi(), getSpiAf(), getSpiAf(), getSpiDevice(), spi_detectBaudRate(), spi_lld_init(), spi_lld_start(), spi_lld_stop(), spiGetBaseClock(), and turnOnSpi().
SPIDriver SPID2 |
SPI1 driver identifier.
Definition at line 47 of file hal_spi_lld.c.
Referenced by getAfListForSpi(), getSpiAf(), getSpiAf(), getSpiDevice(), spi_lld_init(), spi_lld_start(), spi_lld_stop(), spiGetBaseClock(), and turnOnSpi().
|
extern |
SPI1 driver identifier.
Definition at line 47 of file hal_spi_lld.c.
Referenced by getAfListForSpi(), getSpiAf(), getSpiAf(), getSpiDevice(), spi_lld_init(), spi_lld_start(), spi_lld_stop(), spiGetBaseClock(), and turnOnSpi().