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

STM8S/A

stm8s_uart2.h File Reference

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

#include "stm8s.h"

Go to the source code of this file.

Defines

#define IS_UART2_ADDRESS_OK(node)   ((node) < UART2_ADDRESS_MAX )
#define IS_UART2_AUTOSYNC_OK(AutosyncMode)
 Macro used by the assert_param function in order to check the LIN automatic resynchronization mode.
#define IS_UART2_BAUDRATE_OK(NUM)   ((NUM) <= (uint32_t)625000)
 Macro used by the assert_param function in order to check the maximum baudrate value.
#define IS_UART2_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_UART2_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_UART2_CONFIG_IT_OK(Interrupt)
 Macro used by the assert_param function in order to check the different sensitivity values for the Interrupts.
#define IS_UART2_DIVUP_OK(DivupMethod)
 Macro used by the assert_param function in order to check the LIN divider update method.
#define IS_UART2_FLAG_OK(Flag)
 Macro used by the assert_param function in order to check the different sensitivity values for the FLAGs.
#define IS_UART2_GET_IT_OK(ITPendingBit)
 Macro used by the assert function in order to check the different sensitivity values for the pending bit.
#define IS_UART2_IRDAMODE_OK(IrDAMode)
 Macro used by the assert_param function in order to check the different sensitivity values for the IrDAModes.
#define IS_UART2_LINBREAKDETECTIONLENGTH_OK(LINBreakDetectionLength)
 Macro used by the assert_param function in order to check the different sensitivity values for the LINBreakDetectionLengths.
#define IS_UART2_MODE_OK(Mode)
 Macro used by the assert function to check the different functions parameters.
#define IS_UART2_PARITY_OK(Parity)
 Macro used by the assert_param function in order to check the different sensitivity values for the Paritys.
#define IS_UART2_SLAVE_OK(Mode)
 Macro used by the assert_param function in order to check the LIN mode.
#define IS_UART2_STOPBITS_OK(StopBit)
 Macro used by the assert_param function in order to check the different sensitivity values for the UART2_StopBits.
#define IS_UART2_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 UART2_CLOCK_ENABLE|UART2_CLOCK_DISABLE.
#define IS_UART2_WAKEUP_OK(WakeUp)
 Macro used by the assert_param function in order to check the different sensitivity values for the WakeUps.
#define IS_UART2_WORDLENGTH_OK(WordLength)
 Macro used by the assert_param function in order to check the different sensitivity values for the WordLengths.
#define UART2_ADDRESS_MAX   ((uint8_t)16)
 Macro used by the assert_param function in order to check the address of the UART2 or UART node.

Enumerations

enum  UART2_Flag_TypeDef {
  UART2_FLAG_TXE = (uint16_t)0x0080, UART2_FLAG_TC = (uint16_t)0x0040, UART2_FLAG_RXNE = (uint16_t)0x0020, UART2_FLAG_IDLE = (uint16_t)0x0010,
  UART2_FLAG_OR_LHE = (uint16_t)0x0008, UART2_FLAG_NF = (uint16_t)0x0004, UART2_FLAG_FE = (uint16_t)0x0002, UART2_FLAG_PE = (uint16_t)0x0001,
  UART2_FLAG_SBK = (uint16_t)0x0101, UART2_FLAG_LBDF = (uint16_t)0x0210, UART2_FLAG_LHDF = (uint16_t)0x0302, UART2_FLAG_LSF = (uint16_t)0x0301
}
 UART2 Flag possible values. More...
enum  UART2_IrDAMode_TypeDef { UART2_IRDAMODE_NORMAL = (uint8_t)0x00, UART2_IRDAMODE_LOWPOWER = (uint8_t)0x01 }
 UART2 Irda Modes. More...
enum  UART2_IT_TypeDef {
  UART2_IT_TXE = (uint16_t)0x0277, UART2_IT_TC = (uint16_t)0x0266, UART2_IT_RXNE = (uint16_t)0x0255, UART2_IT_IDLE = (uint16_t)0x0244,
  UART2_IT_OR = (uint16_t)0x0235, UART2_IT_PE = (uint16_t)0x0100, UART2_IT_LBDF = (uint16_t)0x0346, UART2_IT_LHDF = (uint16_t)0x0412,
  UART2_IT_RXNE_OR = (uint16_t)0x0205
}
 UART2 Interrupt definition UART2_IT possible values Elements values convention: 0xZYX X: Position of the corresponding Interrupt. More...
enum  UART2_LinAutosync_TypeDef { UART2_LIN_AUTOSYNC_DISABLE = (uint8_t)0x00, UART2_LIN_AUTOSYNC_ENABLE = (uint8_t)0x01 }
 UART2 automatic resynchronisation possible values. More...
enum  UART2_LINBreakDetectionLength_TypeDef { UART2_LINBREAKDETECTIONLENGTH_10BITS = (uint8_t)0x00, UART2_LINBREAKDETECTIONLENGTH_11BITS = (uint8_t)0x01 }
 UART2 LIN Break detection length possible values. More...
enum  UART2_LinDivUp_TypeDef { UART2_LIN_DIVUP_LBRR1 = (uint8_t)0x00, UART2_LIN_DIVUP_NEXTRXNE = (uint8_t)0x01 }
 UART2 Divider Update Method possible values. More...
enum  UART2_LinMode_TypeDef { UART2_LIN_MODE_MASTER = (uint8_t)0x00, UART2_LIN_MODE_SLAVE = (uint8_t)0x01 }
 UART2 Mode possible values. More...
