STM8S/A Standard Peripherals Drivers
|
Functions | |
void | UART4_ClearFlag (UART4_Flag_TypeDef UART4_FLAG) |
Clears the UART4 flags. | |
void | UART4_ClearITPendingBit (UART4_IT_TypeDef UART4_IT) |
Clears the UART4 pending flags. | |
void | UART4_Cmd (FunctionalState NewState) |
Enable the UART4 peripheral. | |
void | UART4_DeInit (void) |
Deinitializes the UART peripheral. | |
FlagStatus | UART4_GetFlagStatus (UART4_Flag_TypeDef UART4_FLAG) |
Checks whether the specified UART4 flag is set or not. | |
ITStatus | UART4_GetITStatus (UART4_IT_TypeDef UART4_IT) |
Checks whether the specified UART4 interrupt has occurred or not. | |
void | UART4_HalfDuplexCmd (FunctionalState NewState) |
Enables or disables the UART�s Half Duplex communication. | |
void | UART4_Init (uint32_t BaudRate, UART4_WordLength_TypeDef WordLength, UART4_StopBits_TypeDef StopBits, UART4_Parity_TypeDef Parity, UART4_SyncMode_TypeDef SyncMode, UART4_Mode_TypeDef Mode) |
Initializes the UART4 according to the specified parameters. | |
void | UART4_IrDACmd (FunctionalState NewState) |
Enables or disables the UART4�s IrDA interface. | |
void | UART4_IrDAConfig (UART4_IrDAMode_TypeDef UART4_IrDAMode) |
Configures the UART4�s IrDA interface. | |
void | UART4_ITConfig (UART4_IT_TypeDef UART4_IT, FunctionalState NewState) |
Enables or disables the specified UART4 interrupts. | |
void | UART4_LINBreakDetectionConfig (UART4_LINBreakDetectionLength_TypeDef UART4_LINBreakDetectionLength) |
Sets the UART4 LIN Break detection length. | |
void | UART4_LINCmd (FunctionalState NewState) |
Enables or disables the UART4 LIN mode. | |
void | UART4_LINConfig (UART4_LinMode_TypeDef UART4_Mode, UART4_LinAutosync_TypeDef UART4_Autosync, UART4_LinDivUp_TypeDef UART4_DivUp) |
Configure the UART4 peripheral. | |
uint8_t | UART4_ReceiveData8 (void) |
Returns the most recent received data by the UART4 peripheral. | |
uint16_t | UART4_ReceiveData9 (void) |
Returns the most recent received data by the UART4 peripheral. | |
void | UART4_ReceiverWakeUpCmd (FunctionalState NewState) |
Determines if the UART4 is in mute mode or not. | |
void | UART4_SendBreak (void) |
Transmits break characters. | |
void | UART4_SendData8 (uint8_t Data) |
Transmits 8 bit data through the UART4 peripheral. | |
void | UART4_SendData9 (uint16_t Data) |
Transmits 9 bit data through the UART4 peripheral. | |
void | UART4_SetAddress (uint8_t UART4_Address) |
Sets the address of the UART4 node. | |
void | UART4_SetGuardTime (uint8_t UART4_GuardTime) |
Sets the specified UART4 guard time. | |
void | UART4_SetPrescaler (uint8_t UART4_Prescaler) |
Sets the system clock prescaler. | |
void | UART4_SmartCardCmd (FunctionalState NewState) |
Enables or disables the UART4 Smart Card mode. | |
void | UART4_SmartCardNACKCmd (FunctionalState NewState) |
Enables or disables NACK transmission. | |
void | UART4_WakeUpConfig (UART4_WakeUp_TypeDef UART4_WakeUp) |
Selects the UART4 WakeUp method. |
Function Documentation
void UART4_ClearFlag | ( | UART4_Flag_TypeDef | UART4_FLAG | ) |
Clears the UART4 flags.
- Note:
- :
- PE (Parity error), FE (Framing error), NE (Noise error), OR (OverRun error) and IDLE (Idle line detected) flags are cleared by software sequence: a read operation to UART4_SR register (UART4_GetFlagStatus())followed by a read operation to UART4_DR register(UART4_ReceiveData8() or UART4_ReceiveData9()).
- RXNE flag can be also cleared by a read to the UART4_DR register (UART4_ReceiveData8()or UART4_ReceiveData9()).
- TC flag can be also cleared by software sequence: a read operation to UART4_SR register (UART4_GetFlagStatus()) followed by a write operation to UART4_DR register (UART4_SendData8() or UART4_SendData9()).
- TXE flag is cleared only by a write to the UART4_DR register (UART4_SendData8() or UART4_SendData9()).
- SBK flag is cleared during the stop bit of break.
- Return values:
-
None
Definition at line 719 of file stm8s_uart4.c.
References IS_UART4_CLEAR_FLAG_OK, UART4_FLAG_LBDF, UART4_FLAG_LHDF, and UART4_FLAG_RXNE.
void UART4_ClearITPendingBit | ( | UART4_IT_TypeDef | UART4_IT | ) |
Clears the UART4 pending flags.
- Note:
- PE (Parity error), FE (Framing error), NE (Noise error), OR (OverRun error) and IDLE (Idle line detected) pending bits are cleared by software sequence: a read operation to UART4_SR register (UART4_GetITStatus()) followed by a read operation to UART4_DR register (UART4_ReceiveData8() or UART4_ReceiveData9()).
- RXNE pending bit can be also cleared by a read to the UART4_DR register (UART4_ReceiveData8() or UART4_ReceiveData9()).
- TC (Transmit complete) pending bit can be cleared by software sequence: a read operation to UART4_SR register (UART4_GetITStatus()) followed by a write operation to UART4_DR register (UART4_SendData8()or UART4_SendData9()).
- TXE pending bit is cleared only by a write to the UART4_DR register (UART4_SendData8() or UART4_SendData9()).
- Return values:
-
None
Definition at line 872 of file stm8s_uart4.c.
References IS_UART4_CLEAR_IT_OK, UART4_IT_LBDF, and UART4_IT_RXNE.
void UART4_Cmd | ( | FunctionalState | NewState | ) |
void UART4_DeInit | ( | void | ) |
Deinitializes the UART peripheral.
Definition at line 53 of file stm8s_uart4.c.
FlagStatus UART4_GetFlagStatus | ( | UART4_Flag_TypeDef | UART4_FLAG | ) |
Checks whether the specified UART4 flag is set or not.
Definition at line 626 of file stm8s_uart4.c.
References IS_UART4_FLAG_OK, RESET, SET, UART4_FLAG_LBDF, UART4_FLAG_LHDF, UART4_FLAG_LSF, and UART4_FLAG_SBK.
ITStatus UART4_GetITStatus | ( | UART4_IT_TypeDef | UART4_IT | ) |
Checks whether the specified UART4 interrupt has occurred or not.
Definition at line 758 of file stm8s_uart4.c.
References IS_UART4_GET_IT_OK, RESET, SET, UART4_IT_LBDF, UART4_IT_LHDF, and UART4_IT_PE.
void UART4_HalfDuplexCmd | ( | FunctionalState | NewState | ) |
Enables or disables the UART�s Half Duplex communication.
< UART4 Half Duplex Enable
< UART4 Half Duplex Disable
Definition at line 272 of file stm8s_uart4.c.
References DISABLE, and IS_FUNCTIONALSTATE_OK.
void UART4_Init | ( | uint32_t | BaudRate, |
UART4_WordLength_TypeDef | WordLength, | ||
UART4_StopBits_TypeDef | StopBits, | ||
UART4_Parity_TypeDef | Parity, | ||
UART4_SyncMode_TypeDef | SyncMode, | ||
UART4_Mode_TypeDef | Mode | ||
) |
Initializes the UART4 according to the specified parameters.
Definition at line 85 of file stm8s_uart4.c.
References CLK_GetClockFreq(), IS_UART4_BAUDRATE_OK, IS_UART4_MODE_OK, IS_UART4_PARITY_OK, IS_UART4_STOPBITS_OK, IS_UART4_SYNCMODE_OK, IS_UART4_WORDLENGTH_OK, UART4_MODE_RX_ENABLE, UART4_MODE_TX_ENABLE, and UART4_SYNCMODE_CLOCK_DISABLE.
void UART4_IrDACmd | ( | FunctionalState | NewState | ) |
Enables or disables the UART4�s IrDA interface.
Definition at line 312 of file stm8s_uart4.c.
References DISABLE, and IS_FUNCTIONALSTATE_OK.
void UART4_IrDAConfig | ( | UART4_IrDAMode_TypeDef | UART4_IrDAMode | ) |
Configures the UART4�s IrDA interface.
Definition at line 292 of file stm8s_uart4.c.
References IS_UART4_IRDAMODE_OK, and UART4_IRDAMODE_NORMAL.
void UART4_ITConfig | ( | UART4_IT_TypeDef | UART4_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified UART4 interrupts.
Definition at line 210 of file stm8s_uart4.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and IS_UART4_CONFIG_IT_OK.
void UART4_LINBreakDetectionConfig | ( | UART4_LINBreakDetectionLength_TypeDef | UART4_LINBreakDetectionLength | ) |
Sets the UART4 LIN Break detection length.
Definition at line 336 of file stm8s_uart4.c.
References IS_UART4_LINBREAKDETECTIONLENGTH_OK, and UART4_LINBREAKDETECTIONLENGTH_10BITS.
void UART4_LINCmd | ( | FunctionalState | NewState | ) |
Enables or disables the UART4 LIN mode.
Definition at line 404 of file stm8s_uart4.c.
References DISABLE, and IS_FUNCTIONALSTATE_OK.
void UART4_LINConfig | ( | UART4_LinMode_TypeDef | UART4_Mode, |
UART4_LinAutosync_TypeDef | UART4_Autosync, | ||
UART4_LinDivUp_TypeDef | UART4_DivUp | ||
) |
Configure the UART4 peripheral.
Definition at line 361 of file stm8s_uart4.c.
References IS_UART4_AUTOSYNC_OK, IS_UART4_DIVUP_OK, IS_UART4_SLAVE_OK, UART4_LIN_AUTOSYNC_DISABLE, UART4_LIN_DIVUP_LBRR1, and UART4_LIN_MODE_MASTER.
uint8_t UART4_ReceiveData8 | ( | void | ) |
Returns the most recent received data by the UART4 peripheral.
Definition at line 507 of file stm8s_uart4.c.
uint16_t UART4_ReceiveData9 | ( | void | ) |
Returns the most recent received data by the UART4 peripheral.
Definition at line 517 of file stm8s_uart4.c.
void UART4_ReceiverWakeUpCmd | ( | FunctionalState | NewState | ) |
Determines if the UART4 is in mute mode or not.
Definition at line 486 of file stm8s_uart4.c.
References DISABLE, and IS_FUNCTIONALSTATE_OK.
void UART4_SendBreak | ( | void | ) |
Transmits break characters.
Definition at line 559 of file stm8s_uart4.c.
void UART4_SendData8 | ( | uint8_t | Data | ) |
Transmits 8 bit data through the UART4 peripheral.
Definition at line 531 of file stm8s_uart4.c.
void UART4_SendData9 | ( | uint16_t | Data | ) |
Transmits 9 bit data through the UART4 peripheral.
Definition at line 542 of file stm8s_uart4.c.
void UART4_SetAddress | ( | uint8_t | UART4_Address | ) |
Sets the address of the UART4 node.
Definition at line 569 of file stm8s_uart4.c.
References IS_UART4_ADDRESS_OK.
void UART4_SetGuardTime | ( | uint8_t | UART4_GuardTime | ) |
Sets the specified UART4 guard time.
- Note:
- SmartCard Mode should be Enabled
Definition at line 586 of file stm8s_uart4.c.
void UART4_SetPrescaler | ( | uint8_t | UART4_Prescaler | ) |
Sets the system clock prescaler.
- Note:
- IrDA Low Power mode or smartcard mode should be enabled
- This function is related to SmartCard and IrDa mode.
Definition at line 614 of file stm8s_uart4.c.
void UART4_SmartCardCmd | ( | FunctionalState | NewState | ) |
Enables or disables the UART4 Smart Card mode.
Definition at line 426 of file stm8s_uart4.c.
References DISABLE, and IS_FUNCTIONALSTATE_OK.
void UART4_SmartCardNACKCmd | ( | FunctionalState | NewState | ) |
Enables or disables NACK transmission.
Definition at line 449 of file stm8s_uart4.c.
References DISABLE, and IS_FUNCTIONALSTATE_OK.
void UART4_WakeUpConfig | ( | UART4_WakeUp_TypeDef | UART4_WakeUp | ) |
Selects the UART4 WakeUp method.
Definition at line 472 of file stm8s_uart4.c.
References IS_UART4_WAKEUP_OK.