Flexcomm interface functions. More...
Flexcomm interface functions.
The FLEXCOMM blocks can operate in different modes such as UART, SPI and I2C, but not all modules support all modes. These functions allow to initialize and configure the FLEXCOMM, as well as route back the ISRs to the corresponding module.
Definition in file flexcomm.h.
Go to the source code of this file.
enum | flexcom_pselid_t { FLEXCOMM_ID_UART = 1 , FLEXCOMM_ID_SPI = 2 , FLEXCOMM_ID_I2C = 3 } |
Flexcomm PSELID values. More... | |
int | flexcomm_init (FLEXCOMM_Type *dev, flexcom_pselid_t mode) |
Initialize a flexcomm module to operate as the selected mode. | |
int | flexcomm_instance_from_addr (const FLEXCOMM_Type *dev) |
Obtain the flexcomm block number (0-based) from the address. | |
enum flexcom_pselid_t |
Flexcomm PSELID values.
This value identifies the current function of a FLEXCOMM module.
Enumerator | |
---|---|
FLEXCOMM_ID_UART | UART mode. |
FLEXCOMM_ID_SPI | SPI mode. |
FLEXCOMM_ID_I2C | I2C mode. |
Definition at line 40 of file flexcomm.h.
int flexcomm_init | ( | FLEXCOMM_Type * | dev, |
flexcom_pselid_t | mode | ||
) |
Initialize a flexcomm module to operate as the selected mode.
int flexcomm_instance_from_addr | ( | const FLEXCOMM_Type * | dev | ) |
Obtain the flexcomm block number (0-based) from the address.
For example, the flexcomm block number of FLEXCOMM2, the pointer to the FLEXCOMM_Type block is 2. If an invalid address is passed returns -1.