![]() |
PDL for FM4
Version1.2
Peripheral Driverl Library for FM4
|
How to use MFS High Level module. More...
Data Structures | |
| struct | stc_mfs_hl_buffer |
| MFS_HL ring buffer. More... | |
| struct | stc_mfs_hl_uart_config |
| MFS_HL UART configuration. More... | |
| struct | stc_mfs_hl_spi_config |
| MFS_HL SPI configuration. More... | |
| struct | stc_mfs_hl_timer_config |
| MFS_HL Timer mode configuration. More... | |
| struct | stc_mfs_hl_csio_config |
| MFS_HL CSIO configuration. More... | |
| struct | stc_mfs_hl_i2c_config |
| MFS_HL I2C configuration. More... | |
| struct | stc_mfs_hl_lin_config |
| MFS_HL LIN configuration. More... | |
| struct | stc_mfs_hl_intern_data |
| MFS_HL module internal data, storing internal information for each enabled MFS instance. More... | |
| struct | stc_mfs_hl_instance_data |
| MFS_HL instance data type. More... | |
Macros | |
| #define | MFS_HL_RELOADVAL_MIN4UART (4u) |
| #define | MFS_HL_RELOADVAL_MIN4CSIO (3u) |
| #define | MFS_HL_RELOADVAL_MIN4LIN (3u) |
| #define | MFS_HL_BGR_MASK (0x7FFFu) |
| #define | MFS_HL_NUM_1 (1u) |
| #define | MFS_HL_NUM_2 (2u) |
| #define | MFS_HL_NUM_3 (3u) |
| #define | MFS_HL_NUM_4 (4u) |
| #define | MFS_HL_NUM_5 (5u) |
| #define | MFS_HL_NUM_6 (6u) |
| #define | MFS_HL_NUM_7 (7u) |
| #define | MFS_HL_NUM_8 (8u) |
| #define | MFS_HL_NUM_9 (9u) |
| #define | MFS_HL_NUM_10 (10u) |
| #define | MFS_HL_MASK_0 (0x01u) |
| #define | MFS_HL_MASK_1 (0x02u) |
| #define | MFS_HL_MASK_2 (0x04u) |
| #define | MFS_HL_MASK_3 (0x08u) |
| #define | MFS_HL_MASK_4 (0x10u) |
| #define | MFS_HL_MASK_5 (0x20u) |
| #define | MFS_HL_MASK_6 (0x40u) |
| #define | MFS_HL_MASK_7 (0x80u) |
| #define | MFS_HL_MASK_0_2 (0x07u) |
| #define | MFS_HL_MASK_0_3 (0x0Fu) |
| #define | MFS_HL_MASK_0_6 (0x7Fu) |
| #define | MFS_HL_MASK_4_7 (0xF0u) |
| #define | MFS_HL_MASK_0_7 (0x000000FFu) |
| #define | MFS_HL_MASK_8_15 (0x0000FF00u) |
| #define | MFS_HL_MASK_16_23 (0x00FF0000u) |
| #define | MFS_HL_MASK_24_31 (0xFF000000u) |
| #define | MFS_HL_MASK_0_15 (0x0000FFFFu) |
| #define | MFS_HL_MASK_16_31 (0xFFFF0000u) |
| #define | MFS_HL_MODE_GROUP_CHK (0xF0u) |
| MFS_HL mode group. More... | |
| #define | MFS_HL_MODE_GROUP_UART (0x10u) |
| #define | MFS_HL_MODE_GROUP_CSIO (0x20u) |
| #define | MFS_HL_MODE_GROUP_I2C (0x30u) |
| #define | MFS_HL_MODE_GROUP_LIN (0x40u) |
Typedefs | |
| typedef void(* | mfs_hl_tx_cb_func_ptr_t )(uint16_t) |
| MFS_HL callback function prototypes. More... | |
| typedef void(* | mfs_hl_rx_cb_func_ptr_t )(uint16_t) |
| typedef uint8_t(* | mfs_hl_i2c_slv_cb_func_prt_t )(uint8_t) |
| typedef void(* | mfs_hl_lin_brk_func_ptr_t )(void) |
| typedef enum en_mfs_hl_fifo_usage | en_mfs_hl_fifo_usage_t |
| MFS_HL FIFO usage. More... | |
| typedef enum en_mfs_hl_exec | en_mfs_hl_exec_t |
| MFS_HL Execution status. More... | |
| typedef enum en_mfs_hl_mfs_mode | en_mfs_hl_mfs_mode_t |
| MFS_HL MFS mode. More... | |
| typedef enum en_mfs_hl_i2c_wait_select | en_mfs_hl_i2c_wait_select_t |
| MFS_HL I2C wait selection. More... | |
| typedef enum en_mfs_hl_i2c_int_state | en_mfs_hl_i2c_int_state_t |
| MFS_HL I2C interrupt status. More... | |
| typedef struct stc_mfs_hl_buffer | stc_mfs_hl_buffer_t |
| MFS_HL ring buffer. More... | |
| typedef struct stc_mfs_hl_uart_config | stc_mfs_hl_uart_config_t |
| MFS_HL UART configuration. More... | |
| typedef struct stc_mfs_hl_spi_config | stc_mfs_hl_spi_config_t |
| MFS_HL SPI configuration. More... | |
| typedef struct stc_mfs_hl_timer_config | stc_mfs_hl_timer_config_t |
| MFS_HL Timer mode configuration. More... | |
| typedef struct stc_mfs_hl_csio_config | stc_mfs_hl_csio_config_t |
| MFS_HL CSIO configuration. More... | |
| typedef struct stc_mfs_hl_i2c_config | stc_mfs_hl_i2c_config_t |
| MFS_HL I2C configuration. More... | |
| typedef struct stc_mfs_hl_lin_config | stc_mfs_hl_lin_config_t |
| MFS_HL LIN configuration. More... | |
| typedef enum en_mfs_hl_buffer | en_mfs_hl_buffer_t |
| Get the poitner to internal RX or TX buffer. More... | |
| typedef struct stc_mfs_hl_intern_data | stc_mfs_hl_intern_data_t |
| MFS_HL module internal data, storing internal information for each enabled MFS instance. More... | |
| typedef struct stc_mfs_hl_instance_data | stc_mfs_hl_instance_data_t |
| MFS_HL instance data type. More... | |
Functions | |
| static stc_mfs_hl_intern_data_t * | MfsHlGetInternDataPtr (volatile stc_mfsn_t *pstcMfs) |
| Return the internal data for a certain MFS_HL instance. More... | |
| static uint16_t | MfsHlGetMin (uint16_t u16Num1, uint16_t u16Num2) |
| Get minimum number. More... | |
| static void | MfsHlWriteBuf (volatile stc_mfsn_t *pstcMfs, stc_mfs_hl_intern_data_t *pstcMfsHlInternData) |
| Write the contents of the buffer to Transmit Data Register. More... | |
| static void | MfsHlIrqHandlerTx (volatile stc_mfsn_t *pstcMfs, void *pvHandle) |
| MFS_HL transmit interrupt service routine. More... | |
| static void | MfsHlReadBuf (volatile stc_mfsn_t *pstcMfs, stc_mfs_hl_intern_data_t *pstcMfsHlInternData) |
| Store received data into buffer. More... | |
| static void | MfsHlIrqHandlerRx (volatile stc_mfsn_t *pstcMfs, void *pvHandle) |
| MFS_HL receive interrupt service routine. More... | |
| static void | MfsHlIrqHandlerSts (volatile stc_mfsn_t *pstcMfs, void *pvHandle) |
| MFS_HL status interrupt service routine. More... | |
| static void | MfsHlFifoUseInit (volatile stc_mfsn_t *pstcMfs, uint16_t u16BufFillLvl) |
| MFS_HL Initialize FIFO to use. More... | |
| static void | MfsHlI2cDataTxMaster (volatile stc_mfsn_t *pstcI2c, stc_mfs_hl_intern_data_t *pstcMfsHlInternData) |
| MFS_HL Operation to send data for I2C master. More... | |
| static void | MfsHlI2cDataRxMaster (volatile stc_mfsn_t *pstcI2c, stc_mfs_hl_intern_data_t *pstcMfsHlInternData) |
| MFS_HL Operation to receive data for I2C master. More... | |
| static void | MfsHlI2cPreStartSlave (volatile stc_mfsn_t *pstcI2c, stc_mfs_hl_intern_data_t *pstcMfsHlInternData) |
| MFS_HL Start operation for I2C slave. More... | |
| static void | MfsHlI2cDataRxSlave (volatile stc_mfsn_t *pstcI2c, stc_mfs_hl_intern_data_t *pstcMfsHlInternData) |
| MFS_HL Operation to receive data for I2C slave. More... | |
| static void | MfsHlI2cDataTxSlave (volatile stc_mfsn_t *pstcI2c, stc_mfs_hl_intern_data_t *pstcMfsHlInternData) |
| MFS_HL Operation to send data for I2C slave. More... | |
| static void | MfsHlI2cIrqHandlerTx (volatile stc_mfsn_t *pstcMfs, void *pvHandle) |
| MFS_HL transmit interrupt service routine for I2C. More... | |
| static void | MfsHlI2cIrqHandlerRx (volatile stc_mfsn_t *pstcMfs, void *pvHandle) |
| MFS_HL receive interrupt service routine for I2C. More... | |
| static void | MfsHlI2cIrqHandlerSts (volatile stc_mfsn_t *pstcMfs, void *pvHandle) |
| MFS_HL status interrupt service routine for I2C. More... | |
| static en_result_t | MfsHlI2cStartSlave (volatile stc_mfsn_t *pstcI2c, stc_mfs_hl_intern_data_t *pstcMfsHlInternData) |
| Start operation as I2C slave. More... | |
| static en_result_t | MfsHlI2cWaitIntState (volatile stc_mfs_hl_intern_data_t *pstcMfsHlInternData) |
| Wait to change I2C interruption state. More... | |
| static en_result_t | MfsHlI2cChkTxRxComplete (stc_mfs_hl_intern_data_t *pstcMfsHlInternData, uint32_t u32MaxCnt) |
| Check changing I2C interruption state. More... | |
| en_result_t | Mfs_Hl_Uart_Init (volatile stc_mfsn_t *pstcUart, stc_mfs_hl_uart_config_t *pstcConfig) |
| Initialize an MFS_HL module as UART mode. This Function initialises the MFS according the UART setup in the passed configuration structure. Several checking are done before that and an error is returned if invalid Modes are requested. More... | |
| en_result_t | Mfs_Hl_Uart_DeInit (volatile stc_mfsn_t *pstcUart) |
| UART deinitialisation of a MFS_HL module. More... | |
| en_result_t | Mfs_Hl_Csio_Init (volatile stc_mfsn_t *pstcCsio, stc_mfs_hl_csio_config_t *pstcConfig) |
| Initialize an MFS_HL module as CSIO mode. More... | |
| en_result_t | Mfs_Hl_Csio_DeInit (volatile stc_mfsn_t *pstcCsio) |
| CSIO deinitialisation of a MFS_HL module. More... | |
| en_result_t | Mfs_Hl_Csio_SynchronousTrans (volatile stc_mfsn_t *pstcCsio, const uint8_t *pu8TxData, uint8_t *pu8RxData, uint16_t u16TransferSize, boolean_t bCsHolding) |
| Simultaneously transmit and receive data as CSIO master. More... | |
| en_result_t | Mfs_Hl_Lin_Init (volatile stc_mfsn_t *pstcLin, stc_mfs_hl_lin_config_t *pstcConfig) |
| Initialize an MFS_HL module as LIN mode. More... | |
| en_result_t | Mfs_Hl_Lin_DeInit (volatile stc_mfsn_t *pstcLin) |
| LIN deinitialisation of a MFS_HL module. More... | |
| en_result_t | Mfs_Hl_Lin_SetBreak (volatile stc_mfsn_t *pstcLin) |
| Set LIN Break with an MFS_HL module in LIN Master Mode. More... | |
| en_result_t | Mfs_Hl_Lin_SetNewBaudDivisor (volatile stc_mfsn_t *pstcLin, uint16_t u16BaudDivisor) |
| Set new baud divisor (NOT Baud Rate!) in LIN Slave Mode. More... | |
| en_result_t | Mfs_Hl_Lin_TransferRxBuffer (volatile stc_mfsn_t *pstcLin, uint8_t *pu8Data, uint16_t u16ReadCount) |
| Transfers n bytes of recent receive buffer to user buffer. More... | |
| en_result_t | Mfs_Hl_Lin_DisableRxInterrupt (volatile stc_mfsn_t *pstcLin) |
| Disable reception interrupt for LIN mode. More... | |
| en_result_t | Mfs_Hl_I2c_Init (volatile stc_mfsn_t *pstcI2c, stc_mfs_hl_i2c_config_t *pstcConfig) |
| Initialize an MFS_HL module as I2C mode. This Function initialises the MFS according the I2C setup in the passed Config Struct. Several Checkings are done before that and an error is returned if invalid Modes are requested. More... | |
| en_result_t | Mfs_Hl_I2c_DeInit (volatile stc_mfsn_t *pstcI2c) |
| I2C deinitialisation of a MFS_HL module. More... | |
| en_result_t | Mfs_Hl_I2c_Write (volatile stc_mfsn_t *pstcI2c, uint8_t u8SlaveAddr, uint8_t *pu8Data, uint16_t *pu16WriteCnt, boolean_t bBlocking) |
| Write data to MFS_HL module for I2C. More... | |
| en_result_t | Mfs_Hl_I2c_Read (volatile stc_mfsn_t *pstcI2c, uint8_t u8SlaveAddr, uint8_t *pu8Data, uint16_t *pu16ReadCnt, boolean_t bBlocking) |
| Read received data from I2C. More... | |
| en_result_t | Mfs_Hl_I2c_WaitTxComplete (volatile stc_mfsn_t *pstcI2c, uint32_t u32MaxCnt) |
| Check to complete I2C transmission. More... | |
| en_result_t | Mfs_Hl_I2c_WaitRxComplete (volatile stc_mfsn_t *pstcI2c, uint32_t u32MaxCnt) |
| Check to complete I2C reception. More... | |
| en_result_t | Mfs_Hl_Write (volatile stc_mfsn_t *pstcMfs, uint8_t *pu8Data, uint16_t u16WriteCnt, boolean_t bBlocking, boolean_t bCsHolding) |
| Write data to MFS_HL module synchronously or asynchronously. More... | |
| en_result_t | Mfs_Hl_Read (volatile stc_mfsn_t *pstcMfs, uint8_t *pu8Data, uint16_t *pu16DataCnt, uint16_t u16ReadCnt, boolean_t bBlocking) |
| Read received data from MFS_HL module synchronously or asynchronously. More... | |
| en_result_t | Mfs_Hl_GetBufferPointer (volatile stc_mfsn_t *pstcMfs, en_mfs_hl_buffer_t enBufIndex, stc_mfs_hl_buffer_t **ppstcBuffer) |
| Get the internal TX or RX buffer pointer. More... | |
Variables | |
| static stc_mfs_hl_instance_data_t | m_astcMfsHlInstanceDataLut [MfsInstanceIndexMax] |
| Look-up table for all enabled MFS_HL instances and their internal data. More... | |
How to use MFS High Level module.
Provided functions of MFS_HL module:
Mfs_Hl_Uart_Init() is used to initialize an MFS instance to UART mode with parameter pstcConfig of type stc_mfs_hl_uart_config_t. Mfs_Hl_Uart_DeInit() is used to reset all MFS UART related register. So this function is used after initialization by Mfs_Hl_Uart_Init().
Mfs_Hl_Csio_Init() is used to initialize an MFS instance to CSIO mode with parameter pstcConfig of type stc_mfs_hl_csio_config_t. This function can be able to set timer mode or SPI mode using chip select (CS) with parameter pstcConfig->pstcMfsSpiConfig of type stc_mfs_hl_spi_config_t. Mfs_Hl_Csio_DeInit() is used to reset all MFS CSIO related register. So this function is used after initialization by Mfs_Hl_Csio_Init(). Mfs_Hl_Csio_SynchronousTrans() is used to transfer and receive data simultaneously. This function is only used by blocking. So interrupt is not used for this function.
Mfs_Hl_Lin_Init() is used to initialize an MFS instance to LIN mode with its dedicated LIN configuration (stc_mfs_hl_lin_config_t). Mfs_Hl_Lin_DeInit() is used to reset all MFS LIN related register. So this function is used after initialization by Mfs_Hl_Lin_Init(). Mfs_Hl_Lin_SetBreak() set the LIN Break in LIN Master mode. The baud rate divisor (not the rate itself!) can be adjusted by Mfs_Hl_Lin_SetNewBaudDivisor() after measurement with a dedicated ICU in LIN Slave mode. Note that the LIN functionality only works properly when the MFS is connected to a LIN transceiver, which means, that the SOT line as always read-back by SIN input! Mfs_Hl_Lin_DisableRxInterrupt() is used to disable the Rx interrupt, if a LIN frame was completely read and a new frame beginning with the LIN break is awaited to avoid unnecessary reception of a '0'-Byte with a framing error. Mfs_Hl_Lin_TransferRxBuffer() transfers the reception data from the internal ring buffer to a user buffer. This function can be used for LIN Master and Slave mode, because of the external LIN transceiver, every data (transmission and/or reception) is always read completely to the reception buffer.
Mfs_Hl_I2c_Init() is used to initialize an MFS instance to I2C mode with parameter pstcConfig of type stc_mfs_hl_i2c_config_t. Mfs_Hl_I2c_DeInit() is used to reset all MFS I2C related register. So this function is used after initialization by Mfs_Hl_I2c_Init(). Mfs_Hl_I2c_Write() is used to transmit data, and Mfs_Hl_I2c_Read() is used to receive data on I2C mode. These function can use synchronously (blocking-call) or asynchronously(non-blocking-call). If user wants to use it synchronously, the parameter bBlocking of Mfs_Hl_I2c_Write() or/and Mfs_Hl_I2c_Read() should specified TRUE. Otherwise, if user wants to use it asynchronously, the parameter bBlocking of Mfs_Hl_I2c_Write() or/and Mfs_Hl_I2c_Read() should specified FALSE. These functions are used for I2C mode. But Mfs_Hl_Read() and Mfs_Hl_Write() can't use for I2C. Mfs_Hl_I2c_WaitTxComplete() and Mfs_Hl_I2c_WaitRxComplete() are used to check complete transmission or receiption. If Mfs_Hl_I2c_Write() is used by non-blocking, please call Mfs_Hl_I2c_WaitTxComplete() at the application periodically because execution status doesn't change to standby if stop condition isn't detected. If Mfs_Hl_I2c_Read() is used by non-blocking, please call Mfs_Hl_I2c_WaitRxComplete() at the application periodically because execution status doesn't change to standby if stop condition isn't detected.
For UART, CSIO or LIN, Mfs_Hl_Read() and Mfs_Hl_Write() can use for communication. See the description of these functions for detail.
| #define MFS_HL_BGR_MASK (0x7FFFu) |
Definition at line 76 of file mfs_hl.c.
Referenced by Mfs_Hl_Csio_Init(), Mfs_Hl_I2c_Init(), Mfs_Hl_Lin_Init(), and Mfs_Hl_Uart_Init().
| #define MFS_HL_MASK_0_2 (0x07u) |
Definition at line 99 of file mfs_hl.c.
Referenced by Mfs_Hl_Csio_Init().
| #define MFS_HL_MASK_0_3 (0x0Fu) |
Definition at line 100 of file mfs_hl.c.
Referenced by Mfs_Hl_Csio_Init().
| #define MFS_HL_MASK_0_6 (0x7Fu) |
Definition at line 101 of file mfs_hl.c.
Referenced by Mfs_Hl_I2c_Init().
| #define MFS_HL_MASK_0_7 (0x000000FFu) |
Definition at line 104 of file mfs_hl.c.
Referenced by MfsHlWriteBuf().
| #define MFS_HL_MODE_GROUP_CHK (0xF0u) |
MFS_HL mode group.
Definition at line 179 of file mfs_hl.h.
Referenced by Mfs_Hl_Read(), and MfsHlIrqHandlerRx().
| #define MFS_HL_MODE_GROUP_CSIO (0x20u) |
Definition at line 181 of file mfs_hl.h.
Referenced by Mfs_Hl_Read(), and MfsHlIrqHandlerRx().
| #define MFS_HL_MODE_GROUP_LIN (0x40u) |
Definition at line 183 of file mfs_hl.h.
Referenced by Mfs_Hl_Read(), and MfsHlIrqHandlerRx().
| #define MFS_HL_MODE_GROUP_UART (0x10u) |
Definition at line 180 of file mfs_hl.h.
Referenced by Mfs_Hl_Read(), and MfsHlIrqHandlerRx().
| #define MFS_HL_NUM_1 (1u) |
Definition at line 79 of file mfs_hl.c.
Referenced by Mfs_Hl_Csio_SynchronousTrans(), Mfs_Hl_I2c_Read(), Mfs_Hl_I2c_Write(), MfsHlI2cDataRxMaster(), MfsHlI2cDataRxSlave(), MfsHlI2cDataTxMaster(), MfsHlReadBuf(), and MfsHlWriteBuf().
| #define MFS_HL_NUM_10 (10u) |
Definition at line 88 of file mfs_hl.c.
Referenced by MfsHlI2cWaitIntState().
| #define MFS_HL_NUM_2 (2u) |
Definition at line 80 of file mfs_hl.c.
Referenced by MfsHlReadBuf(), and MfsHlWriteBuf().
| #define MFS_HL_NUM_3 (3u) |
Definition at line 81 of file mfs_hl.c.
Referenced by MfsHlReadBuf(), and MfsHlWriteBuf().
| #define MFS_HL_NUM_4 (4u) |
Definition at line 82 of file mfs_hl.c.
Referenced by Mfs_Hl_Uart_Init(), MfsHlReadBuf(), and MfsHlWriteBuf().
| #define MFS_HL_NUM_8 (8u) |
Definition at line 86 of file mfs_hl.c.
Referenced by MfsHlReadBuf(), and MfsHlWriteBuf().
| #define MFS_HL_RELOADVAL_MIN4CSIO (3u) |
Definition at line 74 of file mfs_hl.c.
Referenced by Mfs_Hl_Csio_Init().
| #define MFS_HL_RELOADVAL_MIN4LIN (3u) |
Definition at line 75 of file mfs_hl.c.
Referenced by Mfs_Hl_Lin_Init().
| typedef enum en_mfs_hl_buffer en_mfs_hl_buffer_t |
Get the poitner to internal RX or TX buffer.
The buffer information can be gotten with this pointer.
| typedef enum en_mfs_hl_exec en_mfs_hl_exec_t |
MFS_HL Execution status.
| typedef enum en_mfs_hl_fifo_usage en_mfs_hl_fifo_usage_t |
MFS_HL FIFO usage.
| typedef enum en_mfs_hl_i2c_int_state en_mfs_hl_i2c_int_state_t |
MFS_HL I2C interrupt status.
| typedef enum en_mfs_hl_i2c_wait_select en_mfs_hl_i2c_wait_select_t |
MFS_HL I2C wait selection.
| typedef enum en_mfs_hl_mfs_mode en_mfs_hl_mfs_mode_t |
MFS_HL MFS mode.
| typedef void(* mfs_hl_tx_cb_func_ptr_t)(uint16_t) |
| typedef struct stc_mfs_hl_buffer stc_mfs_hl_buffer_t |
MFS_HL ring buffer.
Contains all parameter for ring buffer handling.
| typedef struct stc_mfs_hl_csio_config stc_mfs_hl_csio_config_t |
MFS_HL CSIO configuration.
Contains all parameter for configuratin a MFS channel, if set to CSIO mode.
| typedef struct stc_mfs_hl_i2c_config stc_mfs_hl_i2c_config_t |
MFS_HL I2C configuration.
Contains all parameter for configuratin a MFS channel, if set to I2C mode.
| typedef struct stc_mfs_hl_instance_data stc_mfs_hl_instance_data_t |
MFS_HL instance data type.
| typedef struct stc_mfs_hl_intern_data stc_mfs_hl_intern_data_t |
MFS_HL module internal data, storing internal information for each enabled MFS instance.
| typedef struct stc_mfs_hl_lin_config stc_mfs_hl_lin_config_t |
MFS_HL LIN configuration.
Contains all parameter for configuratin a MFS channel, if set to LIN mode. This configuration was rolled-out from stc_mfs_hl_lin_config_t to save RAM memory since LIN is a special mode. Only use functions with prefix 'Mfs_Hl_Lin_'!
| typedef struct stc_mfs_hl_spi_config stc_mfs_hl_spi_config_t |
MFS_HL SPI configuration.
Contains all parameter for configuratin a MFS channel, if set to CSIO mode.
| typedef struct stc_mfs_hl_timer_config stc_mfs_hl_timer_config_t |
MFS_HL Timer mode configuration.
Contains all parameter for configuratin a MFS channel, if set to CSIO mode.
| typedef struct stc_mfs_hl_uart_config stc_mfs_hl_uart_config_t |
MFS_HL UART configuration.
Contains all parameter for configuratin a MFS channel, if set to UART mode.
| enum en_mfs_hl_buffer |
| enum en_mfs_hl_exec |
| enum en_mfs_hl_fifo_usage |
| enum en_mfs_hl_mfs_mode |
MFS_HL MFS mode.
| en_result_t Mfs_Hl_Csio_DeInit | ( | volatile stc_mfsn_t * | pstcCsio | ) |
CSIO deinitialisation of a MFS_HL module.
This function de-initializes the MFS_HL module activating as CSIO. This function uses for mode change or other changed settings.
| [in] | pstcCsio | Pointer to CSIO (MFS) instance register area |
| Ok | Deinitialisation of MFS_HL module successfully done |
| ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 2317 of file mfs_hl.c.
References ErrorInvalidParameter, FALSE, Mfs_DeInitIrq(), Mfs_SetRxIntCallBack(), Mfs_SetStsIntCallBack(), Mfs_SetTxIntCallBack(), Mfs_SetUpperLayerHandle(), MfsHlExecStby, MfsHlGetInternDataPtr(), MfsHlModeStby, Ok, stc_mfs_hl_intern_data::pfnLinBreakCbFunction, stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcRxBuffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_intern_data::u8Exec, and stc_mfs_hl_intern_data::u8MfsMode.

