RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
stm32h7xx_hal_smartcard.h File Reference

Header file of SMARTCARD HAL module. More...

#include "stm32h7xx_hal_def.h"
#include "stm32h7xx_hal_smartcard_ex.h"

Go to the source code of this file.

Data Structures

struct  SMARTCARD_InitTypeDef
 SMARTCARD Init Structure definition. More...
 
struct  SMARTCARD_AdvFeatureInitTypeDef
 SMARTCARD advanced features initialization structure definition. More...
 
struct  __SMARTCARD_HandleTypeDef
 SMARTCARD handle Structure definition. More...
 

Macros

#define HAL_SMARTCARD_STATE_RESET   0x00000000U
 
#define HAL_SMARTCARD_STATE_READY   0x00000020U
 
#define HAL_SMARTCARD_STATE_BUSY   0x00000024U
 
#define HAL_SMARTCARD_STATE_BUSY_TX   0x00000021U
 
#define HAL_SMARTCARD_STATE_BUSY_RX   0x00000022U
 
#define HAL_SMARTCARD_STATE_BUSY_TX_RX   0x00000023U
 
#define HAL_SMARTCARD_STATE_TIMEOUT   0x000000A0U
 
#define HAL_SMARTCARD_STATE_ERROR   0x000000E0U
 
#define HAL_SMARTCARD_ERROR_NONE   (0x00000000U)
 
#define HAL_SMARTCARD_ERROR_PE   (0x00000001U)
 
#define HAL_SMARTCARD_ERROR_NE   (0x00000002U)
 
#define HAL_SMARTCARD_ERROR_FE   (0x00000004U)
 
#define HAL_SMARTCARD_ERROR_ORE   (0x00000008U)
 
#define HAL_SMARTCARD_ERROR_DMA   (0x00000010U)
 
#define HAL_SMARTCARD_ERROR_RTO   (0x00000020U)
 
#define SMARTCARD_WORDLENGTH_9B   USART_CR1_M0
 
#define SMARTCARD_STOPBITS_0_5   USART_CR2_STOP_0
 
#define SMARTCARD_STOPBITS_1_5   USART_CR2_STOP
 
#define SMARTCARD_PARITY_EVEN   USART_CR1_PCE
 
#define SMARTCARD_PARITY_ODD   (USART_CR1_PCE | USART_CR1_PS)
 
#define SMARTCARD_MODE_RX   USART_CR1_RE
 
#define SMARTCARD_MODE_TX   USART_CR1_TE
 
#define SMARTCARD_MODE_TX_RX   (USART_CR1_TE |USART_CR1_RE)
 
#define SMARTCARD_POLARITY_LOW   0x00000000U
 
#define SMARTCARD_POLARITY_HIGH   USART_CR2_CPOL
 
#define SMARTCARD_PHASE_1EDGE   0x00000000U
 
#define SMARTCARD_PHASE_2EDGE   USART_CR2_CPHA
 
#define SMARTCARD_LASTBIT_DISABLE   0x00000000U
 
#define SMARTCARD_LASTBIT_ENABLE   USART_CR2_LBCL
 
#define SMARTCARD_ONE_BIT_SAMPLE_DISABLE   0x00000000U
 
#define SMARTCARD_ONE_BIT_SAMPLE_ENABLE   USART_CR3_ONEBIT
 
#define SMARTCARD_NACK_DISABLE   0x00000000U
 
#define SMARTCARD_NACK_ENABLE   USART_CR3_NACK
 
#define SMARTCARD_TIMEOUT_DISABLE   0x00000000U
 
#define SMARTCARD_TIMEOUT_ENABLE   USART_CR2_RTOEN
 
#define SMARTCARD_PRESCALER_DIV1   0x00000000U
 
#define SMARTCARD_PRESCALER_DIV2   0x00000001U
 
#define SMARTCARD_PRESCALER_DIV4   0x00000002U
 
#define SMARTCARD_PRESCALER_DIV6   0x00000003U
 
#define SMARTCARD_PRESCALER_DIV8   0x00000004U
 
#define SMARTCARD_PRESCALER_DIV10   0x00000005U
 
#define SMARTCARD_PRESCALER_DIV12   0x00000006U
 
#define SMARTCARD_PRESCALER_DIV16   0x00000007U
 
#define SMARTCARD_PRESCALER_DIV32   0x00000008U
 
#define SMARTCARD_PRESCALER_DIV64   0x00000009U
 
#define SMARTCARD_PRESCALER_DIV128   0x0000000AU
 
#define SMARTCARD_PRESCALER_DIV256   0x0000000BU
 
#define SMARTCARD_ADVFEATURE_TXINV_DISABLE   0x00000000U
 
#define SMARTCARD_ADVFEATURE_TXINV_ENABLE   USART_CR2_TXINV
 
