Functions

LIN mode functions. More...

Collaboration diagram for LIN mode functions:

Functions

void USART_LINBreakDetectLengthConfig (USART_TypeDef *USARTx, uint16_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...
 
uint16_t USART_ReceiveData (USART_TypeDef *USARTx)
 Returns the most recent received data by the USARTx peripheral. More...
 
void USART_SendBreak (USART_TypeDef *USARTx)
 Transmits break characters. More...
 
void USART_SendData (USART_TypeDef *USARTx, uint16_t Data)
 Transmits single data through the USARTx peripheral. More...
 

Detailed Description

LIN mode functions.

Data transfers functions.

 ===============================================================================
                        ##### 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 USART using the USART_Cmd() function.
      (#) Enable the LIN mode using the USART_LINCmd() 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.
      (#) Enable the USART using the USART_Cmd() function.
      (#) Configures the break detection length using the USART_LINBreakDetectLengthConfig()
          function.
      (#) Enable the LIN mode using the USART_LINCmd() 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.
 ===============================================================================
                    ##### Data transfers functions #####
 ===============================================================================
    [..] This subsection provides a set of functions allowing to manage 
         the USART data transfers.
    [..] During an USART reception, data shifts in least significant bit first 
         through the RX pin. When a transmission is taking place, a write instruction to 
         the USART_TDR register stores the data in the shift register.
    [..] The read access of the USART_RDR register can be done using 
         the USART_ReceiveData() function and returns the RDR value.
         Whereas a write access to the USART_TDR can be done using USART_SendData()
         function and stores the written data into TDR.

Function Documentation

void USART_LINBreakDetectLengthConfig ( USART_TypeDef USARTx,
uint16_t  USART_LINBreakDetectLength 
)

Sets the USART LIN Break detection length.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
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 741 of file stm32f4xx_usart.c.

void USART_LINCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's LIN mode.

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

Definition at line 759 of file stm32f4xx_usart.c.

uint16_t USART_ReceiveData ( USART_TypeDef USARTx)

Returns the most recent received data by the USARTx peripheral.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
Return values
Thereceived data.

Definition at line 931 of file stm32f30x_usart.c.

void USART_SendBreak ( USART_TypeDef USARTx)

Transmits break characters.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Return values
None

Definition at line 783 of file stm32f4xx_usart.c.

void USART_SendData ( USART_TypeDef USARTx,
uint16_t  Data 
)

Transmits single data through the USARTx peripheral.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
Datathe data to transmit.
Return values
None

Definition at line 915 of file stm32f30x_usart.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Fri Oct 9 2020 03:17:20