| en_result_t Mfs_Hl_Csio_Init | ( | volatile stc_mfsn_t * | pstcCsio, |
| stc_mfs_hl_csio_config_t * | pstcConfig | ||
| ) |
Initialize an MFS_HL module as CSIO mode.
This Function initialises the MFS according the CSIO setup in the passed configuration structure. Several checking are done before that and an error is returned if invalid Modes are requested.
| [in] | pstcCsio | Pointer to CSIO (MFS) instance register area |
| [in] | pstcConfig | MFS CSIO configuration |
| Ok | Initializiation of MFS_HL module successfully done. |
| ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 1880 of file mfs_hl.c.
References stc_mfs_hl_csio_config::bBitDirection, stc_mfs_hl_spi_config::bCsLevel, stc_mfs_hl_buffer::bOverflow, stc_mfs_hl_csio_config::bSignalSystem, stc_mfs_hl_timer_config::bTimerSyncEnable, ErrorInvalidParameter, FALSE, MFS6, MFS7, MFS_DATA_LEN_10, MFS_DATA_LEN_11, MFS_DATA_LEN_12, MFS_DATA_LEN_13, MFS_DATA_LEN_14, MFS_DATA_LEN_15, MFS_DATA_LEN_16, MFS_DATA_LEN_20, MFS_DATA_LEN_24, MFS_DATA_LEN_32, MFS_DATA_LEN_5, MFS_DATA_LEN_6, MFS_DATA_LEN_7, MFS_DATA_LEN_8, MFS_DATA_LEN_9, Mfs_GetReloadValue(), MFS_HL_BGR_MASK, MFS_HL_MASK_0_2, MFS_HL_MASK_0_3, MFS_HL_RELOADVAL_MIN4CSIO, Mfs_InitRxIrq(), Mfs_InitTxIrq(), MFS_MD_CSIO, Mfs_SetRxIntCallBack(), Mfs_SetStsIntCallBack(), Mfs_SetTxIntCallBack(), Mfs_SetUpperLayerHandle(), MFS_WAIT_TIME_0BIT, MFS_WAIT_TIME_1BIT, MFS_WAIT_TIME_2BITS, MFS_WAIT_TIME_3BITS, MfsCsioActNormalMode, MfsCsioActSpiMode, MfsCsioMaster, MfsCsioSlave, MfsEightBits, MfsElevenBits, MfsFifteenBits, MfsFiveBits, MfsFourteenBits, MfsHlExecStby, MfsHlFifoUseInit(), MfsHlGetInternDataPtr(), MfsHlIrqHandlerRx(), MfsHlIrqHandlerSts(), MfsHlIrqHandlerTx(), MfsHlModeCsioNormalMaster, MfsHlModeCsioNormalMasterTimer, MfsHlModeCsioNormalSlave, MfsHlModeCsioSpiMaster, MfsHlModeCsioSpiMasterWithCs, MfsHlModeCsioSpiSlave, MfsHlModeCsioSpiSlaveWithCs, MfsHlUseFifo, MfsHlUseNoFifo, MfsNineBits, MfsSevenBits, MfsSixBits, MfsSixteenBits, MfsSyncWaitOne, MfsSyncWaitThree, MfsSyncWaitTwo, MfsSyncWaitZero, MfsTenBits, MfsThirteenBits, MfsThirtyTwoBits, MfsTwelveBits, MfsTwentyBits, MfsTwentyFourBits, Ok, stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_csio_config::pfnRxCb, stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_csio_config::pfnTxCb, stc_mfs_hl_csio_config::pstcMfsSpiCsConfig, stc_mfs_hl_csio_config::pstcMfsTimerConfig, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_csio_config::pu8RxBuf, stc_mfs_hl_csio_config::pu8TxBuf, stc_mfs_hl_intern_data::stcRxBuffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_spi_config::u16CsDeSelect, stc_mfs_hl_buffer::u16FillCount, stc_mfs_hl_buffer::u16InIndex, stc_mfs_hl_buffer::u16OutIndex, stc_mfs_hl_csio_config::u16RxBufSize, stc_mfs_hl_intern_data::u16RxCallbackBufFillLevel, stc_mfs_hl_csio_config::u16RxCbBufFillLvl, stc_mfs_hl_timer_config::u16SerialTimer, stc_mfs_hl_csio_config::u16TxBufSize, stc_mfs_hl_buffer::u16TxCount, stc_mfs_hl_buffer::u16TxCounter, stc_mfs_hl_csio_config::u32DataRate, stc_mfs_hl_csio_config::u8CharLength, stc_mfs_hl_spi_config::u8CsDivision, stc_mfs_hl_spi_config::u8CsHoldDelay, stc_mfs_hl_csio_config::u8CsioActMode, stc_mfs_hl_csio_config::u8CsioMode, stc_mfs_hl_spi_config::u8CsSetDelay, stc_mfs_hl_intern_data::u8DataWidth, stc_mfs_hl_intern_data::u8Exec, stc_mfs_hl_csio_config::u8FifoUsage, stc_mfs_hl_intern_data::u8FifoUsage, stc_mfs_hl_intern_data::u8MfsMode, stc_mfs_hl_csio_config::u8SyncWaitTime, stc_mfs_hl_timer_config::u8TimerDivision, and stc_mfs_hl_timer_config::u8TxByte.

