STM8S/A Standard Peripherals Drivers
|
Functions | |
void | UART3_ClearFlag (UART3_Flag_TypeDef UART3_FLAG) |
Clears the UART3 flags. | |
void | UART3_ClearITPendingBit (UART3_IT_TypeDef UART3_IT) |
Clears the UART3 pending flags. | |
void | UART3_Cmd (FunctionalState NewState) |
Enable the UART1 peripheral. | |
void | UART3_DeInit (void) |
Deinitializes the UART peripheral. | |
FlagStatus | UART3_GetFlagStatus (UART3_Flag_TypeDef UART3_FLAG) |
Checks whether the specified UART3 flag is set or not. | |
ITStatus | UART3_GetITStatus (UART3_IT_TypeDef UART3_IT) |
Checks whether the specified UART3 interrupt has occurred or not. | |
void | UART3_Init (uint32_t BaudRate, UART3_WordLength_TypeDef WordLength, UART3_StopBits_TypeDef StopBits, UART3_Parity_TypeDef Parity, UART3_Mode_TypeDef Mode) |
Initializes the UART3 according to the specified parameters. | |
void | UART3_ITConfig (UART3_IT_TypeDef UART3_IT, FunctionalState NewState) |
Enables or disables the specified UART3 interrupts. | |
void | UART3_LINBreakDetectionConfig (UART3_LINBreakDetectionLength_TypeDef UART3_LINBreakDetectionLength) |
Sets the UART3 LIN Break detection length. | |
void | UART3_LINCmd (FunctionalState NewState) |
Enables or disables the UART3 LIN mode. | |
void | UART3_LINConfig (UART3_LinMode_TypeDef UART3_Mode, UART3_LinAutosync_TypeDef UART3_Autosync, UART3_LinDivUp_TypeDef UART3_DivUp) |
Configure the UART3 peripheral. | |
uint8_t | UART3_ReceiveData8 (void) |
Returns the most recent received data by the UART3 peripheral. | |
uint16_t | UART3_ReceiveData9 (void) |
Returns the most recent received data by the UART3 peripheral. | |
void | UART3_ReceiverWakeUpCmd (FunctionalState NewState) |
Determines if the UART3 is in mute mode or not. | |
void | UART3_SendBreak (void) |
Transmits break characters. | |
void | UART3_SendData8 (uint8_t Data) |
Transmits 8 bit data through the UART3 peripheral. | |
void | UART3_SendData9 (uint16_t Data) |
Transmits 9 bit data through the UART3 peripheral. | |
void | UART3_SetAddress (uint8_t UART3_Address) |
Sets the address of the UART3 node. | |
void | UART3_WakeUpConfig (UART3_WakeUp_TypeDef UART3_WakeUp) |
Selects the UART3 WakeUp method. |
Function Documentation
void UART3_ClearFlag | ( | UART3_Flag_TypeDef | UART3_FLAG | ) |
Clears the UART3 flags.
- Note:
- PE (Parity error), FE (Framing error), NF (Noise error), OR (OverRun error) and IDLE (Idle line detected) flags are cleared by software sequence: a read operation to UART3_SR register (UART3_GetFlagStatus())followed by a read operation to UART3_DR register(UART3_ReceiveData8() or UART3_ReceiveData9()).
- RXNE flag can be also cleared by a read to the UART3_DR register (UART3_ReceiveData8()or UART3_ReceiveData9()).
- TC flag can be also cleared by software sequence: a read operation to UART3_SR register (UART3_GetFlagStatus()) followed by a write operation to UART3_DR register (UART3_SendData8() or UART3_SendData9()).
- TXE flag is cleared only by a write to the UART3_DR register (UART3_SendData8() or UART3_SendData9()).
- SBK flag is cleared during the stop bit of break.
- Return values:
-
None
Definition at line 551 of file stm8s_uart3.c.
References IS_UART3_CLEAR_FLAG_OK, UART3_CR4_LBDF, UART3_CR6_LHDF, UART3_CR6_LSF, UART3_FLAG_LBDF, UART3_FLAG_LHDF, UART3_FLAG_RXNE, and UART3_SR_RXNE.
void UART3_ClearITPendingBit | ( | UART3_IT_TypeDef | UART3_IT | ) |
Clears the UART3 pending flags.
- Note:
- PE (Parity error), FE (Framing error), NF (Noise error), OR (OverRun error) and IDLE (Idle line detected) pending bits are cleared by software sequence: a read operation to UART3_SR register (UART3_GetITStatus()) followed by a read operation to UART3_DR register (UART3_ReceiveData8() or UART3_ReceiveData9()).
- RXNE pending bit can be also cleared by a read to the UART3_DR register (UART3_ReceiveData8() or UART3_ReceiveData9() ).
- TC (Transmit complete) pending bit can be cleared by software sequence: a read operation to UART3_SR register (UART3_GetITStatus()) followed by a write operation to UART3_DR register (UART3_SendData8()or UART3_SendData9()).
- TXE pending bit is cleared only by a write to the UART3_DR register (UART3_SendData8() or UART3_SendData9()).
- Return values:
-
None
Definition at line 706 of file stm8s_uart3.c.
References IS_UART3_CLEAR_IT_OK, UART3_CR4_LBDF, UART3_CR6_LHDF, UART3_IT_LBDF, UART3_IT_RXNE, and UART3_SR_RXNE.
void UART3_Cmd | ( | FunctionalState | NewState | ) |
Enable the UART1 peripheral.
Definition at line 160 of file stm8s_uart3.c.
References DISABLE, and UART3_CR1_UARTD.
void UART3_DeInit | ( | void | ) |
Deinitializes the UART peripheral.
Definition at line 54 of file stm8s_uart3.c.
References UART3_BRR1_RESET_VALUE, UART3_BRR2_RESET_VALUE, UART3_CR1_RESET_VALUE, UART3_CR2_RESET_VALUE, UART3_CR3_RESET_VALUE, UART3_CR4_RESET_VALUE, and UART3_CR6_RESET_VALUE.
FlagStatus UART3_GetFlagStatus | ( | UART3_Flag_TypeDef | UART3_FLAG | ) |
Checks whether the specified UART3 flag is set or not.
Definition at line 458 of file stm8s_uart3.c.
References IS_UART3_FLAG_OK, RESET, SET, UART3_FLAG_LBDF, UART3_FLAG_LHDF, UART3_FLAG_LSF, and UART3_FLAG_SBK.
ITStatus UART3_GetITStatus | ( | UART3_IT_TypeDef | UART3_IT | ) |
Checks whether the specified UART3 interrupt has occurred or not.
Definition at line 591 of file stm8s_uart3.c.
References IS_UART3_GET_IT_OK, RESET, SET, UART3_IT_LBDF, UART3_IT_LHDF, and UART3_IT_PE.
void UART3_Init | ( | uint32_t | BaudRate, |
UART3_WordLength_TypeDef | WordLength, | ||
UART3_StopBits_TypeDef | StopBits, | ||
UART3_Parity_TypeDef | Parity, | ||
UART3_Mode_TypeDef | Mode | ||
) |
Initializes the UART3 according to the specified parameters.
Definition at line 83 of file stm8s_uart3.c.
References CLK_GetClockFreq(), IS_UART3_BAUDRATE_OK, IS_UART3_MODE_OK, IS_UART3_PARITY_OK, IS_UART3_STOPBITS_OK, IS_UART3_WORDLENGTH_OK, UART3_BRR1_DIVM, UART3_BRR2_DIVF, UART3_BRR2_DIVM, UART3_CR1_M, UART3_CR1_PCEN, UART3_CR1_PS, UART3_CR2_REN, UART3_CR2_TEN, UART3_CR3_STOP, UART3_MODE_RX_ENABLE, and UART3_MODE_TX_ENABLE.
void UART3_ITConfig | ( | UART3_IT_TypeDef | UART3_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified UART3 interrupts.
Definition at line 189 of file stm8s_uart3.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and IS_UART3_CONFIG_IT_OK.
void UART3_LINBreakDetectionConfig | ( | UART3_LINBreakDetectionLength_TypeDef | UART3_LINBreakDetectionLength | ) |
Sets the UART3 LIN Break detection length.
Definition at line 252 of file stm8s_uart3.c.
References IS_UART3_LINBREAKDETECTIONLENGTH_OK, UART3_CR4_LBDL, and UART3_LINBREAKDETECTIONLENGTH_10BITS.
void UART3_LINCmd | ( | FunctionalState | NewState | ) |
Enables or disables the UART3 LIN mode.
Definition at line 320 of file stm8s_uart3.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and UART3_CR3_LINEN.
void UART3_LINConfig | ( | UART3_LinMode_TypeDef | UART3_Mode, |
UART3_LinAutosync_TypeDef | UART3_Autosync, | ||
UART3_LinDivUp_TypeDef | UART3_DivUp | ||
) |
Configure the UART3 peripheral.
Definition at line 277 of file stm8s_uart3.c.
References IS_UART3_AUTOSYNC_OK, IS_UART3_DIVUP_OK, IS_UART3_SLAVE_OK, UART3_CR6_LASE, UART3_CR6_LDUM, UART3_CR6_LSLV, UART3_LIN_AUTOSYNC_DISABLE, UART3_LIN_DIVUP_LBRR1, and UART3_LIN_MODE_MASTER.
uint8_t UART3_ReceiveData8 | ( | void | ) |
Returns the most recent received data by the UART3 peripheral.
Definition at line 380 of file stm8s_uart3.c.
uint16_t UART3_ReceiveData9 | ( | void | ) |
Returns the most recent received data by the UART3 peripheral.
Definition at line 390 of file stm8s_uart3.c.
References UART3_CR1_R8.
void UART3_ReceiverWakeUpCmd | ( | FunctionalState | NewState | ) |
Determines if the UART3 is in mute mode or not.
Definition at line 358 of file stm8s_uart3.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and UART3_CR2_RWU.
void UART3_SendBreak | ( | void | ) |
void UART3_SendData8 | ( | uint8_t | Data | ) |
Transmits 8 bit data through the UART3 peripheral.
Definition at line 403 of file stm8s_uart3.c.
void UART3_SendData9 | ( | uint16_t | Data | ) |
Transmits 9 bit data through the UART3 peripheral.
Definition at line 414 of file stm8s_uart3.c.
References UART3_CR1_T8.
void UART3_SetAddress | ( | uint8_t | UART3_Address | ) |
Sets the address of the UART3 node.
Definition at line 441 of file stm8s_uart3.c.
References IS_UART3_ADDRESS_OK, and UART3_CR4_ADD.
void UART3_WakeUpConfig | ( | UART3_WakeUp_TypeDef | UART3_WakeUp | ) |
Selects the UART3 WakeUp method.
Definition at line 343 of file stm8s_uart3.c.
References IS_UART3_WAKEUP_OK, and UART3_CR1_WAKE.