#define SMARTCARD_ADVFEATURE_RXINV_DISABLE   0x00000000U
 
#define SMARTCARD_ADVFEATURE_RXINV_ENABLE   USART_CR2_RXINV
 
#define SMARTCARD_ADVFEATURE_DATAINV_DISABLE   0x00000000U
 
#define SMARTCARD_ADVFEATURE_DATAINV_ENABLE   USART_CR2_DATAINV
 
#define SMARTCARD_ADVFEATURE_SWAP_DISABLE   0x00000000U
 
#define SMARTCARD_ADVFEATURE_SWAP_ENABLE   USART_CR2_SWAP
 
#define SMARTCARD_ADVFEATURE_OVERRUN_ENABLE   0x00000000U
 
#define SMARTCARD_ADVFEATURE_OVERRUN_DISABLE   USART_CR3_OVRDIS
 
#define SMARTCARD_ADVFEATURE_DMA_ENABLEONRXERROR   0x00000000U
 
#define SMARTCARD_ADVFEATURE_DMA_DISABLEONRXERROR   USART_CR3_DDRE
 
#define SMARTCARD_ADVFEATURE_MSBFIRST_DISABLE   0x00000000U
 
#define SMARTCARD_ADVFEATURE_MSBFIRST_ENABLE   USART_CR2_MSBFIRST
 
#define SMARTCARD_RXDATA_FLUSH_REQUEST   USART_RQR_RXFRQ
 
#define SMARTCARD_TXDATA_FLUSH_REQUEST   USART_RQR_TXFRQ
 
#define SMARTCARD_IT_MASK   0x001FU
 
#define SMARTCARD_CR_MASK   0x00E0U
 
#define SMARTCARD_CR_POS   5U
 
#define SMARTCARD_ISR_MASK   0x1F00U
 
#define SMARTCARD_ISR_POS   8U
 
#define __HAL_SMARTCARD_RESET_HANDLE_STATE(__HANDLE__)
 Reset SMARTCARD handle states.
 
#define __HAL_SMARTCARD_FLUSH_DRREGISTER(__HANDLE__)
 Flush the Smartcard Data registers.
 
#define __HAL_SMARTCARD_CLEAR_FLAG(__HANDLE__, __FLAG__)   ((__HANDLE__)->Instance->ICR = (__FLAG__))
 Clear the specified SMARTCARD pending flag.
 
#define __HAL_SMARTCARD_CLEAR_PEFLAG(__HANDLE__)   __HAL_SMARTCARD_CLEAR_FLAG((__HANDLE__), SMARTCARD_CLEAR_PEF)
 Clear the SMARTCARD PE pending flag.
 
#define __HAL_SMARTCARD_CLEAR_FEFLAG(__HANDLE__)   __HAL_SMARTCARD_CLEAR_FLAG((__HANDLE__), SMARTCARD_CLEAR_FEF)
 Clear the SMARTCARD FE pending flag.
 
#define __HAL_SMARTCARD_CLEAR_NEFLAG(__HANDLE__)   __HAL_SMARTCARD_CLEAR_FLAG((__HANDLE__), SMARTCARD_CLEAR_NEF)
 Clear the SMARTCARD NE pending flag.
 
#define __HAL_SMARTCARD_CLEAR_OREFLAG(__HANDLE__)   __HAL_SMARTCARD_CLEAR_FLAG((__HANDLE__), SMARTCARD_CLEAR_OREF)
 Clear the SMARTCARD ORE pending flag.
 
#define __HAL_SMARTCARD_CLEAR_IDLEFLAG(__HANDLE__)   __HAL_SMARTCARD_CLEAR_FLAG((__HANDLE__), SMARTCARD_CLEAR_IDLEF)
 Clear the SMARTCARD IDLE pending flag.
 
#define __HAL_SMARTCARD_GET_FLAG(__HANDLE__, __FLAG__)   (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__))
 Check whether the specified Smartcard flag is set or not.
 
#define __HAL_SMARTCARD_ENABLE_IT(__HANDLE__, __INTERRUPT__)
 Enable the specified SmartCard interrupt.
 
#define __HAL_SMARTCARD_DISABLE_IT(__HANDLE__, __INTERRUPT__)
 Disable the specified SmartCard interrupt.
 
#define __HAL_SMARTCARD_GET_IT(__HANDLE__, __INTERRUPT__)
 Check whether the specified SmartCard interrupt has occurred or not.
 
#define __HAL_SMARTCARD_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)
 Check whether the specified SmartCard interrupt source is enabled or not.
 
#define __HAL_SMARTCARD_CLEAR_IT(__HANDLE__, __IT_CLEAR__)   ((__HANDLE__)->Instance->ICR |= (uint32_t)(__IT_CLEAR__))
 Clear the specified SMARTCARD ISR flag, in setting the proper ICR register flag.
 