| en_result_t Mfs_Hl_Csio_SynchronousTrans | ( | volatile stc_mfsn_t * | pstcCsio, |
| const uint8_t * | pu8TxData, | ||
| uint8_t * | pu8RxData, | ||
| uint16_t | u16TransferSize, | ||
| boolean_t | bCsHolding | ||
| ) |
Simultaneously transmit and receive data as CSIO master.
This function will transmit and receive the same amount of data, based on the serial (shift) clock signal (MFS SCK pin) in synchronous master or slave mode. The operation mode of the MFS instance must be setup for synchronous master or slave mode.
While the data in Mfs_Hl_Csio_SynchronousTrans::pu8TxData is transmitted the input data is received and stored in Mfs_Hl_Csio_SynchronousTrans::pu8RxData. The function operates in CSIO (blocking) mode only i.e. it will wait until the amount of data defined by Mfs_Hl_Csio_SynchronousTrans::u16TransferSize is transmitted/received. No MFS internal buffers or transfer counters are used. The TX/RX callback functions will not be called. Note, that in synchronous slave mode, the transfer is controlled by the external master device, providing the serial shift clock. This may cause this function to block very long time.
Because this function uses blocking method, no interrupts are needed and therfore are not used. Also no FIFO operation is performed.
| [in] | pstcCsio | Pointer to CSIO (MFS) instance register area |
| [in] | pu8TxData | Pointer to transmit data buffer, can be NULL. |
| [in,out] | pu8RxData | Pointer to receive data buffer, can be NULL. |
| [in] | u16TransferSize | Transmit size (Must be at least 1) |
| [in] | bCsHolding | Specify to hold chip select |
| Ok | Transfer done successfully. |
| ErrorInvalidParameter | If any of following conditions are met:
|
| ErrorOperationInProgress | A transmission is still pending or the RX buffer is not empty. |
| ErrorInvalidMode | MFS_HL module was not initalised in MFS CSIO mode. |
| Error | Character length is over 8 bits. |
Definition at line 2450 of file mfs_hl.c.
References Error, ErrorInvalidMode, ErrorInvalidParameter, FALSE, MFS_CSIO_SSR_ERR, MFS_CSIO_TBYTE_MAX, MFS_HL_NUM_1, MFS_MD_CSIO, MFS_SSR_RDRF, MfsHlGetInternDataPtr(), MfsHlModeCsioNormalMasterTimer, MfsHlModeCsioSpiMasterWithCs, Ok, PDL_WAIT_LOOP_HOOK(), stc_mfs_hl_intern_data::pfnReceiveCbFunction, TRUE, and stc_mfs_hl_intern_data::u8MfsMode.

