stm8s_uart4.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. /**
  2. ********************************************************************************
  3. * @file stm8s_uart4.h
  4. * @author MCD Application Team
  5. * @version V2.3.0
  6. * @date 16-June-2017
  7. * @brief This file contains all functions prototypes and macros for the UART4 peripheral.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
  12. *
  13. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  14. * You may not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at:
  16. *
  17. * http://www.st.com/software_license_agreement_liberty_v2
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an "AS IS" BASIS,
  21. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. *
  25. ******************************************************************************
  26. */
  27. /* Define to prevent recursive inclusion -------------------------------------*/
  28. #ifndef __STM8S_UART4_H
  29. #define __STM8S_UART4_H
  30. /* Includes ------------------------------------------------------------------*/
  31. #include "stm8s.h"
  32. /** @addtogroup STM8S_StdPeriph_Driver
  33. * @{
  34. */
  35. /* Exported types ------------------------------------------------------------*/
  36. /** @addtogroup UART4_Exported_Types
  37. * @{
  38. */
  39. /**
  40. * @brief UART4 Irda Modes
  41. */
  42. typedef enum { UART4_IRDAMODE_NORMAL = (uint8_t)0x00, /**< 0x00 Irda Normal Mode */
  43. UART4_IRDAMODE_LOWPOWER = (uint8_t)0x01 /**< 0x01 Irda Low Power Mode */
  44. } UART4_IrDAMode_TypeDef;
  45. /**
  46. * @brief UART4 WakeUP Modes
  47. */
  48. typedef enum { UART4_WAKEUP_IDLELINE = (uint8_t)0x00, /**< 0x01 Idle Line wake up */
  49. UART4_WAKEUP_ADDRESSMARK = (uint8_t)0x08 /**< 0x02 Address Mark wake up */
  50. } UART4_WakeUp_TypeDef;
  51. /**
  52. * @brief UART4 LIN Break detection length possible values
  53. */
  54. typedef enum { UART4_LINBREAKDETECTIONLENGTH_10BITS = (uint8_t)0x00, /**< 0x01 10 bits Lin Break detection */
  55. UART4_LINBREAKDETECTIONLENGTH_11BITS = (uint8_t)0x01 /**< 0x02 11 bits Lin Break detection */
  56. } UART4_LINBreakDetectionLength_TypeDef;
  57. /**
  58. * @brief UART4 stop bits possible values
  59. */
  60. typedef enum { UART4_STOPBITS_1 = (uint8_t)0x00, /**< One stop bit is transmitted at the end of frame*/
  61. UART4_STOPBITS_0_5 = (uint8_t)0x10, /**< Half stop bits is transmitted at the end of frame*/
  62. UART4_STOPBITS_2 = (uint8_t)0x20, /**< Two stop bits are transmitted at the end of frame*/
  63. UART4_STOPBITS_1_5 = (uint8_t)0x30 /**< One and half stop bits*/
  64. } UART4_StopBits_TypeDef;
  65. /**
  66. * @brief UART4 parity possible values
  67. */
  68. typedef enum { UART4_PARITY_NO = (uint8_t)0x00, /**< No Parity*/
  69. UART4_PARITY_EVEN = (uint8_t)0x04, /**< Even Parity*/
  70. UART4_PARITY_ODD = (uint8_t)0x06 /**< Odd Parity*/
  71. } UART4_Parity_TypeDef;
  72. /**
  73. * @brief UART4 Mode possible values
  74. */
  75. typedef enum { UART4_LIN_MODE_MASTER = (uint8_t)0x00, /**< LIN Master Mode*/
  76. UART4_LIN_MODE_SLAVE = (uint8_t)0x01 /**< LIN Slave Mode*/
  77. } UART4_LinMode_TypeDef;
  78. /**
  79. * @brief UART4 automatic resynchronisation possible values
  80. */
  81. typedef enum { UART4_LIN_AUTOSYNC_DISABLE = (uint8_t)0x00, /**< LIN Autosynchronization Disable*/
  82. UART4_LIN_AUTOSYNC_ENABLE = (uint8_t)0x01 /**< LIN Autosynchronization Enable*/
  83. } UART4_LinAutosync_TypeDef;
  84. /**
  85. * @brief UART4 Divider Update Method possible values
  86. */
  87. typedef enum { UART4_LIN_DIVUP_LBRR1 = (uint8_t)0x00, /**< LIN LDIV is updated as soon as LBRR1 is written*/
  88. UART4_LIN_DIVUP_NEXTRXNE = (uint8_t)0x01 /**< LIN LDIV is updated at the next received character*/
  89. } UART4_LinDivUp_TypeDef;
  90. /**
  91. * @brief UART4 Synchrone modes
  92. */
  93. typedef enum { UART4_SYNCMODE_CLOCK_DISABLE = (uint8_t)0x80, /**< 0x80 Sync mode Disable, SLK pin Disable */
  94. UART4_SYNCMODE_CLOCK_ENABLE = (uint8_t)0x08, /**< 0x08 Sync mode Enable, SLK pin Enable */
  95. UART4_SYNCMODE_CPOL_LOW = (uint8_t)0x40, /**< 0x40 Steady low value on SCLK pin outside transmission window */
  96. UART4_SYNCMODE_CPOL_HIGH = (uint8_t)0x04, /**< 0x04 Steady high value on SCLK pin outside transmission window */
  97. UART4_SYNCMODE_CPHA_MIDDLE = (uint8_t)0x20, /**< 0x20 SCLK clock line activated in middle of data bit */
  98. UART4_SYNCMODE_CPHA_BEGINING = (uint8_t)0x02, /**< 0x02 SCLK clock line activated at beginning of data bit */
  99. UART4_SYNCMODE_LASTBIT_DISABLE = (uint8_t)0x10, /**< 0x10 The clock pulse of the last data bit is not output to the SCLK pin */
  100. UART4_SYNCMODE_LASTBIT_ENABLE = (uint8_t)0x01 /**< 0x01 The clock pulse of the last data bit is output to the SCLK pin */
  101. } UART4_SyncMode_TypeDef;
  102. /**
  103. * @brief UART4 Word length possible values
  104. */
  105. typedef enum { UART4_WORDLENGTH_8D = (uint8_t)0x00,/**< 0x00 8 bits Data */
  106. UART4_WORDLENGTH_9D = (uint8_t)0x10 /**< 0x10 9 bits Data */
  107. } UART4_WordLength_TypeDef;
  108. /**
  109. * @brief UART4 Mode possible values
  110. */
  111. typedef enum { UART4_MODE_RX_ENABLE = (uint8_t)0x08, /**< 0x08 Receive Enable */
  112. UART4_MODE_TX_ENABLE = (uint8_t)0x04, /**< 0x04 Transmit Enable */
  113. UART4_MODE_TX_DISABLE = (uint8_t)0x80, /**< 0x80 Transmit Disable */
  114. UART4_MODE_RX_DISABLE = (uint8_t)0x40, /**< 0x40 Single-wire Half-duplex mode */
  115. UART4_MODE_TXRX_ENABLE = (uint8_t)0x0C /**< 0x0C Transmit Enable and Receive Enable */
  116. } UART4_Mode_TypeDef;
  117. /**
  118. * @brief UART4 Flag possible values
  119. */
  120. typedef enum
  121. {
  122. UART4_FLAG_TXE = (uint16_t)0x0080, /*!< Transmit Data Register Empty flag */
  123. UART4_FLAG_TC = (uint16_t)0x0040, /*!< Transmission Complete flag */
  124. UART4_FLAG_RXNE = (uint16_t)0x0020, /*!< Read Data Register Not Empty flag */
  125. UART4_FLAG_IDLE = (uint16_t)0x0010, /*!< Idle line detected flag */
  126. UART4_FLAG_OR_LHE = (uint16_t)0x0008, /*!< OverRun error flag */
  127. UART4_FLAG_NF = (uint16_t)0x0004, /*!< Noise error flag */
  128. UART4_FLAG_FE = (uint16_t)0x0002, /*!< Framing Error flag */
  129. UART4_FLAG_PE = (uint16_t)0x0001, /*!< Parity Error flag */
  130. UART4_FLAG_SBK = (uint16_t)0x0101, /**< Send Break Complete interrupt flag */
  131. UART4_FLAG_LBDF = (uint16_t)0x0210, /**< LIN Break Detection Flag */
  132. UART4_FLAG_LHDF = (uint16_t)0x0302, /**< LIN Header Detection Flag*/
  133. UART4_FLAG_LSF = (uint16_t)0x0301 /**< LIN Sync Field Flag*/
  134. } UART4_Flag_TypeDef;
  135. /**
  136. * @brief UART4 Interrupt definition
  137. * UART4_IT possible values
  138. * Elements values convention: 0xZYX
  139. * X: Position of the corresponding Interrupt
  140. * - For the following values, X means the interrupt position in the CR2 register.
  141. * UART4_IT_TXE
  142. * UART4_IT_TC
  143. * UART4_IT_RXNE
  144. * UART4_IT_IDLE
  145. * UART4_IT_OR
  146. * - For the UART4_IT_PE value, X means the flag position in the CR1 register.
  147. * - For the UART4_IT_LBDF value, X means the flag position in the CR4 register.
  148. * - For the UART4_IT_LHDF value, X means the flag position in the CR6 register.
  149. * Y: Flag position
  150. * - For the following values, Y means the flag (pending bit) position in the SR register.
  151. * UART4_IT_TXE
  152. * UART4_IT_TC
  153. * UART4_IT_RXNE
  154. * UART4_IT_IDLE
  155. * UART4_IT_OR
  156. * UART4_IT_PE
  157. * - For the UART4_IT_LBDF value, Y means the flag position in the CR4 register.
  158. * - For the UART4_IT_LHDF value, Y means the flag position in the CR6 register.
  159. * Z: Register index: indicate in which register the dedicated interrupt source is:
  160. * - 1==> CR1 register
  161. * - 2==> CR2 register
  162. * - 3==> CR4 register
  163. * - 4==> CR6 register
  164. */
  165. typedef enum { UART4_IT_TXE = (uint16_t)0x0277, /**< Transmit interrupt */
  166. UART4_IT_TC = (uint16_t)0x0266, /**< Transmission Complete interrupt */
  167. UART4_IT_RXNE = (uint16_t)0x0255, /**< Data Register Not Empty interrupt */
  168. UART4_IT_IDLE = (uint16_t)0x0244, /**< Idle line detected interrupt */
  169. UART4_IT_OR = (uint16_t)0x0235, /**< OverRun error interrupt */
  170. UART4_IT_PE = (uint16_t)0x0100, /**< Parity Error interrupt */
  171. UART4_IT_LBDF = (uint16_t)0x0346, /**< LIN Break Detection interrupt */
  172. UART4_IT_LHDF = (uint16_t)0x0412, /**< LIN Header Detection interrupt*/
  173. UART4_IT_RXNE_OR = (uint16_t)0x0205 /*!< Receive/Overrun interrupt */
  174. } UART4_IT_TypeDef;
  175. /**
  176. * @}
  177. */
  178. /* Exported constants --------------------------------------------------------*/
  179. /* Exported macros -----------------------------------------------------------*/
  180. /* Private macros ------------------------------------------------------------*/
  181. /** @addtogroup UART4_Private_Macros
  182. * @{
  183. */
  184. /**
  185. * @brief Macro used by the assert function to check the different functions parameters.
  186. */
  187. /**
  188. * @brief Macro used by the assert_param function in order to check the different
  189. * sensitivity values for the MODEs possible combination should be one of
  190. * the following.
  191. */
  192. #define IS_UART4_MODE_OK(Mode) \
  193. (((Mode) == (uint8_t)UART4_MODE_RX_ENABLE) || \
  194. ((Mode) == (uint8_t)UART4_MODE_RX_DISABLE) || \
  195. ((Mode) == (uint8_t)UART4_MODE_TX_ENABLE) || \
  196. ((Mode) == (uint8_t)UART4_MODE_TX_DISABLE) || \
  197. ((Mode) == (uint8_t)UART4_MODE_TXRX_ENABLE) || \
  198. ((Mode) == (uint8_t)((uint8_t)UART4_MODE_TX_ENABLE|(uint8_t)UART4_MODE_RX_ENABLE)) || \
  199. ((Mode) == (uint8_t)((uint8_t)UART4_MODE_TX_ENABLE|(uint8_t)UART4_MODE_RX_DISABLE)) || \
  200. ((Mode) == (uint8_t)((uint8_t)UART4_MODE_TX_DISABLE|(uint8_t)UART4_MODE_RX_DISABLE)) || \
  201. ((Mode) == (uint8_t)((uint8_t)UART4_MODE_TX_DISABLE|(uint8_t)UART4_MODE_RX_ENABLE)))
  202. /**
  203. * @brief Macro used by the assert_param function in order to check the different
  204. * sensitivity values for the WordLengths
  205. */
  206. #define IS_UART4_WORDLENGTH_OK(WordLength) \
  207. (((WordLength) == UART4_WORDLENGTH_8D) || \
  208. ((WordLength) == UART4_WORDLENGTH_9D))
  209. /**
  210. * @brief Macro used by the assert_param function in order to check the different
  211. * sensitivity values for the SyncModes; it should exclude values such
  212. * as UART4_CLOCK_ENABLE|UART4_CLOCK_DISABLE
  213. */
  214. #define IS_UART4_SYNCMODE_OK(SyncMode) \
  215. (!((((SyncMode)&(((uint8_t)UART4_SYNCMODE_CLOCK_ENABLE)|((uint8_t)UART4_SYNCMODE_CLOCK_DISABLE))) == (((uint8_t)UART4_SYNCMODE_CLOCK_ENABLE)|((uint8_t)UART4_SYNCMODE_CLOCK_DISABLE))) || \
  216. (((SyncMode)&(((uint8_t)UART4_SYNCMODE_CPOL_LOW )|((uint8_t)UART4_SYNCMODE_CPOL_HIGH))) == (((uint8_t)UART4_SYNCMODE_CPOL_LOW )|((uint8_t)UART4_SYNCMODE_CPOL_HIGH))) || \
  217. (((SyncMode)&(((uint8_t)UART4_SYNCMODE_CPHA_MIDDLE)|((uint8_t)UART4_SYNCMODE_CPHA_BEGINING))) == (((uint8_t)UART4_SYNCMODE_CPHA_MIDDLE)|((uint8_t)UART4_SYNCMODE_CPHA_BEGINING))) || \
  218. (((SyncMode)&(((uint8_t)UART4_SYNCMODE_LASTBIT_DISABLE)|((uint8_t)UART4_SYNCMODE_LASTBIT_ENABLE))) == (((uint8_t)UART4_SYNCMODE_LASTBIT_DISABLE)|((uint8_t)UART4_SYNCMODE_LASTBIT_ENABLE)))))
  219. /**
  220. * @brief Macro used by the assert_param function in order to check the
  221. * different sensitivity values for the FLAGs
  222. */
  223. #define IS_UART4_FLAG_OK(Flag) \
  224. (((Flag) == UART4_FLAG_TXE) || \
  225. ((Flag) == UART4_FLAG_TC) || \
  226. ((Flag) == UART4_FLAG_RXNE) || \
  227. ((Flag) == UART4_FLAG_IDLE) || \
  228. ((Flag) == UART4_FLAG_OR_LHE) || \
  229. ((Flag) == UART4_FLAG_NF) || \
  230. ((Flag) == UART4_FLAG_FE) || \
  231. ((Flag) == UART4_FLAG_PE) || \
  232. ((Flag) == UART4_FLAG_SBK) || \
  233. ((Flag) == UART4_FLAG_LSF) || \
  234. ((Flag) == UART4_FLAG_LHDF) || \
  235. ((Flag) == UART4_FLAG_LBDF))
  236. /**
  237. * @brief Macro used by the assert_param function in order to check the
  238. * different sensitivity values for the FLAGs that can be cleared by writing 0
  239. */
  240. #define IS_UART4_CLEAR_FLAG_OK(Flag) \
  241. (((Flag) == UART4_FLAG_RXNE) || \
  242. ((Flag) == UART4_FLAG_LHDF) || \
  243. ((Flag) == UART4_FLAG_LSF) || \
  244. ((Flag) == UART4_FLAG_LBDF))
  245. /**
  246. * @brief Macro used by the assert_param function in order to check
  247. * the different sensitivity values for the Interrupts
  248. */
  249. #define IS_UART4_CONFIG_IT_OK(Interrupt) \
  250. (((Interrupt) == UART4_IT_PE) || \
  251. ((Interrupt) == UART4_IT_TXE) || \
  252. ((Interrupt) == UART4_IT_TC) || \
  253. ((Interrupt) == UART4_IT_RXNE_OR ) || \
  254. ((Interrupt) == UART4_IT_IDLE) || \
  255. ((Interrupt) == UART4_IT_LHDF) || \
  256. ((Interrupt) == UART4_IT_LBDF))
  257. /**
  258. * @brief Macro used by the assert function in order to check the different
  259. * sensitivity values for the pending bit
  260. */
  261. #define IS_UART4_GET_IT_OK(ITPendingBit) \
  262. (((ITPendingBit) == UART4_IT_TXE) || \
  263. ((ITPendingBit) == UART4_IT_TC) || \
  264. ((ITPendingBit) == UART4_IT_RXNE) || \
  265. ((ITPendingBit) == UART4_IT_IDLE) || \
  266. ((ITPendingBit) == UART4_IT_OR) || \
  267. ((ITPendingBit) == UART4_IT_LBDF) || \
  268. ((ITPendingBit) == UART4_IT_LHDF) || \
  269. ((ITPendingBit) == UART4_IT_PE))
  270. /**
  271. * @brief Macro used by the assert function in order to check the different
  272. * sensitivity values for the pending bit that can be cleared by writing 0
  273. */
  274. #define IS_UART4_CLEAR_IT_OK(ITPendingBit) \
  275. (((ITPendingBit) == UART4_IT_RXNE) || \
  276. ((ITPendingBit) == UART4_IT_LHDF) || \
  277. ((ITPendingBit) == UART4_IT_LBDF))
  278. /**
  279. * @brief Macro used by the assert_param function in order to check the different
  280. * sensitivity values for the IrDAModes
  281. */
  282. #define IS_UART4_IRDAMODE_OK(IrDAMode) \
  283. (((IrDAMode) == UART4_IRDAMODE_LOWPOWER) || \
  284. ((IrDAMode) == UART4_IRDAMODE_NORMAL))
  285. /**
  286. * @brief Macro used by the assert_param function in order to check the different
  287. * sensitivity values for the WakeUps
  288. */
  289. #define IS_UART4_WAKEUP_OK(WakeUp) \
  290. (((WakeUp) == UART4_WAKEUP_IDLELINE) || \
  291. ((WakeUp) == UART4_WAKEUP_ADDRESSMARK))
  292. /**
  293. * @brief Macro used by the assert_param function in order to check the different
  294. * sensitivity values for the LINBreakDetectionLengths
  295. */
  296. #define IS_UART4_LINBREAKDETECTIONLENGTH_OK(LINBreakDetectionLength) \
  297. (((LINBreakDetectionLength) == UART4_LINBREAKDETECTIONLENGTH_10BITS) || \
  298. ((LINBreakDetectionLength) == UART4_LINBREAKDETECTIONLENGTH_11BITS))
  299. /**
  300. * @brief Macro used by the assert_param function in order to check the different
  301. * sensitivity values for the UART4_StopBits
  302. */
  303. #define IS_UART4_STOPBITS_OK(StopBit) (((StopBit) == UART4_STOPBITS_1) || \
  304. ((StopBit) == UART4_STOPBITS_0_5) || \
  305. ((StopBit) == UART4_STOPBITS_2) || \
  306. ((StopBit) == UART4_STOPBITS_1_5 ))
  307. /**
  308. * @brief Macro used by the assert_param function in order to check the different
  309. * sensitivity values for the Paritys
  310. */
  311. #define IS_UART4_PARITY_OK(Parity) (((Parity) == UART4_PARITY_NO) || \
  312. ((Parity) == UART4_PARITY_EVEN) || \
  313. ((Parity) == UART4_PARITY_ODD ))
  314. /**
  315. * @brief Macro used by the assert_param function in order to check the maximum
  316. * baudrate value
  317. */
  318. #define IS_UART4_BAUDRATE_OK(NUM) ((NUM) <= (uint32_t)625000)
  319. /**
  320. * @brief Macro used by the assert_param function in order to check the address
  321. * of the UART4 or UART node
  322. */
  323. #define UART4_ADDRESS_MAX ((uint8_t)16)
  324. #define IS_UART4_ADDRESS_OK(node) ((node) < UART4_ADDRESS_MAX )
  325. /**
  326. * @brief Macro used by the assert_param function in order to check the LIN mode
  327. */
  328. #define IS_UART4_SLAVE_OK(Mode) \
  329. (((Mode) == UART4_LIN_MODE_MASTER) || \
  330. ((Mode) == UART4_LIN_MODE_SLAVE))
  331. /**
  332. * @brief Macro used by the assert_param function in order to check the LIN
  333. * automatic resynchronization mode
  334. */
  335. #define IS_UART4_AUTOSYNC_OK(AutosyncMode) \
  336. (((AutosyncMode) == UART4_LIN_AUTOSYNC_ENABLE) || \
  337. ((AutosyncMode) == UART4_LIN_AUTOSYNC_DISABLE))
  338. /**
  339. * @brief Macro used by the assert_param function in order to check the LIN divider update method
  340. */
  341. #define IS_UART4_DIVUP_OK(DivupMethod) \
  342. (((DivupMethod) == UART4_LIN_DIVUP_LBRR1) || \
  343. ((DivupMethod) == UART4_LIN_DIVUP_NEXTRXNE))
  344. /**
  345. * @}
  346. */
  347. /* Exported functions ------------------------------------------------------- */
  348. /** @addtogroup UART4_Exported_Functions
  349. * @{
  350. */
  351. void UART4_DeInit(void);
  352. void UART4_Init(uint32_t BaudRate, UART4_WordLength_TypeDef WordLength,
  353. UART4_StopBits_TypeDef StopBits, UART4_Parity_TypeDef Parity,
  354. UART4_SyncMode_TypeDef SyncMode, UART4_Mode_TypeDef Mode);
  355. void UART4_Cmd(FunctionalState NewState);
  356. void UART4_ITConfig(UART4_IT_TypeDef UART4_IT, FunctionalState NewState);
  357. void UART4_HalfDuplexCmd(FunctionalState NewState);
  358. void UART4_IrDAConfig(UART4_IrDAMode_TypeDef UART4_IrDAMode);
  359. void UART4_IrDACmd(FunctionalState NewState);
  360. void UART4_LINBreakDetectionConfig(UART4_LINBreakDetectionLength_TypeDef UART4_LINBreakDetectionLength);
  361. void UART4_LINConfig(UART4_LinMode_TypeDef UART4_Mode,
  362. UART4_LinAutosync_TypeDef UART4_Autosync,
  363. UART4_LinDivUp_TypeDef UART4_DivUp);
  364. void UART4_LINCmd(FunctionalState NewState);
  365. void UART4_SmartCardCmd(FunctionalState NewState);
  366. void UART4_SmartCardNACKCmd(FunctionalState NewState);
  367. void UART4_WakeUpConfig(UART4_WakeUp_TypeDef UART4_WakeUp);
  368. void UART4_ReceiverWakeUpCmd(FunctionalState NewState);
  369. uint8_t UART4_ReceiveData8(void);
  370. uint16_t UART4_ReceiveData9(void);
  371. void UART4_SendData8(uint8_t Data);
  372. void UART4_SendData9(uint16_t Data);
  373. void UART4_SendBreak(void);
  374. void UART4_SetAddress(uint8_t UART4_Address);
  375. void UART4_SetGuardTime(uint8_t UART4_GuardTime);
  376. void UART4_SetPrescaler(uint8_t UART4_Prescaler);
  377. FlagStatus UART4_GetFlagStatus(UART4_Flag_TypeDef UART4_FLAG);
  378. void UART4_ClearFlag(UART4_Flag_TypeDef UART4_FLAG);
  379. ITStatus UART4_GetITStatus(UART4_IT_TypeDef UART4_IT);
  380. void UART4_ClearITPendingBit(UART4_IT_TypeDef UART4_IT);
  381. /**
  382. * @}
  383. */
  384. #endif /* __STM8S_UART4_H */
  385. /**
  386. * @}
  387. */
  388. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/