Functions

Smartcard mode functions. More...

Collaboration diagram for Smartcard mode functions:

Functions

void USART_LINBreakDetectLengthConfig (USART_TypeDef *USARTx, uint32_t USART_LINBreakDetectLength)
 Sets the USART LIN Break detection length. More...
 
void USART_LINCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's LIN mode. More...
 
void USART_SetGuardTime (USART_TypeDef *USARTx, uint8_t USART_GuardTime)
 Sets the specified USART guard time. More...
 
void USART_SmartCardCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's Smart Card mode. More...
 
void USART_SmartCardNACKCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables NACK transmission. More...
 

Detailed Description

Smartcard mode functions.

LIN mode functions.

 ===============================================================================
                              ##### Smartcard mode functions #####
 ===============================================================================  
    [..]
    This subsection provides a set of functions allowing to manage the USART 
    Smartcard communication.
    [..]
    The Smartcard interface is designed to support asynchronous protocol Smartcards as
    defined in the ISO 7816-3 standard.
    [..]
    The USART can provide a clock to the smartcard through the SCLK output.
    In smartcard mode, SCLK is not associated to the communication but is simply derived 
    from the internal peripheral input clock through a 5-bit prescaler.
    [..]
    Smartcard communication is possible through the following procedure:
      (#) Configures the Smartcard Prescaler using the USART_SetPrescaler() function.
      (#) Configures the Smartcard Guard Time using the USART_SetGuardTime() function.
      (#) Program the USART clock using the USART_ClockInit() function as following:
        (++) USART Clock enabled
        (++) USART CPOL Low
        (++) USART CPHA on first edge
        (++) USART Last Bit Clock Enabled
      (#) Program the Smartcard interface using the USART_Init() function as following:
        (++) Word Length = 9 Bits
        (++) 1.5 Stop Bit
        (++) Even parity
        (++) BaudRate = 12096 baud
        (++) Hardware flow control disabled (RTS and CTS signals)
        (++) Tx and Rx enabled
      (#) POptionally you can enable the parity error interrupt using the USART_ITConfig()
          function
      (#) PEnable the USART using the USART_Cmd() function.
      (#) PEnable the Smartcard NACK using the USART_SmartCardNACKCmd() function.
      (#) PEnable the Smartcard interface using the USART_SmartCardCmd() function.

    Please refer to the ISO 7816-3 specification for more details.

      -@- It is also possible to choose 0.5 stop bit for receiving but it is recommended 
          to use 1.5 stop bits for both transmitting and receiving to avoid switching 
          between the two configurations.
      -@- In smartcard mode, the following bits must be kept cleared:
        (+@) LINEN bit in the USART_CR2 register.
        (+@) HDSEL and IREN bits in the USART_CR3 register.
      -@- Smartcard mode is available on USART peripherals only (not available on UART4 
          and UART5 peripherals).
 ===============================================================================
                       ##### LIN mode functions #####
 ===============================================================================
    [..] This subsection provides a set of functions allowing to manage the USART 
         LIN Mode communication.
    [..] In LIN mode, 8-bit data format with 1 stop bit is required in accordance 
         with the LIN standard.
    [..] Only this LIN Feature is supported by the USART IP:
         (+) LIN Master Synchronous Break send capability and LIN slave break 
             detection capability :  13-bit break generation and 10/11 bit break 
             detection.
    [..] USART LIN Master transmitter communication is possible through the 
         following procedure:
         (#) Program the Baud rate, Word length = 8bits, Stop bits = 1bit, Parity, 
             Mode transmitter or Mode receiver and hardware flow control values 
             using the USART_Init() function.
         (#) Enable the LIN mode using the USART_LINCmd() function.
         (#) Enable the USART using the USART_Cmd() function.
         (#) Send the break character using USART_SendBreak() function.
    [..] USART LIN Master receiver communication is possible through the 
         following procedure:
         (#) Program the Baud rate, Word length = 8bits, Stop bits = 1bit, Parity, 
             Mode transmitter or Mode receiver and hardware flow control values 
             using the USART_Init() function.
         (#) Configures the break detection length 
             using the USART_LINBreakDetectLengthConfig() function.
         (#) Enable the LIN mode using the USART_LINCmd() function.
         (#) Enable the USART using the USART_Cmd() function.
         [..]
         (@) In LIN mode, the following bits must be kept cleared:
             (+@) CLKEN in the USART_CR2 register.
             (+@) STOP[1:0], SCEN, HDSEL and IREN in the USART_CR3 register.

Function Documentation

void USART_LINBreakDetectLengthConfig ( USART_TypeDef USARTx,
uint32_t  USART_LINBreakDetectLength 
)

Sets the USART LIN Break detection length.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_LINBreakDetectLengthspecifies the LIN break detection length. This parameter can be one of the following values:
  • USART_LINBreakDetectLength_10b: 10-bit break detection
  • USART_LINBreakDetectLength_11b: 11-bit break detection
Return values
None

Definition at line 1113 of file stm32f30x_usart.c.

void USART_LINCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's LIN mode.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
NewStatenew state of the USART LIN mode. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1131 of file stm32f30x_usart.c.

void USART_SetGuardTime ( USART_TypeDef USARTx,
uint8_t  USART_GuardTime 
)

Sets the specified USART guard time.

Parameters
USARTxwhere x can be 1, 2, 3 or 6 to select the USART or UART peripheral.
USART_GuardTimespecifies the guard time.
Return values
None

Definition at line 920 of file stm32f4xx_usart.c.

void USART_SmartCardCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's Smart Card mode.

Parameters
USARTxwhere x can be 1, 2, 3 or 6 to select the USART or UART peripheral.
NewStatenew state of the Smart Card mode. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 939 of file stm32f4xx_usart.c.

void USART_SmartCardNACKCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables NACK transmission.

Parameters
USARTxwhere x can be 1, 2, 3 or 6 to select the USART or UART peripheral.
NewStatenew state of the NACK transmission. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 964 of file stm32f4xx_usart.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Mar 24 2021 02:18:19