rusEFI
The most advanced open source ECU
|
Typedefs | |
typedef void(* | lpspi_master_isr_t) (LPSPI_Type *base, lpspi_master_handle_t *handle) |
Typedef for master interrupt handler. | |
typedef void(* | lpspi_slave_isr_t) (LPSPI_Type *base, lpspi_slave_handle_t *handle) |
Typedef for slave interrupt handler. | |
Enumerations | |
enum | _lpspi_default_watermarks { kLpspiDefaultTxWatermark = 0 , kLpspiDefaultRxWatermark = 0 } |
Default watermark values. More... | |
Functions | |
uint32_t | LPSPI_GetInstance (LPSPI_Type *base) |
Get instance number for LPSPI module. | |
static void | LPSPI_SetOnePcsPolarity (LPSPI_Type *base, lpspi_which_pcs_t pcs, lpspi_pcs_polarity_config_t activeLowOrHigh) |
Configures the LPSPI peripheral chip select polarity. | |
static uint32_t | LPSPI_CombineWriteData (uint8_t *txData, uint32_t bytesEachWrite, bool isByteSwap) |
Combine the write data for 1 byte to 4 bytes. This is not a public API. | |
static void | LPSPI_SeparateReadData (uint8_t *rxData, uint32_t readData, uint32_t bytesEachRead, bool isByteSwap) |
Separate the read data for 1 byte to 4 bytes. This is not a public API. | |
static void | LPSPI_MasterTransferFillUpTxFifo (LPSPI_Type *base, lpspi_master_handle_t *handle) |
Master fill up the TX FIFO with data. This is not a public API. | |
static void | LPSPI_MasterTransferComplete (LPSPI_Type *base, lpspi_master_handle_t *handle) |
Master finish up a transfer. It would call back if there is callback function and set the state to idle. This is not a public API. | |
static void | LPSPI_SlaveTransferFillUpTxFifo (LPSPI_Type *base, lpspi_slave_handle_t *handle) |
Slave fill up the TX FIFO with data. This is not a public API. | |
static void | LPSPI_SlaveTransferComplete (LPSPI_Type *base, lpspi_slave_handle_t *handle) |
Slave finish up a transfer. It would call back if there is callback function and set the state to idle. This is not a public API. | |
static void | LPSPI_CommonIRQHandler (LPSPI_Type *base, void *param) |
LPSPI common interrupt handler. | |
void | LPSPI_SetDummyData (LPSPI_Type *base, uint8_t dummyData) |
Set up the dummy data. | |
void | LPSPI_MasterInit (LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz) |
Initializes the LPSPI master. | |
void | LPSPI_MasterGetDefaultConfig (lpspi_master_config_t *masterConfig) |
Sets the lpspi_master_config_t structure to default values. | |
void | LPSPI_SlaveInit (LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig) |
LPSPI slave configuration. | |
void | LPSPI_SlaveGetDefaultConfig (lpspi_slave_config_t *slaveConfig) |
Sets the lpspi_slave_config_t structure to default values. | |
void | LPSPI_Reset (LPSPI_Type *base) |
Restores the LPSPI peripheral to reset state. Note that this function sets all registers to reset state. As a result, the LPSPI module can't work after calling this API. | |
void | LPSPI_Deinit (LPSPI_Type *base) |
De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock. | |
uint32_t | LPSPI_MasterSetBaudRate (LPSPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz, uint32_t *tcrPrescaleValue) |
Sets the LPSPI baud rate in bits per second. | |
void | LPSPI_MasterSetDelayScaler (LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay) |
Manually configures a specific LPSPI delay parameter (module must be disabled to change the delay values). | |
uint32_t | LPSPI_MasterSetDelayTimes (LPSPI_Type *base, uint32_t delayTimeInNanoSec, lpspi_delay_type_t whichDelay, uint32_t srcClock_Hz) |
Calculates the delay based on the desired delay input in nanoseconds (module must be disabled to change the delay values). | |
void | LPSPI_MasterTransferCreateHandle (LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_master_transfer_callback_t callback, void *userData) |
Initializes the LPSPI master handle. | |
bool | LPSPI_CheckTransferArgument (lpspi_transfer_t *transfer, uint32_t bitsPerFrame, uint32_t bytesPerFrame) |
Check the argument for transfer . | |
status_t | LPSPI_MasterTransferBlocking (LPSPI_Type *base, lpspi_transfer_t *transfer) |
LPSPI master transfer data using a polling method. | |
status_t | LPSPI_MasterTransferNonBlocking (LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_transfer_t *transfer) |
LPSPI master transfer data using an interrupt method. | |
status_t | LPSPI_MasterTransferGetCount (LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count) |
Gets the master transfer remaining bytes. | |
void | LPSPI_MasterTransferAbort (LPSPI_Type *base, lpspi_master_handle_t *handle) |
LPSPI master abort transfer which uses an interrupt method. | |
void | LPSPI_MasterTransferHandleIRQ (LPSPI_Type *base, lpspi_master_handle_t *handle) |
LPSPI Master IRQ handler function. | |
void | LPSPI_SlaveTransferCreateHandle (LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_slave_transfer_callback_t callback, void *userData) |
Initializes the LPSPI slave handle. | |
status_t | LPSPI_SlaveTransferNonBlocking (LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_transfer_t *transfer) |
LPSPI slave transfer data using an interrupt method. | |
status_t | LPSPI_SlaveTransferGetCount (LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count) |
Gets the slave transfer remaining bytes. | |
void | LPSPI_SlaveTransferAbort (LPSPI_Type *base, lpspi_slave_handle_t *handle) |
LPSPI slave aborts a transfer which uses an interrupt method. | |
void | LPSPI_SlaveTransferHandleIRQ (LPSPI_Type *base, lpspi_slave_handle_t *handle) |
LPSPI Slave IRQ handler function. | |
void | LPSPI0_DriverIRQHandler (void) |
void | LPSPI1_DriverIRQHandler (void) |
void | LPSPI2_DriverIRQHandler (void) |
void | LPSPI3_DriverIRQHandler (void) |
void | LPSPI4_DriverIRQHandler (void) |
void | LPSPI5_DriverIRQHandler (void) |
void | DMA_SPI0_INT_DriverIRQHandler (void) |
void | DMA_SPI1_INT_DriverIRQHandler (void) |
void | DMA_SPI2_INT_DriverIRQHandler (void) |
void | DMA_SPI3_INT_DriverIRQHandler (void) |
void | ADMA_SPI0_INT_DriverIRQHandler (void) |
void | ADMA_SPI1_INT_DriverIRQHandler (void) |
void | ADMA_SPI2_INT_DriverIRQHandler (void) |
void | ADMA_SPI3_INT_DriverIRQHandler (void) |
Variables | |
static const uint8_t | s_baudratePrescaler [] = {1, 2, 4, 8, 16, 32, 64, 128} |
static LPSPI_Type *const | s_lpspiBases [] = LPSPI_BASE_PTRS |
Pointers to lpspi bases for each instance. | |
static const IRQn_Type | s_lpspiIRQ [] = LPSPI_IRQS |
Pointers to lpspi IRQ number for each instance. | |
static const clock_ip_name_t | s_lpspiClocks [] = LPSPI_CLOCKS |
Pointers to lpspi clocks for each instance. | |
static const clock_ip_name_t | s_LpspiPeriphClocks [] = LPSPI_PERIPH_CLOCKS |
static void * | s_lpspiHandle [ARRAY_SIZE(s_lpspiBases)] = {NULL} |
Pointers to lpspi handles for each instance. | |
static lpspi_master_isr_t | s_lpspiMasterIsr |
Pointer to master IRQ handler for each instance. | |
static lpspi_slave_isr_t | s_lpspiSlaveIsr |
Pointer to slave IRQ handler for each instance. | |
volatile uint8_t | g_lpspiDummyData [ARRAY_SIZE(s_lpspiBases)] = {0} |
Global variable for dummy data value setting. | |
typedef void(* lpspi_master_isr_t) (LPSPI_Type *base, lpspi_master_handle_t *handle) |
Typedef for master interrupt handler.
Definition at line 33 of file fsl_lpspi.c.
typedef void(* lpspi_slave_isr_t) (LPSPI_Type *base, lpspi_slave_handle_t *handle) |
Typedef for slave interrupt handler.
Definition at line 36 of file fsl_lpspi.c.
Default watermark values.
The default watermarks are set to zero.
Enumerator | |
---|---|
kLpspiDefaultTxWatermark | |
kLpspiDefaultRxWatermark |
Definition at line 26 of file fsl_lpspi.c.
void ADMA_SPI0_INT_DriverIRQHandler | ( | void | ) |
Definition at line 2073 of file fsl_lpspi.c.
void ADMA_SPI1_INT_DriverIRQHandler | ( | void | ) |
void ADMA_SPI2_INT_DriverIRQHandler | ( | void | ) |
void ADMA_SPI3_INT_DriverIRQHandler | ( | void | ) |
void DMA_SPI0_INT_DriverIRQHandler | ( | void | ) |
void DMA_SPI1_INT_DriverIRQHandler | ( | void | ) |
void DMA_SPI2_INT_DriverIRQHandler | ( | void | ) |
void DMA_SPI3_INT_DriverIRQHandler | ( | void | ) |
void LPSPI0_DriverIRQHandler | ( | void | ) |
void LPSPI1_DriverIRQHandler | ( | void | ) |
void LPSPI2_DriverIRQHandler | ( | void | ) |
void LPSPI3_DriverIRQHandler | ( | void | ) |
void LPSPI4_DriverIRQHandler | ( | void | ) |
void LPSPI5_DriverIRQHandler | ( | void | ) |
|
static |
Combine the write data for 1 byte to 4 bytes. This is not a public API.
Definition at line 1812 of file fsl_lpspi.c.
Referenced by LPSPI_MasterTransferBlocking(), LPSPI_MasterTransferFillUpTxFifo(), LPSPI_SlaveTransferFillUpTxFifo(), and LPSPI_SlaveTransferHandleIRQ().
|
static |
LPSPI common interrupt handler.
handle | pointer to s_lpspiHandle which stores the transfer state. |
Definition at line 1976 of file fsl_lpspi.c.
Referenced by ADMA_SPI0_INT_DriverIRQHandler(), ADMA_SPI1_INT_DriverIRQHandler(), ADMA_SPI2_INT_DriverIRQHandler(), ADMA_SPI3_INT_DriverIRQHandler(), DMA_SPI0_INT_DriverIRQHandler(), DMA_SPI1_INT_DriverIRQHandler(), DMA_SPI2_INT_DriverIRQHandler(), DMA_SPI3_INT_DriverIRQHandler(), LPSPI0_DriverIRQHandler(), LPSPI1_DriverIRQHandler(), LPSPI2_DriverIRQHandler(), LPSPI3_DriverIRQHandler(), LPSPI4_DriverIRQHandler(), and LPSPI5_DriverIRQHandler().
static uint32_t LPSPI_GetInstance | ( | LPSPI_Type * | base | ) |
Get instance number for LPSPI module.
base | LPSPI peripheral base address. |
Definition at line 146 of file fsl_lpspi.c.
Referenced by ADMA_SPI0_INT_DriverIRQHandler(), ADMA_SPI1_INT_DriverIRQHandler(), ADMA_SPI2_INT_DriverIRQHandler(), ADMA_SPI3_INT_DriverIRQHandler(), DMA_SPI0_INT_DriverIRQHandler(), DMA_SPI1_INT_DriverIRQHandler(), DMA_SPI2_INT_DriverIRQHandler(), DMA_SPI3_INT_DriverIRQHandler(), LPSPI_Deinit(), LPSPI_MasterInit(), LPSPI_MasterTransferBlocking(), LPSPI_MasterTransferCreateHandle(), LPSPI_MasterTransferNonBlocking(), LPSPI_SetDummyData(), LPSPI_SlaveInit(), LPSPI_SlaveTransferCreateHandle(), and LPSPI_SlaveTransferNonBlocking().
|
static |
Master finish up a transfer. It would call back if there is callback function and set the state to idle. This is not a public API.
Definition at line 1170 of file fsl_lpspi.c.
Referenced by LPSPI_MasterTransferHandleIRQ().
|
static |
Master fill up the TX FIFO with data. This is not a public API.
Definition at line 1110 of file fsl_lpspi.c.
Referenced by LPSPI_MasterTransferHandleIRQ(), and LPSPI_MasterTransferNonBlocking().
|
static |
Separate the read data for 1 byte to 4 bytes. This is not a public API.
Definition at line 1896 of file fsl_lpspi.c.
Referenced by LPSPI_MasterTransferBlocking(), LPSPI_MasterTransferHandleIRQ(), and LPSPI_SlaveTransferHandleIRQ().
|
static |
Configures the LPSPI peripheral chip select polarity.
This function takes in the desired peripheral chip select (Pcs) and it's corresponding desired polarity and configures the Pcs signal to operate with the desired characteristic.
base | LPSPI peripheral address. |
pcs | The particular peripheral chip select (parameter value is of type lpspi_which_pcs_t) for which we wish to apply the active high or active low characteristic. |
activeLowOrHigh | The setting for either "active high, inactive low (0)" or "active low, inactive high(1)" of type lpspi_pcs_polarity_config_t. |
Definition at line 385 of file fsl_lpspi.c.
Referenced by LPSPI_MasterInit(), and LPSPI_SlaveInit().
|
static |
Slave finish up a transfer. It would call back if there is callback function and set the state to idle. This is not a public API.
Definition at line 1593 of file fsl_lpspi.c.
Referenced by LPSPI_SlaveTransferHandleIRQ().
|
static |
Slave fill up the TX FIFO with data. This is not a public API.
Definition at line 1564 of file fsl_lpspi.c.
Referenced by LPSPI_SlaveTransferHandleIRQ(), and LPSPI_SlaveTransferNonBlocking().
|
static |
Definition at line 116 of file fsl_lpspi.c.
Referenced by LPSPI_MasterSetBaudRate(), and LPSPI_MasterSetDelayTimes().
|
static |
Pointers to lpspi bases for each instance.
Definition at line 119 of file fsl_lpspi.c.
Referenced by LPSPI_GetInstance().
|
static |
Pointers to lpspi clocks for each instance.
Definition at line 126 of file fsl_lpspi.c.
Referenced by LPSPI_Deinit(), LPSPI_MasterInit(), and LPSPI_SlaveInit().
|
static |
Pointers to lpspi handles for each instance.
Definition at line 135 of file fsl_lpspi.c.
Referenced by ADMA_SPI0_INT_DriverIRQHandler(), ADMA_SPI1_INT_DriverIRQHandler(), ADMA_SPI2_INT_DriverIRQHandler(), ADMA_SPI3_INT_DriverIRQHandler(), DMA_SPI0_INT_DriverIRQHandler(), DMA_SPI1_INT_DriverIRQHandler(), DMA_SPI2_INT_DriverIRQHandler(), DMA_SPI3_INT_DriverIRQHandler(), LPSPI0_DriverIRQHandler(), LPSPI1_DriverIRQHandler(), LPSPI2_DriverIRQHandler(), LPSPI3_DriverIRQHandler(), LPSPI4_DriverIRQHandler(), LPSPI5_DriverIRQHandler(), LPSPI_MasterTransferCreateHandle(), and LPSPI_SlaveTransferCreateHandle().
|
static |
Pointers to lpspi IRQ number for each instance.
Definition at line 122 of file fsl_lpspi.c.
Referenced by LPSPI_MasterTransferNonBlocking(), and LPSPI_SlaveTransferNonBlocking().
|
static |
Pointer to master IRQ handler for each instance.
Definition at line 138 of file fsl_lpspi.c.
Referenced by LPSPI_CommonIRQHandler(), and LPSPI_MasterTransferCreateHandle().
|
static |
Definition at line 129 of file fsl_lpspi.c.
Referenced by LPSPI_Deinit(), LPSPI_MasterInit(), and LPSPI_SlaveInit().
|
static |
Pointer to slave IRQ handler for each instance.
Definition at line 140 of file fsl_lpspi.c.
Referenced by LPSPI_CommonIRQHandler(), and LPSPI_SlaveTransferCreateHandle().