| en_result_t Mfs_Hl_GetBufferPointer | ( | volatile stc_mfsn_t * | pstcMfs, |
| en_mfs_hl_buffer_t | enBufIndex, | ||
| stc_mfs_hl_buffer_t ** | ppstcBuffer | ||
| ) |
Get the internal TX or RX buffer pointer.
The buffer information can be gotten with this pointer.
| [in] | pstcMfs | Pointer to MFS instance register area. |
| [in] | enBufIndex | Buffer index |
| [out] | ppstcBuffer | Pointer to the pointer of RX or TX buffer |
| Ok | Write data successfully done. |
| ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 4671 of file mfs_hl.c.
References ErrorInvalidParameter, MfsHlGetInternDataPtr(), MfsHlRxBuffer, MfsHlTxBuffer, Ok, stc_mfs_hl_intern_data::stcRxBuffer, and stc_mfs_hl_intern_data::stcTxBuffer.

| en_result_t Mfs_Hl_I2c_DeInit | ( | volatile stc_mfsn_t * | pstcI2c | ) |
I2C deinitialisation of a MFS_HL module.
All used mfs register are reset to their default values.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area |
| Ok | Deinitialisation of MFS_HL module successfully done |
| ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 3446 of file mfs_hl.c.
References ErrorInvalidParameter, FALSE, Mfs_DeInitIrq(), Mfs_SetRxIntCallBack(), Mfs_SetStsIntCallBack(), Mfs_SetTxIntCallBack(), Mfs_SetUpperLayerHandle(), MfsHlExecStby, MfsHlGetInternDataPtr(), MfsHlModeStby, Ok, stc_mfs_hl_intern_data::pfnI2cSlvStCbFunction, stc_mfs_hl_intern_data::pfnLinBreakCbFunction, stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcRxBuffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_intern_data::u8Exec, and stc_mfs_hl_intern_data::u8MfsMode.

| en_result_t Mfs_Hl_I2c_Init | ( | volatile stc_mfsn_t * | pstcI2c, |
| stc_mfs_hl_i2c_config_t * | pstcConfig | ||
| ) |
Initialize an MFS_HL module as I2C mode. This Function initialises the MFS according the I2C setup in the passed Config Struct. Several Checkings are done before that and an error is returned if invalid Modes are requested.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area |
| [in] | pstcConfig | MFS I2C configuration |
| Ok | Initializiation of MFS_HL module successfully done. |
| ErrorInvalidParameter | If one of following conditions are met:
|
| ErrorUninitialized | If bus clock is over specification, NFCR can't set properly. So this function returned this error code. |
Definition at line 3147 of file mfs_hl.c.
References stc_mfs_hl_buffer::bOverflow, ErrorInvalidParameter, ErrorUninitialized, FALSE, MFS_CLOCK_100M, MFS_CLOCK_120M, MFS_CLOCK_140M, MFS_CLOCK_160M, MFS_CLOCK_180M, MFS_CLOCK_200M, MFS_CLOCK_220M, MFS_CLOCK_240M, MFS_CLOCK_260M, MFS_CLOCK_280M, MFS_CLOCK_300M, MFS_CLOCK_320M, MFS_CLOCK_340M, MFS_CLOCK_360M, MFS_CLOCK_380M, MFS_CLOCK_400M, MFS_CLOCK_40M, MFS_CLOCK_60M, MFS_CLOCK_80M, MFS_FIFO_MAX_VAL, Mfs_GetBusClock(), MFS_HL_BGR_MASK, MFS_HL_MASK_0_6, MFS_I2C_FAST_MODE_PLUS_CH_A, MFS_I2C_FAST_MODE_PLUS_CH_B, Mfs_I2c_GetReloadValue(), Mfs_InitRxIrq(), Mfs_InitTxIrq(), MFS_MD_I2C, Mfs_SetRxIntCallBack(), Mfs_SetStsIntCallBack(), Mfs_SetTxIntCallBack(), Mfs_SetUpperLayerHandle(), MfsEightBits, MfsHlExecStby, MfsHlFifoUseInit(), MfsHlGetInternDataPtr(), MfsHlI2cIrqHandlerRx(), MfsHlI2cIrqHandlerSts(), MfsHlI2cIrqHandlerTx(), MfsHlModeI2cMaster, MfsHlModeI2cSlave, MfsHlUseFifo, MfsHlUseNoFifo, MfsI2cDisableFastModePlus, MfsI2cEnableFastModePlus, MfsI2cMaster, MfsI2cNoizeFilterLess100M, MfsI2cNoizeFilterLess120M, MfsI2cNoizeFilterLess140M, MfsI2cNoizeFilterLess160M, MfsI2cNoizeFilterLess180M, MfsI2cNoizeFilterLess200M, MfsI2cNoizeFilterLess220M, MfsI2cNoizeFilterLess240M, MfsI2cNoizeFilterLess260M, MfsI2cNoizeFilterLess280M, MfsI2cNoizeFilterLess300M, MfsI2cNoizeFilterLess320M, MfsI2cNoizeFilterLess340M, MfsI2cNoizeFilterLess360M, MfsI2cNoizeFilterLess380M, MfsI2cNoizeFilterLess400M, MfsI2cNoizeFilterLess40M, MfsI2cNoizeFilterLess60M, MfsI2cNoizeFilterLess80M, MfsI2cSlave, Ok, stc_mfs_hl_i2c_config::pfnI2cSlvStCb, stc_mfs_hl_intern_data::pfnI2cSlvStCbFunction, stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_i2c_config::pfnRxCb, stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_i2c_config::pfnTxCb, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcRxBuffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16FillCount, stc_mfs_hl_buffer::u16InIndex, stc_mfs_hl_buffer::u16OutIndex, stc_mfs_hl_intern_data::u16RxCallbackBufFillLevel, stc_mfs_hl_buffer::u16TxCount, stc_mfs_hl_buffer::u16TxCounter, stc_mfs_hl_i2c_config::u32DataRate, stc_mfs_hl_intern_data::u8DataWidth, stc_mfs_hl_intern_data::u8Exec, stc_mfs_hl_i2c_config::u8FastMode, stc_mfs_hl_i2c_config::u8FifoUsage, stc_mfs_hl_intern_data::u8FifoUsage, stc_mfs_hl_i2c_config::u8I2cMode, stc_mfs_hl_intern_data::u8MfsMode, and stc_mfs_hl_i2c_config::u8SlvAddr.