enum  UART2_Mode_TypeDef {
  UART2_MODE_RX_ENABLE = (uint8_t)0x08, UART2_MODE_TX_ENABLE = (uint8_t)0x04, UART2_MODE_TX_DISABLE = (uint8_t)0x80, UART2_MODE_RX_DISABLE = (uint8_t)0x40,
  UART2_MODE_TXRX_ENABLE = (uint8_t)0x0C
}
 UART2 Mode possible values. More...
enum  UART2_Parity_TypeDef { UART2_PARITY_NO = (uint8_t)0x00, UART2_PARITY_EVEN = (uint8_t)0x04, UART2_PARITY_ODD = (uint8_t)0x06 }
 UART2 parity possible values. More...
enum  UART2_StopBits_TypeDef { UART2_STOPBITS_1 = (uint8_t)0x00, UART2_STOPBITS_0_5 = (uint8_t)0x10, UART2_STOPBITS_2 = (uint8_t)0x20, UART2_STOPBITS_1_5 = (uint8_t)0x30 }
 UART2 stop bits possible values. More...
enum  UART2_SyncMode_TypeDef {
  UART2_SYNCMODE_CLOCK_DISABLE = (uint8_t)0x80, UART2_SYNCMODE_CLOCK_ENABLE = (uint8_t)0x08, UART2_SYNCMODE_CPOL_LOW = (uint8_t)0x40, UART2_SYNCMODE_CPOL_HIGH = (uint8_t)0x04,
  UART2_SYNCMODE_CPHA_MIDDLE = (uint8_t)0x20, UART2_SYNCMODE_CPHA_BEGINING = (uint8_t)0x02, UART2_SYNCMODE_LASTBIT_DISABLE = (uint8_t)0x10, UART2_SYNCMODE_LASTBIT_ENABLE = (uint8_t)0x01
}
 UART2 Synchrone modes. More...
enum  UART2_WakeUp_TypeDef { UART2_WAKEUP_IDLELINE = (uint8_t)0x00, UART2_WAKEUP_ADDRESSMARK = (uint8_t)0x08 }
 UART2 WakeUP Modes. More...
enum  UART2_WordLength_TypeDef { UART2_WORDLENGTH_8D = (uint8_t)0x00, UART2_WORDLENGTH_9D = (uint8_t)0x10 }
 UART2 Word length possible values. More...

Functions

void UART2_ClearFlag (UART2_Flag_TypeDef UART2_FLAG)
 Clears the UART2 flags.
void UART2_ClearITPendingBit (UART2_IT_TypeDef UART2_IT)
 Clears the UART2 pending flags.
void UART2_Cmd (FunctionalState NewState)
 Enable the UART2 peripheral.
void UART2_DeInit (void)
 Deinitializes the UART peripheral.
FlagStatus UART2_GetFlagStatus (UART2_Flag_TypeDef UART2_FLAG)
 Checks whether the specified UART2 flag is set or not.
ITStatus UART2_GetITStatus (UART2_IT_TypeDef UART2_IT)
 Checks whether the specified UART2 interrupt has occurred or not.
void UART2_HalfDuplexCmd (FunctionalState NewState)
void UART2_Init (uint32_t BaudRate, UART2_WordLength_TypeDef WordLength, UART2_StopBits_TypeDef StopBits, UART2_Parity_TypeDef Parity, UART2_SyncMode_TypeDef SyncMode, UART2_Mode_TypeDef Mode)
 Initializes the UART2 according to the specified parameters.
void UART2_IrDACmd (FunctionalState NewState)
 Enables or disables the UART2�s IrDA interface.
void UART2_IrDAConfig (UART2_IrDAMode_TypeDef UART2_IrDAMode)
 Configures the UART2�s IrDA interface.
void UART2_ITConfig (UART2_IT_TypeDef UART2_IT, FunctionalState NewState)
 Enables or disables the specified UART2 interrupts.
void UART2_LINBreakDetectionConfig (UART2_LINBreakDetectionLength_TypeDef UART2_LINBreakDetectionLength)
 Sets the UART2 LIN Break detection length.
void UART2_LINCmd (FunctionalState NewState)
 Enables or disables the UART2 LIN mode.
void UART2_LINConfig (UART2_LinMode_TypeDef UART2_Mode, UART2_LinAutosync_TypeDef UART2_Autosync, UART2_LinDivUp_TypeDef UART2_DivUp)
 Configure the UART2 peripheral.
uint8_t UART2_ReceiveData8 (void)
 Returns the most recent received data by the UART2 peripheral.
uint16_t UART2_ReceiveData9 (void)
 Returns the most recent received data by the UART2 peripheral.
void UART2_ReceiverWakeUpCmd (FunctionalState NewState)
 Determines if the UART2 is in mute mode or not.
void UART2_SendBreak (void)
 Transmits break characters.
void UART2_SendData8 (uint8_t Data)
 Transmits 8 bit data through the UART2 peripheral.
void UART2_SendData9 (uint16_t Data)
 Transmits 9 bit data through the UART2 peripheral.
void UART2_SetAddress (uint8_t UART2_Address)
 Sets the address of the UART2 node.
void UART2_SetGuardTime (uint8_t UART2_GuardTime)
 Sets the specified UART2 guard time.
void UART2_SetPrescaler (uint8_t UART2_Prescaler)
 Sets the system clock prescaler.
void UART2_SmartCardCmd (FunctionalState NewState)
 Enables or disables the UART2 Smart Card mode.
void UART2_SmartCardNACKCmd (FunctionalState NewState)
 Enables or disables NACK transmission.
void UART2_WakeUpConfig (UART2_WakeUp_TypeDef UART2_WakeUp)
 Selects the UART2 WakeUp method.

Detailed Description

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

Author:
MCD Application Team
Version:
V2.3.0
Date:
16-June-2017
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_uart2.h.

STM8 Standard Peripherals Library: Footer

 

 

 

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