![]() |
MAX32660 Peripheral Driver API
Peripheral Driver API for the MAX32660
|
Modules | |
| SPIMSS_Registers | |
Data Structures | |
| struct | mxc_spimss_req_t |
Typedefs | |
| typedef void(* | mxc_spimss_callback_fn) (mxc_spimss_req_t *req, int error_code) |
Enumerations | |
| enum | mxc_spimss_width_t |
Functions | |
| int | MXC_SPIMSS_Init (mxc_spimss_regs_t *spi, unsigned mode, unsigned freq, const sys_map_t sys_cfg) |
| int | MXC_SPIMSS_Shutdown (mxc_spimss_regs_t *spi) |
| int | MXC_SPIMSS_MasterTrans (mxc_spimss_regs_t *spi, mxc_spimss_req_t *req) |
| int | MXC_SPIMSS_MasterTransDMA (mxc_spimss_regs_t *spi, mxc_spimss_req_t *req) |
| void | MXC_SPIMSS_Handler (mxc_spimss_regs_t *spi) |
| int | MXC_SPIMSS_SlaveTrans (mxc_spimss_regs_t *spi, mxc_spimss_req_t *req) |
| int | MXC_SPIMSS_MasterTransAsync (mxc_spimss_regs_t *spi, mxc_spimss_req_t *req) |
| int | MXC_SPIMSS_SlaveTransAsync (mxc_spimss_regs_t *spi, mxc_spimss_req_t *req) |
| int | MXC_SPIMSS_AbortAsync (mxc_spimss_req_t *req) |
| int | MXC_SPIMSS_SetAutoDMAHandlers (mxc_spimss_regs_t *spi, bool enable) |
| int | MXC_SPIMSS_SetTXDMAChannel (mxc_spimss_regs_t *spi, unsigned int channel) |
| int | MXC_SPIMSS_GetTXDMAChannel (mxc_spimss_regs_t *spi) |
| int | MXC_SPIMSS_SetRXDMAChannel (mxc_spimss_regs_t *spi, unsigned int channel) |
| int | MXC_SPIMSS_GetRXDMAChannel (mxc_spimss_regs_t *spi) |
| struct mxc_spimss_req |
Structure definition for an SPI Master Transaction request.
Structure type representing a SPI Master Transaction request.
Data Fields | |
| uint8_t | ssel |
| uint8_t | deass |
| void * | tx_data |
| void * | rx_data |
| mxc_spimss_width_t | width |
| unsigned | len |
| unsigned | bits |
| unsigned | rx_num |
| unsigned | tx_num |
| mxc_spimss_callback_fn | callback |
| unsigned bits |
Number of bits in transfer unit (e.g. 8 for byte, 16 for short)
| mxc_spimss_callback_fn callback |
Callback function if desired, NULL otherwise
| uint8_t deass |
Not Used
| unsigned len |
Number of transfer units to send from the tx_data buffer.
| void* rx_data |
Pointer to a buffer to store data received. NULL if undesired.
| unsigned rx_num |
Number of bytes actually read into the rx_data buffer.
| uint8_t ssel |
Not Used
| void* tx_data |
Pointer to a buffer to transmit data from. NULL if undesired.
| unsigned tx_num |
Number of bytes actually sent from the tx_data buffer
| mxc_spimss_width_t width |
Not Used
| typedef void(* mxc_spimss_callback_fn) (mxc_spimss_req_t *req, int error_code) |
Callback function type used in asynchronous SPI Master communication requests.
The function declaration for the SPI Master callback is:
req | Pointer to a #spi_req object representing the active SPI Master active transaction. |
error_code | An error code if the active transaction had a failure or E_NO_ERROR if successful. |
| enum mxc_spimss_width_t |
| int MXC_SPIMSS_AbortAsync | ( | mxc_spimss_req_t * | req | ) |
Aborts an Asynchronous request.
| req | Pointer to spi request |
E_NO_ERROR if successful, error if unsuccessful. | int MXC_SPIMSS_GetRXDMAChannel | ( | mxc_spimss_regs_t * | spi | ) |
Returns the current RX channel id set for SPIMSS DMA transaction.
| spi | Pointer to spi module |
#RXDMA_ChannelId of the spi module. | int MXC_SPIMSS_GetTXDMAChannel | ( | mxc_spimss_regs_t * | spi | ) |
Returns the current TX channel id set for SPIMSS DMA transaction.
| spi | Pointer to spi module |
#TXDMA_ChannelId of the spi module. | void MXC_SPIMSS_Handler | ( | mxc_spimss_regs_t * | spi | ) |
Execute SPI transaction based on interrupt handler.
| spi | The spi |
| int MXC_SPIMSS_Init | ( | mxc_spimss_regs_t * | spi, |
| unsigned | mode, | ||
| unsigned | freq, | ||
| const sys_map_t | sys_cfg | ||
| ) |
Initialize the spi.
| spi | Pointer to spi module to initialize. |
| mode | SPI mode for clock phase and polarity. |
| freq | Desired clock frequency. |
| sys_cfg | System configuration object |
E_NO_ERROR if successful, appropriate error otherwise | int MXC_SPIMSS_MasterTrans | ( | mxc_spimss_regs_t * | spi, |
| mxc_spimss_req_t * | req | ||
| ) |
Execute a master transaction.
| spi | Pointer to spi module. |
| req | Pointer to spi request |
E_NO_ERROR if successful, error if unsuccessful. | int MXC_SPIMSS_MasterTransAsync | ( | mxc_spimss_regs_t * | spi, |
| mxc_spimss_req_t * | req | ||
| ) |
Asynchronously read/write SPI Master data.
| spi | Pointer to spi module |
| req | Pointer to spi request |
E_NO_ERROR if successful, error if unsuccessful. | int MXC_SPIMSS_MasterTransDMA | ( | mxc_spimss_regs_t * | spi, |
| mxc_spimss_req_t * | req | ||
| ) |
Execute a master transaction over DMA.
| spi | Pointer to spi module. |
| req | Pointer to spi request. |
E_NO_ERROR if successful, error if unsuccessful. | int MXC_SPIMSS_SetAutoDMAHandlers | ( | mxc_spimss_regs_t * | spi, |
| bool | enable | ||
| ) |
Enable Disable auto dma handling. If set to true, dma channel for transaction is acquired in the MXC_SPIMSS_MasterTransDMA function. Otherwise, user has to set tx and rx channel for SPIMSS DMA transaction with MXC_SPIMSS_SetTXDMAChannel and MXC_SPIMSS_SetRXDMAChannel functions.
| spi | Pointer to spi module |
| enable | Enable Disable auto handler |
E_NO_ERROR if successful, error if unsuccessful. | int MXC_SPIMSS_SetRXDMAChannel | ( | mxc_spimss_regs_t * | spi, |
| unsigned int | channel | ||
| ) |
Set the RX channel id for DMA to be used in SPIMSS DMA transaction.
| spi | Pointer to spi module |
| channel | Id of the channel for RXDma Channel. |
E_NO_ERROR if successful, error if unsuccessful. | int MXC_SPIMSS_SetTXDMAChannel | ( | mxc_spimss_regs_t * | spi, |
| unsigned int | channel | ||
| ) |
Set the TX channel id for DMA to be used in SPIMSS DMA transaction.
| spi | Pointer to spi module |
| channel | Id of the channel for TXDma Channel. |
E_NO_ERROR if successful, error if unsuccessful. | int MXC_SPIMSS_Shutdown | ( | mxc_spimss_regs_t * | spi | ) |
Shutdown SPI module.
| spi | Pointer to SPI regs. |
E_NO_ERROR if successful, appropriate error otherwise | int MXC_SPIMSS_SlaveTrans | ( | mxc_spimss_regs_t * | spi, |
| mxc_spimss_req_t * | req | ||
| ) |
Execute a slave transaction.
| spi | Pointer to spi module. |
| req | Pointer to spi request |
E_NO_ERROR if successful, error if unsuccessful. | int MXC_SPIMSS_SlaveTransAsync | ( | mxc_spimss_regs_t * | spi, |
| mxc_spimss_req_t * | req | ||
| ) |
Asynchronously read/write SPI Slave data.
| spi | Pointer to spi module |
| req | Pointer to spi request |
E_NO_ERROR if successful, error if unsuccessful.