| en_result_t Mfs_Hl_I2c_Read | ( | volatile stc_mfsn_t * | pstcI2c, |
| uint8_t | u8SlaveAddr, | ||
| uint8_t * | pu8Data, | ||
| uint16_t * | pu16ReadCnt, | ||
| boolean_t | bBlocking | ||
| ) |
Read received data from I2C.
The received data is copied from Receive Data Register into the provided data buffer Mfs_Hl_I2c_Read::pu8Data. The slave address (Mfs_Hl_I2c_Read::u8SlaveAddr) is used on master mode. The size is defined by Mfs_Hl_I2c_Read::pu16ReadCnt. If non-blocking is specified (Mfs_Hl_I2c_Read::bBlocking is FALSE), this function will return immediately after available datas from remote device are received into the provided buffer. (Mfs_Hl_I2c_Read::pu8Data)
Anyway, Receive interrupt is used in any case.
Note: Don't access to the buffer which specified by pu8Data until reception processing completes.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area. |
| [in] | u8SlaveAddr | Slave Address. |
| [in,out] | pu8Data | Buffer to store received characters. |
| [in,out] | pu16ReadCnt | Pointrer to variable for number of bytes been read. |
| [in] | bBlocking | If TRUE, synchronously wait until pu16ReadCnt bytes have been received. If FALSE, return immediately. |
| Ok | Read data successfully done or started. |
| ErrorInvalidParameter | If one of following conditions are met:
|
| ErrorOperationInProgress | If the following condition is met:
|
| ErrorTimeout | Interruption state didn't change within the specified period of time. |
Definition at line 3856 of file mfs_hl.c.
References ErrorInvalidParameter, ErrorOperationInProgress, ErrorTimeout, FALSE, MFS_FIFO_MAX_VAL, MFS_HL_NUM_1, MfsHlExecReceiving, MfsHlExecStby, MfsHlGetInternDataPtr(), MfsHlGetMin(), MfsHlI2cStartSlave(), MfsHlI2cWaitIntState(), MfsHlModeI2cMaster, MfsHlUseFifo, MfsI2cRead, Ok, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcRxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16InIndex, stc_mfs_hl_intern_data::u32I2cProcCnt, stc_mfs_hl_intern_data::u8Exec, stc_mfs_hl_intern_data::u8FifoUsage, and stc_mfs_hl_intern_data::u8MfsMode.

| en_result_t Mfs_Hl_I2c_WaitRxComplete | ( | volatile stc_mfsn_t * | pstcI2c, |
| uint32_t | u32MaxCnt | ||
| ) |
Check to complete I2C reception.
If Mfs_Hl_I2c_Read() is used by non-blocking, please call this function at the application periodically because execution status doesn't change to standby if stop condition isn't detected.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area. |
| [in] | u32MaxCnt | Maximum period to check state changing |
| Ok | Write data successfully done. |
| ErrorInvalidParameter | If one of following conditions are met:
|
| ErrorInvalidMode | A transmission is still ongoing. |
| ErrorOperationInProgress | A reception is still ongoing. |
| ErrorTimeout | A reception didn't complete within the specified period. |
Definition at line 4072 of file mfs_hl.c.
References ErrorInvalidMode, ErrorInvalidParameter, ErrorOperationInProgress, ErrorTimeout, MfsHlExecReceiving, MfsHlExecStby, MfsHlGetInternDataPtr(), MfsHlI2cChkTxRxComplete(), Ok, stc_mfs_hl_intern_data::stcRxBuffer, stc_mfs_hl_buffer::u16InIndex, and stc_mfs_hl_intern_data::u8Exec.

| en_result_t Mfs_Hl_I2c_WaitTxComplete | ( | volatile stc_mfsn_t * | pstcI2c, |
| uint32_t | u32MaxCnt | ||
| ) |
Check to complete I2C transmission.
If Mfs_Hl_I2c_Write() is used by non-blocking, please call this function at the application periodically because execution status doesn't change to standby if stop condition isn't detected.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area. |
| [in] | u32MaxCnt | Maximum period to check state changing |
| Ok | Write data successfully done. |
| ErrorInvalidParameter | If one of following conditions are met:
|
| ErrorInvalidMode | A reception is still ongoing. |
| ErrorOperationInProgress | A transmission is still ongoing. |
| ErrorTimeout | A transmission didn't complete within the specified period. |
Definition at line 4004 of file mfs_hl.c.
References ErrorInvalidMode, ErrorInvalidParameter, ErrorOperationInProgress, ErrorTimeout, MfsHlExecStby, MfsHlExecTransmitting, MfsHlGetInternDataPtr(), MfsHlI2cChkTxRxComplete(), Ok, stc_mfs_hl_intern_data::stcTxBuffer, stc_mfs_hl_buffer::u16OutIndex, and stc_mfs_hl_intern_data::u8Exec.

| en_result_t Mfs_Hl_I2c_Write | ( | volatile stc_mfsn_t * | pstcI2c, |
| uint8_t | u8SlaveAddr, | ||
| uint8_t * | pu8Data, | ||
| uint16_t * | pu16WriteCnt, | ||
| boolean_t | bBlocking | ||
| ) |
Write data to MFS_HL module for I2C.
The data provided by Mfs_Hl_I2c_Write::pu8Data is used directly and the transmission (via TX interrupt) is started, if not ongoing already.
If Mfs_Hl_I2c_Write::bBlocking is specified FALSE, the function will return immediately after datas are transfered to the remote device.
If Mfs_Hl_I2c_Write::bBlocking is specified TRUE, the function wait until all data is transferred to the MFS hardware FIFO. If the referenced MFS does not have a FIFO single data is written.
Note: Don't access to the buffer which specified by pu8Data until transmission processing completes.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area |
| [in] | u8SlaveAddr | Slave address for master mode |
| [in] | pu8Data | Pointer to data buffer for transmission |
| [in,out] | pu16WriteCnt | Pointrer to variable for number of bytes to send(must be at least 1). And pointrer to variable for number of bytes been sent. |
| [in] | bBlocking | If TRUE, synchronously wait until all data is transferred into the hardware (Fifo) buffer. If FALSE, return immediately. |
| Ok | Write data successfully done or started. |
| ErrorInvalidParameter | If one of following conditions are met:
|
| ErrorOperationInProgress | If the following condition is met:
|
| ErrorTimeout | Interruption state didn't change within the specified period of time. |
Definition at line 3696 of file mfs_hl.c.
References ErrorInvalidParameter, ErrorOperationInProgress, ErrorTimeout, FALSE, MFS_HL_NUM_1, MfsHlExecStby, MfsHlExecTransmitting, MfsHlGetInternDataPtr(), MfsHlI2cStartSlave(), MfsHlI2cWaitIntState(), MfsHlModeI2cMaster, MfsHlUseFifo, MfsI2cWrite, Ok, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16OutIndex, stc_mfs_hl_intern_data::u32I2cProcCnt, stc_mfs_hl_intern_data::u8Exec, stc_mfs_hl_intern_data::u8FifoUsage, and stc_mfs_hl_intern_data::u8MfsMode.

| en_result_t Mfs_Hl_Lin_DeInit | ( | volatile stc_mfsn_t * | pstcLin | ) |
LIN deinitialisation of a MFS_HL module.
This function de-initializes the MFS_HL module activating as LIN. This function uses for mode change or other changed settings.
| [in] | pstcLin | Pointer to LIN (MFS) instance register area |
| Ok | LIN Deinitialisation of MFS_HL module successfully done |
| ErrorInvalidMode | MFS not in LIN mode |
| ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 2895 of file mfs_hl.c.
References ErrorInvalidMode, Mfs_Hl_Uart_DeInit(), MFS_SMR_LIN_MODE, and MFS_SMR_MODEBITS_MASK.

| en_result_t Mfs_Hl_Lin_DisableRxInterrupt | ( | volatile stc_mfsn_t * | pstcLin | ) |
Disable reception interrupt for LIN mode.
| Ok | Baud rate was set correctly |
| ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 3102 of file mfs_hl.c.
References ErrorInvalidParameter, FALSE, MfsHlGetInternDataPtr(), and Ok.