#define __HAL_SMARTCARD_SEND_REQ(__HANDLE__, __REQ__)   ((__HANDLE__)->Instance->RQR |= (uint16_t)(__REQ__))
 Set a specific SMARTCARD request flag.
 
#define __HAL_SMARTCARD_ONE_BIT_SAMPLE_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT)
 Enable the SMARTCARD one bit sample method.
 
#define __HAL_SMARTCARD_ONE_BIT_SAMPLE_DISABLE(__HANDLE__)
 Disable the SMARTCARD one bit sample method.
 
#define __HAL_SMARTCARD_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE)
 Enable the USART associated to the SMARTCARD Handle.
 
#define __HAL_SMARTCARD_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE)
 Disable the USART associated to the SMARTCARD Handle.
 
#define SMARTCARD_GETCLOCKSOURCE(__HANDLE__, __CLOCKSOURCE__)
 Report the SMARTCARD clock source.
 
#define IS_SMARTCARD_BAUDRATE(__BAUDRATE__)   ((__BAUDRATE__) < 6250001U)
 Check the Baud rate range.
 
#define IS_SMARTCARD_BLOCKLENGTH(__LENGTH__)   ((__LENGTH__) <= 0xFFU)
 Check the block length range.
 
#define IS_SMARTCARD_TIMEOUT_VALUE(__TIMEOUTVALUE__)   ((__TIMEOUTVALUE__) <= 0xFFFFFFU)
 Check the receiver timeout value.
 
#define IS_SMARTCARD_AUTORETRY_COUNT(__COUNT__)   ((__COUNT__) <= 0x7U)
 Check the SMARTCARD autoretry counter value.
 
#define IS_SMARTCARD_WORD_LENGTH(__LENGTH__)   ((__LENGTH__) == SMARTCARD_WORDLENGTH_9B)
 Ensure that SMARTCARD frame length is valid.
 
#define IS_SMARTCARD_STOPBITS(__STOPBITS__)
 Ensure that SMARTCARD frame number of stop bits is valid.
 
#define IS_SMARTCARD_PARITY(__PARITY__)
 Ensure that SMARTCARD frame parity is valid.
 
#define IS_SMARTCARD_MODE(__MODE__)   ((((__MODE__) & 0xFFF3U) == 0x00U) && ((__MODE__) != 0x00U))
 Ensure that SMARTCARD communication mode is valid.
 
#define IS_SMARTCARD_POLARITY(__CPOL__)
 Ensure that SMARTCARD frame polarity is valid.
 
#define IS_SMARTCARD_PHASE(__CPHA__)   (((__CPHA__) == SMARTCARD_PHASE_1EDGE) || ((__CPHA__) == SMARTCARD_PHASE_2EDGE))
 Ensure that SMARTCARD frame phase is valid.
 
#define IS_SMARTCARD_LASTBIT(__LASTBIT__)
 Ensure that SMARTCARD frame last bit clock pulse setting is valid.
 
#define IS_SMARTCARD_ONE_BIT_SAMPLE(__ONEBIT__)
 Ensure that SMARTCARD frame sampling is valid.
 
#define IS_SMARTCARD_NACK(__NACK__)
 Ensure that SMARTCARD NACK transmission setting is valid.
 
#define IS_SMARTCARD_TIMEOUT(__TIMEOUT__)
 Ensure that SMARTCARD receiver timeout setting is valid.
 
#define IS_SMARTCARD_CLOCKPRESCALER(__CLOCKPRESCALER__)
 Ensure that SMARTCARD clock Prescaler is valid.
 
#define IS_SMARTCARD_ADVFEATURE_INIT(__INIT__)
 Ensure that SMARTCARD advanced features initialization is valid.
 
#define IS_SMARTCARD_ADVFEATURE_TXINV(__TXINV__)
 Ensure that SMARTCARD frame TX inversion setting is valid.
 
#define IS_SMARTCARD_ADVFEATURE_RXINV(__RXINV__)
 Ensure that SMARTCARD frame RX inversion setting is valid.
 
#define IS_SMARTCARD_ADVFEATURE_DATAINV(__DATAINV__)
 Ensure that SMARTCARD frame data inversion setting is valid.
 
#define IS_SMARTCARD_ADVFEATURE_SWAP(__SWAP__)
 Ensure that SMARTCARD frame RX/TX pins swap setting is valid.
 
#define IS_SMARTCARD_OVERRUN(__OVERRUN__)
 Ensure that SMARTCARD frame overrun setting is valid.
 
#define IS_SMARTCARD_ADVFEATURE_DMAONRXERROR(__DMA__)
 Ensure that SMARTCARD DMA enabling or disabling on error setting is valid.
 
#define IS_SMARTCARD_ADVFEATURE_MSBFIRST(__MSBFIRST__)
 Ensure that SMARTCARD frame MSB first setting is valid.
 
