STM8S/A Standard Peripherals Drivers: stm8s_uart4.h File Reference

STM8S/A Standard Peripherals Library

stm8s_uart4.h File Reference

This file contains all functions prototypes and macros for the UART4 peripheral. More...

#include "stm8s.h"

Go to the source code of this file.

Defines

#define IS_UART4_ADDRESS_OK(node)   ((node) < UART4_ADDRESS_MAX )
#define IS_UART4_AUTOSYNC_OK(AutosyncMode)
 Macro used by the assert_param function in order to check the LIN automatic resynchronization mode.
#define IS_UART4_BAUDRATE_OK(NUM)   ((NUM) <= (uint32_t)625000)
 Macro used by the assert_param function in order to check the maximum baudrate value.
#define IS_UART4_CLEAR_FLAG_OK(Flag)
 Macro used by the assert_param function in order to check the different sensitivity values for the FLAGs that can be cleared by writing 0.
#define IS_UART4_CLEAR_IT_OK(ITPendingBit)
 Macro used by the assert function in order to check the different sensitivity values for the pending bit that can be cleared by writing 0.
#define IS_UART4_CONFIG_IT_OK(Interrupt)
 Macro used by the assert_param function in order to check the different sensitivity values for the Interrupts.
#define IS_UART4_DIVUP_OK(DivupMethode)
 Macro used by the assert_param function in order to check the LIN divider update method.
#define IS_UART4_FLAG_OK(Flag)
 Macro used by the assert_param function in order to check the different sensitivity values for the FLAGs.
#define IS_UART4_GET_IT_OK(ITPendingBit)
 Macro used by the assert function in order to check the different sensitivity values for the pending bit.
#define IS_UART4_IRDAMODE_OK(IrDAMode)
 Macro used by the assert_param function in order to check the different sensitivity values for the IrDAModes.
#define IS_UART4_LINBREAKDETECTIONLENGTH_OK(LINBreakDetectionLength)
 Macro used by the assert_param function in order to check the different sensitivity values for the LINBreakDetectionLengths.
#define IS_UART4_MODE_OK(Mode)
 Macro used by the assert function to check the different functions parameters.
#define IS_UART4_PARITY_OK(Parity)
 Macro used by the assert_param function in order to check the different sensitivity values for the Paritys.
#define IS_UART4_SLAVE_OK(Mode)
 Macro used by the assert_param function in order to check the LIN mode.
#define IS_UART4_STOPBITS_OK(StopBit)
 Macro used by the assert_param function in order to check the different sensitivity values for the UART4_StopBits.
#define IS_UART4_SYNCMODE_OK(SyncMode)
 Macro used by the assert_param function in order to check the different sensitivity values for the SyncModes; it should exclude values such as UART4_CLOCK_ENABLE|UART4_CLOCK_DISABLE.
#define IS_UART4_WAKEUP_OK(WakeUp)
 Macro used by the assert_param function in order to check the different sensitivity values for the WakeUps.
#define IS_UART4_WORDLENGTH_OK(WordLength)
 Macro used by the assert_param function in order to check the different sensitivity values for the WordLengths.
#define UART4_ADDRESS_MAX   ((uint8_t)16)
 Macro used by the assert_param function in order to check the address of the UART4 or UART node.

Enumerations

enum  UART4_Flag_TypeDef {
  UART4_FLAG_TXE = (uint16_t)0x0080, UART4_FLAG_TC = (uint16_t)0x0040, UART4_FLAG_RXNE = (uint16_t)0x0020, UART4_FLAG_IDLE = (uint16_t)0x0010,
  UART4_FLAG_OR_LHE = (uint16_t)0x0008, UART4_FLAG_NF = (uint16_t)0x0004, UART4_FLAG_FE = (uint16_t)0x0002, UART4_FLAG_PE = (uint16_t)0x0001,
  UART4_FLAG_SBK = (uint16_t)0x0101, UART4_FLAG_LBDF = (uint16_t)0x0210, UART4_FLAG_LHDF = (uint16_t)0x0302, UART4_FLAG_LSF = (uint16_t)0x0301
}
 UART4 Flag possible values. More...
enum  UART4_IrDAMode_TypeDef { UART4_IRDAMODE_NORMAL = (uint8_t)0x00, UART4_IRDAMODE_LOWPOWER = (uint8_t)0x01 }
 UART4 Irda Modes. More...
