|
STM32G474xx HAL用户手册
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32g4xx_hal_smartcard.h 00004 * @author MCD Application Team 00005 * @brief Header file of SMARTCARD HAL module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * Copyright (c) 2019 STMicroelectronics. 00010 * All rights reserved. 00011 * 00012 * This software is licensed under terms that can be found in the LICENSE file 00013 * in the root directory of this software component. 00014 * If no LICENSE file comes with this software, it is provided AS-IS. 00016 * 00017 ****************************************************************************** 00017 */ 00018 00019 /* Define to prevent recursive inclusion -------------------------------------*/ 00020 #ifndef STM32G4xx_HAL_SMARTCARD_H 00021 #define STM32G4xx_HAL_SMARTCARD_H 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 /* Includes ------------------------------------------------------------------*/ 00028 #include "stm32g4xx_hal_def.h" 00029 00030 /** @addtogroup STM32G4xx_HAL_Driver 00031 * @{ 00032 */ 00033 00034 /** @addtogroup SMARTCARD 00035 * @{ 00036 */ 00037 00038 /* Exported types ------------------------------------------------------------*/ 00039 /** @defgroup SMARTCARD_Exported_Types SMARTCARD Exported Types 00040 * @{ 00041 */ 00042 00043 /** 00044 * @brief SMARTCARD Init Structure definition 00045 */ 00046 typedef struct 00047 { 00048 uint32_t BaudRate; /*!< Configures the SmartCard communication baud rate. 00049 The baud rate register is computed using the following formula: 00050 Baud Rate Register = ((usart_ker_ckpres) / ((hsmartcard->Init.BaudRate))) 00051 where usart_ker_ckpres is the USART input clock divided by a prescaler */ 00052 00053 uint32_t WordLength; /*!< Specifies the number of data bits transmitted or received in a frame. 00054 This parameter @ref SMARTCARD_Word_Length can only be 00055 set to 9 (8 data + 1 parity bits). */ 00056 00057 uint32_t StopBits; /*!< Specifies the number of stop bits. 00058 This parameter can be a value of @ref SMARTCARD_Stop_Bits. */ 00059 00060 uint16_t Parity; /*!< Specifies the parity mode. 00061 This parameter can be a value of @ref SMARTCARD_Parity 00063 @note The parity is enabled by default (PCE is forced to 1). 00064 Since the WordLength is forced to 8 bits + parity, M is 00065 forced to 1 and the parity bit is the 9th bit. */ 00066 00067 uint16_t Mode; /*!< Specifies whether the Receive or Transmit mode is enabled or disabled. 00069 This parameter can be a value of @ref SMARTCARD_Mode */ 00070 00070 uint16_t CLKPolarity; /*!< Specifies the steady state of the serial clock. 00071 This parameter can be a value of @ref SMARTCARD_Clock_Polarity */ 00072 00073 uint16_t CLKPhase; /*!< Specifies the clock transition on which the bit capture is made. 00074 This parameter can be a value of @ref SMARTCARD_Clock_Phase */ 00075 00076 uint16_t CLKLastBit; /*!< Specifies whether the clock pulse corresponding to the last transmitted 00077 data bit (MSB) has to be output on the SCLK pin in synchronous mode. 00078 This parameter can be a value of @ref SMARTCARD_Last_Bit */ 00079 00080 uint16_t OneBitSampling; /*!< Specifies whether a single sample or three samples' majority vote 00081 is selected. Selecting the single sample method increases 00083