Contains all macro definitions and function prototypes support for scn firmware library on A31L12x. More...
Go to the source code of this file.
Data Structures | |
struct | SCn_CFG_Type |
Functions | |
HAL_Status_Type | HAL_SC_Init (SCn_Type *SCx, SCn_CFG_Type *SCn_Config) |
Initialize the SCn peripheral with the specified parameters. More... | |
HAL_Status_Type | HAL_SC_DeInit (SCn_Type *SCx) |
Deinitialize the SCn peripheral registers to their default reset values. More... | |
HAL_Status_Type | HAL_SC_ConfigStructInit (SCn_CFG_Type *SCn_Config, SCn_OPMODE_Type mode, uint32_t Baudrate) |
Fills each SCn_Config member with its default value: More... | |
HAL_Status_Type | HAL_SC_ConfigInterrupt (SCn_Type *SCx, SCn_INT_Type SCn_IntCfg, FunctionalState NewState) |
Configure the interrupt source of selected SCn peripheral. More... | |
HAL_Status_Type | HAL_SC_ControlConfig (SCn_Type *SCx, SCn_CR1_CONTROL_Type Mode, FunctionalState NewState) |
Configure Control mode for SCn peripheral. More... | |
HAL_Status_Type | HAL_SC_Enable (SCn_Type *SCx, FunctionalState state) |
SCn enable control. More... | |
HAL_Status_Type | HAL_SC_AutoAct (SCn_Type *SCx) |
SCn Auto Activation and Cold Reset. More... | |
HAL_Status_Type | HAL_SC_AutoWarmRst (SCn_Type *SCx) |
SCn Auto Warm Reset. More... | |
HAL_Status_Type | HAL_SC_AutoDeAct (SCn_Type *SCx) |
SCn Auto Deactivation. More... | |
HAL_Status_Type | HAL_SC_SetRxTimeOutData (SCn_Type *SCx, uint32_t RxTimeOutD) |
SCn Receive Time Out Data Register Set. More... | |
HAL_Status_Type | HAL_SC_SetExGuardTime (SCn_Type *SCx, uint32_t TxExGuardTime) |
SCn Transmit Extra Guard Time Register Set. More... | |
HAL_Status_Type | HAL_SC_SetT34DR (SCn_Type *SCx, uint32_t SCnT3data, uint32_t SCnT4data) |
SCn T3DR and T4DR Registers Set. More... | |
HAL_Status_Type | HAL_SC_SetLevel (SCn_Type *SCx, SCn_CR2_LEVEL_POS SelectPin, SetState SetLevel) |
Set Level for SCn peripheral when Smartcard Interface Mode. More... | |
HAL_Status_Type | HAL_SC_AutoConvDet (SCn_Type *SCx) |
SCn Auto Convention Detection. More... | |
HAL_Status_Type | HAL_SC_SetConv (SCn_Type *SCx, SCn_CONV_Type conv_sel) |
SCn Convention Selection. More... | |
HAL_Status_Type | HAL_SC_ConfigRetry (SCn_Type *SCx, uint8_t retry_num, SCn_DTIME_Type retry_dly) |
SCn Retry Configuration with the specified parameters. More... | |
HAL_Status_Type | HAL_SC_RetryEnable (SCn_Type *SCx, SCn_RETRY_EN_DISABLE retry_en) |
SCn Retry Enable. More... | |
HAL_Status_Type | HAL_SC_SetInPol (SCn_Type *SCx, SCn_INPUT_POLARITY_Type In_pol) |
SCn Input Pin Polarity Set. More... | |
HAL_Status_Type | HAL_SC_RxCntEnable (SCn_Type *SCx, SCn_RXCNT_EN_DISABLE RxCnt_en) |
SCn Receive Byte Count Enable. More... | |
HAL_Status_Type | HAL_SC_SetRxBlkLen (SCn_Type *SCx, uint8_t blk_len) |
SCn Rx block length set with the specified parameters. More... | |
HAL_Status_Type | HAL_SC_ClearStatus (SCn_Type *SCx, SCn_STATUS_Type Status) |
Clear Status register in SCn peripheral. More... | |
uint32_t | HAL_SC_GetStatus (SCn_Type *SCx) |
Get current value of Status register in SCn peripheral. More... | |
uint8_t | HAL_SC_GetRxLineBusy (SCn_Type *SCx) |
Get the Rx Line Busy bit. More... | |
uint8_t | HAL_SC_GetSCnINST (SCn_Type *SCx) |
Get the SCnIN Pin Status. More... | |
FlagStatus | HAL_SC_CheckBusy (SCn_Type *SCx) |
Check whether if SCn is busy or not. More... | |
HAL_Status_Type | HAL_SC_TransmitByte (SCn_Type *SCx, uint8_t Data) |
Transmit a single data through SCn peripheral. More... | |
uint8_t | HAL_SC_ReceiveByte (SCn_Type *SCx) |
Receive a single data from SCn peripheral. More... | |
uint32_t | HAL_SC_Transmit (SCn_Type *SCx, uint8_t *txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag) |
Send a block of data via SCn peripheral. More... | |
uint32_t | HAL_SC_Receive (SCn_Type *SCx, uint8_t *rxbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag) |
Receive a block of data via SCn peripheral. More... | |
Contains all macro definitions and function prototypes support for scn firmware library on A31L12x.
Copyright(C) 2019, ABOV Semiconductor All rights reserved.
ABOV Disclaimer
IMPORTANT NOTICE ? PLEASE READ CAREFULLY ABOV Semiconductor ("ABOV") reserves the right to make changes, corrections, enhancements, modifications, and improvements to ABOV products and/or to this document at any time without notice. ABOV does not give warranties as to the accuracy or completeness of the information included herein. Purchasers should obtain the latest relevant information of ABOV products before placing orders. Purchasers are entirely responsible for the choice, selection, and use of ABOV products and ABOV assumes no liability for application assistance or the design of purchasers' products. No license, express or implied, to any intellectual property rights is granted by ABOV herein. ABOV disclaims all express and implied warranties and shall not be responsible or liable for any injuries or damages related to use of ABOV products in such unauthorized applications. ABOV and the ABOV logo are trademarks of ABOV. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces the information previously supplied in any former versions of this document. 2020 ABOV Semiconductor All rights reserved
Definition in file A31L12x_hal_scn.h.
enum SCn_CONV_Type |
SCn Convention Type definition
Enumerator | |
---|---|
SCn_DIRECT_CONV | Direct Convention |
SCn_INVERSE_CONV | Inverse Convention |
Definition at line 157 of file A31L12x_hal_scn.h.
enum SCn_CR1_CONTROL_Type |
SCn Control type definition
Enumerator | |
---|---|
SCn_CR1_SCIEN | |
SCn_CR1_RTOEN | |
SCn_CR1_RXE | |
SCn_CR1_TXE | |
SCn_CR1_PEN |
Definition at line 137 of file A31L12x_hal_scn.h.
enum SCn_CR2_LEVEL_POS |
SCn Smartcard Interface Mode Pin Level definition
Enumerator | |
---|---|
SCn_CR2_CLKEN | |
SCn_CR2_CLKLV | |
SCn_CR2_DATALV | |
SCn_CR2_RSTLV | |
SCn_CR2_PWRLV |
Definition at line 147 of file A31L12x_hal_scn.h.
enum SCn_DATA_BIT_Type |
SCn Data Bit type definitions
Enumerator | |
---|---|
SCn_DATA_BIT_5 | 5 Data Bits |
SCn_DATA_BIT_6 | 6 Data Bits |
SCn_DATA_BIT_7 | 7 Data Bits |
SCn_DATA_BIT_8 | 8 Data Bits |
Definition at line 114 of file A31L12x_hal_scn.h.
enum SCn_DTIME_Type |
SCn Delay Time After Retry definition
Enumerator | |
---|---|
SCn_DTIME_2J5ETU | Delay Time: 2.5etu Before Retry |
SCn_DTIME_2J5PEXT | Delay Time: 2.5etu + Extra Time Before Retry |
Definition at line 171 of file A31L12x_hal_scn.h.
SCn Delay Time After Retry definition
Enumerator | |
---|---|
SCn_INPUT_POLARITY_FALLING | Insert/Removal on falling edge |
SCn_INPUT_POLARITY_RISING | Insert/Removal on rising edge |
SCn_INPUT_POLARITY_BOTH | Insert/Removal on both of falling and rising edge |
Definition at line 178 of file A31L12x_hal_scn.h.
enum SCn_INT_Type |
SCn Interrupt definition
Enumerator | |
---|---|
SCn_INTCFG_RXC | |
SCn_INTCFG_TXC | |
SCn_INTCFG_RTO | |
SCn_INTCFG_BLED | |
SCn_INTCFG_SCIN | |
SCn_INTCFG_TRYER | |
SCn_INTCFG_CONED | |
SCn_INTCFG_CONER | |
SCn_INTCFG_SED | |
SCn_INTCFG_SER | |
SCn_INTCFG_RSTA |
Definition at line 215 of file A31L12x_hal_scn.h.
enum SCn_OPMODE_Type |
Enumerator | |
---|---|
SCn_SCI_MODE | Smart Card Interface Mode |
SCn_UART_MODE | UART Mode |
Definition at line 93 of file A31L12x_hal_scn.h.
enum SCn_OVR_SAMP_Type |
SCn Oversampling Type definition
Enumerator | |
---|---|
SCn_OVR_SAMP_16 | 16 Oversampling |
SCn_OVR_SAMP_8 | 8 Oversampling |
Definition at line 130 of file A31L12x_hal_scn.h.
enum SCn_PARITY_BIT_Type |
SCn Parity Bit type definition
Enumerator | |
---|---|
SCn_PARITY_BIT_ODD | Odd parity |
SCn_PARITY_BIT_EVEN | Even parity |
Definition at line 107 of file A31L12x_hal_scn.h.
SCn Parity Enable/Disable definition
Enumerator | |
---|---|
SCn_PARITY_DISABLE | Disable parity |
SCn_PARITY_ENABLE | Enable parity |
Definition at line 100 of file A31L12x_hal_scn.h.
enum SCn_RETRY_EN_DISABLE |
SCn Retry Enable definition
Enumerator | |
---|---|
SCn_RETRY_DISABLE | Retry Disable |
SCn_RETRY_ENABLE | Retry Enable |
Definition at line 164 of file A31L12x_hal_scn.h.
enum SCn_RXCNT_EN_DISABLE |
SCn Received Byte Count Enable definition
Enumerator | |
---|---|
SCn_RXCNT_DISABLE | Received Byte Count Disable |
SCn_RXCNT_ENABLE | Received Byte Count Enable |
Definition at line 186 of file A31L12x_hal_scn.h.
enum SCn_STATUS_Type |
SCn Status definition
Definition at line 193 of file A31L12x_hal_scn.h.
enum SCn_STOP_BIT_Type |
SCn Stop Bit type definitions
Enumerator | |
---|---|
SCn_STOP_BIT_1 | 1 Stop Bits |
SCn_STOP_BIT_2 | 2 Stop Bits |
Definition at line 123 of file A31L12x_hal_scn.h.
HAL_Status_Type HAL_SC_AutoAct | ( | SCn_Type * | SCx | ) |
SCn Auto Activation and Cold Reset.
[in] | SCx | Pointer to the target SC
|
Definition at line 403 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_AutoConvDet | ( | SCn_Type * | SCx | ) |
SCn Auto Convention Detection.
[in] | SCx | Pointer to the target SC
|
Definition at line 595 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_AutoDeAct | ( | SCn_Type * | SCx | ) |
SCn Auto Deactivation.
[in] | SCx | Pointer to the target SC
|
Definition at line 443 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_AutoWarmRst | ( | SCn_Type * | SCx | ) |
SCn Auto Warm Reset.
[in] | SCx | Pointer to the target SC
|
Definition at line 423 of file A31L12x_hal_scn.c.
FlagStatus HAL_SC_CheckBusy | ( | SCn_Type * | SCx | ) |
Check whether if SCn is busy or not.
[in] | SCx | Pointer to the target SC
|
Definition at line 829 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_ClearStatus | ( | SCn_Type * | SCx, |
SCn_STATUS_Type | Status | ||
) |
Clear Status register in SCn peripheral.
[in] | SCx | Pointer to SCn peripheral
|
[in] | Status |
Definition at line 765 of file A31L12x_hal_scn.c.
References HAL_ERROR, HAL_OK, and SCn_STATUS_ALL_EXCEPT_TXC.
Referenced by HAL_SC_Init(), and HAL_SC_Transmit().
HAL_Status_Type HAL_SC_ConfigInterrupt | ( | SCn_Type * | SCx, |
SCn_INT_Type | SCn_IntCfg, | ||
FunctionalState | NewState | ||
) |
Configure the interrupt source of selected SCn peripheral.
[in] | SCx | Pointer to SCn peripheral
|
[in] | SCn_IntCfg | Specifies the interrupt source
|
[in] | NewState | Next State of Interrupt Operation
|
Definition at line 283 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_ConfigRetry | ( | SCn_Type * | SCx, |
uint8_t | retry_num, | ||
SCn_DTIME_Type | retry_dly | ||
) |
SCn Retry Configuration with the specified parameters.
[in] | SCx | Pointer to the target SC
|
[in] | retry_num | Specifies the retry number |
[in] | retry_dly | Specifies the delay time before retry
|
Definition at line 645 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_ConfigStructInit | ( | SCn_CFG_Type * | SCn_Config, |
SCn_OPMODE_Type | mode, | ||
uint32_t | Baudrate | ||
) |
Fills each SCn_Config member with its default value:
[out] | SCn_Config | Pointer to a SCn_CFG_Type structure which will be initialized. |
[in] | mode | SCn Operation Mode Type |
[in] | Baudrate |
Definition at line 229 of file A31L12x_hal_scn.c.
References SCn_CFG_Type::Baud_rate_Compensation, SCn_CFG_Type::Baudrate, SCn_CFG_Type::Databits, SCn_CFG_Type::Extra_guard_time, HAL_ERROR, HAL_OK, SCn_CFG_Type::Mode, SCn_CFG_Type::Oversampling, SCn_CFG_Type::Parity, SCn_CFG_Type::ParityEnDis, SCn_CFG_Type::SCI_clock_gen, SCn_DATA_BIT_8, SCn_OVR_SAMP_16, SCn_PARITY_BIT_EVEN, SCn_PARITY_DISABLE, SCn_PARITY_ENABLE, SCn_STOP_BIT_1, SCn_UART_MODE, SCn_CFG_Type::Stopbits, SCn_CFG_Type::T3_dur_time, and SCn_CFG_Type::T4_dur_time.
HAL_Status_Type HAL_SC_ControlConfig | ( | SCn_Type * | SCx, |
SCn_CR1_CONTROL_Type | Mode, | ||
FunctionalState | NewState | ||
) |
Configure Control mode for SCn peripheral.
[in] | SCx | Pointer to the target SC
|
[in] | Mode | Control Mode
|
[in] | NewState | Next State of Functional Operation
|
Definition at line 326 of file A31L12x_hal_scn.c.
References ENABLE, HAL_ERROR, HAL_OK, SCn_CR1_PEN, SCn_CR1_RTOEN, SCn_CR1_RXE, SCn_CR1_SCIEN, and SCn_CR1_TXE.
HAL_Status_Type HAL_SC_DeInit | ( | SCn_Type * | SCx | ) |
Deinitialize the SCn peripheral registers to their default reset values.
[in] | SCx | Pointer to the target SC
|
Definition at line 180 of file A31L12x_hal_scn.c.
References HAL_ERROR, HAL_OK, HAL_SCU_Peripheral_EnableClock2(), and HAL_SCU_Peripheral_SetReset2().
HAL_Status_Type HAL_SC_Enable | ( | SCn_Type * | SCx, |
FunctionalState | state | ||
) |
SCn enable control.
[in] | SCx | Pointer to the target SC
|
[in] | state |
|
Definition at line 376 of file A31L12x_hal_scn.c.
uint8_t HAL_SC_GetRxLineBusy | ( | SCn_Type * | SCx | ) |
Get the Rx Line Busy bit.
[in] | SCx | Pointer to the target SC
|
Definition at line 805 of file A31L12x_hal_scn.c.
uint8_t HAL_SC_GetSCnINST | ( | SCn_Type * | SCx | ) |
Get the SCnIN Pin Status.
[in] | SCx | Pointer to the target SC
|
Definition at line 817 of file A31L12x_hal_scn.c.
uint32_t HAL_SC_GetStatus | ( | SCn_Type * | SCx | ) |
Get current value of Status register in SCn peripheral.
[in] | SCx | Pointer to SCn peripheral
|
Definition at line 792 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_Init | ( | SCn_Type * | SCx, |
SCn_CFG_Type * | SCx_ConfigStruct | ||
) |
Initialize the SCn peripheral with the specified parameters.
[in] | SCx | Pointer to the target SC
|
[in] | SCx_ConfigStruct | Pointer to a SCn_CFG_Type structure that contains the configuration information for the specified peripheral. |
Definition at line 112 of file A31L12x_hal_scn.c.
References SCn_CFG_Type::Baud_rate_Compensation, SCn_CFG_Type::Baudrate, SCn_CFG_Type::Databits, SCn_CFG_Type::Extra_guard_time, HAL_ERROR, HAL_OK, HAL_SC_ClearStatus(), HAL_SC_ReceiveByte(), HAL_SCU_Peripheral_EnableClock2(), HAL_SCU_Peripheral_SetReset2(), SCn_CFG_Type::Mode, SCn_CFG_Type::Oversampling, SCn_CFG_Type::Parity, SCn_CFG_Type::ParityEnDis, sc_set_divisors(), SCn_CFG_Type::SCI_clock_gen, SCn_BaseClock, SCn_STATUS_ALL_EXCEPT_TXC, SCn_CFG_Type::Stopbits, SCn_CFG_Type::T3_dur_time, and SCn_CFG_Type::T4_dur_time.
uint32_t HAL_SC_Receive | ( | SCn_Type * | SCx, |
uint8_t * | rxbuf, | ||
uint32_t | buflen, | ||
TRANSFER_BLOCK_Type | flag | ||
) |
Receive a block of data via SCn peripheral.
[in] | SCx | Pointer to the target SC
|
[out] | rxbuf | Pointer to Received buffer |
[in] | buflen | Length of Received buffer |
[in] | flag | Flag mode
|
Definition at line 977 of file A31L12x_hal_scn.c.
References BLOCKING, and HAL_SC_ReceiveByte().
uint8_t HAL_SC_ReceiveByte | ( | SCn_Type * | SCx | ) |
Receive a single data from SCn peripheral.
[in] | SCx | Pointer to the target SC
|
Definition at line 870 of file A31L12x_hal_scn.c.
Referenced by HAL_SC_Init(), and HAL_SC_Receive().
HAL_Status_Type HAL_SC_RetryEnable | ( | SCn_Type * | SCx, |
SCn_RETRY_EN_DISABLE | retry_en | ||
) |
SCn Retry Enable.
[in] | SCx | Pointer to the target SC
|
[in] | retry_en | Enable/Disable retry
|
Definition at line 670 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_RxCntEnable | ( | SCn_Type * | SCx, |
SCn_RXCNT_EN_DISABLE | RxCnt_en | ||
) |
SCn Receive Byte Count Enable.
[in] | SCx | Pointer to the target SC
|
[in] | RxCnt_en | Enable/Disable Rx Byte Count
|
Definition at line 722 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_SetConv | ( | SCn_Type * | SCx, |
SCn_CONV_Type | conv_sel | ||
) |
SCn Convention Selection.
[in] | SCx | Pointer to the target SC
|
[in] | conv_sel | Convention Selection
|
Definition at line 619 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_SetExGuardTime | ( | SCn_Type * | SCx, |
uint32_t | TxExGuardTime | ||
) |
SCn Transmit Extra Guard Time Register Set.
[in] | SCx | Pointer to the target SC
|
[in] | TxExGuardTime | Transmit Extra Guard Time between the last stop bit and the next start bit
|
Definition at line 489 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_SetInPol | ( | SCn_Type * | SCx, |
SCn_INPUT_POLARITY_Type | In_pol | ||
) |
SCn Input Pin Polarity Set.
[in] | SCx | Pointer to the target SC
|
[in] | In_pol | Input Polarity Setting
|
Definition at line 695 of file A31L12x_hal_scn.c.
References HAL_ERROR, HAL_OK, and SCn_INPUT_POLARITY_BOTH.
HAL_Status_Type HAL_SC_SetLevel | ( | SCn_Type * | SCx, |
SCn_CR2_LEVEL_POS | SelectPin, | ||
SetState | SetLevel | ||
) |
Set Level for SCn peripheral when Smartcard Interface Mode.
[in] | SCx | Pointer to the target SC
|
[in] | Mode | Control Mode
|
[in] | SetLevel | Next State of Functional Operation
|
Definition at line 547 of file A31L12x_hal_scn.c.
References HAL_ERROR, HAL_OK, SCn_CR2_CLKEN, SCn_CR2_CLKLV, SCn_CR2_DATALV, SCn_CR2_PWRLV, SCn_CR2_RSTLV, and SET.
HAL_Status_Type HAL_SC_SetRxBlkLen | ( | SCn_Type * | SCx, |
uint8_t | blk_len | ||
) |
SCn Rx block length set with the specified parameters.
[in] | SCx | Pointer to the target SC
|
[in] | blk_len | Specifies the rx block length |
Definition at line 744 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_SetRxTimeOutData | ( | SCn_Type * | SCx, |
uint32_t | RxTimeOutD | ||
) |
SCn Receive Time Out Data Register Set.
[in] | SCx | Pointer to the target SC
|
[in] | RxTimeOutD | Receive Time Out Data with baud rate unit
|
Definition at line 466 of file A31L12x_hal_scn.c.
HAL_Status_Type HAL_SC_SetT34DR | ( | SCn_Type * | SCx, |
uint32_t | SCnT3data, | ||
uint32_t | SCnT4data | ||
) |
SCn T3DR and T4DR Registers Set.
[in] | SCx | Pointer to the target SC
|
[in] | SCnT3data | No. of fsc clock: Time duration for "Reset Assertion" of "Clock Disabe after Reset De-Assertion" of Smartcard Interface mode
|
[in] | SCnT4data | No. of fsc clock: Time duration for "ATR after Reset Assertion" of "from data low to Power down" of Smartcard Interface mode
|
Definition at line 515 of file A31L12x_hal_scn.c.
uint32_t HAL_SC_Transmit | ( | SCn_Type * | SCx, |
uint8_t * | txbuf, | ||
uint32_t | buflen, | ||
TRANSFER_BLOCK_Type | flag | ||
) |
Send a block of data via SCn peripheral.
[in] | SCx | Pointer to the target SC
|
[in] | txbuf | Pointer to Transmit buffer |
[in] | buflen | Length of Transmit buffer |
[in] | flag | Flag used in SCn transfer
|
Definition at line 892 of file A31L12x_hal_scn.c.
References BLOCKING, HAL_SC_ClearStatus(), HAL_SC_TransmitByte(), and SCn_STATUS_TXC.
HAL_Status_Type HAL_SC_TransmitByte | ( | SCn_Type * | SCx, |
uint8_t | Data | ||
) |
Transmit a single data through SCn peripheral.
[in] | SCx | Pointer to the target SC
|
[in] | Data | Data to transmit (must be 8-bit long) |
Definition at line 850 of file A31L12x_hal_scn.c.
References HAL_ERROR, and HAL_OK.
Referenced by HAL_SC_Transmit().