STM8S/A Standard Peripherals Drivers
|
This file contains all functions prototypes and macros for the UART1 peripheral. More...
#include "stm8s.h"
Go to the source code of this file.
Defines | |
#define | IS_UART1_ADDRESS_OK(node) ((node) < UART1_ADDRESS_MAX ) |
#define | IS_UART1_BAUDRATE_OK(NUM) ((NUM) <= (uint32_t)625000) |
Macro used by the assert_param function in order to check the maximum baudrate value. | |
#define | IS_UART1_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_UART1_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_UART1_CONFIG_IT_OK(Interrupt) |
Macro used by the assert_param function in order to check the different sensitivity values for the Interrupts. | |
#define | IS_UART1_FLAG_OK(Flag) |
Macro used by the assert_param function in order to check the different sensitivity values for the FLAGs. | |
#define | IS_UART1_GET_IT_OK(ITPendingBit) |
Macro used by the assert function in order to check the different sensitivity values for the pending bit. | |
#define | IS_UART1_IRDAMODE_OK(IrDAMode) |
Macro used by the assert_param function in order to check the different sensitivity values for the IrDAModes. | |
#define | IS_UART1_LINBREAKDETECTIONLENGTH_OK(LINBreakDetectionLength) |
Macro used by the assert_param function in order to check the different sensitivity values for the LINBreakDetectionLengths. | |
#define | IS_UART1_MODE_OK(Mode) |
Macro used by the assert function to check the different functions parameters. | |
#define | IS_UART1_PARITY_OK(Parity) |
Macro used by the assert_param function in order to check the different sensitivity values for the Parity. | |
#define | IS_UART1_STOPBITS_OK(StopBit) |
Macro used by the assert_param function in order to check the different sensitivity values for the UART1_StopBits. | |
#define | IS_UART1_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 UART1_CLOCK_ENABLE|UART1_CLOCK_DISABLE. | |
#define | IS_UART1_WAKEUP_OK(WakeUp) |
Macro used by the assert_param function in order to check the different sensitivity values for the WakeUps. | |
#define | IS_UART1_WORDLENGTH_OK(WordLength) |
Macro used by the assert_param function in order to check the different sensitivity values for the WordLengths. | |
#define | UART1_ADDRESS_MAX ((uint8_t)16) |
Macro used by the assert_param function in order to check the address of the UART1 or UART node. | |
Enumerations | |
enum | UART1_Flag_TypeDef { UART1_FLAG_TXE = (uint16_t)0x0080, UART1_FLAG_TC = (uint16_t)0x0040, UART1_FLAG_RXNE = (uint16_t)0x0020, UART1_FLAG_IDLE = (uint16_t)0x0010, UART1_FLAG_OR = (uint16_t)0x0008, UART1_FLAG_NF = (uint16_t)0x0004, UART1_FLAG_FE = (uint16_t)0x0002, UART1_FLAG_PE = (uint16_t)0x0001, UART1_FLAG_LBDF = (uint16_t)0x0210, UART1_FLAG_SBK = (uint16_t)0x0101 } |
UART1 Flag possible values. More... | |
enum | UART1_IrDAMode_TypeDef { UART1_IRDAMODE_NORMAL = (uint8_t)0x00, UART1_IRDAMODE_LOWPOWER = (uint8_t)0x01 } |
UART1 Irda Modes. More... | |
enum | UART1_IT_TypeDef { UART1_IT_TXE = (uint16_t)0x0277, UART1_IT_TC = (uint16_t)0x0266, UART1_IT_RXNE = (uint16_t)0x0255, UART1_IT_IDLE = (uint16_t)0x0244, UART1_IT_OR = (uint16_t)0x0235, UART1_IT_PE = (uint16_t)0x0100, UART1_IT_LBDF = (uint16_t)0x0346, UART1_IT_RXNE_OR = (uint16_t)0x0205 } |
UART1 Interrupt definition UART1_IT possible values Elements values convention: 0xZYX X: Position of the corresponding Interrupt. More... | |
enum | UART1_LINBreakDetectionLength_TypeDef { UART1_LINBREAKDETECTIONLENGTH_10BITS = (uint8_t)0x00, UART1_LINBREAKDETECTIONLENGTH_11BITS = (uint8_t)0x01 } |
UART1 LIN Break detection length possible values. More... | |
enum | UART1_Mode_TypeDef { UART1_MODE_RX_ENABLE = (uint8_t)0x08, UART1_MODE_TX_ENABLE = (uint8_t)0x04, UART1_MODE_TX_DISABLE = (uint8_t)0x80, UART1_MODE_RX_DISABLE = (uint8_t)0x40, UART1_MODE_TXRX_ENABLE = (uint8_t)0x0C } |
UART1 Mode possible values. More... | |
enum | UART1_Parity_TypeDef { UART1_PARITY_NO = (uint8_t)0x00, UART1_PARITY_EVEN = (uint8_t)0x04, UART1_PARITY_ODD = (uint8_t)0x06 } |
UART1 parity possible values. More... | |
enum | UART1_StopBits_TypeDef { UART1_STOPBITS_1 = (uint8_t)0x00, UART1_STOPBITS_0_5 = (uint8_t)0x10, UART1_STOPBITS_2 = (uint8_t)0x20, UART1_STOPBITS_1_5 = (uint8_t)0x30 } |
UART1 stop bits possible values. More... | |
enum | UART1_SyncMode_TypeDef { UART1_SYNCMODE_CLOCK_DISABLE = (uint8_t)0x80, UART1_SYNCMODE_CLOCK_ENABLE = (uint8_t)0x08, UART1_SYNCMODE_CPOL_LOW = (uint8_t)0x40, UART1_SYNCMODE_CPOL_HIGH = (uint8_t)0x04, UART1_SYNCMODE_CPHA_MIDDLE = (uint8_t)0x20, UART1_SYNCMODE_CPHA_BEGINING = (uint8_t)0x02, UART1_SYNCMODE_LASTBIT_DISABLE = (uint8_t)0x10, UART1_SYNCMODE_LASTBIT_ENABLE = (uint8_t)0x01 } |
UART1 Synchrone modes. More... | |
enum | UART1_WakeUp_TypeDef { UART1_WAKEUP_IDLELINE = (uint8_t)0x00, UART1_WAKEUP_ADDRESSMARK = (uint8_t)0x08 } |
UART1 WakeUP Modes. More... | |
enum | UART1_WordLength_TypeDef { UART1_WORDLENGTH_8D = (uint8_t)0x00, UART1_WORDLENGTH_9D = (uint8_t)0x10 } |
UART1 Word length possible values. More... | |
Functions | |
void | UART1_ClearFlag (UART1_Flag_TypeDef UART1_FLAG) |
Clears the UART1 flags. | |
void | UART1_ClearITPendingBit (UART1_IT_TypeDef UART1_IT) |
Clears the UART1 pending flags. | |
void | UART1_Cmd (FunctionalState NewState) |
Enable the UART1 peripheral. | |
void | UART1_DeInit (void) |
Deinitializes the UART peripheral. | |
FlagStatus | UART1_GetFlagStatus (UART1_Flag_TypeDef UART1_FLAG) |
Checks whether the specified UART1 flag is set or not. | |
ITStatus | UART1_GetITStatus (UART1_IT_TypeDef UART1_IT) |
Checks whether the specified UART1 interrupt has occurred or not. | |
void | UART1_HalfDuplexCmd (FunctionalState NewState) |
Enables or disables the UART�s Half Duplex communication. | |
void | UART1_Init (uint32_t BaudRate, UART1_WordLength_TypeDef WordLength, UART1_StopBits_TypeDef StopBits, UART1_Parity_TypeDef Parity, UART1_SyncMode_TypeDef SyncMode, UART1_Mode_TypeDef Mode) |
Initializes the UART1 according to the specified parameters. | |
void | UART1_IrDACmd (FunctionalState NewState) |
Enables or disables the UART�s IrDA interface. | |
void | UART1_IrDAConfig (UART1_IrDAMode_TypeDef UART1_IrDAMode) |
Configures the UART�s IrDA interface. | |
void | UART1_ITConfig (UART1_IT_TypeDef UART1_IT, FunctionalState NewState) |
Enables or disables the specified USART interrupts. | |
void | UART1_LINBreakDetectionConfig (UART1_LINBreakDetectionLength_TypeDef UART1_LINBreakDetectionLength) |
Sets the UART1 LIN Break detection length. | |
void | UART1_LINCmd (FunctionalState NewState) |
Enables or disables the UART1�s LIN mode. | |
uint8_t | UART1_ReceiveData8 (void) |
Returns the most recent received data by the UART1 peripheral. | |
uint16_t | UART1_ReceiveData9 (void) |
Returns the most recent received data by the UART1 peripheral. | |
void | UART1_ReceiverWakeUpCmd (FunctionalState NewState) |
Determines if the UART1 is in mute mode or not. | |
void | UART1_SendBreak (void) |
Transmits break characters. | |
void | UART1_SendData8 (uint8_t Data) |
Transmits 8 bit data through the UART1 peripheral. | |
void | UART1_SendData9 (uint16_t Data) |
Transmits 9 bit data through the UART peripheral. | |
void | UART1_SetAddress (uint8_t UART1_Address) |
Sets the address of the UART1 node. | |
void | UART1_SetGuardTime (uint8_t UART1_GuardTime) |
Sets the specified UART guard time. | |
void | UART1_SetPrescaler (uint8_t UART1_Prescaler) |
Sets the system clock prescaler. | |
void | UART1_SmartCardCmd (FunctionalState NewState) |
Enables or disables the UART1 Smart Card mode. | |
void | UART1_SmartCardNACKCmd (FunctionalState NewState) |
Enables or disables NACK transmission. | |
void | UART1_WakeUpConfig (UART1_WakeUp_TypeDef UART1_WakeUp) |
Selects the UART1 WakeUp method. |
Detailed Description
This file contains all functions prototypes and macros for the UART1 peripheral.
- 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_uart1.h.