#include <compiler.h>
#include <sdrv_common.h>
#include <types.h>
Go to the source code of this file.
|
| status_t | sdrv_sent_init (sdrv_sent_t *ctrl, sdrv_sent_config_t *cfg) |
| |
| status_t | sdrv_sent_deinit (sdrv_sent_t *ctrl) |
| |
| status_t | sdrv_sent_set_callback (sdrv_sent_t *ctrl, sdrv_sent_chanid_e sdrv_sent_chanid, sdrv_sent_recv_cb_t callback, void *userdata) |
| |
| status_t | sdrv_sent_recv_start (sdrv_sent_t *ctrl, sdrv_sent_chanid_e sent_chan_id) |
| |
| status_t | sdrv_sent_recv_stop (sdrv_sent_t *ctrl, sdrv_sent_chanid_e sent_chan_id) |
| |
| status_t | sdrv_sent_parse_msg (sdrv_sent_t *ctrl, sdrv_sent_chanid_e sent_chan_id) |
| |
| status_t | sdrv_sent_get_frame (sdrv_sent_t *ctrl, sdrv_sent_chanid_e sent_chan_id, uint32_t *frame_err, sent_chan_frame_t *frame) |
| |
| int | sdrv_sent_irq_handle (uint32_t irq, void *ctrl) |
| |
- Initialization and Configuration
- Data receive
- Fast channel mode
- Interrupts and flags management
Note:
- Fast channel read mode have 3 different format:
- Standard format(driver use)
- Single secure sensor message format
- High Speed Message Format User should parse the data field further according to the format, if the frame is not a standard format.
- Fifo water mark level User should process the remaining data in the fifo, if the total amount of data received does not align with the fifo water mark level.
- Copyright
- Copyright (c) 2020 Semidrive Semiconductor. All rights reserved.
◆ SENT_HIGH_SPEED_DATA_NIBBLE
| #define SENT_HIGH_SPEED_DATA_NIBBLE 4U |
◆ SENT_SECURE_SENSOR_DATA_NIBBLE
| #define SENT_SECURE_SENSOR_DATA_NIBBLE 6U |
◆ sdrv_frame_err_e
Sdrv sent frame error code enum.
◆ sdrv_sent_chan_config_t
Sdrv sent channel config struct.
◆ sdrv_sent_chan_t
Sdrv sent channel struct.
◆ sdrv_sent_chanid_e
◆ sdrv_sent_config_t
Sdrv sent module config struct.
◆ sdrv_sent_frame_state_e
Sdrv sent frame status enum.
◆ sdrv_sent_recv_cb_t
◆ sdrv_sent_t
◆ sent_chan_frame_t
◆ sent_chan_state_e
Sdrv sent frame status enum.
◆ sdrv_frame_err
Sdrv sent frame error code enum.
| Enumerator |
|---|
| SENT_OK | Frame no error.
|
| SENT_SYNC_ERR | Sync/Calibration pulse is not 56 ticks.
|
| SENT_STATUS_ERR | Status signal error.
|
| SENT_DATA_ERR | Nibble data is bigger than 15.
|
| SENT_CRC_ERR | Nibble data crc is mismatched.
|
| SENT_LOW_PULSE_ERR | Nibble low pulse width error.
|
| SENT_MSB_NOT_ZERO | SENT_HIGH_SPEED_FORMAT Only.
|
| SENT_INV_MSN_ERR | SENT_SINGLE_SECURE_FORMAT Only.
|
| SENT_CONUNTER_VAL_ERR | SENT_SINGLE_SECURE_FORMAT Only.
|
| SENT_TICK_FREQ_ERR | SENT_SINGLE_SECURE_FORMAT Only.
|
| SENT_NOT_OK | SENT_SINGLE_SECURE_FORMAT Only.
|
◆ sdrv_sent_bitnum_e
Sdrv sent data width enum.
| Enumerator |
|---|
| SENT_DATA_WIDTH_4_BIT | Sent frame data width is 4bits.
|
| SENT_DATA_WIDTH_8_BIT | Sent frame data width is 8bits.
|
| SENT_DATA_WIDTH_12_BIT | |
| SENT_DATA_WIDTH_16_BIT | Sent frame data width is 16bits.
|
| SENT_DATA_WIDTH_20_BIT | Sent frame data width is 20bits.
|
| SENT_DATA_WIDTH_24_BIT | Sent frame data width is 24bits.
|
◆ sdrv_sent_chanid
Sdrv sent channel id enum.
| Enumerator |
|---|
| SDRV_SENT_HW_CPT_A | Sdrv sent hardware channel A.
|
| SDRV_SENT_HW_CPT_B | Sdrv sent hardware channel B.
|
| SDRV_SENT_HW_CPT_C | Sdrv sent hardware channel C.
|
| SDRV_SENT_HW_CPT_D | Sdrv sent hardware channel D.
|
| SDRV_SENT_CHAN_NUM | Sdrv sent hardware channel number.
|
◆ sdrv_sent_clk_src_e
sdrv sent clock source enum.
| Enumerator |
|---|
| SDRV_SENT_HF_CLK | High frequency(HF) clock, up to 400MHz.
|
| SDRV_SENT_AHF_CLK | Alternative High frequency(AHF) clock, up to 400MHz.
|
| SDRV_SENT_EXT_CLK | External clock, up to 24MHz.
|
| SDRV_SENT_LP_CLK | Low power(LP) clock, typically from low speed om chip RCOSC.
|
◆ sdrv_sent_fastchan_e
Sdrv sent channel transmit format enum.
| Enumerator |
|---|
| SENT_STANDARD_FORMAT | Sent use standard format.
|
| SENT_SINGLE_SECURE_FORMAT | Sent use single secure sensor message format.
|
| SENT_HIGH_SPEED_FORMAT | Sent use high speed message format.
|
◆ sdrv_sent_sta_e
Sdrv sent status enum.
| Enumerator |
|---|
| SENT_STATUS_UNINIT | Sdrv sent module is uninitialized.
|
| SENT_STATUS_INITED | Sdrv sent module is initialized.
|
◆ sent_chan_state
Sdrv sent frame status enum.
| Enumerator |
|---|
| CHAN_STATUS_UNINIT | Sdrv sent channel is uninitialized.
|
| CHAN_STATUS_INITED | Sdrv sent channel is initialized.
|
| CHAN_STATUS_RUNNING | Sdrv sent channel is running.
|
| CHAN_STATUS_STOPPED | Sdrv sent channel is stopped.
|
◆ sent_frame_state
Sdrv sent frame status enum.
| Enumerator |
|---|
| SENT_IDLE | The sent is idle, waiting to receive the sync pulse.
|
| SENT_SYNC | The frame successfully receives the sync pulse and waits to receive the status pulse.
|
| SENT_STATUS | The frame successfully receives the status pulse and waits to receive the data pulse.
|
| SENT_DATA | The frame is receiving the data pulse.
|
| SENT_CRC | The frame successfully receives all data pulse and waits to receive the crc pulse.
|
| SENT_PAUSE | The frame successfully receives the crc pulse and waits to receive the pause pulse.
|
◆ sdrv_sent_deinit()
Sdrv sent controller deinitialization.
This fuction deinitializes sent module.
- Parameters
-
| [in] | ctrl | Sdrv sent controller. |
- Returns
- The result of deinitializing sent.
- SDRV_STATUS_INVALID_PARAM : The input parameter contains a null pointer.
- SDRV_STATUS_OK : Sent is deinitialized success.
◆ sdrv_sent_get_frame()
Get sent frame info.
- Parameters
-
| [in] | ctrl | Sent controller |
| [in] | sent_chan_id | Sent channel id |
| [out] | frame_err | Frame error code |
| [out] | frame | Frame information |
- Returns
- The result of initializing sent.
- SDRV_STATUS_INVALID_PARAM : The input parameter contains a null pointer.
- SDRV_STATUS_FAIL : The state of channel is error or the frame is invalid.
- SDRV_STATUS_OK : Get sent frame success.
◆ sdrv_sent_init()
Sdrv sent controller initialization.
This fuction initializes sent(etimer) module and channel and controller entity status.
- Parameters
-
| [in] | ctrl | Sdrv sent controller. |
| [in] | cfg | Sdrv sent configurations. |
- Returns
- The result of initializing sent.
- SDRV_STATUS_INVALID_PARAM : The input parameter contains a null pointer.
- SDRV_STATUS_OK : Sent is initialized success.
◆ sdrv_sent_irq_handle()
| int sdrv_sent_irq_handle |
( |
uint32_t |
irq, |
|
|
void * |
ctrl |
|
) |
| |
Sdrv sent interrupt handler.
- Parameters
-
| [in] | irq | The irq number of uartx |
| [in] | ctrl | Sdrv sent controller |
◆ sdrv_sent_parse_msg()
Parse sent frame.
This function is used in the following two situations: 1.Enter sent interrupt, 2.The user actively calls function to parse the remaining data in fifo after stopping channal.
- Parameters
-
| [in] | ctrl | Sent controller |
| [in] | sent_chan_id | Sent channel id |
- Returns
- The result of initializing sent.
- SDRV_STATUS_INVALID_PARAM : The input parameter contains a null pointer.
- SDRV_STATUS_OK : Parse sent frame success.
◆ sdrv_sent_recv_start()
Sent starts to receive frames.
Sent channel will receive frames after calling this function. User could stop the sent channel by calling sdrv_sent_recv_stop().
- Parameters
-
| [in] | ctrl | Sent controller |
| [in] | sent_chan_id | Sent channel id |
- Returns
- The result of initializing sent.
- SDRV_STATUS_INVALID_PARAM : The input parameter contains a null pointer.
- SDRV_STATUS_OK : Start sent channel success.
◆ sdrv_sent_recv_stop()
Sent stop recv frame.
Sent channel will receive frames after calling sdrv_sent_recv_start(). User could stop the sent channel by calling this function.
- Parameters
-
| [in] | ctrl | Sent controller |
| [in] | sent_chan_id | Sent channel id |
- Returns
- The result of initializing sent.
- SDRV_STATUS_INVALID_PARAM : The input parameter contains a null pointer.
- SDRV_STATUS_OK : Stop sent channel success.
◆ sdrv_sent_set_callback()
Sent set callback function.
- Parameters
-
| [in] | ctrl | Sdrv sent controller. |
| [in] | sent_chan_id | Sent channel id |
| [in] | callback | Callback function |
| [in] | userdata | Callback user param |
- Returns
- The result of initializing sent.
- SDRV_STATUS_INVALID_PARAM : The input parameter contains a null pointer.
- SDRV_STATUS_OK : Set callback function success.