| en_result_t Mfs_Hl_Lin_Init | ( | volatile stc_mfsn_t * | pstcLin, |
| stc_mfs_hl_lin_config_t * | pstcConfig | ||
| ) |
Initialize an MFS_HL module as LIN mode.
This Function initialises the MFS according the LIN setup in the passed configuration structure. Several checking are done before that and an error is returned if invalid Modes are requested.
| [in] | pstcLin | Pointer to LIN (MFS) instance register area |
| [in] | pstcConfig | MFS LIN configuration |
| Ok | Initializiation of MFS_HL module successfully done. |
| ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 2637 of file mfs_hl.c.
References stc_mfs_hl_lin_config::bLinBreakIrqEnable, stc_mfs_hl_buffer::bOverflow, ErrorInvalidParameter, FALSE, Mfs_GetReloadValue(), MFS_HL_BGR_MASK, MFS_HL_RELOADVAL_MIN4LIN, Mfs_InitRxIrq(), Mfs_InitTxIrq(), MFS_LIN_BREAK_13BITS, MFS_LIN_BREAK_14BITS, MFS_LIN_BREAK_15BITS, MFS_LIN_BREAK_16BITS, MFS_LIN_DELIMITER_1BIT, MFS_LIN_DELIMITER_2BITS, MFS_LIN_DELIMITER_3BITS, MFS_LIN_DELIMITER_4BITS, MFS_MD_LIN, MFS_RX_FIFO_MIN_VAL, Mfs_SetRxIntCallBack(), Mfs_SetStsIntCallBack(), Mfs_SetTxIntCallBack(), Mfs_SetUpperLayerHandle(), MfsEightBits, MfsHlExecStby, MfsHlFifoUseInit(), MfsHlGetInternDataPtr(), MfsHlIrqHandlerRx(), MfsHlIrqHandlerSts(), MfsHlIrqHandlerTx(), MfsHlModeLinMaster, MfsHlModeLinSlave, MfsHlUseFifo, MfsHlUseNoFifo, MfsLinBreakLength13, MfsLinBreakLength14, MfsLinBreakLength15, MfsLinBreakLength16, MfsLinDelimiterLength1, MfsLinDelimiterLength2, MfsLinDelimiterLength3, MfsLinDelimiterLength4, MfsLinFourStopBits, MfsLinMaster, MfsLinOneStopBit, MfsLinSlave, MfsLinThreeStopBits, MfsLinTwoStopBits, Ok, stc_mfs_hl_intern_data::pfnLinBreakCbFunction, stc_mfs_hl_lin_config::pfnLinBrkCb, stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_lin_config::pfnRxCb, stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_lin_config::pfnTxCb, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_lin_config::pu8RxBuf, stc_mfs_hl_lin_config::pu8TxBuf, stc_mfs_hl_intern_data::stcRxBuffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16FillCount, stc_mfs_hl_buffer::u16InIndex, stc_mfs_hl_buffer::u16OutIndex, stc_mfs_hl_lin_config::u16RxBufSize, stc_mfs_hl_intern_data::u16RxCallbackBufFillLevel, stc_mfs_hl_lin_config::u16TxBufSize, stc_mfs_hl_buffer::u16TxCount, stc_mfs_hl_buffer::u16TxCounter, stc_mfs_hl_lin_config::u32DataRate, stc_mfs_hl_lin_config::u8BreakLength, stc_mfs_hl_intern_data::u8DataWidth, stc_mfs_hl_lin_config::u8DelimiterLength, stc_mfs_hl_intern_data::u8Exec, stc_mfs_hl_lin_config::u8FifoUsage, stc_mfs_hl_intern_data::u8FifoUsage, stc_mfs_hl_lin_config::u8LinMode, stc_mfs_hl_intern_data::u8MfsMode, and stc_mfs_hl_lin_config::u8StopBits.

| en_result_t Mfs_Hl_Lin_SetBreak | ( | volatile stc_mfsn_t * | pstcLin | ) |
Set LIN Break with an MFS_HL module in LIN Master Mode.
This Function sets a LIN break and break delimiter length with the configuration by the previous initialization.
| [in] | pstcLin | Pointer to LIN (MFS) instance register area |
| Ok | LIN Break is (being) generated |
| ErrorInvalidParameter | If one of following conditions are met:
|
| ErrorInvalidMode | MFS not in LIN master mode |
| ErrorOperationInProgress | MFS not ready for generating break |
Definition at line 2932 of file mfs_hl.c.
References ErrorInvalidMode, ErrorInvalidParameter, ErrorOperationInProgress, FALSE, MFS_SMR_LIN_MODE, MFS_SMR_MODEBITS_MASK, MfsHlGetInternDataPtr(), Ok, and TRUE.

| en_result_t Mfs_Hl_Lin_SetNewBaudDivisor | ( | volatile stc_mfsn_t * | pstcLin, |
| uint16_t | u16BaudDivisor | ||
| ) |
Set new baud divisor (NOT Baud Rate!) in LIN Slave Mode.
This Function sets a new (calculated) baud divisor, if the MFS is in LIN Slave mode.
| [in] | pstcLin | Pointer to LIN (MFS) instance register area |
| [in] | u16BaudDivisor | New (calculated) Baud Divisor |
| Ok | Baud rate was set correctly |
| ErrorInvalidParameter | If one of following conditions are met:
|
| ErrorInvalidMode | MFS not in LIN slave mode |
Definition at line 2993 of file mfs_hl.c.
References ErrorInvalidMode, ErrorInvalidParameter, FALSE, MFS_SMR_LIN_MODE, MFS_SMR_MODEBITS_MASK, MfsHlGetInternDataPtr(), and Ok.

| en_result_t Mfs_Hl_Lin_TransferRxBuffer | ( | volatile stc_mfsn_t * | pstcLin, |
| uint8_t * | pu8Data, | ||
| uint16_t | u16ReadCount | ||
| ) |
Transfers n bytes of recent receive buffer to user buffer.
| [in] | pstcLin | Pointer to MFS instance register area |
| [in,out] | pu8Data | Pointer to data buffer |
| [in] | u16ReadCount | Number of bytes to be transfered |
| Ok | Process is success |
| ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 3041 of file mfs_hl.c.
References ErrorInvalidParameter, MfsHlGetInternDataPtr(), Ok, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcRxBuffer, stc_mfs_hl_buffer::u16BufferSize, and stc_mfs_hl_buffer::u16InIndex.

| en_result_t Mfs_Hl_Read | ( | volatile stc_mfsn_t * | pstcMfs, |
| uint8_t * | pu8Data, | ||
| uint16_t * | pu16DataCnt, | ||
| uint16_t | u16ReadCnt, | ||
| boolean_t | bBlocking | ||
| ) |
Read received data from MFS_HL module synchronously or asynchronously.
This function can use for UART, CSIO or LIN.
The received data is copied from internal RX buffer (filled by RX interrupt) into the provided data buffer Mfs_Hl_Read::pu8Data. The size is defined by Mfs_Hl_Read::pu16DataCnt. Depending on the Mfs_Hl_Read::bBlocking parameter, the function behavior is different.
For an asynchronous (non-blocking) call (Mfs_Hl_Read::bBlocking = FALSE), the function will return immediately after all currently available characters (in SW ring buffer and HW FIFO) are copied into the provided buffer (Mfs_Hl_Read::pu8Data) or the maximum count (Mfs_Hl_Read::u16ReadCnt) is reached. The value returned by Mfs_Hl_Read::pu16DataCnt gives the count of characters that was read actually. If the referenced MFS does not have a FIFO single data is read.
For a synchronous (blocking) call (Mfs_Hl_Read::bBlocking == TRUE), the function will return after the requested count of characters (Mfs_Hl_Read::pu16DataCnt) is received completely. This should be used with caution as the full application can get stuck if no further data is received.
| [in] | pstcMfs | Pointer to MFS instance register area |
| [in,out] | pu8Data | Buffer to store received data |
| [in,out] | pu16DataCnt | Pointer to variable for number of bytes been read |
| [in] | u16ReadCnt | Maximum number of characters to read (ensure sufficient size of pu16DataCnt::pu8Data!) |
| [in] | bBlocking | If TRUE, synchronously wait until pu16DataCnt::u16ReadCnt bytes have been received. If FALSE, read all available and return immediately. |
| Ok | Read data successfully done or started. |
| ErrorInvalidParameter | If one of following conditions are met:
|
| ErrorOperationInProgress | If the following condition is met:
|
Definition at line 4419 of file mfs_hl.c.
References Error, ErrorInvalidParameter, ErrorOperationInProgress, FALSE, MFS_CSIO_SSR_ERR, MFS_FIFO_MAX_VAL, MFS_HL_MODE_GROUP_CHK, MFS_HL_MODE_GROUP_CSIO, MFS_HL_MODE_GROUP_LIN, MFS_HL_MODE_GROUP_UART, MFS_LIN_SSR_ERR, MFS_RX_FIFO_MIN_VAL, MFS_SSR_RDRF, MFS_UART_SSR_ERR, MfsHlExecStby, MfsHlGetInternDataPtr(), MfsHlGetMin(), MfsHlReadBuf(), MfsHlUseFifo, Ok, PDL_WAIT_LOOP_HOOK(), stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcRxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16FillCount, stc_mfs_hl_buffer::u16OutIndex, stc_mfs_hl_intern_data::u8Exec, stc_mfs_hl_intern_data::u8FifoUsage, and stc_mfs_hl_intern_data::u8MfsMode.

| en_result_t Mfs_Hl_Uart_DeInit | ( | volatile stc_mfsn_t * | pstcUart | ) |
UART deinitialisation of a MFS_HL module.
This function de-initializes the MFS_HL module activating as UART. This function uses for mode change or other changed settings.
| [in] | pstcUart | Pointer to UART (MFS) instance register area |
| Ok | Deinitialisation of MFS_HL module successfully done |
| ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 1791 of file mfs_hl.c.
References ErrorInvalidParameter, FALSE, Mfs_DeInitIrq(), Mfs_SetRxIntCallBack(), Mfs_SetStsIntCallBack(), Mfs_SetTxIntCallBack(), Mfs_SetUpperLayerHandle(), MfsHlExecStby, MfsHlGetInternDataPtr(), MfsHlModeStby, Ok, stc_mfs_hl_intern_data::pfnLinBreakCbFunction, stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcRxBuffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_intern_data::u8Exec, and stc_mfs_hl_intern_data::u8MfsMode.
Referenced by Mfs_Hl_Lin_DeInit().


