HAL SMARTCARD Functions ¶
IRQHandler and Default Callbacks ¶
- group SMARTCARD_Exported_Functions_Group8
-
This subsection provides the function handling the interruption of the SMARTCARDx in asynchronous mode.
-
HAL_SMARTCARD_IRQHandler() : process the interruption of an instance
HAL_SMARTCARD_IRQHandler() is designed to process the different interruptions in the following order:
-
Error on Rx side (PE, FE, NE, ORE, RTOF)
-
Error on DMA side
-
Data on Rx side
-
Data on Tx side
-
FIFO Empty (Tx)
-
FIFO Full (Rx)
Depending on the process function one’s use, different callback might be triggered:
Process API
\
CallbacksHAL_SMARTCARD_Transmit_IT
HAL_SMARTCARD_Receive_IT
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_ErrorCallback
x
x
Process API
\
CallbacksHAL_SMARTCARD_Transmit_IT_Opt
HAL_SMARTCARD_Receive_IT_Opt
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_ErrorCallback
x
x
HAL_SMARTCARD_TxFifoEmptyCallback*
x
HAL_SMARTCARD_RxFifoFullCallback**
x
Process API
\
CallbacksHAL_SMARTCARD_Transmit_DMA
HAL_SMARTCARD_Receive_DMA
HAL_SMARTCARD_TxHalfCpltCallback*
x
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxHalfCpltCallback*
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_ErrorCallback**
x
x
Process API
\
CallbacksHAL_SMARTCARD_Transmit_DMA_Opt
HAL_SMARTCARD_Receive_DMA_Opt
HAL_SMARTCARD_TxHalfCpltCallback
x
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxHalfCpltCallback
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_TxFifoEmptyCallback*
x
HAL_SMARTCARD_RxFifoFullCallback**
x
HAL_SMARTCARD_ErrorCallback
x
x
Process API
\
CallbacksHAL_SMARTCARD_Abort_IT
HAL_SMARTCARD_AbortCpltCallback
x
HAL_SMARTCARD_ErrorCallback
x
Note
* with HAL_SMARTCARD_OPT_TX_IT_FIFO_EMPTY arguments value for interrupts parameter
Note
** with HAL_SMARTCARD_OPT_RX_IT_FIFO_FULL arguments value for interrupts parameter
Note
* these callbacks might be called following DMA IRQ management, not SMARTCARDx IRQ management.
Note
** these callbacks might be called following DMA IRQ management, or SMARTCARDx IRQ management.
Note
* with HAL_SMARTCARD_OPT_TX_IT_FIFO_EMPTY arguments value for interrupts parameter
Note
** with HAL_SMARTCARD_OPT_RX_IT_FIFO_FULL arguments value for interrupts parameter
Functions
-
void
HAL_SMARTCARD_IRQHandler
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Handle SMARTCARD interrupt request.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
-
void
HAL_SMARTCARD_TxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
SMARTCARD Tx completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_TxCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_TxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
SMARTCARD Tx Half completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_TxHalfCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_RxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
SMARTCARD Rx completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_RxCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_RxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
SMARTCARD Rx Half completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_RxHalfCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_ErrorCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
SMARTCARD Error callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_ErrorCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_AbortCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
SMARTCARD Abort completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_AbortCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_RxFifoFullCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
SMARTCARD Rx FIFO full callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_RxFifoFullCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_TxFifoEmptyCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
SMARTCARD Tx FIFO empty callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_TxFifoEmptyCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
- group SMARTCARD_Exported_Functions_Group8
-
This subsection provides the function handling the interruption of the SMARTCARDx in asynchronous mode.
-
HAL_SMARTCARD_IRQHandler() : process the interruption of an instance
HAL_SMARTCARD_IRQHandler() is designed to process the different interruptions in the following order:
-
Error on Rx side (PE, FE, NE, ORE, RTOF)
-
Error on DMA side
-
Data on Rx side
-
Data on Tx side
-
FIFO Empty (Tx)
-
FIFO Full (Rx)
Depending on the process function one’s use, different callback might be triggered:
Process API
\
CallbacksHAL_SMARTCARD_Transmit_IT
HAL_SMARTCARD_Receive_IT
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_ErrorCallback
x
x
Process API
\
CallbacksHAL_SMARTCARD_Transmit_IT_Opt
HAL_SMARTCARD_Receive_IT_Opt
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_ErrorCallback
x
x
HAL_SMARTCARD_TxFifoEmptyCallback*
x
HAL_SMARTCARD_RxFifoFullCallback**
x
Process API
\
CallbacksHAL_SMARTCARD_Transmit_DMA
HAL_SMARTCARD_Receive_DMA
HAL_SMARTCARD_TxHalfCpltCallback*
x
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxHalfCpltCallback*
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_ErrorCallback**
x
x
Process API
\
CallbacksHAL_SMARTCARD_Transmit_DMA_Opt
HAL_SMARTCARD_Receive_DMA_Opt
HAL_SMARTCARD_TxHalfCpltCallback
x
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxHalfCpltCallback
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_TxFifoEmptyCallback*
x
HAL_SMARTCARD_RxFifoFullCallback**
x
HAL_SMARTCARD_ErrorCallback
x
x
Process API
\
CallbacksHAL_SMARTCARD_Abort_IT
HAL_SMARTCARD_AbortCpltCallback
x
HAL_SMARTCARD_ErrorCallback
x
Note
* with HAL_SMARTCARD_OPT_TX_IT_FIFO_EMPTY arguments value for interrupts parameter
Note
** with HAL_SMARTCARD_OPT_RX_IT_FIFO_FULL arguments value for interrupts parameter
Note
* these callbacks might be called following DMA IRQ management, not SMARTCARDx IRQ management.
Note
** these callbacks might be called following DMA IRQ management, or SMARTCARDx IRQ management.
Note
* with HAL_SMARTCARD_OPT_TX_IT_FIFO_EMPTY arguments value for interrupts parameter
Note
** with HAL_SMARTCARD_OPT_RX_IT_FIFO_FULL arguments value for interrupts parameter
Functions
-
void
HAL_SMARTCARD_IRQHandler
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Handle SMARTCARD interrupt request.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
-
void
HAL_SMARTCARD_TxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Tx completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_TxCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_TxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Tx Half completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_TxHalfCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_RxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Rx completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_RxCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_RxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Rx Half completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_RxHalfCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_ErrorCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Error callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_ErrorCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_AbortCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Abort completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_AbortCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_RxFifoFullCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Rx FIFO full callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_RxFifoFullCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_TxFifoEmptyCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Tx FIFO empty callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_TxFifoEmptyCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
- group SMARTCARD_Exported_Functions_Group8
-
This subsection provides the function handling the interruption of the SMARTCARDx in asynchronous mode.
-
HAL_SMARTCARD_IRQHandler() : process the interruption of an instance
HAL_SMARTCARD_IRQHandler() is designed to process the different interruptions in the following order:
-
Error on Rx side (PE, FE, NE, ORE, RTOF)
-
Error on DMA side
-
Data on Rx side
-
Data on Tx side
-
FIFO Empty (Tx)
-
FIFO Full (Rx)
Depending on the process function one’s use, different callback might be triggered:
Process API
\
CallbacksHAL_SMARTCARD_Transmit_IT
HAL_SMARTCARD_Receive_IT
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_ErrorCallback
x
x
Process API
\
CallbacksHAL_SMARTCARD_Transmit_IT_Opt
HAL_SMARTCARD_Receive_IT_Opt
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_ErrorCallback
x
x
HAL_SMARTCARD_TxFifoEmptyCallback*
x
HAL_SMARTCARD_RxFifoFullCallback**
x
Process API
\
CallbacksHAL_SMARTCARD_Transmit_DMA
HAL_SMARTCARD_Receive_DMA
HAL_SMARTCARD_TxHalfCpltCallback*
x
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxHalfCpltCallback*
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_ErrorCallback**
x
x
Process API
\
CallbacksHAL_SMARTCARD_Transmit_DMA_Opt
HAL_SMARTCARD_Receive_DMA_Opt
HAL_SMARTCARD_TxHalfCpltCallback
x
HAL_SMARTCARD_TxCpltCallback
x
HAL_SMARTCARD_RxHalfCpltCallback
x
HAL_SMARTCARD_RxCpltCallback
x
HAL_SMARTCARD_TxFifoEmptyCallback*
x
HAL_SMARTCARD_RxFifoFullCallback**
x
HAL_SMARTCARD_ErrorCallback
x
x
Process API
\
CallbacksHAL_SMARTCARD_Abort_IT
HAL_SMARTCARD_AbortCpltCallback
x
HAL_SMARTCARD_ErrorCallback
x
Note
* with HAL_SMARTCARD_OPT_TX_IT_FIFO_EMPTY arguments value for interrupts parameter
Note
** with HAL_SMARTCARD_OPT_RX_IT_FIFO_FULL arguments value for interrupts parameter
Note
* these callbacks might be called following DMA IRQ management, not SMARTCARDx IRQ management.
Note
** these callbacks might be called following DMA IRQ management, or SMARTCARDx IRQ management.
Note
* with HAL_SMARTCARD_OPT_TX_IT_FIFO_EMPTY arguments value for interrupts parameter
Note
** with HAL_SMARTCARD_OPT_RX_IT_FIFO_FULL arguments value for interrupts parameter
Functions
-
void
HAL_SMARTCARD_IRQHandler
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Handle SMARTCARD interrupt request.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
-
void
HAL_SMARTCARD_TxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Tx completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_TxCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_TxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Tx Half completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_TxHalfCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_RxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Rx completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_RxCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_RxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Rx Half completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_RxHalfCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_ErrorCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Error callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_ErrorCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_AbortCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Abort completed callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_AbortCpltCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_RxFifoFullCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Rx FIFO full callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_RxFifoFullCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
void
HAL_SMARTCARD_TxFifoEmptyCallback
(
hal_smartcard_handle_t
*
hsmartcard
)
-
SMARTCARD Tx FIFO empty callback.
Warning
This function must not be modified, when the callback is needed, the HAL_SMARTCARD_TxFifoEmptyCallback() can be implemented in the user file.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
Initialization and de-initialization functions ¶
- group SMARTCARD_Exported_Functions_Group1
-
This subsection provides a set of functions allowing to initialize and de-initialize the USARTx peripheral:
-
Call the function HAL_SMARTCARD_Init() to initialize the selected HAL_SMARTCARD handle and associate an instance.
-
Call the function HAL_SMARTCARD_DeInit() to restore the default initialization of the selected USARTx peripheral.
Functions
-
hal_status_t
HAL_SMARTCARD_Init
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_t
instance
)
¶
-
Initialize the SMARTCARD according to the associated handle.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
-
instance – SMARTCARD instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – When the handle is NULL.
-
HAL_ERROR – When the MUTEX cannot be created.
-
HAL_OK – HAL SMARTCARD driver correctly Initialized for the given SMARTCARD instance.
-
-
hal_status_t
HAL_SMARTCARD_DeInit
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
De-Initialize the HAL SMARTCARD driver for the given handle.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
- Return values :
-
HAL_OK – HAL SMARTCARD driver correctly deinitialized for the given SMARTCARD handle.
-
- group SMARTCARD_Exported_Functions_Group1
-
This subsection provides a set of functions allowing to initialize and de-initialize the USARTx peripheral:
-
Call the function HAL_SMARTCARD_Init() to initialize the selected HAL_SMARTCARD handle and associate an instance.
-
Call the function HAL_SMARTCARD_DeInit() to restore the default initialization of the selected USARTx peripheral.
Functions
-
hal_status_t
HAL_SMARTCARD_Init
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_t
instance
)
-
Initialize the SMARTCARD according to the associated handle.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
-
instance – SMARTCARD instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – When the handle is NULL.
-
HAL_ERROR – When the MUTEX cannot be created.
-
HAL_OK – HAL SMARTCARD driver correctly Initialized for the given SMARTCARD instance.
-
-
hal_status_t
HAL_SMARTCARD_DeInit
(
hal_smartcard_handle_t
*
hsmartcard
)
-
De-Initialize the HAL SMARTCARD driver for the given handle.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
- Return values :
-
HAL_OK – HAL SMARTCARD driver correctly deinitialized for the given SMARTCARD handle.
-
- group SMARTCARD_Exported_Functions_Group1
-
This subsection provides a set of functions allowing to initialize and de-initialize the USARTx peripheral:
-
Call the function HAL_SMARTCARD_Init() to initialize the selected HAL_SMARTCARD handle and associate an instance.
-
Call the function HAL_SMARTCARD_DeInit() to restore the default initialization of the selected USARTx peripheral.
Functions
-
hal_status_t
HAL_SMARTCARD_Init
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_t
instance
)
-
Initialize the SMARTCARD according to the associated handle.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
-
instance – SMARTCARD instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – When the handle is NULL.
-
HAL_ERROR – When the MUTEX cannot be created.
-
HAL_OK – HAL SMARTCARD driver correctly Initialized for the given SMARTCARD instance.
-
-
hal_status_t
HAL_SMARTCARD_DeInit
(
hal_smartcard_handle_t
*
hsmartcard
)
-
De-Initialize the HAL SMARTCARD driver for the given handle.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
- Return values :
-
HAL_OK – HAL SMARTCARD driver correctly deinitialized for the given SMARTCARD handle.
-
General Config functions ¶
- group SMARTCARD_Exported_Functions_Group2
-
This subsection provides a set of functions allowing to configure the USARTx peripheral in SMARTCARD mode:
-
Global configuration :
-
HAL_SMARTCARD_SetConfig() , set the minimum required configuration into the handler instance registers.
-
HAL_SMARTCARD_GetConfig() , fetch the minimum required configuration from the handler instance registers.
-
Functions
-
hal_status_t
HAL_SMARTCARD_SetConfig
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smartcard_config_t
*
p_config
)
¶
-
Configure the SMARTCARD according to the user parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_config – Pointer to the configuration structure
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_GetConfig
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_config_t
*
p_config
)
¶
-
Retrieve the SMARTCARD configuration from the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_config – Pointer to the configuration structure
-
- Return values :
-
HAL_OK – Operation completed successfully
-
- group SMARTCARD_Exported_Functions_Group2
-
This subsection provides a set of functions allowing to configure the USARTx peripheral in SMARTCARD mode:
-
Global configuration :
-
HAL_SMARTCARD_SetConfig() , set the minimum required configuration into the handler instance registers.
-
HAL_SMARTCARD_GetConfig() , fetch the minimum required configuration from the handler instance registers.
-
Functions
-
hal_status_t
HAL_SMARTCARD_SetConfig
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smartcard_config_t
*
p_config
)
-
Configure the SMARTCARD according to the user parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_config – Pointer to the configuration structure
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_GetConfig
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_config_t
*
p_config
)
-
Retrieve the SMARTCARD configuration from the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_config – Pointer to the configuration structure
-
- Return values :
-
HAL_OK – Operation completed successfully
-
- group SMARTCARD_Exported_Functions_Group2
-
This subsection provides a set of functions allowing to configure the USARTx peripheral in SMARTCARD mode:
-
Global configuration :
-
HAL_SMARTCARD_SetConfig() , set the minimum required configuration into the handler instance registers.
-
HAL_SMARTCARD_GetConfig() , fetch the minimum required configuration from the handler instance registers.
-
Functions
-
hal_status_t
HAL_SMARTCARD_SetConfig
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smartcard_config_t
*
p_config
)
-
Configure the SMARTCARD according to the user parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_config – Pointer to the configuration structure
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_GetConfig
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_config_t
*
p_config
)
-
Retrieve the SMARTCARD configuration from the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_config – Pointer to the configuration structure
-
- Return values :
-
HAL_OK – Operation completed successfully
-
Unitary basic config functions ¶
- group SMARTCARD_Exported_Functions_Group3
-
This subsection provides a set of unitary functions allowing to configure the USARTx peripheral in SMARTCARD mode:
-
Unitary configuration :
-
HAL_SMARTCARD_SetBaudRate() , set the baud rate value into the handler instance registers.
-
HAL_SMARTCARD_GetBaudRate() , fetch the baud rate value from the handler instance registers.
-
HAL_SMARTCARD_SetStopBits() , set the stop bits value into the handler instance registers.
-
HAL_SMARTCARD_GetStopBits() , fetch the stop bits value from the handler instance registers.
-
HAL_SMARTCARD_SetFirstBit() , set the first bit sent (MSB or LSB) value into the handler instance registers.
-
HAL_SMARTCARD_GetFirstBit() , fetch the first bit sent (MSB or LSB) value from the handler instance registers.
-
HAL_SMARTCARD_SetParity() , set the parity value into the handler instance registers.
-
HAL_SMARTCARD_GetParity() , fetch the parity value from the handler instance registers.
-
HAL_SMARTCARD_SetNack() , set the nack value (NACK transmission is enabled/disabled in case of parity error) into the handler instance registers.
-
HAL_SMARTCARD_GetNack() , fetch the nack value from the handler instance registers.
-
HAL_SMARTCARD_SetClockOutput() , set the clock output value into the handler instance registers.
-
HAL_SMARTCARD_GetClockOutput() , fetch the clock output value from the handler instance registers.
-
HAL_SMARTCARD_SetClockPolarity() , set the clock polarity value into the handler instance registers.
-
HAL_SMARTCARD_GetClockPolarity() , fetch the clock polarity value from the handler instance registers.
-
HAL_SMARTCARD_SetClockPhase() , set the clock phase value into the handler instance registers.
-
HAL_SMARTCARD_GetClockPhase() , fetch the clock phase value from the handler instance registers.
-
HAL_SMARTCARD_SetGuardTime() , set the guard time value into the handler instance registers.
-
HAL_SMARTCARD_GetGuardTime() , fetch the guard time value from the handler instance registers.
-
HAL_SMARTCARD_SetAutoRetryCount() ,set the auto retry value into the handler instance registers.
-
HAL_SMARTCARD_GetAutoRetryCount() , fetch the auto retry count value from the handler instance registers.
Those parameters have the following default state :
| Parameter | Default register state | |———————|:——————————–—:| | Baudrate | 0U | (This value must be changed) | StopBits | HAL_SMARTCARD_STOP_BIT_1 | (does not exist in smartcard context) | FirstBit | HAL_SMARTCARD_BIT_ORDER_LSB_FIRST | | Parity | HAL_SMARTCARD_PARITY_ODD | | Nack | HAL_SMARTCARD_NACK_DISABLE | | ClockOutput | HAL_SMARTCARD_CLOCK_OUTPUT_DISABLE | | ClockPolarity | HAL_SMARTCARD_CLOCK_POLARITY_LOW | | ClockPhase | HAL_SMARTCARD_CLOCK_PHASE_1_EDGE | | GuardTime | 0U | | AutoRetryCount | 0U |
-
Functions
-
hal_status_t
HAL_SMARTCARD_SetBaudRate
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
baud_rate
)
¶
-
Set the SMARTCARD baud rate configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
baud_rate – SMARTCARD baud rate
-
- Return values :
-
-
HAL_OK – SMARTCARD baud rate set successfully
-
HAL_INVALID_PARAM – Invalid baud rate parameter
-
-
uint32_t
HAL_SMARTCARD_GetBaudRate
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD baud rate configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD baud rate value
-
hal_status_t
HAL_SMARTCARD_SetStopBits
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_stop_bits_t
stop_bits
)
¶
-
Set the Stop Bits configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
stop_bits – SMARTCARD stop bit
-
- Return values :
-
HAL_OK – SMARTCARD stop bit value set successfully
-
hal_smartcard_stop_bits_t
HAL_SMARTCARD_GetStopBits
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD Stop Bits configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_stop_bits_t – SMARTCARD stop bit value
-
hal_status_t
HAL_SMARTCARD_SetFirstBit
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_bit_order_t
first_bit
)
¶
-
Set the SMARTCARD first bit sent (MSB or LSB) configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
first_bit – SMARTCARD first bit sent (MSB or LSB)
-
- Return values :
-
HAL_OK – SMARTCARD first bit set successfully
-
hal_smartcard_bit_order_t
HAL_SMARTCARD_GetFirstBit
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD first bit sent (MSB or LSB) configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_bit_order_t – SMARTCARD first bit sent (MSB or LSB)
-
hal_status_t
HAL_SMARTCARD_SetParity
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_parity_t
parity
)
¶
-
Set the SMARTCARD parity configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
parity – SMARTCARD parity mode
-
- Return values :
-
HAL_OK – SMARTCARD parity mode set successfully
-
hal_smartcard_parity_t
HAL_SMARTCARD_GetParity
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD parity configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_parity_t – SMARTCARD parity mode
-
hal_status_t
HAL_SMARTCARD_SetNack
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_nack_state_t
nack
)
¶
-
Set SMARTCARD nack management setting configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
nack – SMARTCARD nack management setting
-
- Return values :
-
HAL_OK – nack management set successfully
-
hal_smartcard_nack_state_t
HAL_SMARTCARD_GetNack
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get SMARTCARD nack management setting configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_nack_state_t – nack status
-
hal_status_t
HAL_SMARTCARD_SetClockOutput
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_clock_output_t
clock_output
)
¶
-
Enable the SMARTCARD clock output.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
clock_output – SMARTCARD clock output setting from hal_smartcard_clock_output_t
-
- Return values :
-
HAL_OK – SMARTCARD clock output enabled successfully
-
hal_smartcard_clock_output_t
HAL_SMARTCARD_GetClockOutput
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get SMARTCARD clock output configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_clock_output_t – clock output status
-
hal_status_t
HAL_SMARTCARD_SetClockPolarity
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_clock_polarity_t
clock_polarity
)
¶
-
Set the SMARTCARD clock polarity configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
clock_polarity – SMARTCARD clock polarity
-
- Return values :
-
HAL_OK – SMARTCARD clock polarity set successfully
-
hal_smartcard_clock_polarity_t
HAL_SMARTCARD_GetClockPolarity
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD clock polarity configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_clock_polarity_t – SMARTCARD clock polarity
-
hal_status_t
HAL_SMARTCARD_SetClockPhase
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_clock_phase_t
clock_phase
)
¶
-
Set the SMARTCARD clock phase configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
clock_phase – SMARTCARD clock phase
-
- Return values :
-
HAL_OK – SMARTCARD clock phase set successfully
-
hal_smartcard_clock_phase_t
HAL_SMARTCARD_GetClockPhase
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD clock phase configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_clock_phase_t – SMARTCARD clock phase
-
hal_status_t
HAL_SMARTCARD_SetGuardTime
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
guard_time_etu
)
¶
-
Set the SMARTCARD guard time configuration passed in parameters into the handler instance registers.
Note
guard time is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
guard_time_etu – SMARTCARD guard time (Elementary Time Unit)
-
- Return values :
-
HAL_OK – SMARTCARD guard time set successfully
-
uint32_t
HAL_SMARTCARD_GetGuardTime
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD guard time configuration from the handler instance registers.
Note
guard time is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD guard time
-
hal_status_t
HAL_SMARTCARD_SetAutoRetryCount
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
retry_count
)
¶
-
Set the SMARTCARD auto retry count feature into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
retry_count – SMARTCARD retry count
-
- Return values :
-
HAL_OK – SMARTCARD retry count set successfully
-
uint32_t
HAL_SMARTCARD_GetAutoRetryCount
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD auto retry count feature from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD retry count
-
- group SMARTCARD_Exported_Functions_Group3
-
This subsection provides a set of unitary functions allowing to configure the USARTx peripheral in SMARTCARD mode:
-
Unitary configuration :
-
HAL_SMARTCARD_SetBaudRate() , set the baud rate value into the handler instance registers.
-
HAL_SMARTCARD_GetBaudRate() , fetch the baud rate value from the handler instance registers.
-
HAL_SMARTCARD_SetStopBits() , set the stop bits value into the handler instance registers.
-
HAL_SMARTCARD_GetStopBits() , fetch the stop bits value from the handler instance registers.
-
HAL_SMARTCARD_SetFirstBit() , set the first bit sent (MSB or LSB) value into the handler instance registers.
-
HAL_SMARTCARD_GetFirstBit() , fetch the first bit sent (MSB or LSB) value from the handler instance registers.
-
HAL_SMARTCARD_SetParity() , set the parity value into the handler instance registers.
-
HAL_SMARTCARD_GetParity() , fetch the parity value from the handler instance registers.
-
HAL_SMARTCARD_SetNack() , set the nack value (NACK transmission is enabled/disabled in case of parity error) into the handler instance registers.
-
HAL_SMARTCARD_GetNack() , fetch the nack value from the handler instance registers.
-
HAL_SMARTCARD_SetClockOutput() , set the clock output value into the handler instance registers.
-
HAL_SMARTCARD_GetClockOutput() , fetch the clock output value from the handler instance registers.
-
HAL_SMARTCARD_SetClockPolarity() , set the clock polarity value into the handler instance registers.
-
HAL_SMARTCARD_GetClockPolarity() , fetch the clock polarity value from the handler instance registers.
-
HAL_SMARTCARD_SetClockPhase() , set the clock phase value into the handler instance registers.
-
HAL_SMARTCARD_GetClockPhase() , fetch the clock phase value from the handler instance registers.
-
HAL_SMARTCARD_SetGuardTime() , set the guard time value into the handler instance registers.
-
HAL_SMARTCARD_GetGuardTime() , fetch the guard time value from the handler instance registers.
-
HAL_SMARTCARD_SetAutoRetryCount() ,set the auto retry value into the handler instance registers.
-
HAL_SMARTCARD_GetAutoRetryCount() , fetch the auto retry count value from the handler instance registers.
Those parameters have the following default state :
| Parameter | Default register state | |———————|:——————————–—:| | Baudrate | 0U | (This value must be changed) | StopBits | HAL_SMARTCARD_STOP_BIT_1 | (does not exist in smartcard context) | FirstBit | HAL_SMARTCARD_BIT_ORDER_LSB_FIRST | | Parity | HAL_SMARTCARD_PARITY_ODD | | Nack | HAL_SMARTCARD_NACK_DISABLE | | ClockOutput | HAL_SMARTCARD_CLOCK_OUTPUT_DISABLE | | ClockPolarity | HAL_SMARTCARD_CLOCK_POLARITY_LOW | | ClockPhase | HAL_SMARTCARD_CLOCK_PHASE_1_EDGE | | GuardTime | 0U | | AutoRetryCount | 0U |
-
Functions
-
hal_status_t
HAL_SMARTCARD_SetBaudRate
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
baud_rate
)
-
Set the SMARTCARD baud rate configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
baud_rate – SMARTCARD baud rate
-
- Return values :
-
-
HAL_OK – SMARTCARD baud rate set successfully
-
HAL_INVALID_PARAM – Invalid baud rate parameter
-
-
uint32_t
HAL_SMARTCARD_GetBaudRate
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD baud rate configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD baud rate value
-
hal_status_t
HAL_SMARTCARD_SetStopBits
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_stop_bits_t
stop_bits
)
-
Set the Stop Bits configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
stop_bits – SMARTCARD stop bit
-
- Return values :
-
HAL_OK – SMARTCARD stop bit value set successfully
-
hal_smartcard_stop_bits_t
HAL_SMARTCARD_GetStopBits
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD Stop Bits configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_stop_bits_t – SMARTCARD stop bit value
-
hal_status_t
HAL_SMARTCARD_SetFirstBit
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_bit_order_t
first_bit
)
-
Set the SMARTCARD first bit sent (MSB or LSB) configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
first_bit – SMARTCARD first bit sent (MSB or LSB)
-
- Return values :
-
HAL_OK – SMARTCARD first bit set successfully
-
hal_smartcard_bit_order_t
HAL_SMARTCARD_GetFirstBit
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD first bit sent (MSB or LSB) configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_bit_order_t – SMARTCARD first bit sent (MSB or LSB)
-
hal_status_t
HAL_SMARTCARD_SetParity
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_parity_t
parity
)
-
Set the SMARTCARD parity configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
parity – SMARTCARD parity mode
-
- Return values :
-
HAL_OK – SMARTCARD parity mode set successfully
-
hal_smartcard_parity_t
HAL_SMARTCARD_GetParity
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD parity configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_parity_t – SMARTCARD parity mode
-
hal_status_t
HAL_SMARTCARD_SetNack
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_nack_state_t
nack
)
-
Set SMARTCARD nack management setting configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
nack – SMARTCARD nack management setting
-
- Return values :
-
HAL_OK – nack management set successfully
-
hal_smartcard_nack_state_t
HAL_SMARTCARD_GetNack
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get SMARTCARD nack management setting configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_nack_state_t – nack status
-
hal_status_t
HAL_SMARTCARD_SetClockOutput
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_clock_output_t
clock_output
)
-
Enable the SMARTCARD clock output.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
clock_output – SMARTCARD clock output setting from hal_smartcard_clock_output_t
-
- Return values :
-
HAL_OK – SMARTCARD clock output enabled successfully
-
hal_smartcard_clock_output_t
HAL_SMARTCARD_GetClockOutput
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get SMARTCARD clock output configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_clock_output_t – clock output status
-
hal_status_t
HAL_SMARTCARD_SetClockPolarity
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_clock_polarity_t
clock_polarity
)
-
Set the SMARTCARD clock polarity configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
clock_polarity – SMARTCARD clock polarity
-
- Return values :
-
HAL_OK – SMARTCARD clock polarity set successfully
-
hal_smartcard_clock_polarity_t
HAL_SMARTCARD_GetClockPolarity
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD clock polarity configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_clock_polarity_t – SMARTCARD clock polarity
-
hal_status_t
HAL_SMARTCARD_SetClockPhase
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_clock_phase_t
clock_phase
)
-
Set the SMARTCARD clock phase configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
clock_phase – SMARTCARD clock phase
-
- Return values :
-
HAL_OK – SMARTCARD clock phase set successfully
-
hal_smartcard_clock_phase_t
HAL_SMARTCARD_GetClockPhase
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD clock phase configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_clock_phase_t – SMARTCARD clock phase
-
hal_status_t
HAL_SMARTCARD_SetGuardTime
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
guard_time_etu
)
-
Set the SMARTCARD guard time configuration passed in parameters into the handler instance registers.
Note
guard time is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
guard_time_etu – SMARTCARD guard time (Elementary Time Unit)
-
- Return values :
-
HAL_OK – SMARTCARD guard time set successfully
-
uint32_t
HAL_SMARTCARD_GetGuardTime
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD guard time configuration from the handler instance registers.
Note
guard time is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD guard time
-
hal_status_t
HAL_SMARTCARD_SetAutoRetryCount
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
retry_count
)
-
Set the SMARTCARD auto retry count feature into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
retry_count – SMARTCARD retry count
-
- Return values :
-
HAL_OK – SMARTCARD retry count set successfully
-
uint32_t
HAL_SMARTCARD_GetAutoRetryCount
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD auto retry count feature from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD retry count
-
- group SMARTCARD_Exported_Functions_Group3
-
This subsection provides a set of unitary functions allowing to configure the USARTx peripheral in SMARTCARD mode:
-
Unitary configuration :
-
HAL_SMARTCARD_SetBaudRate() , set the baud rate value into the handler instance registers.
-
HAL_SMARTCARD_GetBaudRate() , fetch the baud rate value from the handler instance registers.
-
HAL_SMARTCARD_SetStopBits() , set the stop bits value into the handler instance registers.
-
HAL_SMARTCARD_GetStopBits() , fetch the stop bits value from the handler instance registers.
-
HAL_SMARTCARD_SetFirstBit() , set the first bit sent (MSB or LSB) value into the handler instance registers.
-
HAL_SMARTCARD_GetFirstBit() , fetch the first bit sent (MSB or LSB) value from the handler instance registers.
-
HAL_SMARTCARD_SetParity() , set the parity value into the handler instance registers.
-
HAL_SMARTCARD_GetParity() , fetch the parity value from the handler instance registers.
-
HAL_SMARTCARD_SetNack() , set the nack value (NACK transmission is enabled/disabled in case of parity error) into the handler instance registers.
-
HAL_SMARTCARD_GetNack() , fetch the nack value from the handler instance registers.
-
HAL_SMARTCARD_SetClockOutput() , set the clock output value into the handler instance registers.
-
HAL_SMARTCARD_GetClockOutput() , fetch the clock output value from the handler instance registers.
-
HAL_SMARTCARD_SetClockPolarity() , set the clock polarity value into the handler instance registers.
-
HAL_SMARTCARD_GetClockPolarity() , fetch the clock polarity value from the handler instance registers.
-
HAL_SMARTCARD_SetClockPhase() , set the clock phase value into the handler instance registers.
-
HAL_SMARTCARD_GetClockPhase() , fetch the clock phase value from the handler instance registers.
-
HAL_SMARTCARD_SetGuardTime() , set the guard time value into the handler instance registers.
-
HAL_SMARTCARD_GetGuardTime() , fetch the guard time value from the handler instance registers.
-
HAL_SMARTCARD_SetAutoRetryCount() ,set the auto retry value into the handler instance registers.
-
HAL_SMARTCARD_GetAutoRetryCount() , fetch the auto retry count value from the handler instance registers.
Those parameters have the following default state :
| Parameter | Default register state | |———————|:——————————–—:| | Baudrate | 0U | (This value must be changed) | StopBits | HAL_SMARTCARD_STOP_BIT_1 | (does not exist in smartcard context) | FirstBit | HAL_SMARTCARD_BIT_ORDER_LSB_FIRST | | Parity | HAL_SMARTCARD_PARITY_ODD | | Nack | HAL_SMARTCARD_NACK_DISABLE | | ClockOutput | HAL_SMARTCARD_CLOCK_OUTPUT_DISABLE | | ClockPolarity | HAL_SMARTCARD_CLOCK_POLARITY_LOW | | ClockPhase | HAL_SMARTCARD_CLOCK_PHASE_1_EDGE | | GuardTime | 0U | | AutoRetryCount | 0U |
-
Functions
-
hal_status_t
HAL_SMARTCARD_SetBaudRate
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
baud_rate
)
-
Set the SMARTCARD baud rate configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
baud_rate – SMARTCARD baud rate
-
- Return values :
-
-
HAL_OK – SMARTCARD baud rate set successfully
-
HAL_INVALID_PARAM – Invalid baud rate parameter
-
-
uint32_t
HAL_SMARTCARD_GetBaudRate
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD baud rate configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD baud rate value
-
hal_status_t
HAL_SMARTCARD_SetStopBits
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_stop_bits_t
stop_bits
)
-
Set the Stop Bits configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
stop_bits – SMARTCARD stop bit
-
- Return values :
-
HAL_OK – SMARTCARD stop bit value set successfully
-
hal_smartcard_stop_bits_t
HAL_SMARTCARD_GetStopBits
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD Stop Bits configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_stop_bits_t – SMARTCARD stop bit value
-
hal_status_t
HAL_SMARTCARD_SetFirstBit
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_bit_order_t
first_bit
)
-
Set the SMARTCARD first bit sent (MSB or LSB) configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
first_bit – SMARTCARD first bit sent (MSB or LSB)
-
- Return values :
-
HAL_OK – SMARTCARD first bit set successfully
-
hal_smartcard_bit_order_t
HAL_SMARTCARD_GetFirstBit
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD first bit sent (MSB or LSB) configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_bit_order_t – SMARTCARD first bit sent (MSB or LSB)
-
hal_status_t
HAL_SMARTCARD_SetParity
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_parity_t
parity
)
-
Set the SMARTCARD parity configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
parity – SMARTCARD parity mode
-
- Return values :
-
HAL_OK – SMARTCARD parity mode set successfully
-
hal_smartcard_parity_t
HAL_SMARTCARD_GetParity
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD parity configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_parity_t – SMARTCARD parity mode
-
hal_status_t
HAL_SMARTCARD_SetNack
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_nack_state_t
nack
)
-
Set SMARTCARD nack management setting configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
nack – SMARTCARD nack management setting
-
- Return values :
-
HAL_OK – nack management set successfully
-
hal_smartcard_nack_state_t
HAL_SMARTCARD_GetNack
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get SMARTCARD nack management setting configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_nack_state_t – nack status
-
hal_status_t
HAL_SMARTCARD_SetClockOutput
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_clock_output_t
clock_output
)
-
Enable the SMARTCARD clock output.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
clock_output – SMARTCARD clock output setting from hal_smartcard_clock_output_t
-
- Return values :
-
HAL_OK – SMARTCARD clock output enabled successfully
-
hal_smartcard_clock_output_t
HAL_SMARTCARD_GetClockOutput
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get SMARTCARD clock output configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_clock_output_t – clock output status
-
hal_status_t
HAL_SMARTCARD_SetClockPolarity
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_clock_polarity_t
clock_polarity
)
-
Set the SMARTCARD clock polarity configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
clock_polarity – SMARTCARD clock polarity
-
- Return values :
-
HAL_OK – SMARTCARD clock polarity set successfully
-
hal_smartcard_clock_polarity_t
HAL_SMARTCARD_GetClockPolarity
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD clock polarity configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_clock_polarity_t – SMARTCARD clock polarity
-
hal_status_t
HAL_SMARTCARD_SetClockPhase
(
const
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_clock_phase_t
clock_phase
)
-
Set the SMARTCARD clock phase configuration passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
clock_phase – SMARTCARD clock phase
-
- Return values :
-
HAL_OK – SMARTCARD clock phase set successfully
-
hal_smartcard_clock_phase_t
HAL_SMARTCARD_GetClockPhase
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD clock phase configuration from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_clock_phase_t – SMARTCARD clock phase
-
hal_status_t
HAL_SMARTCARD_SetGuardTime
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
guard_time_etu
)
-
Set the SMARTCARD guard time configuration passed in parameters into the handler instance registers.
Note
guard time is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
guard_time_etu – SMARTCARD guard time (Elementary Time Unit)
-
- Return values :
-
HAL_OK – SMARTCARD guard time set successfully
-
uint32_t
HAL_SMARTCARD_GetGuardTime
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD guard time configuration from the handler instance registers.
Note
guard time is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD guard time
-
hal_status_t
HAL_SMARTCARD_SetAutoRetryCount
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
retry_count
)
-
Set the SMARTCARD auto retry count feature into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
retry_count – SMARTCARD retry count
-
- Return values :
-
HAL_OK – SMARTCARD retry count set successfully
-
uint32_t
HAL_SMARTCARD_GetAutoRetryCount
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD auto retry count feature from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD retry count
-
Advanced config functions ¶
- group SMARTCARD_Exported_Functions_Group4
-
This subsection provides a set of functions allowing to configure optional USARTx parameters for SMARTCARD mode:
-
Pin inversion:
-
HAL_SMARTCARD_EnableIOInvert() , enable pin active level logic inversion into the handler instance registers.
-
HAL_SMARTCARD_DisableIOInvert() , disable pin active level logic inversion into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledIOInvert() , fetch pin active level logic inversion status from the handler instance registers.
-
HAL_SMARTCARD_EnableDataInvert() , enable binary data logic inversion into the handler instance registers.
-
HAL_SMARTCARD_DisableDataInvert() , disable binary data logic inversion into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledDataInvert() , fetch binary data logic inversion status from the handler instance registers.
-
HAL_SMARTCARD_EnableTxRxSwap() , enable USART GPIO swap into the handler instance registers.
-
HAL_SMARTCARD_DisableTxRxSwap() , disable USART GPIO swap into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledTxRxSwap() , fetch USART GPIO swap status from the handler instance registers.
-
-
Rx overrun :
-
HAL_SMARTCARD_EnableRxOverRunDetection() , enable Rx overrun errors detection into the handler instance registers.
-
HAL_SMARTCARD_DisableRxOverRunDetection() , disable Rx overrun errors detection into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledRxOverRunDetection() , fetch Rx overrun errors detection status from the handler instance registers.
-
-
DMA disable on Rx error:
-
HAL_SMARTCARD_EnableDMAStopOnRxError() , enable DMA stop on Rx error into the handler instance registers.
-
HAL_SMARTCARD_DisableDMAStopOnRxError() , disable DMA stop on Rx error into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledDMAStopOnRxError() , fetch DMA stop on Rx error status from the handler instance registers.
-
-
Timeout :
-
HAL_SMARTCARD_SetReceiverTimeout() , set the the Rx timeout value into the handler instance registers.
-
HAL_SMARTCARD_GetReceiverTimeout() , fetch the the Rx timeout value from the handler instance registers.
-
HAL_SMARTCARD_EnableReceiverTimeout() , enable Rx timeout detection into the handler instance registers.
-
HAL_SMARTCARD_DisableReceiverTimeout() , disable Rx timeout detection into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledReceiverTimeout() , fetch Rx timeout detection status from the handler instance registers.
-
-
Tx complete indication:
-
HAL_SMARTCARD_SetTxCpltIndication() , set the guard time Tx complete indication into the handler instance registers.
-
HAL_SMARTCARD_GetTxCpltIndication() , fetch the guard time Tx complete indication from the handler instance registers.
-
-
Block Length :
-
HAL_SMARTCARD_SetBlockLength() , set the the block length value into the handler instance registers.
-
HAL_SMARTCARD_GetBlockLength() , fetch the the Rx timeout value from the handler instance registers.
-
HAL_SMARTCARD_EnableEndOfBlockIT() , enable end of block interrupt into the handler instance registers.
-
HAL_SMARTCARD_DisableEndOfBlockIT() , disable end of block interrupt into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledEndOfBlockIT() , fetch end of block interrupt status from the handler instance registers.
-
Those optional parameters have the following default state :
Parameter
Default register state
IOInversion
HAL_SMARTCARD_IO_INVERT_DISABLED
DataInvert
HAL_SMARTCARD_DATA_INVERT_DISABLED
TxRxSwap
HAL_SMARTCARD_TX_RX_SWAP_DISABLED
RxOverRunDetection
HAL_SMARTCARD_OVERRUN_DETECT_ENABLED
DMAStopOnRxError
HAL_SMARTCARD_DMA_STOP_NONE
ReceiverTimeout
HAL_SMARTCARD_TIMEOUT_DISABLED
TxCpltIndication
HAL_SMARTCARD_TX_CPLT_AFTER_GUARD_TIME
BlockLength
0U
Functions
-
hal_status_t
HAL_SMARTCARD_EnableIOInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Enable SMARTCARD pin active level logic inversion into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Tx inversion feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableIOInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Disable SMARTCARD pin active level logic inversion into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Tx inversion feature disabled successfully
-
hal_smartcard_io_invert_status_t
HAL_SMARTCARD_IsEnabledIOInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD pin active level logic inversion status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_inversion_status_t – SMARTCARD Tx inversion feature status
-
hal_status_t
HAL_SMARTCARD_EnableDataInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Enable the binary Data Inversion into the handler instance registers, (1=L, 0=H).
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_status_t
HAL_SMARTCARD_DisableDataInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Disable the binary Data Inversion into the handler instance registers (1=H, 0=L).
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_smartcard_data_invert_status_t
HAL_SMARTCARD_IsEnabledDataInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Return the binary Data Inversion status according to the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
hal_smartcard_data_invert_status_t – Current Data Inversion status.
-
hal_status_t
HAL_SMARTCARD_EnableTxRxSwap
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Enable the Swap between Tx and Rx Pin into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_status_t
HAL_SMARTCARD_DisableTxRxSwap
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Disable the Swap between Tx and Rx Pin into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_smartcard_tx_rx_swap_status_t
HAL_SMARTCARD_IsEnabledTxRxSwap
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Return the Swap between Tx and Rx Pin status according to the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
hal_smartcard_tx_rx_swap_status_t – Current Tx Rx Swap status.
-
hal_status_t
HAL_SMARTCARD_EnableRxOverRunDetection
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Enable SMARTCARD RxOverrun detection into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Rx overrun feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableRxOverRunDetection
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Disable SMARTCARD RxOverrun detection into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Rx overrun feature disabled successfully
-
hal_smartcard_rx_overrun_detection_status_t
HAL_SMARTCARD_IsEnabledRxOverRunDetection
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD RxOverrun detection status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_rx_overrun_detection_status_t – SMARTCARD Rx overrun feature status
-
hal_status_t
HAL_SMARTCARD_EnableDMAStopOnRxError
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Enable SMARTCARD DMA stop on Rx error into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – DMA stop on Rx error feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableDMAStopOnRxError
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Disable SMARTCARD DMA stop on Rx error into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – DMA stop on Rx error feature disabled successfully
-
hal_smartcard_dma_stop_status_t
HAL_SMARTCARD_IsEnabledDMAStopOnRxError
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD DMA stop on Rx error status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_dma_stop_status_t – SMARTCARD DMA stop on Rx error feature status
-
hal_status_t
HAL_SMARTCARD_SetReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
timeout_etu
)
¶
-
Set the SMARTCARD receiver timeout value passed in parameters into the handler instance registers.
Note
timeout is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
timeout_etu – SMARTCARD receiver timeout value
-
- Return values :
-
HAL_OK – SMARTCARD receiver timeout value set successfully
-
uint32_t
HAL_SMARTCARD_GetReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD receiver timeout value from the handler instance registers.
Note
timeout is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD receiver timeout value
-
hal_status_t
HAL_SMARTCARD_EnableReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Enable SMARTCARD Receiver Timeout feature into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Receiver Timeout feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Disable SMARTCARD Receiver Timeout feature into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Receiver Timeout feature disabled successfully
-
hal_smartcard_timeout_status_t
HAL_SMARTCARD_IsEnabledReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD Receiver Timeout feature status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_timeout_status_t – SMARTCARD Receiver Timeout feature status
-
hal_status_t
HAL_SMARTCARD_SetTxCpltIndication
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smarcard_tx_cplt_guard_time_indication_t
tx_cplt_indication
)
¶
-
Set the SMARTCARD Pre guard time Tx complete indication passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
tx_cplt_indication – SMARTCARD Pre guard time Tx complete indication
-
- Return values :
-
HAL_OK – SMARTCARD Tx completion indication set successfully
-
hal_smarcard_tx_cplt_guard_time_indication_t
HAL_SMARTCARD_GetTxCpltIndication
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD Pre guard time Tx complete indication feature from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smarcard_tx_cplt_guard_time_indication_t – SMARTCARD Pre guard time Tx complete indication
-
hal_status_t
HAL_SMARTCARD_SetBlockLength
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
block_length_byte
)
¶
-
Set the SMARTCARD block length for T=1 smartcard protocol passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
block_length_byte – block length
-
- Return values :
-
HAL_OK – SMARTCARD block length set successfully
-
uint32_t
HAL_SMARTCARD_GetBlockLength
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD block length for T=1 smartcard protocol from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD block length
-
hal_status_t
HAL_SMARTCARD_EnableEndOfBlockIT
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Enable SMARTCARD End of block interrupt into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – End of block interrupt enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableEndOfBlockIT
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Disable SMARTCARD End of block interrupt into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – End of block interrupt disabled successfully
-
hal_smartcard_end_of_block_interrupt_status_t
HAL_SMARTCARD_IsEnabledEndOfBlockIT
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD End of block interrupt status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_end_of_block_interrupt_status_t – SMARTCARD End of block interrupt status
-
- group SMARTCARD_Exported_Functions_Group4
-
This subsection provides a set of functions allowing to configure optional USARTx parameters for SMARTCARD mode:
-
Pin inversion:
-
HAL_SMARTCARD_EnableIOInvert() , enable pin active level logic inversion into the handler instance registers.
-
HAL_SMARTCARD_DisableIOInvert() , disable pin active level logic inversion into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledIOInvert() , fetch pin active level logic inversion status from the handler instance registers.
-
HAL_SMARTCARD_EnableDataInvert() , enable binary data logic inversion into the handler instance registers.
-
HAL_SMARTCARD_DisableDataInvert() , disable binary data logic inversion into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledDataInvert() , fetch binary data logic inversion status from the handler instance registers.
-
HAL_SMARTCARD_EnableTxRxSwap() , enable USART GPIO swap into the handler instance registers.
-
HAL_SMARTCARD_DisableTxRxSwap() , disable USART GPIO swap into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledTxRxSwap() , fetch USART GPIO swap status from the handler instance registers.
-
-
Rx overrun :
-
HAL_SMARTCARD_EnableRxOverRunDetection() , enable Rx overrun errors detection into the handler instance registers.
-
HAL_SMARTCARD_DisableRxOverRunDetection() , disable Rx overrun errors detection into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledRxOverRunDetection() , fetch Rx overrun errors detection status from the handler instance registers.
-
-
DMA disable on Rx error:
-
HAL_SMARTCARD_EnableDMAStopOnRxError() , enable DMA stop on Rx error into the handler instance registers.
-
HAL_SMARTCARD_DisableDMAStopOnRxError() , disable DMA stop on Rx error into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledDMAStopOnRxError() , fetch DMA stop on Rx error status from the handler instance registers.
-
-
Timeout :
-
HAL_SMARTCARD_SetReceiverTimeout() , set the the Rx timeout value into the handler instance registers.
-
HAL_SMARTCARD_GetReceiverTimeout() , fetch the the Rx timeout value from the handler instance registers.
-
HAL_SMARTCARD_EnableReceiverTimeout() , enable Rx timeout detection into the handler instance registers.
-
HAL_SMARTCARD_DisableReceiverTimeout() , disable Rx timeout detection into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledReceiverTimeout() , fetch Rx timeout detection status from the handler instance registers.
-
-
Tx complete indication:
-
HAL_SMARTCARD_SetTxCpltIndication() , set the guard time Tx complete indication into the handler instance registers.
-
HAL_SMARTCARD_GetTxCpltIndication() , fetch the guard time Tx complete indication from the handler instance registers.
-
-
Block Length :
-
HAL_SMARTCARD_SetBlockLength() , set the the block length value into the handler instance registers.
-
HAL_SMARTCARD_GetBlockLength() , fetch the the Rx timeout value from the handler instance registers.
-
HAL_SMARTCARD_EnableEndOfBlockIT() , enable end of block interrupt into the handler instance registers.
-
HAL_SMARTCARD_DisableEndOfBlockIT() , disable end of block interrupt into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledEndOfBlockIT() , fetch end of block interrupt status from the handler instance registers.
-
Those optional parameters have the following default state :
Parameter
Default register state
IOInversion
HAL_SMARTCARD_IO_INVERT_DISABLED
DataInvert
HAL_SMARTCARD_DATA_INVERT_DISABLED
TxRxSwap
HAL_SMARTCARD_TX_RX_SWAP_DISABLED
RxOverRunDetection
HAL_SMARTCARD_OVERRUN_DETECT_ENABLED
DMAStopOnRxError
HAL_SMARTCARD_DMA_STOP_NONE
ReceiverTimeout
HAL_SMARTCARD_TIMEOUT_DISABLED
TxCpltIndication
HAL_SMARTCARD_TX_CPLT_AFTER_GUARD_TIME
BlockLength
0U
Functions
-
hal_status_t
HAL_SMARTCARD_EnableIOInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD pin active level logic inversion into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Tx inversion feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableIOInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD pin active level logic inversion into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Tx inversion feature disabled successfully
-
hal_smartcard_io_invert_status_t
HAL_SMARTCARD_IsEnabledIOInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD pin active level logic inversion status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_inversion_status_t – SMARTCARD Tx inversion feature status
-
hal_status_t
HAL_SMARTCARD_EnableDataInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable the binary Data Inversion into the handler instance registers, (1=L, 0=H).
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_status_t
HAL_SMARTCARD_DisableDataInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable the binary Data Inversion into the handler instance registers (1=H, 0=L).
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_smartcard_data_invert_status_t
HAL_SMARTCARD_IsEnabledDataInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Return the binary Data Inversion status according to the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
hal_smartcard_data_invert_status_t – Current Data Inversion status.
-
hal_status_t
HAL_SMARTCARD_EnableTxRxSwap
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable the Swap between Tx and Rx Pin into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_status_t
HAL_SMARTCARD_DisableTxRxSwap
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable the Swap between Tx and Rx Pin into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_smartcard_tx_rx_swap_status_t
HAL_SMARTCARD_IsEnabledTxRxSwap
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Return the Swap between Tx and Rx Pin status according to the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
hal_smartcard_tx_rx_swap_status_t – Current Tx Rx Swap status.
-
hal_status_t
HAL_SMARTCARD_EnableRxOverRunDetection
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD RxOverrun detection into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Rx overrun feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableRxOverRunDetection
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD RxOverrun detection into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Rx overrun feature disabled successfully
-
hal_smartcard_rx_overrun_detection_status_t
HAL_SMARTCARD_IsEnabledRxOverRunDetection
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD RxOverrun detection status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_rx_overrun_detection_status_t – SMARTCARD Rx overrun feature status
-
hal_status_t
HAL_SMARTCARD_EnableDMAStopOnRxError
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD DMA stop on Rx error into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – DMA stop on Rx error feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableDMAStopOnRxError
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD DMA stop on Rx error into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – DMA stop on Rx error feature disabled successfully
-
hal_smartcard_dma_stop_status_t
HAL_SMARTCARD_IsEnabledDMAStopOnRxError
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD DMA stop on Rx error status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_dma_stop_status_t – SMARTCARD DMA stop on Rx error feature status
-
hal_status_t
HAL_SMARTCARD_SetReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
timeout_etu
)
-
Set the SMARTCARD receiver timeout value passed in parameters into the handler instance registers.
Note
timeout is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
timeout_etu – SMARTCARD receiver timeout value
-
- Return values :
-
HAL_OK – SMARTCARD receiver timeout value set successfully
-
uint32_t
HAL_SMARTCARD_GetReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD receiver timeout value from the handler instance registers.
Note
timeout is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD receiver timeout value
-
hal_status_t
HAL_SMARTCARD_EnableReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD Receiver Timeout feature into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Receiver Timeout feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD Receiver Timeout feature into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Receiver Timeout feature disabled successfully
-
hal_smartcard_timeout_status_t
HAL_SMARTCARD_IsEnabledReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD Receiver Timeout feature status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_timeout_status_t – SMARTCARD Receiver Timeout feature status
-
hal_status_t
HAL_SMARTCARD_SetTxCpltIndication
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smarcard_tx_cplt_guard_time_indication_t
tx_cplt_indication
)
-
Set the SMARTCARD Pre guard time Tx complete indication passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
tx_cplt_indication – SMARTCARD Pre guard time Tx complete indication
-
- Return values :
-
HAL_OK – SMARTCARD Tx completion indication set successfully
-
hal_smarcard_tx_cplt_guard_time_indication_t
HAL_SMARTCARD_GetTxCpltIndication
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD Pre guard time Tx complete indication feature from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smarcard_tx_cplt_guard_time_indication_t – SMARTCARD Pre guard time Tx complete indication
-
hal_status_t
HAL_SMARTCARD_SetBlockLength
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
block_length_byte
)
-
Set the SMARTCARD block length for T=1 smartcard protocol passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
block_length_byte – block length
-
- Return values :
-
HAL_OK – SMARTCARD block length set successfully
-
uint32_t
HAL_SMARTCARD_GetBlockLength
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD block length for T=1 smartcard protocol from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD block length
-
hal_status_t
HAL_SMARTCARD_EnableEndOfBlockIT
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD End of block interrupt into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – End of block interrupt enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableEndOfBlockIT
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD End of block interrupt into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – End of block interrupt disabled successfully
-
hal_smartcard_end_of_block_interrupt_status_t
HAL_SMARTCARD_IsEnabledEndOfBlockIT
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD End of block interrupt status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_end_of_block_interrupt_status_t – SMARTCARD End of block interrupt status
-
- group SMARTCARD_Exported_Functions_Group4
-
This subsection provides a set of functions allowing to configure optional USARTx parameters for SMARTCARD mode:
-
Pin inversion:
-
HAL_SMARTCARD_EnableIOInvert() , enable pin active level logic inversion into the handler instance registers.
-
HAL_SMARTCARD_DisableIOInvert() , disable pin active level logic inversion into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledIOInvert() , fetch pin active level logic inversion status from the handler instance registers.
-
HAL_SMARTCARD_EnableDataInvert() , enable binary data logic inversion into the handler instance registers.
-
HAL_SMARTCARD_DisableDataInvert() , disable binary data logic inversion into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledDataInvert() , fetch binary data logic inversion status from the handler instance registers.
-
HAL_SMARTCARD_EnableTxRxSwap() , enable USART GPIO swap into the handler instance registers.
-
HAL_SMARTCARD_DisableTxRxSwap() , disable USART GPIO swap into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledTxRxSwap() , fetch USART GPIO swap status from the handler instance registers.
-
-
Rx overrun :
-
HAL_SMARTCARD_EnableRxOverRunDetection() , enable Rx overrun errors detection into the handler instance registers.
-
HAL_SMARTCARD_DisableRxOverRunDetection() , disable Rx overrun errors detection into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledRxOverRunDetection() , fetch Rx overrun errors detection status from the handler instance registers.
-
-
DMA disable on Rx error:
-
HAL_SMARTCARD_EnableDMAStopOnRxError() , enable DMA stop on Rx error into the handler instance registers.
-
HAL_SMARTCARD_DisableDMAStopOnRxError() , disable DMA stop on Rx error into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledDMAStopOnRxError() , fetch DMA stop on Rx error status from the handler instance registers.
-
-
Timeout :
-
HAL_SMARTCARD_SetReceiverTimeout() , set the the Rx timeout value into the handler instance registers.
-
HAL_SMARTCARD_GetReceiverTimeout() , fetch the the Rx timeout value from the handler instance registers.
-
HAL_SMARTCARD_EnableReceiverTimeout() , enable Rx timeout detection into the handler instance registers.
-
HAL_SMARTCARD_DisableReceiverTimeout() , disable Rx timeout detection into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledReceiverTimeout() , fetch Rx timeout detection status from the handler instance registers.
-
-
Tx complete indication:
-
HAL_SMARTCARD_SetTxCpltIndication() , set the guard time Tx complete indication into the handler instance registers.
-
HAL_SMARTCARD_GetTxCpltIndication() , fetch the guard time Tx complete indication from the handler instance registers.
-
-
Block Length :
-
HAL_SMARTCARD_SetBlockLength() , set the the block length value into the handler instance registers.
-
HAL_SMARTCARD_GetBlockLength() , fetch the the Rx timeout value from the handler instance registers.
-
HAL_SMARTCARD_EnableEndOfBlockIT() , enable end of block interrupt into the handler instance registers.
-
HAL_SMARTCARD_DisableEndOfBlockIT() , disable end of block interrupt into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledEndOfBlockIT() , fetch end of block interrupt status from the handler instance registers.
-
Those optional parameters have the following default state :
Parameter
Default register state
IOInversion
HAL_SMARTCARD_IO_INVERT_DISABLED
DataInvert
HAL_SMARTCARD_DATA_INVERT_DISABLED
TxRxSwap
HAL_SMARTCARD_TX_RX_SWAP_DISABLED
RxOverRunDetection
HAL_SMARTCARD_OVERRUN_DETECT_ENABLED
DMAStopOnRxError
HAL_SMARTCARD_DMA_STOP_NONE
ReceiverTimeout
HAL_SMARTCARD_TIMEOUT_DISABLED
TxCpltIndication
HAL_SMARTCARD_TX_CPLT_AFTER_GUARD_TIME
BlockLength
0U
Functions
-
hal_status_t
HAL_SMARTCARD_EnableIOInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD pin active level logic inversion into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Tx inversion feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableIOInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD pin active level logic inversion into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Tx inversion feature disabled successfully
-
hal_smartcard_io_invert_status_t
HAL_SMARTCARD_IsEnabledIOInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD pin active level logic inversion status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_inversion_status_t – SMARTCARD Tx inversion feature status
-
hal_status_t
HAL_SMARTCARD_EnableDataInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable the binary Data Inversion into the handler instance registers, (1=L, 0=H).
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_status_t
HAL_SMARTCARD_DisableDataInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable the binary Data Inversion into the handler instance registers (1=H, 0=L).
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_smartcard_data_invert_status_t
HAL_SMARTCARD_IsEnabledDataInvert
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Return the binary Data Inversion status according to the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
hal_smartcard_data_invert_status_t – Current Data Inversion status.
-
hal_status_t
HAL_SMARTCARD_EnableTxRxSwap
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable the Swap between Tx and Rx Pin into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_status_t
HAL_SMARTCARD_DisableTxRxSwap
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable the Swap between Tx and Rx Pin into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
HAL_OK – SMARTCARD instance has been correctly configured.
-
hal_smartcard_tx_rx_swap_status_t
HAL_SMARTCARD_IsEnabledTxRxSwap
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Return the Swap between Tx and Rx Pin status according to the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
hal_smartcard_tx_rx_swap_status_t – Current Tx Rx Swap status.
-
hal_status_t
HAL_SMARTCARD_EnableRxOverRunDetection
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD RxOverrun detection into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Rx overrun feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableRxOverRunDetection
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD RxOverrun detection into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Rx overrun feature disabled successfully
-
hal_smartcard_rx_overrun_detection_status_t
HAL_SMARTCARD_IsEnabledRxOverRunDetection
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD RxOverrun detection status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_rx_overrun_detection_status_t – SMARTCARD Rx overrun feature status
-
hal_status_t
HAL_SMARTCARD_EnableDMAStopOnRxError
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD DMA stop on Rx error into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – DMA stop on Rx error feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableDMAStopOnRxError
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD DMA stop on Rx error into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – DMA stop on Rx error feature disabled successfully
-
hal_smartcard_dma_stop_status_t
HAL_SMARTCARD_IsEnabledDMAStopOnRxError
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD DMA stop on Rx error status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_dma_stop_status_t – SMARTCARD DMA stop on Rx error feature status
-
hal_status_t
HAL_SMARTCARD_SetReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
timeout_etu
)
-
Set the SMARTCARD receiver timeout value passed in parameters into the handler instance registers.
Note
timeout is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
timeout_etu – SMARTCARD receiver timeout value
-
- Return values :
-
HAL_OK – SMARTCARD receiver timeout value set successfully
-
uint32_t
HAL_SMARTCARD_GetReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD receiver timeout value from the handler instance registers.
Note
timeout is expressed in etu (Elementary Time Unit), in SMARTCARD case etu is the baud period duration.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD receiver timeout value
-
hal_status_t
HAL_SMARTCARD_EnableReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD Receiver Timeout feature into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Receiver Timeout feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD Receiver Timeout feature into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – Receiver Timeout feature disabled successfully
-
hal_smartcard_timeout_status_t
HAL_SMARTCARD_IsEnabledReceiverTimeout
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD Receiver Timeout feature status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_timeout_status_t – SMARTCARD Receiver Timeout feature status
-
hal_status_t
HAL_SMARTCARD_SetTxCpltIndication
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smarcard_tx_cplt_guard_time_indication_t
tx_cplt_indication
)
-
Set the SMARTCARD Pre guard time Tx complete indication passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
tx_cplt_indication – SMARTCARD Pre guard time Tx complete indication
-
- Return values :
-
HAL_OK – SMARTCARD Tx completion indication set successfully
-
hal_smarcard_tx_cplt_guard_time_indication_t
HAL_SMARTCARD_GetTxCpltIndication
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD Pre guard time Tx complete indication feature from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smarcard_tx_cplt_guard_time_indication_t – SMARTCARD Pre guard time Tx complete indication
-
hal_status_t
HAL_SMARTCARD_SetBlockLength
(
const
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
block_length_byte
)
-
Set the SMARTCARD block length for T=1 smartcard protocol passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
block_length_byte – block length
-
- Return values :
-
HAL_OK – SMARTCARD block length set successfully
-
uint32_t
HAL_SMARTCARD_GetBlockLength
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD block length for T=1 smartcard protocol from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
uint32_t – SMARTCARD block length
-
hal_status_t
HAL_SMARTCARD_EnableEndOfBlockIT
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD End of block interrupt into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – End of block interrupt enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableEndOfBlockIT
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD End of block interrupt into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – End of block interrupt disabled successfully
-
hal_smartcard_end_of_block_interrupt_status_t
HAL_SMARTCARD_IsEnabledEndOfBlockIT
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD End of block interrupt status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_end_of_block_interrupt_status_t – SMARTCARD End of block interrupt status
-
FIFO config functions ¶
- group SMARTCARD_Exported_Functions_Group5
-
This subsection provides a set of functions allowing to use the fifo mode feature for the USARTx instance. Prior to use the fifo mode feature, one has to configure one’s instance with HAL_SMARTCARD_SetConfig() . A set of functions is provided to use the fifo mode feature:
-
HAL_SMARTCARD_EnableFifoMode() , enable fifo into the handler instance registers.
-
HAL_SMARTCARD_DisableFifoMode() , disable fifo into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledFifoMode() , fetch fifo status from the handler instance registers.
-
HAL_SMARTCARD_SetTxFifoThreshold() , set the the Tx fifo threshold value into the handler instance registers.
-
HAL_SMARTCARD_GetTxFifoThreshold() , fetch the the Tx fifo threshold value from the handler instance registers.
-
HAL_SMARTCARD_SetRxFifoThreshold() , set the the Rx fifo threshold value into the handler instance registers.
-
HAL_SMARTCARD_GetRxFifoThreshold() , fetch the Rx fifo threshold value from the handler instance registers.
The feature has been designed to be used following the procedure:
-
Start process, i.e: HAL_SMARTCARD_Receive()
Functions
-
hal_status_t
HAL_SMARTCARD_EnableFifoMode
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Enable SMARTCARD FIFO mode into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – FIFO feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableFifoMode
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Disable SMARTCARD FIFO mode into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – FIFO feature disabled successfully
-
hal_smartcard_fifo_mode_status_t
HAL_SMARTCARD_IsEnabledFifoMode
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD FIFO status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_fifo_mode_status_t – SMARTCARD FIFO feature status
-
hal_status_t
HAL_SMARTCARD_SetTxFifoThreshold
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smartcard_fifo_threshold_t
tx_fifo_threshold
)
¶
-
Set the SMARTCARD Tx FIFO threshold value passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
tx_fifo_threshold – SMARTCARD Tx FIFO threshold value
-
- Return values :
-
HAL_OK – SMARTCARD Tx FIFO threshold value set successfully
-
hal_smartcard_fifo_threshold_t
HAL_SMARTCARD_GetTxFifoThreshold
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD Tx FIFO threshold value from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_fifo_threshold_t – SMARTCARD Tx FIFO threshold value
-
hal_status_t
HAL_SMARTCARD_SetRxFifoThreshold
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smartcard_fifo_threshold_t
rx_fifo_threshold
)
¶
-
Set the SMARTCARD Rx FIFO threshold value passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
rx_fifo_threshold – SMARTCARD Rx FIFO threshold value
-
- Return values :
-
HAL_OK – SMARTCARD Rx FIFO threshold value set successfully
-
hal_smartcard_fifo_threshold_t
HAL_SMARTCARD_GetRxFifoThreshold
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Get the SMARTCARD Rx FIFO threshold value from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_fifo_threshold_t – SMARTCARD Rx FIFO threshold
-
- group SMARTCARD_Exported_Functions_Group5
-
This subsection provides a set of functions allowing to use the fifo mode feature for the USARTx instance. Prior to use the fifo mode feature, one has to configure one’s instance with HAL_SMARTCARD_SetConfig() . A set of functions is provided to use the fifo mode feature:
-
HAL_SMARTCARD_EnableFifoMode() , enable fifo into the handler instance registers.
-
HAL_SMARTCARD_DisableFifoMode() , disable fifo into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledFifoMode() , fetch fifo status from the handler instance registers.
-
HAL_SMARTCARD_SetTxFifoThreshold() , set the the Tx fifo threshold value into the handler instance registers.
-
HAL_SMARTCARD_GetTxFifoThreshold() , fetch the the Tx fifo threshold value from the handler instance registers.
-
HAL_SMARTCARD_SetRxFifoThreshold() , set the the Rx fifo threshold value into the handler instance registers.
-
HAL_SMARTCARD_GetRxFifoThreshold() , fetch the Rx fifo threshold value from the handler instance registers.
The feature has been designed to be used following the procedure:
-
Start process, i.e: HAL_SMARTCARD_Receive()
Functions
-
hal_status_t
HAL_SMARTCARD_EnableFifoMode
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD FIFO mode into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – FIFO feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableFifoMode
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD FIFO mode into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – FIFO feature disabled successfully
-
hal_smartcard_fifo_mode_status_t
HAL_SMARTCARD_IsEnabledFifoMode
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD FIFO status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_fifo_mode_status_t – SMARTCARD FIFO feature status
-
hal_status_t
HAL_SMARTCARD_SetTxFifoThreshold
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smartcard_fifo_threshold_t
tx_fifo_threshold
)
-
Set the SMARTCARD Tx FIFO threshold value passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
tx_fifo_threshold – SMARTCARD Tx FIFO threshold value
-
- Return values :
-
HAL_OK – SMARTCARD Tx FIFO threshold value set successfully
-
hal_smartcard_fifo_threshold_t
HAL_SMARTCARD_GetTxFifoThreshold
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD Tx FIFO threshold value from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_fifo_threshold_t – SMARTCARD Tx FIFO threshold value
-
hal_status_t
HAL_SMARTCARD_SetRxFifoThreshold
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smartcard_fifo_threshold_t
rx_fifo_threshold
)
-
Set the SMARTCARD Rx FIFO threshold value passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
rx_fifo_threshold – SMARTCARD Rx FIFO threshold value
-
- Return values :
-
HAL_OK – SMARTCARD Rx FIFO threshold value set successfully
-
hal_smartcard_fifo_threshold_t
HAL_SMARTCARD_GetRxFifoThreshold
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD Rx FIFO threshold value from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_fifo_threshold_t – SMARTCARD Rx FIFO threshold
-
- group SMARTCARD_Exported_Functions_Group5
-
This subsection provides a set of functions allowing to use the fifo mode feature for the USARTx instance. Prior to use the fifo mode feature, one has to configure one’s instance with HAL_SMARTCARD_SetConfig() . A set of functions is provided to use the fifo mode feature:
-
HAL_SMARTCARD_EnableFifoMode() , enable fifo into the handler instance registers.
-
HAL_SMARTCARD_DisableFifoMode() , disable fifo into the handler instance registers.
-
HAL_SMARTCARD_IsEnabledFifoMode() , fetch fifo status from the handler instance registers.
-
HAL_SMARTCARD_SetTxFifoThreshold() , set the the Tx fifo threshold value into the handler instance registers.
-
HAL_SMARTCARD_GetTxFifoThreshold() , fetch the the Tx fifo threshold value from the handler instance registers.
-
HAL_SMARTCARD_SetRxFifoThreshold() , set the the Rx fifo threshold value into the handler instance registers.
-
HAL_SMARTCARD_GetRxFifoThreshold() , fetch the Rx fifo threshold value from the handler instance registers.
The feature has been designed to be used following the procedure:
-
Start process, i.e: HAL_SMARTCARD_Receive()
Functions
-
hal_status_t
HAL_SMARTCARD_EnableFifoMode
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Enable SMARTCARD FIFO mode into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – FIFO feature enabled successfully
-
hal_status_t
HAL_SMARTCARD_DisableFifoMode
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Disable SMARTCARD FIFO mode into the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
HAL_OK – FIFO feature disabled successfully
-
hal_smartcard_fifo_mode_status_t
HAL_SMARTCARD_IsEnabledFifoMode
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD FIFO status from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_fifo_mode_status_t – SMARTCARD FIFO feature status
-
hal_status_t
HAL_SMARTCARD_SetTxFifoThreshold
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smartcard_fifo_threshold_t
tx_fifo_threshold
)
-
Set the SMARTCARD Tx FIFO threshold value passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
tx_fifo_threshold – SMARTCARD Tx FIFO threshold value
-
- Return values :
-
HAL_OK – SMARTCARD Tx FIFO threshold value set successfully
-
hal_smartcard_fifo_threshold_t
HAL_SMARTCARD_GetTxFifoThreshold
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD Tx FIFO threshold value from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_fifo_threshold_t – SMARTCARD Tx FIFO threshold value
-
hal_status_t
HAL_SMARTCARD_SetRxFifoThreshold
(
hal_smartcard_handle_t
*
hsmartcard
,
const
hal_smartcard_fifo_threshold_t
rx_fifo_threshold
)
-
Set the SMARTCARD Rx FIFO threshold value passed in parameters into the handler instance registers.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
rx_fifo_threshold – SMARTCARD Rx FIFO threshold value
-
- Return values :
-
HAL_OK – SMARTCARD Rx FIFO threshold value set successfully
-
hal_smartcard_fifo_threshold_t
HAL_SMARTCARD_GetRxFifoThreshold
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Get the SMARTCARD Rx FIFO threshold value from the handler instance registers.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t
- Return values :
-
hal_smartcard_fifo_threshold_t – SMARTCARD Rx FIFO threshold
-
IO operation functions ¶
- group SMARTCARD_Exported_Functions_Group6
-
This subsection provides a set of functions allowing to manage the SMARTCARD data transfers.
There are two modes of transfer:
-
Blocking mode: The communication is performed in polling mode. The HAL status of all data processing is returned by the same function after finishing transfer.
-
Non-Blocking mode: The communication is performed using Interrupts or DMA, These API’s return the HAL status. The end of the data processing will be indicated through the dedicated SMARTCARD IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. The HAL_SMARTCARD_TxCpltCallback() , HAL_SMARTCARD_RxCpltCallback() user callbacks will be executed respectively at the end of the Transmit or Receive process The HAL_SMARTCARD_ErrorCallback() user callback will be executed when a communication error is detected.
Polling APIs:
-
HAL_SMARTCARD_Transmit() , transmit an amount of data in blocking mode.
-
HAL_SMARTCARD_Receive() , receive an amount of data in blocking mode.
-
HAL_SMARTCARD_Abort() , abort data transfer.
IT APIs:
-
HAL_SMARTCARD_Transmit_IT() , transmit an amount of data in interrupt mode.
-
HAL_SMARTCARD_Transmit_IT_Opt() , transmit an amount of data in interrupt mode, enabling given optional interrupts.
-
HAL_SMARTCARD_Receive_IT() , receive an amount of data in interrupt mode.
-
HAL_SMARTCARD_Receive_IT_Opt() , receive an amount of data in interrupt mode, enabling given optional interrupts.
-
HAL_SMARTCARD_Abort_IT() , abort data transfer and call HAL_SMARTCARD_AbortCpltCallback() .
DMA APIs:
-
HAL_SMARTCARD_Transmit_DMA() , transmit an amount of data in DMA mode.
-
HAL_SMARTCARD_Transmit_DMA_Opt() , transmit an amount of data in DMA mode, enabling given optional interrupts.
-
HAL_SMARTCARD_Receive_DMA() , receive an amount of data in DMA mode.
-
HAL_SMARTCARD_Receive_DMA_Opt() , receive an amount of data in DMA mode, enabling given optional interrupts.
Functions
-
hal_status_t
HAL_SMARTCARD_Transmit
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
timeout_ms
)
¶
-
Send an amount of data in blocking mode.
Note
When FIFO mode is enabled, writing a data in the TDR register adds one data to the TXFIFO. Write operations to the TDR register are performed when TXFNF flag is set. From hardware perspective, TXFNF flag and TXE are mapped on the same bit-field.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be sent.
-
timeout_ms – Timeout duration.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_TIMEOUT – Transfer timeout
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
timeout_ms
)
¶
-
Receive an amount of data in blocking mode.
Note
When FIFO mode is enabled, the RXFNE flag is set as long as the RXFIFO is not empty. Read operations from the RDR register are performed when RXFNE flag is set. From hardware perspective, RXFNE flag and RXNE are mapped on the same bit-field.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
timeout_ms – Timeout duration.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_TIMEOUT – Transfer timeout
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_IT
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
)
¶
-
Send an amount of data in interrupt mode.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_TDR register is empty, i.e one interrupt per data to transmit.
Note
When FIFO mode is enabled, USART interrupt is generated whenever TXFIFO threshold reached. In that case the interrupt rate depends on TXFIFO threshold configuration.
Note
This function sets the hsmartcard->TxIsr function pointer according to the FIFO mode (data transmission processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be sent.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_IT_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
¶
-
Send an amount of data in interrupt mode, allow user to enable Optional Interrupts part of SMARTCARD optional TX IT interrupts.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_TDR register is empty, i.e one interrupt per data to transmit.
Note
When FIFO mode is enabled, USART interrupt is generated whenever TXFIFO threshold reached. In that case the interrupt rate depends on TXFIFO threshold configuration.
Note
This function sets the hsmartcard->TxIsr function pointer according to the FIFO mode (data transmission processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – Pointer to data buffer.
-
size_byte – Amount of data to be sent.
-
interrupts – Optional interrupts part of SMARTCARD optional TX IT interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_IT
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
)
¶
-
Receive an amount of data in interrupt mode.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_RDR register can be read, i.e one interrupt per data to receive.
Note
When FIFO mode is enabled, USART interrupt is generated whenever RXFIFO threshold reached. In that case the interrupt rate depends on RXFIFO threshold configuration.
Note
This function sets the hsmartcard->RxIsr function pointer according to the FIFO mode (data reception processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_IT_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
¶
-
Receive an amount of data in interrupt mode, allow user to enable Optional Interrupts part of SMARTCARD Optional RX IT interrupts.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_RDR register can be read, i.e one interrupt per data to receive.
Note
When FIFO mode is enabled, USART interrupt is generated whenever RXFIFO threshold reached. In that case the interrupt rate depends on RXFIFO threshold configuration.
Note
This function sets the hsmartcard->RxIsr function pointer according to the FIFO mode (data reception processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
interrupts – Optional interrupts part of SMARTCARD Optional RX IT interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_DMA
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
)
¶
-
Send an amount of data in DMA mode.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be sent.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_DMA_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
¶
-
Send an amount of data in DMA mode, allow user to enable Optional Interrupts part of SMARTCARD Optional TX DMA interrupts.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – Pointer to data buffer.
-
size_byte – Amount of data to be sent.
-
interrupts – Optional interrupts part of SMARTCARD Optional TX DMA interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_DMA
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
)
¶
-
Receive an amount of data in DMA mode.
Note
The SMARTCARD-associated USART parity is enabled (PCE = 1), the received data contain the parity bit (MSB position).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_DMA_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
¶
-
Receive an amount of data in DMA mode, allow user to enable Optional Interrupts part of SMARTCARD Optional RX DMA interrupts.
Note
The SMARTCARD-associated USART parity is enabled (PCE = 1), the received data contain the parity bit (MSB position).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – Pointer to data buffer.
-
size_byte – Amount of data to be received.
-
interrupts – Optional interrupts part of SMARTCARD Optional RX DMA interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Abort
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Abort ongoing transfers either Tx or Rx (blocking mode).
Note
This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
-
Disable SMARTCARD Interrupts (Tx and Rx)
-
Disable the DMA transfer in the peripheral register (if enabled)
-
Abort DMA transfer by calling HAL_DMA_Abort (in case of transfer in DMA mode)
-
Set handle State to HAL_SMARTCARD_STATE_IDLE
Note
This procedure is executed in blocking mode : when exiting function, Abort is considered as completed.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
- Return values :
-
-
HAL_OK – Operation successfully aborted
-
HAL_TIMEOUT – Abort timeout
-
-
-
hal_status_t
HAL_SMARTCARD_Abort_IT
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Abort ongoing transfers either Tx or Rx (Interrupt mode).
Note
This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
-
Disable SMARTCARD Interrupts (Tx and Rx)
-
Disable the DMA transfer in the peripheral register (if enabled)
-
Abort DMA transfer by calling HAL_DMA_Abort_IT (in case of transfer in DMA mode)
-
Set handle State to HAL_SMARTCARD_STATE_IDLE
-
At abort completion, call user abort complete callback
Note
This procedure is executed in Interrupt mode, meaning that abort procedure could be considered as completed only when user abort complete callback is executed (not when exiting function).
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
- Return values :
-
HAL_OK – Operation successfully aborted
-
-
- group SMARTCARD_Exported_Functions_Group6
-
This subsection provides a set of functions allowing to manage the SMARTCARD data transfers.
There are two modes of transfer:
-
Blocking mode: The communication is performed in polling mode. The HAL status of all data processing is returned by the same function after finishing transfer.
-
Non-Blocking mode: The communication is performed using Interrupts or DMA, These API’s return the HAL status. The end of the data processing will be indicated through the dedicated SMARTCARD IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. The HAL_SMARTCARD_TxCpltCallback() , HAL_SMARTCARD_RxCpltCallback() user callbacks will be executed respectively at the end of the Transmit or Receive process The HAL_SMARTCARD_ErrorCallback() user callback will be executed when a communication error is detected.
Polling APIs:
-
HAL_SMARTCARD_Transmit() , transmit an amount of data in blocking mode.
-
HAL_SMARTCARD_Receive() , receive an amount of data in blocking mode.
-
HAL_SMARTCARD_Abort() , abort data transfer.
IT APIs:
-
HAL_SMARTCARD_Transmit_IT() , transmit an amount of data in interrupt mode.
-
HAL_SMARTCARD_Transmit_IT_Opt() , transmit an amount of data in interrupt mode, enabling given optional interrupts.
-
HAL_SMARTCARD_Receive_IT() , receive an amount of data in interrupt mode.
-
HAL_SMARTCARD_Receive_IT_Opt() , receive an amount of data in interrupt mode, enabling given optional interrupts.
-
HAL_SMARTCARD_Abort_IT() , abort data transfer and call HAL_SMARTCARD_AbortCpltCallback() .
DMA APIs:
-
HAL_SMARTCARD_Transmit_DMA() , transmit an amount of data in DMA mode.
-
HAL_SMARTCARD_Transmit_DMA_Opt() , transmit an amount of data in DMA mode, enabling given optional interrupts.
-
HAL_SMARTCARD_Receive_DMA() , receive an amount of data in DMA mode.
-
HAL_SMARTCARD_Receive_DMA_Opt() , receive an amount of data in DMA mode, enabling given optional interrupts.
Functions
-
hal_status_t
HAL_SMARTCARD_Transmit
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
timeout_ms
)
-
Send an amount of data in blocking mode.
Note
When FIFO mode is enabled, writing a data in the TDR register adds one data to the TXFIFO. Write operations to the TDR register are performed when TXFNF flag is set. From hardware perspective, TXFNF flag and TXE are mapped on the same bit-field.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be sent.
-
timeout_ms – Timeout duration.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_TIMEOUT – Transfer timeout
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
timeout_ms
)
-
Receive an amount of data in blocking mode.
Note
When FIFO mode is enabled, the RXFNE flag is set as long as the RXFIFO is not empty. Read operations from the RDR register are performed when RXFNE flag is set. From hardware perspective, RXFNE flag and RXNE are mapped on the same bit-field.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
timeout_ms – Timeout duration.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_TIMEOUT – Transfer timeout
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_IT
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
)
-
Send an amount of data in interrupt mode.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_TDR register is empty, i.e one interrupt per data to transmit.
Note
When FIFO mode is enabled, USART interrupt is generated whenever TXFIFO threshold reached. In that case the interrupt rate depends on TXFIFO threshold configuration.
Note
This function sets the hsmartcard->TxIsr function pointer according to the FIFO mode (data transmission processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be sent.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_IT_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
-
Send an amount of data in interrupt mode, allow user to enable Optional Interrupts part of SMARTCARD optional TX IT interrupts.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_TDR register is empty, i.e one interrupt per data to transmit.
Note
When FIFO mode is enabled, USART interrupt is generated whenever TXFIFO threshold reached. In that case the interrupt rate depends on TXFIFO threshold configuration.
Note
This function sets the hsmartcard->TxIsr function pointer according to the FIFO mode (data transmission processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – Pointer to data buffer.
-
size_byte – Amount of data to be sent.
-
interrupts – Optional interrupts part of SMARTCARD optional TX IT interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_IT
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
)
-
Receive an amount of data in interrupt mode.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_RDR register can be read, i.e one interrupt per data to receive.
Note
When FIFO mode is enabled, USART interrupt is generated whenever RXFIFO threshold reached. In that case the interrupt rate depends on RXFIFO threshold configuration.
Note
This function sets the hsmartcard->RxIsr function pointer according to the FIFO mode (data reception processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_IT_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
-
Receive an amount of data in interrupt mode, allow user to enable Optional Interrupts part of SMARTCARD Optional RX IT interrupts.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_RDR register can be read, i.e one interrupt per data to receive.
Note
When FIFO mode is enabled, USART interrupt is generated whenever RXFIFO threshold reached. In that case the interrupt rate depends on RXFIFO threshold configuration.
Note
This function sets the hsmartcard->RxIsr function pointer according to the FIFO mode (data reception processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
interrupts – Optional interrupts part of SMARTCARD Optional RX IT interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_DMA
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
)
-
Send an amount of data in DMA mode.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be sent.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_DMA_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
-
Send an amount of data in DMA mode, allow user to enable Optional Interrupts part of SMARTCARD Optional TX DMA interrupts.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – Pointer to data buffer.
-
size_byte – Amount of data to be sent.
-
interrupts – Optional interrupts part of SMARTCARD Optional TX DMA interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_DMA
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
)
-
Receive an amount of data in DMA mode.
Note
The SMARTCARD-associated USART parity is enabled (PCE = 1), the received data contain the parity bit (MSB position).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_DMA_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
-
Receive an amount of data in DMA mode, allow user to enable Optional Interrupts part of SMARTCARD Optional RX DMA interrupts.
Note
The SMARTCARD-associated USART parity is enabled (PCE = 1), the received data contain the parity bit (MSB position).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – Pointer to data buffer.
-
size_byte – Amount of data to be received.
-
interrupts – Optional interrupts part of SMARTCARD Optional RX DMA interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Abort
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Abort ongoing transfers either Tx or Rx (blocking mode).
Note
This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
-
Disable SMARTCARD Interrupts (Tx and Rx)
-
Disable the DMA transfer in the peripheral register (if enabled)
-
Abort DMA transfer by calling HAL_DMA_Abort (in case of transfer in DMA mode)
-
Set handle State to HAL_SMARTCARD_STATE_IDLE
Note
This procedure is executed in blocking mode : when exiting function, Abort is considered as completed.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
- Return values :
-
-
HAL_OK – Operation successfully aborted
-
HAL_TIMEOUT – Abort timeout
-
-
-
hal_status_t
HAL_SMARTCARD_Abort_IT
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Abort ongoing transfers either Tx or Rx (Interrupt mode).
Note
This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
-
Disable SMARTCARD Interrupts (Tx and Rx)
-
Disable the DMA transfer in the peripheral register (if enabled)
-
Abort DMA transfer by calling HAL_DMA_Abort_IT (in case of transfer in DMA mode)
-
Set handle State to HAL_SMARTCARD_STATE_IDLE
-
At abort completion, call user abort complete callback
Note
This procedure is executed in Interrupt mode, meaning that abort procedure could be considered as completed only when user abort complete callback is executed (not when exiting function).
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
- Return values :
-
HAL_OK – Operation successfully aborted
-
-
- group SMARTCARD_Exported_Functions_Group6
-
This subsection provides a set of functions allowing to manage the SMARTCARD data transfers.
There are two modes of transfer:
-
Blocking mode: The communication is performed in polling mode. The HAL status of all data processing is returned by the same function after finishing transfer.
-
Non-Blocking mode: The communication is performed using Interrupts or DMA, These API’s return the HAL status. The end of the data processing will be indicated through the dedicated SMARTCARD IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. The HAL_SMARTCARD_TxCpltCallback() , HAL_SMARTCARD_RxCpltCallback() user callbacks will be executed respectively at the end of the Transmit or Receive process The HAL_SMARTCARD_ErrorCallback() user callback will be executed when a communication error is detected.
Polling APIs:
-
HAL_SMARTCARD_Transmit() , transmit an amount of data in blocking mode.
-
HAL_SMARTCARD_Receive() , receive an amount of data in blocking mode.
-
HAL_SMARTCARD_Abort() , abort data transfer.
IT APIs:
-
HAL_SMARTCARD_Transmit_IT() , transmit an amount of data in interrupt mode.
-
HAL_SMARTCARD_Transmit_IT_Opt() , transmit an amount of data in interrupt mode, enabling given optional interrupts.
-
HAL_SMARTCARD_Receive_IT() , receive an amount of data in interrupt mode.
-
HAL_SMARTCARD_Receive_IT_Opt() , receive an amount of data in interrupt mode, enabling given optional interrupts.
-
HAL_SMARTCARD_Abort_IT() , abort data transfer and call HAL_SMARTCARD_AbortCpltCallback() .
DMA APIs:
-
HAL_SMARTCARD_Transmit_DMA() , transmit an amount of data in DMA mode.
-
HAL_SMARTCARD_Transmit_DMA_Opt() , transmit an amount of data in DMA mode, enabling given optional interrupts.
-
HAL_SMARTCARD_Receive_DMA() , receive an amount of data in DMA mode.
-
HAL_SMARTCARD_Receive_DMA_Opt() , receive an amount of data in DMA mode, enabling given optional interrupts.
Functions
-
hal_status_t
HAL_SMARTCARD_Transmit
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
timeout_ms
)
-
Send an amount of data in blocking mode.
Note
When FIFO mode is enabled, writing a data in the TDR register adds one data to the TXFIFO. Write operations to the TDR register are performed when TXFNF flag is set. From hardware perspective, TXFNF flag and TXE are mapped on the same bit-field.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be sent.
-
timeout_ms – Timeout duration.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_TIMEOUT – Transfer timeout
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
timeout_ms
)
-
Receive an amount of data in blocking mode.
Note
When FIFO mode is enabled, the RXFNE flag is set as long as the RXFIFO is not empty. Read operations from the RDR register are performed when RXFNE flag is set. From hardware perspective, RXFNE flag and RXNE are mapped on the same bit-field.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
timeout_ms – Timeout duration.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_TIMEOUT – Transfer timeout
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_IT
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
)
-
Send an amount of data in interrupt mode.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_TDR register is empty, i.e one interrupt per data to transmit.
Note
When FIFO mode is enabled, USART interrupt is generated whenever TXFIFO threshold reached. In that case the interrupt rate depends on TXFIFO threshold configuration.
Note
This function sets the hsmartcard->TxIsr function pointer according to the FIFO mode (data transmission processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be sent.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_IT_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
-
Send an amount of data in interrupt mode, allow user to enable Optional Interrupts part of SMARTCARD optional TX IT interrupts.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_TDR register is empty, i.e one interrupt per data to transmit.
Note
When FIFO mode is enabled, USART interrupt is generated whenever TXFIFO threshold reached. In that case the interrupt rate depends on TXFIFO threshold configuration.
Note
This function sets the hsmartcard->TxIsr function pointer according to the FIFO mode (data transmission processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – Pointer to data buffer.
-
size_byte – Amount of data to be sent.
-
interrupts – Optional interrupts part of SMARTCARD optional TX IT interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_IT
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
)
-
Receive an amount of data in interrupt mode.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_RDR register can be read, i.e one interrupt per data to receive.
Note
When FIFO mode is enabled, USART interrupt is generated whenever RXFIFO threshold reached. In that case the interrupt rate depends on RXFIFO threshold configuration.
Note
This function sets the hsmartcard->RxIsr function pointer according to the FIFO mode (data reception processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_IT_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
-
Receive an amount of data in interrupt mode, allow user to enable Optional Interrupts part of SMARTCARD Optional RX IT interrupts.
Note
When FIFO mode is disabled, USART interrupt is generated whenever USART_RDR register can be read, i.e one interrupt per data to receive.
Note
When FIFO mode is enabled, USART interrupt is generated whenever RXFIFO threshold reached. In that case the interrupt rate depends on RXFIFO threshold configuration.
Note
This function sets the hsmartcard->RxIsr function pointer according to the FIFO mode (data reception processing depends on FIFO mode).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
interrupts – Optional interrupts part of SMARTCARD Optional RX IT interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_BUSY – Concurrent process ongoing
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_DMA
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
)
-
Send an amount of data in DMA mode.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be sent.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Transmit_DMA_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
const
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
-
Send an amount of data in DMA mode, allow user to enable Optional Interrupts part of SMARTCARD Optional TX DMA interrupts.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – Pointer to data buffer.
-
size_byte – Amount of data to be sent.
-
interrupts – Optional interrupts part of SMARTCARD Optional TX DMA interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_DMA
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
)
-
Receive an amount of data in DMA mode.
Note
The SMARTCARD-associated USART parity is enabled (PCE = 1), the received data contain the parity bit (MSB position).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – pointer to data buffer.
-
size_byte – amount of data to be received.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Receive_DMA_Opt
(
hal_smartcard_handle_t
*
hsmartcard
,
uint8_t
*
p_data
,
uint16_t
size_byte
,
uint32_t
interrupts
)
-
Receive an amount of data in DMA mode, allow user to enable Optional Interrupts part of SMARTCARD Optional RX DMA interrupts.
Note
The SMARTCARD-associated USART parity is enabled (PCE = 1), the received data contain the parity bit (MSB position).
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
-
p_data – Pointer to data buffer.
-
size_byte – Amount of data to be received.
-
interrupts – Optional interrupts part of SMARTCARD Optional RX DMA interrupts.
-
- Return values :
-
-
HAL_OK – Operation started successfully
-
HAL_ERROR – DMA did not start successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_Abort
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Abort ongoing transfers either Tx or Rx (blocking mode).
Note
This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
-
Disable SMARTCARD Interrupts (Tx and Rx)
-
Disable the DMA transfer in the peripheral register (if enabled)
-
Abort DMA transfer by calling HAL_DMA_Abort (in case of transfer in DMA mode)
-
Set handle State to HAL_SMARTCARD_STATE_IDLE
Note
This procedure is executed in blocking mode : when exiting function, Abort is considered as completed.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
- Return values :
-
-
HAL_OK – Operation successfully aborted
-
HAL_TIMEOUT – Abort timeout
-
-
-
hal_status_t
HAL_SMARTCARD_Abort_IT
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Abort ongoing transfers either Tx or Rx (Interrupt mode).
Note
This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
-
Disable SMARTCARD Interrupts (Tx and Rx)
-
Disable the DMA transfer in the peripheral register (if enabled)
-
Abort DMA transfer by calling HAL_DMA_Abort_IT (in case of transfer in DMA mode)
-
Set handle State to HAL_SMARTCARD_STATE_IDLE
-
At abort completion, call user abort complete callback
Note
This procedure is executed in Interrupt mode, meaning that abort procedure could be considered as completed only when user abort complete callback is executed (not when exiting function).
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for the specified SMARTCARD module.
- Return values :
-
HAL_OK – Operation successfully aborted
-
-
DMA Configuration functions ¶
- group SMARTCARD_Exported_Functions_Group7
-
This subsection provides a set of functions allowing to link the HAL SMARTCARD handle to a Tx and Rx DMA handler for the USARTx instance. A set of functions is provided to use the DMA feature:
-
HAL_SMARTCARD_SetTxDMA() : Link a DMA instance to the Tx channel
-
HAL_SMARTCARD_SetRxDMA() : Link a DMA instance to the Rx channel
Functions
-
hal_status_t
HAL_SMARTCARD_SetTxDMA
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_dma_handle_t
*
hdma_tx
)
¶
-
Set DMA channel for Transmission.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
hdma_tx – Pointer to a hal_dma_handle_t structure which contains the DMA instance
-
- Return values :
-
-
HAL_OK – The channel has been correctly set.
-
HAL_INVALID_PARAM – hdma_tx is NULL.
-
-
hal_status_t
HAL_SMARTCARD_SetRxDMA
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_dma_handle_t
*
hdma_rx
)
¶
-
Set DMA channel for Reception.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
hdma_rx – Pointer to a hal_dma_handle_t structure which contains the DMA instance
-
- Return values :
-
-
HAL_OK – The channel has been correctly set.
-
HAL_INVALID_PARAM – hdma_rx is NULL.
-
-
- group SMARTCARD_Exported_Functions_Group7
-
This subsection provides a set of functions allowing to link the HAL SMARTCARD handle to a Tx and Rx DMA handler for the USARTx instance. A set of functions is provided to use the DMA feature:
-
HAL_SMARTCARD_SetTxDMA() : Link a DMA instance to the Tx channel
-
HAL_SMARTCARD_SetRxDMA() : Link a DMA instance to the Rx channel
Functions
-
hal_status_t
HAL_SMARTCARD_SetTxDMA
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_dma_handle_t
*
hdma_tx
)
-
Set DMA channel for Transmission.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
hdma_tx – Pointer to a hal_dma_handle_t structure which contains the DMA instance
-
- Return values :
-
-
HAL_OK – The channel has been correctly set.
-
HAL_INVALID_PARAM – hdma_tx is NULL.
-
-
hal_status_t
HAL_SMARTCARD_SetRxDMA
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_dma_handle_t
*
hdma_rx
)
-
Set DMA channel for Reception.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
hdma_rx – Pointer to a hal_dma_handle_t structure which contains the DMA instance
-
- Return values :
-
-
HAL_OK – The channel has been correctly set.
-
HAL_INVALID_PARAM – hdma_rx is NULL.
-
-
- group SMARTCARD_Exported_Functions_Group7
-
This subsection provides a set of functions allowing to link the HAL SMARTCARD handle to a Tx and Rx DMA handler for the USARTx instance. A set of functions is provided to use the DMA feature:
-
HAL_SMARTCARD_SetTxDMA() : Link a DMA instance to the Tx channel
-
HAL_SMARTCARD_SetRxDMA() : Link a DMA instance to the Rx channel
Functions
-
hal_status_t
HAL_SMARTCARD_SetTxDMA
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_dma_handle_t
*
hdma_tx
)
-
Set DMA channel for Transmission.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
hdma_tx – Pointer to a hal_dma_handle_t structure which contains the DMA instance
-
- Return values :
-
-
HAL_OK – The channel has been correctly set.
-
HAL_INVALID_PARAM – hdma_tx is NULL.
-
-
hal_status_t
HAL_SMARTCARD_SetRxDMA
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_dma_handle_t
*
hdma_rx
)
-
Set DMA channel for Reception.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
hdma_rx – Pointer to a hal_dma_handle_t structure which contains the DMA instance
-
- Return values :
-
-
HAL_OK – The channel has been correctly set.
-
HAL_INVALID_PARAM – hdma_rx is NULL.
-
-
Callbacks Register functions ¶
- group SMARTCARD_Exported_Functions_Group9
-
This subsection provides a set of functions allowing to configure the Callbacks for the USARTx instance. Prior to configure the Callbacks, one has to configure one’s with HAL_SMARTCARD_SetConfig() . A set of functions is provided to configure the callbacks:
-
HAL_SMARTCARD_RegisterTxHalfCpltCallback() : Set the Tx half complete callback
-
HAL_SMARTCARD_RegisterTxCpltCallback() : Set the Tx complete callback
-
HAL_SMARTCARD_RegisterRxHalfCpltCallback() : Set the Rx half complete callback
-
HAL_SMARTCARD_RegisterRxCpltCallback() : Set the Rx complete callback
-
HAL_SMARTCARD_RegisterErrorCallback() : Set the error callback
-
HAL_SMARTCARD_RegisterAbortCpltCallback() : Set the abort complete callback
-
HAL_SMARTCARD_RegisterRxFifoFullCallback() : Set the Rx Fifo full callback
-
HAL_SMARTCARD_RegisterTxFifoEmptyCallback() : Set the Tx Fifo empty callback
Functions
-
hal_status_t
HAL_SMARTCARD_RegisterTxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
¶
-
Register the SMARTCARD Tx Transfer completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Tx Transfer completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterTxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
¶
-
Register the SMARTCARD Tx Transfer Half completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Tx Transfer Half completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterRxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
¶
-
Register the SMARTCARD Rx Transfer completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Rx Transfer completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterRxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
¶
-
Register the SMARTCARD Rx Transfer Half completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Rx Transfer Half completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterErrorCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
¶
-
Register the SMARTCARD error callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the error callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterAbortCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
¶
-
Register the SMARTCARD abort complete callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the abort complete function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterRxFifoFullCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
¶
-
Register the SMARTCARD Rx FIFO empty callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the abort Rx FIFO empty function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterTxFifoEmptyCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
¶
-
Register the SMARTCARD Tx FIFO empty callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Tx FIFO empty function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
- group SMARTCARD_Exported_Functions_Group9
-
This subsection provides a set of functions allowing to configure the Callbacks for the USARTx instance. Prior to configure the Callbacks, one has to configure one’s with HAL_SMARTCARD_SetConfig() . A set of functions is provided to configure the callbacks:
-
HAL_SMARTCARD_RegisterTxHalfCpltCallback() : Set the Tx half complete callback
-
HAL_SMARTCARD_RegisterTxCpltCallback() : Set the Tx complete callback
-
HAL_SMARTCARD_RegisterRxHalfCpltCallback() : Set the Rx half complete callback
-
HAL_SMARTCARD_RegisterRxCpltCallback() : Set the Rx complete callback
-
HAL_SMARTCARD_RegisterErrorCallback() : Set the error callback
-
HAL_SMARTCARD_RegisterAbortCpltCallback() : Set the abort complete callback
-
HAL_SMARTCARD_RegisterRxFifoFullCallback() : Set the Rx Fifo full callback
-
HAL_SMARTCARD_RegisterTxFifoEmptyCallback() : Set the Tx Fifo empty callback
Functions
-
hal_status_t
HAL_SMARTCARD_RegisterTxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Tx Transfer completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Tx Transfer completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterTxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Tx Transfer Half completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Tx Transfer Half completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterRxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Rx Transfer completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Rx Transfer completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterRxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Rx Transfer Half completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Rx Transfer Half completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterErrorCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD error callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the error callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterAbortCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD abort complete callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the abort complete function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterRxFifoFullCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Rx FIFO empty callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the abort Rx FIFO empty function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterTxFifoEmptyCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Tx FIFO empty callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Tx FIFO empty function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
- group SMARTCARD_Exported_Functions_Group9
-
This subsection provides a set of functions allowing to configure the Callbacks for the USARTx instance. Prior to configure the Callbacks, one has to configure one’s with HAL_SMARTCARD_SetConfig() . A set of functions is provided to configure the callbacks:
-
HAL_SMARTCARD_RegisterTxHalfCpltCallback() : Set the Tx half complete callback
-
HAL_SMARTCARD_RegisterTxCpltCallback() : Set the Tx complete callback
-
HAL_SMARTCARD_RegisterRxHalfCpltCallback() : Set the Rx half complete callback
-
HAL_SMARTCARD_RegisterRxCpltCallback() : Set the Rx complete callback
-
HAL_SMARTCARD_RegisterErrorCallback() : Set the error callback
-
HAL_SMARTCARD_RegisterAbortCpltCallback() : Set the abort complete callback
-
HAL_SMARTCARD_RegisterRxFifoFullCallback() : Set the Rx Fifo full callback
-
HAL_SMARTCARD_RegisterTxFifoEmptyCallback() : Set the Tx Fifo empty callback
Functions
-
hal_status_t
HAL_SMARTCARD_RegisterTxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Tx Transfer completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Tx Transfer completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterTxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Tx Transfer Half completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Tx Transfer Half completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterRxCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Rx Transfer completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Rx Transfer completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterRxHalfCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Rx Transfer Half completed callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Rx Transfer Half completed callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterErrorCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD error callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the error callback function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterAbortCpltCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD abort complete callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the abort complete function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterRxFifoFullCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Rx FIFO empty callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the abort Rx FIFO empty function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
hal_status_t
HAL_SMARTCARD_RegisterTxFifoEmptyCallback
(
hal_smartcard_handle_t
*
hsmartcard
,
hal_smartcard_cb_t
p_callback
)
-
Register the SMARTCARD Tx FIFO empty callback.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t
-
p_callback – Pointer to the Tx FIFO empty function
-
- Return values :
-
-
HAL_OK – Operation completed successfully
-
HAL_INVALID_PARAM – Invalid parameter
-
-
State, Error and Clock Frequency functions ¶
- group SMARTCARD_Exported_Functions_Group10
-
This subsection provides 2 functions allowing to read peripheral state and last occurred errors.
-
HAL_SMARTCARD_GetState() API can be helpful to check in run-time the state of the SMARTCARD peripheral
-
HAL_SMARTCARD_GetLastErrorCodes() API to retrieve the error codes in case of HAL_ERROR return available under the compilation switch USE_HAL_SMARTCARD_GET_LAST_ERRORS
-
HAL_SMARTCARD_GetClockFreq() , report the SMARTCARD clock frequency from the RCC configuration.
Functions
-
hal_smartcard_state_t
HAL_SMARTCARD_GetState
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Retrieve the SMARTCARD handle state.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
- Return values :
-
hal_smartcard_state_t – SMARTCARD state
-
uint32_t
HAL_SMARTCARD_GetLastErrorCodes
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Retrieve the SMARTCARD errors codes.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
- Return values :
-
uint32_t – Returned value can be a combination of the following values:
-
uint32_t
HAL_SMARTCARD_GetClockFreq
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Report the SMARTCARD clock frequency from the RCC configuration.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the USART instance.
- Return values :
-
uint32_t – clock frequency
-
- group SMARTCARD_Exported_Functions_Group10
-
This subsection provides 2 functions allowing to read peripheral state and last occurred errors.
-
HAL_SMARTCARD_GetState() API can be helpful to check in run-time the state of the SMARTCARD peripheral
-
HAL_SMARTCARD_GetLastErrorCodes() API to retrieve the error codes in case of HAL_ERROR return available under the compilation switch USE_HAL_SMARTCARD_GET_LAST_ERRORS
-
HAL_SMARTCARD_GetClockFreq() , report the SMARTCARD clock frequency from the RCC configuration.
Functions
-
hal_smartcard_state_t
HAL_SMARTCARD_GetState
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Retrieve the SMARTCARD handle state.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
- Return values :
-
hal_smartcard_state_t – SMARTCARD state
-
uint32_t
HAL_SMARTCARD_GetLastErrorCodes
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Retrieve the SMARTCARD errors codes.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
- Return values :
-
uint32_t – Returned value can be a combination of the following values:
-
uint32_t
HAL_SMARTCARD_GetClockFreq
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Report the SMARTCARD clock frequency from the RCC configuration.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the USART instance.
- Return values :
-
uint32_t – clock frequency
-
- group SMARTCARD_Exported_Functions_Group10
-
This subsection provides 2 functions allowing to read peripheral state and last occurred errors.
-
HAL_SMARTCARD_GetState() API can be helpful to check in run-time the state of the SMARTCARD peripheral
-
HAL_SMARTCARD_GetLastErrorCodes() API to retrieve the error codes in case of HAL_ERROR return available under the compilation switch USE_HAL_SMARTCARD_GET_LAST_ERRORS
-
HAL_SMARTCARD_GetClockFreq() , report the SMARTCARD clock frequency from the RCC configuration.
Functions
-
hal_smartcard_state_t
HAL_SMARTCARD_GetState
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Retrieve the SMARTCARD handle state.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
- Return values :
-
hal_smartcard_state_t – SMARTCARD state
-
uint32_t
HAL_SMARTCARD_GetLastErrorCodes
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Retrieve the SMARTCARD errors codes.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure that contains the configuration information for SMARTCARD module.
- Return values :
-
uint32_t – Returned value can be a combination of the following values:
-
uint32_t
HAL_SMARTCARD_GetClockFreq
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Report the SMARTCARD clock frequency from the RCC configuration.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the USART instance.
- Return values :
-
uint32_t – clock frequency
-
Acquire/Release Bus functions ¶
- group SMARTCARD_Exported_Functions_Group11
-
This subsection provides functions allowing to control the bus of the USARTx instance:
-
HAL_SMARTCARD_AcquireBus() : Acquire the bus
-
HAL_SMARTCARD_ReleaseBus() : Release the bus.
For multi task application, it is strongly recommended to use the bus operation functions to avoid race concurrency.
Functions
-
hal_status_t
HAL_SMARTCARD_AcquireBus
(
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
timeout_ms
)
¶
-
Acquire the current instance bus.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
timeout_ms – Timeout in milliseconds for the Acquire to expire.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Operation completed with error.
-
-
hal_status_t
HAL_SMARTCARD_ReleaseBus
(
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Release the current instance bus.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Operation completed with error.
-
-
- group SMARTCARD_Exported_Functions_Group11
-
This subsection provides functions allowing to control the bus of the USARTx instance:
-
HAL_SMARTCARD_AcquireBus() : Acquire the bus
-
HAL_SMARTCARD_ReleaseBus() : Release the bus.
For multi task application, it is strongly recommended to use the bus operation functions to avoid race concurrency.
Functions
-
hal_status_t
HAL_SMARTCARD_AcquireBus
(
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
timeout_ms
)
-
Acquire the current instance bus.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
timeout_ms – Timeout in milliseconds for the Acquire to expire.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Operation completed with error.
-
-
hal_status_t
HAL_SMARTCARD_ReleaseBus
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Release the current instance bus.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Operation completed with error.
-
-
- group SMARTCARD_Exported_Functions_Group11
-
This subsection provides functions allowing to control the bus of the USARTx instance:
-
HAL_SMARTCARD_AcquireBus() : Acquire the bus
-
HAL_SMARTCARD_ReleaseBus() : Release the bus.
For multi task application, it is strongly recommended to use the bus operation functions to avoid race concurrency.
Functions
-
hal_status_t
HAL_SMARTCARD_AcquireBus
(
hal_smartcard_handle_t
*
hsmartcard
,
uint32_t
timeout_ms
)
-
Acquire the current instance bus.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
timeout_ms – Timeout in milliseconds for the Acquire to expire.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Operation completed with error.
-
-
hal_status_t
HAL_SMARTCARD_ReleaseBus
(
hal_smartcard_handle_t
*
hsmartcard
)
-
Release the current instance bus.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Operation completed with error.
-
-
UserData functions ¶
- group SMARTCARD_Exported_Functions_Group12
-
This subsection provides functions allowing to set user specific data to a SMARTCARDx instance:
-
HAL_SMARTCARD_SetUserData() : Set user data in handler.
-
HAL_SMARTCARD_GetUserData() : Get user data from handler.
Functions
-
void
HAL_SMARTCARD_SetUserData
(
hal_smartcard_handle_t
*
hsmartcard
,
const
void
*
p_user_data
)
¶
-
Store User Data pointer into the handle.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_SMARTCARD_GetUserData
(
const
hal_smartcard_handle_t
*
hsmartcard
)
¶
-
Retrieve User Data pointer from the handle.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
Pointer – to the user data.
-
- group SMARTCARD_Exported_Functions_Group12
-
This subsection provides functions allowing to set user specific data to a SMARTCARDx instance:
-
HAL_SMARTCARD_SetUserData() : Set user data in handler.
-
HAL_SMARTCARD_GetUserData() : Get user data from handler.
Functions
-
void
HAL_SMARTCARD_SetUserData
(
hal_smartcard_handle_t
*
hsmartcard
,
const
void
*
p_user_data
)
-
Store User Data pointer into the handle.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_SMARTCARD_GetUserData
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Retrieve User Data pointer from the handle.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
Pointer – to the user data.
-
- group SMARTCARD_Exported_Functions_Group12
-
This subsection provides functions allowing to set user specific data to a SMARTCARDx instance:
-
HAL_SMARTCARD_SetUserData() : Set user data in handler.
-
HAL_SMARTCARD_GetUserData() : Get user data from handler.
Functions
-
void
HAL_SMARTCARD_SetUserData
(
hal_smartcard_handle_t
*
hsmartcard
,
const
void
*
p_user_data
)
-
Store User Data pointer into the handle.
- Parameters :
-
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_SMARTCARD_GetUserData
(
const
hal_smartcard_handle_t
*
hsmartcard
)
-
Retrieve User Data pointer from the handle.
- Parameters :
-
hsmartcard – Pointer to a hal_smartcard_handle_t structure which contains the SMARTCARD instance.
- Return values :
-
Pointer – to the user data.
-