#define IS_SMARTCARD_REQUEST_PARAMETER(__PARAM__)
 Ensure that SMARTCARD request parameter is valid.
 

Typedefs

typedef uint32_t HAL_SMARTCARD_StateTypeDef
 HAL SMARTCARD State definition.
 
typedef struct __SMARTCARD_HandleTypeDef SMARTCARD_HandleTypeDef
 SMARTCARD handle Structure definition.
 

Enumerations

enum  SMARTCARD_ClockSourceTypeDef {
  SMARTCARD_CLOCKSOURCE_D2PCLK1 = 0x00U , SMARTCARD_CLOCKSOURCE_D2PCLK2 = 0x01U , SMARTCARD_CLOCKSOURCE_HSI = 0x04U , SMARTCARD_CLOCKSOURCE_CSI = 0x08U ,
  SMARTCARD_CLOCKSOURCE_LSE = 0x20U , SMARTCARD_CLOCKSOURCE_PLL2Q = 0x40U , SMARTCARD_CLOCKSOURCE_PLL3Q = 0x80U , SMARTCARD_CLOCKSOURCE_UNDEFINED = 0x10U
}
 SMARTCARD clock sources. More...
 

Functions

HAL_StatusTypeDef HAL_SMARTCARD_Init (SMARTCARD_HandleTypeDef *hsmartcard)
 
HAL_StatusTypeDef HAL_SMARTCARD_DeInit (SMARTCARD_HandleTypeDef *hsmartcard)
 
void HAL_SMARTCARD_MspInit (SMARTCARD_HandleTypeDef *hsmartcard)
 
void HAL_SMARTCARD_MspDeInit (SMARTCARD_HandleTypeDef *hsmartcard)
 
HAL_StatusTypeDef HAL_SMARTCARD_Transmit (SMARTCARD_HandleTypeDef *hsmartcard, const uint8_t *pData, uint16_t Size, uint32_t Timeout)
 
HAL_StatusTypeDef HAL_SMARTCARD_Receive (SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size, uint32_t Timeout)
 
HAL_StatusTypeDef HAL_SMARTCARD_Transmit_IT (SMARTCARD_HandleTypeDef *hsmartcard, const uint8_t *pData, uint16_t Size)
 
HAL_StatusTypeDef HAL_SMARTCARD_Receive_IT (SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size)
 
HAL_StatusTypeDef HAL_SMARTCARD_Transmit_DMA (SMARTCARD_HandleTypeDef *hsmartcard, const uint8_t *pData, uint16_t Size)
 
HAL_StatusTypeDef HAL_SMARTCARD_Receive_DMA (SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size)
 
HAL_StatusTypeDef HAL_SMARTCARD_Abort (SMARTCARD_HandleTypeDef *hsmartcard)
 
HAL_StatusTypeDef HAL_SMARTCARD_AbortTransmit (SMARTCARD_HandleTypeDef *hsmartcard)
 
HAL_StatusTypeDef HAL_SMARTCARD_AbortReceive (SMARTCARD_HandleTypeDef *hsmartcard)
 
HAL_StatusTypeDef HAL_SMARTCARD_Abort_IT (SMARTCARD_HandleTypeDef *hsmartcard)
 
HAL_StatusTypeDef HAL_SMARTCARD_AbortTransmit_IT (SMARTCARD_HandleTypeDef *hsmartcard)
 
HAL_StatusTypeDef HAL_SMARTCARD_AbortReceive_IT (SMARTCARD_HandleTypeDef *hsmartcard)
 
void HAL_SMARTCARD_IRQHandler (SMARTCARD_HandleTypeDef *hsmartcard)
 
void HAL_SMARTCARD_TxCpltCallback (SMARTCARD_HandleTypeDef *hsmartcard)
 
void HAL_SMARTCARD_RxCpltCallback (SMARTCARD_HandleTypeDef *hsmartcard)
 
void HAL_SMARTCARD_ErrorCallback (SMARTCARD_HandleTypeDef *hsmartcard)
 
void HAL_SMARTCARD_AbortCpltCallback (SMARTCARD_HandleTypeDef *hsmartcard)
 
void HAL_SMARTCARD_AbortTransmitCpltCallback (SMARTCARD_HandleTypeDef *hsmartcard)
 
void HAL_SMARTCARD_AbortReceiveCpltCallback (SMARTCARD_HandleTypeDef *hsmartcard)
 
HAL_SMARTCARD_StateTypeDef HAL_SMARTCARD_GetState (const SMARTCARD_HandleTypeDef *hsmartcard)
 
uint32_t HAL_SMARTCARD_GetError (const SMARTCARD_HandleTypeDef *hsmartcard)
 

Detailed Description

Header file of SMARTCARD HAL module.

Author
MCD Application Team
Attention

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.