| en_result_t Mfs_Hl_Uart_Init | ( | volatile stc_mfsn_t * | pstcUart, |
| stc_mfs_hl_uart_config_t * | pstcConfig | ||
| ) |
Initialize an MFS_HL module as UART mode. This Function initialises the MFS according the UART setup in the passed configuration structure. Several checking are done before that and an error is returned if invalid Modes are requested.
| [in] | pstcUart | Pointer to UART (MFS) instance register area |
| [in] | pstcConfig | MFS UART configuration |
| Ok | Initializiation of MFS_HL module successfully done. |
| ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 1475 of file mfs_hl.c.
References stc_mfs_hl_uart_config::bBitDirection, stc_mfs_hl_uart_config::bHwFlow, stc_mfs_hl_buffer::bOverflow, stc_mfs_hl_uart_config::bSignalSystem, ErrorInvalidParameter, FALSE, MFS_DATA_LEN_5, MFS_DATA_LEN_6, MFS_DATA_LEN_7, MFS_DATA_LEN_8, MFS_DATA_LEN_9, Mfs_GetReloadValue(), MFS_HL_BGR_MASK, MFS_HL_NUM_4, Mfs_InitRxIrq(), Mfs_InitTxIrq(), MFS_MD_UART_MULTI, MFS_MD_UART_NORNAL, Mfs_SetRxIntCallBack(), Mfs_SetTxIntCallBack(), Mfs_SetUpperLayerHandle(), MfsEightBits, MfsFiveBits, MfsFourStopBits, MfsHlExecStby, MfsHlFifoUseInit(), MfsHlGetInternDataPtr(), MfsHlIrqHandlerRx(), MfsHlIrqHandlerTx(), MfsHlModeUartMulti, MfsHlModeUartNormal, MfsHlUseFifo, MfsHlUseNoFifo, MfsNineBits, MfsOneStopBit, MfsParityEven, MfsParityNone, MfsParityOdd, MfsSevenBits, MfsSixBits, MfsThreeStopBits, MfsTwoStopBits, MfsUartMulti, MfsUartNormal, Ok, stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_uart_config::pfnRxCb, stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_uart_config::pfnTxCb, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_uart_config::pu8RxBuf, stc_mfs_hl_uart_config::pu8TxBuf, stc_mfs_hl_intern_data::stcRxBuffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16FillCount, stc_mfs_hl_buffer::u16InIndex, stc_mfs_hl_buffer::u16OutIndex, stc_mfs_hl_uart_config::u16RxBufSize, stc_mfs_hl_intern_data::u16RxCallbackBufFillLevel, stc_mfs_hl_uart_config::u16RxCbBufFillLvl, stc_mfs_hl_uart_config::u16TxBufSize, stc_mfs_hl_buffer::u16TxCount, stc_mfs_hl_buffer::u16TxCounter, stc_mfs_hl_uart_config::u32DataRate, stc_mfs_hl_uart_config::u8CharLength, stc_mfs_hl_intern_data::u8DataWidth, stc_mfs_hl_intern_data::u8Exec, stc_mfs_hl_uart_config::u8FifoUsage, stc_mfs_hl_intern_data::u8FifoUsage, stc_mfs_hl_intern_data::u8MfsMode, stc_mfs_hl_uart_config::u8Parity, stc_mfs_hl_uart_config::u8StopBit, and stc_mfs_hl_uart_config::u8UartMode.

| en_result_t Mfs_Hl_Write | ( | volatile stc_mfsn_t * | pstcMfs, |
| uint8_t * | pu8Data, | ||
| uint16_t | u16WriteCnt, | ||
| boolean_t | bBlocking, | ||
| boolean_t | bCsHolding | ||
| ) |
Write data to MFS_HL module synchronously or asynchronously.
This function can use for UART, CSIO or LIN.
The data provided by Mfs_Hl_Write::pu8Data is copied into the internal TX buffer and the transmission (via TX interrupt) is started, if transmission is not ongoing already. Depending on the Mfs_Hl_Write::bBlocking parameter, the function return behavior is different.
For an asynchronous (non-blocking) call (Mfs_Hl_Write::bBlocking = FALSE), the free size of the internal buffer must be sufficient to take all data (Mfs_Hl_Write::pu8Data) of length Mfs_Hl_Write::u16WriteCnt, otherwise the function will return ErrorBufferFull. After all data is copied into the internal buffer, the function will return immediately. The transmission may be pending when the function returns.
For a synchronous (blocking) call (Mfs_Hl_Write::bBlocking = TRUE), the function will wait until all data is transferred to the MFS hardware FIFO. The transmission may be pending when the function returns. If the referenced MFS does not have a FIFO single data is written.
However, when call-back for transmission is not set, this function executes only by blocking.
| [in] | pstcMfs | Pointer to MFS instance register area |
| [in] | pu8Data | Transmit data buffer holding data to transmit |
| [in] | u16WriteCnt | Number of characters to write, must be at least 1 |
| [in] | bBlocking | If TRUE, synchronously wait until all data is transferred into the hardware Fifo buffer If FALSE, put data into internal TX buffer and return immediately But this parameter isn't effective when the call-back for transmission isn't set. |
| [in] | bCsHolding | Specify to hold chip select This parameter is only effective when mode is CSIO/SPI master and chip select function is used. |
| Ok | Transmit data successfully done or started. |
| ErrorInvalidParameter | If one of following conditions are met:
|
| ErrorOperationInProgress | A transmission or reception is still ongoing |
| ErrorBufferFull | Insufficient free size of TX buffer to take all data (in case of Mfs_Hl_Write::bBlocking = FALSE only) |
Definition at line 4172 of file mfs_hl.c.
References ErrorBufferFull, ErrorInvalidParameter, ErrorOperationInProgress, FALSE, MFS_CSIO_TBYTE_MAX, MfsHlExecStby, MfsHlExecTransmitting, MfsHlGetInternDataPtr(), MfsHlGetMin(), MfsHlModeCsioNormalMasterTimer, MfsHlModeCsioSpiMasterWithCs, MfsHlUseFifo, MfsHlWriteBuf(), Ok, PDL_WAIT_LOOP_HOOK(), stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16FillCount, stc_mfs_hl_buffer::u16InIndex, stc_mfs_hl_buffer::u16TxCount, stc_mfs_hl_buffer::u16TxCounter, stc_mfs_hl_intern_data::u8Exec, stc_mfs_hl_intern_data::u8FifoUsage, and stc_mfs_hl_intern_data::u8MfsMode.

|
static |
MFS_HL Initialize FIFO to use.
| [in] | pstcMfs | Pointer to MFS instance register area |
| [in] | u16BufFillLvl | Filled count to interrupt |
Definition at line 760 of file mfs_hl.c.
References FALSE, MFS_FIFO_MAX_VAL, MfsHlGetMin(), and TRUE.
Referenced by Mfs_Hl_Csio_Init(), Mfs_Hl_I2c_Init(), Mfs_Hl_Lin_Init(), and Mfs_Hl_Uart_Init().


|
static |
Return the internal data for a certain MFS_HL instance.
| pstcMfs | Pointer to MFS_HL instance |
Definition at line 311 of file mfs_hl.c.
References MfsInstanceIndexMax, and stc_mfs_hl_instance_data::stcInternData.
Referenced by Mfs_Hl_Csio_DeInit(), Mfs_Hl_Csio_Init(), Mfs_Hl_Csio_SynchronousTrans(), Mfs_Hl_GetBufferPointer(), Mfs_Hl_I2c_DeInit(), Mfs_Hl_I2c_Init(), Mfs_Hl_I2c_Read(), Mfs_Hl_I2c_WaitRxComplete(), Mfs_Hl_I2c_WaitTxComplete(), Mfs_Hl_I2c_Write(), Mfs_Hl_Lin_DisableRxInterrupt(), Mfs_Hl_Lin_Init(), Mfs_Hl_Lin_SetBreak(), Mfs_Hl_Lin_SetNewBaudDivisor(), Mfs_Hl_Lin_TransferRxBuffer(), Mfs_Hl_Read(), Mfs_Hl_Uart_DeInit(), Mfs_Hl_Uart_Init(), and Mfs_Hl_Write().

|
static |
Get minimum number.
| [in] | u16Num1 | The number to compare to u16Num2 |
| [in] | u16Num2 | The number to compare to u16Num1 |
Definition at line 341 of file mfs_hl.c.
Referenced by Mfs_Hl_I2c_Read(), Mfs_Hl_Read(), Mfs_Hl_Write(), MfsHlFifoUseInit(), MfsHlI2cDataTxMaster(), MfsHlI2cDataTxSlave(), and MfsHlWriteBuf().

|
static |
Check changing I2C interruption state.
| [in] | pstcMfsHlInternData | Pointer to internal data |
| [in] | u32MaxCnt | Maximum counter to check state changing |
| Ok | Interruption state changed within the specified period of count. |
| ErrorOperationInProgress | Interruption state doesn't change and counter isn't overflow yet. |
| ErrorTimeout | Interruption state didn't change within the specified period of count. |
Definition at line 3629 of file mfs_hl.c.
References ErrorOperationInProgress, ErrorTimeout, MfsHlExecStby, Ok, stc_mfs_hl_intern_data::u32I2cProcCnt, and stc_mfs_hl_intern_data::u8Exec.
Referenced by Mfs_Hl_I2c_WaitRxComplete(), and Mfs_Hl_I2c_WaitTxComplete().

|
static |
MFS_HL Operation to receive data for I2C master.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area |
| [in] | pstcMfsHlInternData | Pointer to internal data |
Definition at line 930 of file mfs_hl.c.
References FALSE, MFS_HL_NUM_1, MfsHlExecStby, stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcRxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16InIndex, and stc_mfs_hl_intern_data::u8Exec.
Referenced by MfsHlI2cIrqHandlerRx(), and MfsHlI2cIrqHandlerSts().

|
static |
MFS_HL Operation to receive data for I2C slave.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area |
| [in] | pstcMfsHlInternData | Pointer to internal data |
Definition at line 1104 of file mfs_hl.c.
References FALSE, MFS_HL_NUM_1, MfsHlExecStby, stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcRxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16InIndex, and stc_mfs_hl_intern_data::u8Exec.
Referenced by MfsHlI2cIrqHandlerRx(), and MfsHlI2cIrqHandlerSts().