enum  UART4_IT_TypeDef {
  UART4_IT_TXE = (uint16_t)0x0277, UART4_IT_TC = (uint16_t)0x0266, UART4_IT_RXNE = (uint16_t)0x0255, UART4_IT_IDLE = (uint16_t)0x0244,
  UART4_IT_OR = (uint16_t)0x0235, UART4_IT_PE = (uint16_t)0x0100, UART4_IT_LBDF = (uint16_t)0x0346, UART4_IT_LHDF = (uint16_t)0x0412,
  UART4_IT_RXNE_OR = (uint16_t)0x0205
}
 UART4 Interrupt definition UART4_IT possible values Elements values convention: 0xZYX X: Position of the corresponding Interrupt. More...
enum  UART4_LinAutosync_TypeDef { UART4_LIN_AUTOSYNC_DISABLE = (uint8_t)0x00, UART4_LIN_AUTOSYNC_ENABLE = (uint8_t)0x01 }
 UART4 automatic resynchronisation possible values. More...
enum  UART4_LINBreakDetectionLength_TypeDef { UART4_LINBREAKDETECTIONLENGTH_10BITS = (uint8_t)0x00, UART4_LINBREAKDETECTIONLENGTH_11BITS = (uint8_t)0x01 }
 UART4 LIN Break detection length possible values. More...
enum  UART4_LinDivUp_TypeDef { UART4_LIN_DIVUP_LBRR1 = (uint8_t)0x00, UART4_LIN_DIVUP_NEXTRXNE = (uint8_t)0x01 }
 UART4 Divider Update Method possible values. More...
enum  UART4_LinMode_TypeDef { UART4_LIN_MODE_MASTER = (uint8_t)0x00, UART4_LIN_MODE_SLAVE = (uint8_t)0x01 }
 UART4 Mode possible values. More...
enum  UART4_Mode_TypeDef {
  UART4_MODE_RX_ENABLE = (uint8_t)0x08, UART4_MODE_TX_ENABLE = (uint8_t)0x04, UART4_MODE_TX_DISABLE = (uint8_t)0x80, UART4_MODE_RX_DISABLE = (uint8_t)0x40,
  UART4_MODE_TXRX_ENABLE = (uint8_t)0x0C
}
 UART4 Mode possible values. More...
enum  UART4_Parity_TypeDef { UART4_PARITY_NO = (uint8_t)0x00, UART4_PARITY_EVEN = (uint8_t)0x04, UART4_PARITY_ODD = (uint8_t)0x06 }
 UART4 parity possible values. More...
enum  UART4_StopBits_TypeDef { UART4_STOPBITS_1 = (uint8_t)0x00, UART4_STOPBITS_0_5 = (uint8_t)0x10, UART4_STOPBITS_2 = (uint8_t)0x20, UART4_STOPBITS_1_5 = (uint8_t)0x30 }
 UART4 stop bits possible values. More...
enum  UART4_SyncMode_TypeDef {
  UART4_SYNCMODE_CLOCK_DISABLE = (uint8_t)0x80, UART4_SYNCMODE_CLOCK_ENABLE = (uint8_t)0x08, UART4_SYNCMODE_CPOL_LOW = (uint8_t)0x40, UART4_SYNCMODE_CPOL_HIGH = (uint8_t)0x04,
  UART4_SYNCMODE_CPHA_MIDDLE = (uint8_t)0x20, UART4_SYNCMODE_CPHA_BEGINING = (uint8_t)0x02, UART4_SYNCMODE_LASTBIT_DISABLE = (uint8_t)0x10, UART4_SYNCMODE_LASTBIT_ENABLE = (uint8_t)0x01
}
 UART4 Synchrone modes. More...
enum  UART4_WakeUp_TypeDef { UART4_WAKEUP_IDLELINE = (uint8_t)0x00, UART4_WAKEUP_ADDRESSMARK = (uint8_t)0x08 }
 UART4 WakeUP Modes. More...
enum  UART4_WordLength_TypeDef { UART4_WORDLENGTH_8D = (uint8_t)0x00, UART4_WORDLENGTH_9D = (uint8_t)0x10 }
 UART4 Word length possible values. More...

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.

Detailed Description

This file contains all functions prototypes and macros for the UART4 peripheral.

Author:
MCD Application Team
Version:
V2.2.0
Date:
30-September-2014
Attention:

© COPYRIGHT 2014 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stm8s_uart4.h.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com