|
static |
MFS_HL Operation to send data for I2C master.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area |
| [in] | pstcMfsHlInternData | Pointer to internal data |
Definition at line 806 of file mfs_hl.c.
References FALSE, MFS_FIFO_MAX_VAL, MFS_HL_NUM_1, MfsHlExecStby, MfsHlGetMin(), MfsHlUseFifo, stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16OutIndex, stc_mfs_hl_intern_data::u8Exec, and stc_mfs_hl_intern_data::u8FifoUsage.
Referenced by MfsHlI2cIrqHandlerSts(), and MfsHlI2cIrqHandlerTx().


|
static |
MFS_HL Operation to send data for I2C slave.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area |
| [in] | pstcMfsHlInternData | Pointer to internal data |
Definition at line 1209 of file mfs_hl.c.
References FALSE, MFS_FIFO_MAX_VAL, MfsHlExecStby, MfsHlGetMin(), MfsHlUseFifo, stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16OutIndex, stc_mfs_hl_intern_data::u8Exec, and stc_mfs_hl_intern_data::u8FifoUsage.
Referenced by MfsHlI2cIrqHandlerSts(), and MfsHlI2cIrqHandlerTx().


|
static |
MFS_HL receive interrupt service routine for I2C.
This Function is called on Reception Interrupt set by the I2C.
| [in] | pstcMfs | Pointer to I2C (MFS) instance register area |
| [in] | pvHandle | Pointer to internal data |
Definition at line 1374 of file mfs_hl.c.
References MfsHlExecStby, MfsHlI2cDataRxMaster(), MfsHlI2cDataRxSlave(), MfsHlI2cPreStartSlave(), MfsHlModeI2cMaster, stc_mfs_hl_intern_data::u8Exec, and stc_mfs_hl_intern_data::u8MfsMode.
Referenced by Mfs_Hl_I2c_Init().


|
static |
MFS_HL status interrupt service routine for I2C.
This Function is called on Status Interrupt set by the I2C.
| [in] | pstcMfs | Pointer to I2C (MFS) instance register area |
| [in] | pvHandle | Pointer to internal data |
Definition at line 1412 of file mfs_hl.c.
References MfsHlExecReceiving, MfsHlExecStby, MfsHlExecTransmitting, MfsHlI2cDataRxMaster(), MfsHlI2cDataRxSlave(), MfsHlI2cDataTxMaster(), MfsHlI2cDataTxSlave(), MfsHlI2cPreStartSlave(), MfsHlModeI2cMaster, stc_mfs_hl_intern_data::u8Exec, and stc_mfs_hl_intern_data::u8MfsMode.
Referenced by Mfs_Hl_I2c_Init().


|
static |
MFS_HL transmit interrupt service routine for I2C.
This Function is called on Transmit Interrupt set by the I2C.
| [in] | pstcMfs | Pointer to I2C (MFS) instance register area |
| [in] | pvHandle | Pointer to internal data |
Definition at line 1344 of file mfs_hl.c.
References MfsHlI2cDataTxMaster(), MfsHlI2cDataTxSlave(), MfsHlModeI2cMaster, and stc_mfs_hl_intern_data::u8MfsMode.
Referenced by Mfs_Hl_I2c_Init().


|
static |
MFS_HL Start operation for I2C slave.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area |
| [in] | pstcMfsHlInternData | Pointer to internal data |
Definition at line 1039 of file mfs_hl.c.
References FALSE, MfsI2cRead, MfsI2cWrite, stc_mfs_hl_intern_data::pfnI2cSlvStCbFunction, and TRUE.
Referenced by MfsHlI2cIrqHandlerRx(), and MfsHlI2cIrqHandlerSts().

|
static |
Start operation as I2C slave.
| [in] | pstcI2c | Pointer to I2C (MFS) instance register area |
| [in] | pstcMfsHlInternData | Pointer to internal data |
| Ok | Start slave process successfully done |
| ErrorInvalidMode | Slave isn't active |
Definition at line 3519 of file mfs_hl.c.
References ErrorInvalidMode, FALSE, MfsHlExecStby, MfsHlUseFifo, Ok, TRUE, stc_mfs_hl_intern_data::u8Exec, and stc_mfs_hl_intern_data::u8FifoUsage.
Referenced by Mfs_Hl_I2c_Read(), and Mfs_Hl_I2c_Write().

|
static |
Wait to change I2C interruption state.
| [in] | pstcMfsHlInternData | Pointer to internal data |
| Ok | Interruption state changed within the specified period of time. |
| ErrorTimeout | Interruption state didn't change within the specified period of time. |
Definition at line 3591 of file mfs_hl.c.
References ErrorTimeout, Mfs_GetBusClock(), MFS_HL_NUM_10, MfsHlExecStby, Ok, and stc_mfs_hl_intern_data::u8Exec.
Referenced by Mfs_Hl_I2c_Read(), and Mfs_Hl_I2c_Write().


|
static |
MFS_HL receive interrupt service routine.
This Function is called on each Receive Interrupt set by the MFS. It stores the data from the FIFO into the internal Ring Buffer an triggers a callback function if the specific Fill Level of the internal Ring Buffer is reached. If the referenced MFS does not have a FIFO single data is read.
In LIN mode this ISR also handles the LIN Break detection.
Definition at line 662 of file mfs_hl.c.
References MFS_CSIO_SSR_ERR, MFS_HL_MODE_GROUP_CHK, MFS_HL_MODE_GROUP_CSIO, MFS_HL_MODE_GROUP_LIN, MFS_HL_MODE_GROUP_UART, MFS_LIN_SSR_ERR, MFS_UART_SSR_ERR, MfsHlReadBuf(), stc_mfs_hl_intern_data::pfnReceiveCbFunction, stc_mfs_hl_intern_data::stcRxBuffer, TRUE, stc_mfs_hl_buffer::u16FillCount, stc_mfs_hl_intern_data::u16RxCallbackBufFillLevel, and stc_mfs_hl_intern_data::u8MfsMode.
Referenced by Mfs_Hl_Csio_Init(), Mfs_Hl_Lin_Init(), and Mfs_Hl_Uart_Init().


|
static |
MFS_HL status interrupt service routine.
Definition at line 723 of file mfs_hl.c.
References FALSE, MFS_SMR_LIN_MODE, MFS_SMR_MODEBITS_MASK, stc_mfs_hl_intern_data::pfnLinBreakCbFunction, and TRUE.
Referenced by Mfs_Hl_Csio_Init(), and Mfs_Hl_Lin_Init().

|
static |
MFS_HL transmit interrupt service routine.
This Function is called on each Transmit Interrupt set by the MFS. This highly depends on the Configuration of the INT Sources. Interrupts might occur on TX Fifo empty, last bit has been shifted out, ... The data from the internal Ring Buffer is put into the Fifo until there's no more space left or all data has been transferred to the Fifo. If the referenced MFS does not have a FIFO single data is put.
In LIN mode this handler also checks for LIN Break detection. If it is detected, possible reception errors are cleared, the reception register (RDR) is flushed and (if not NULL) a dedicated callback function is called. Afterwards the Function is left by return w/o any further transmission action.
Definition at line 454 of file mfs_hl.c.
References FALSE, MfsHlExecStby, MfsHlExecWaitTxBusIdle, MfsHlModeCsioNormalMasterTimer, MfsHlUseFifo, MfsHlWriteBuf(), stc_mfs_hl_intern_data::pfnTransmitCbFunction, stc_mfs_hl_intern_data::stcTxBuffer, TRUE, stc_mfs_hl_buffer::u16FillCount, stc_mfs_hl_buffer::u16TxCount, stc_mfs_hl_buffer::u16TxCounter, stc_mfs_hl_intern_data::u8Exec, stc_mfs_hl_intern_data::u8FifoUsage, and stc_mfs_hl_intern_data::u8MfsMode.
Referenced by Mfs_Hl_Csio_Init(), Mfs_Hl_Lin_Init(), and Mfs_Hl_Uart_Init().


|
static |
Store received data into buffer.
It stores the data from the FIFO into the internal Ring Buffer If the referenced MFS does not have a FIFO single data is read.
| [in] | pstcMfs | Pointer to MFS instance register area |
| [in,out] | pstcMfsHlInternData | Pointer to internal data |
Definition at line 543 of file mfs_hl.c.
References stc_mfs_hl_buffer::bOverflow, MFS_HL_NUM_1, MFS_HL_NUM_2, MFS_HL_NUM_3, MFS_HL_NUM_4, MFS_HL_NUM_8, MfsEightBits, MfsHlUseFifo, MfsSixteenBits, MfsTwentyFourBits, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcRxBuffer, TRUE, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16FillCount, stc_mfs_hl_buffer::u16InIndex, stc_mfs_hl_intern_data::u8DataWidth, and stc_mfs_hl_intern_data::u8FifoUsage.
Referenced by Mfs_Hl_Read(), and MfsHlIrqHandlerRx().

|
static |
Write the contents of the buffer to Transmit Data Register.
The data from the internal Ring Buffer is put into the Fifo until there's no more space left or all data has been transferred to the Fifo. If the referenced MFS does not have a FIFO single data is put.
| [in] | pstcMfs | Pointer to MFS instance register area |
| [in,out] | pstcMfsHlInternData | Pointer to internal data |
Definition at line 369 of file mfs_hl.c.
References MFS_FIFO_MAX_VAL, MFS_HL_MASK_0_7, MFS_HL_NUM_1, MFS_HL_NUM_2, MFS_HL_NUM_3, MFS_HL_NUM_4, MFS_HL_NUM_8, MfsEightBits, MfsHlGetMin(), MfsHlUseFifo, MfsSixteenBits, MfsTwentyFourBits, stc_mfs_hl_buffer::pu8Buffer, stc_mfs_hl_intern_data::stcTxBuffer, stc_mfs_hl_buffer::u16BufferSize, stc_mfs_hl_buffer::u16FillCount, stc_mfs_hl_buffer::u16OutIndex, stc_mfs_hl_buffer::u16TxCount, stc_mfs_hl_buffer::u16TxCounter, stc_mfs_hl_intern_data::u8DataWidth, and stc_mfs_hl_intern_data::u8FifoUsage.
Referenced by Mfs_Hl_Write(), and MfsHlIrqHandlerTx().


|
static |