apm32f0xx_usart.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. /*!
  2. * @file apm32f0xx_usart.h
  3. *
  4. * @brief This file contains all the functions prototypes for the USART firmware library
  5. *
  6. * @version V1.0.3
  7. *
  8. * @date 2022-09-20
  9. *
  10. * @attention
  11. *
  12. * Copyright (C) 2020-2022 Geehy Semiconductor
  13. *
  14. * You may not use this file except in compliance with the
  15. * GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
  16. *
  17. * The program is only for reference, which is distributed in the hope
  18. * that it will be useful and instructional for customers to develop
  19. * their software. Unless required by applicable law or agreed to in
  20. * writing, the program is distributed on an "AS IS" BASIS, WITHOUT
  21. * ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
  23. * and limitations under the License.
  24. */
  25. #ifndef __APM32F0XX_USART_H
  26. #define __APM32F0XX_USART_H
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #include "apm32f0xx.h"
  31. /** @addtogroup APM32F0xx_StdPeriphDriver
  32. @{
  33. */
  34. /** @addtogroup USART_Driver USART Driver
  35. @{
  36. */
  37. /** @defgroup USART_Macros Macros
  38. @{
  39. */
  40. /** Macros description */
  41. #define USART_MACROS 1
  42. /**@} end of group USART_Macros*/
  43. /** @defgroup USART_Enumerations Enumerations
  44. @{
  45. */
  46. /**
  47. * @brief USART Word Length define
  48. */
  49. typedef enum
  50. {
  51. USART_WORD_LEN_8B = 0, /*!< 8-bit data length */
  52. USART_WORD_LEN_9B = BIT12, /*!< 9-bit data length */
  53. USART_WORD_LEN_7B = BIT12 | BIT28 /*!< only available for APM32F072 and APM32F030 devices */
  54. } USART_WORD_LEN_T;
  55. /**
  56. * @brief USART Stop bits define
  57. */
  58. typedef enum
  59. {
  60. USART_STOP_BIT_1 = 0, /*!< 1-bit stop bit */
  61. USART_STOP_BIT_2 = BIT13, /*!< 2-bit stop bit */
  62. USART_STOP_BIT_1_5 = BIT12 | BIT13 /*!< 1.5-bit stop bit */
  63. } USART_STOP_BITS_T;
  64. /**
  65. * @brief USART Parity define
  66. */
  67. typedef enum
  68. {
  69. USART_PARITY_NONE = 0, /*!< Disable parity control */
  70. USART_PARITY_EVEN = BIT10, /*!< Enable even parity control */
  71. USART_PARITY_ODD = BIT10 | BIT9 /*!< Enable odd parity control*/
  72. } USART_PARITY_T;
  73. /**
  74. * @brief USART mode define
  75. */
  76. typedef enum
  77. {
  78. USART_MODE_RX = BIT2, /*!< Enable USART Receive mode */
  79. USART_MODE_TX = BIT3, /*!< Enable USART transmit mode */
  80. USART_MODE_TX_RX = BIT2 | BIT3 /*!< Enable USART receive and transmit mode */
  81. } USART_MODE_T;
  82. /**
  83. * @brief USART hardware flow control define
  84. */
  85. typedef enum
  86. {
  87. USART_FLOW_CTRL_NONE = 0, /*!< Disable hardware flow control */
  88. USART_FLOW_CTRL_RTS = BIT8, /*!< Enable RTS hardware flow control */
  89. USART_FLOW_CTRL_CTS = BIT9, /*!< Enable CTS hardware flow control */
  90. USART_FLOW_CTRL_RTS_CTS = BIT8 | BIT9 /*!< Enable RTS and CTS hardware flow control */
  91. } USART_HARDWARE_FLOW_CTRL_T;
  92. /**
  93. * @brief USART synchronization clock enable/disable
  94. */
  95. typedef enum
  96. {
  97. USART_CLKEN_DISABLE = ((uint8_t)0), /*!< Disable usart clock */
  98. USART_CLKEN_ENABLE = ((uint8_t)1) /*!< Enable usart clock */
  99. } USART_CLKEN_T;
  100. /**
  101. * @brief USART Clock polarity define
  102. */
  103. typedef enum
  104. {
  105. USART_CLKPOL_LOW = ((uint8_t)0), /*!< Set clock polarity to low */
  106. USART_CLKPOL_HIGH = ((uint8_t)1) /*!< Set clock polarity to high */
  107. } USART_CLKPOL_T;
  108. /**
  109. * @brief USART Clock phase define
  110. */
  111. typedef enum
  112. {
  113. USART_CLKPHA_1EDGE = ((uint8_t)0), /*!< Set usart to sample at the edge of the first clock */
  114. USART_CLKPHA_2EDGE = ((uint8_t)1) /*!< Set usart to sample at the edge of the second clock */
  115. } USART_CLKPHA_T;
  116. /**
  117. * @brief USART Last bit clock pulse enable
  118. */
  119. typedef enum
  120. {
  121. USART_LBCP_DISABLE = ((uint8_t)0), /*!< Disable output last bit clock pulse */
  122. USART_LBCP_ENABLE = ((uint8_t)1) /*!< Enable output last bit clock pulse */
  123. } USART_LBCP_T;
  124. /**
  125. * @brief USART DMA requests
  126. */
  127. typedef enum
  128. {
  129. USART_DMA_REQUEST_RX = BIT6, /*!< USART DMA receive request */
  130. USART_DMA_REQUEST_TX = BIT7 /*!< USART DMA transmit request */
  131. } USART_DMA_REQUEST_T;
  132. /**
  133. * @brief USART DMA reception error
  134. */
  135. typedef enum
  136. {
  137. USART_DMA_RXERR_ENABLE = ((uint8_t)0), /*!< USART DMA reception error enable */
  138. USART_DMA_RXERR_DISABLE = ((uint8_t)1) /*!< USART DMA reception error disable */
  139. } USART_DMA_RXERR_T;
  140. /**
  141. * @brief USART wakeup method
  142. */
  143. typedef enum
  144. {
  145. USART_WAKEUP_IDLE_LINE = ((uint8_t)0), /*!< WakeUp by an idle line detection */
  146. USART_WAKEUP_ADDRESS_MARK = ((uint8_t)1) /*!< WakeUp by an address mark */
  147. } USART_WAKEUP_T;
  148. /**
  149. * @brief USART LIN break detection length
  150. */
  151. typedef enum
  152. {
  153. USART_BREAK_LENGTH_10B = ((uint8_t)0), /*!< 10-bit break detection */
  154. USART_BREAK_LENGTH_11B = ((uint8_t)1) /*!< 11-bit break detection */
  155. } USART_BREAK_LENGTH_T;
  156. /**
  157. * @brief USART address mode
  158. */
  159. typedef enum
  160. {
  161. USART_ADDRESS_MODE_4B = ((uint8_t)0), /*!< 4-bit address detection */
  162. USART_ADDRESS_MODE_7B = ((uint8_t)1) /*!< 7-bit address detection */
  163. } USART_ADDRESS_MODE_T;
  164. /**
  165. * @brief USART address mode, only available for APM32F072 devices
  166. */
  167. typedef enum
  168. {
  169. USART_WAKEUP_SOURCE_ADDRESS = ((uint8_t)0), /*!< usart wakeup by address */
  170. USART_WAKEUP_SOURCE_START = ((uint8_t)2), /*!< usart wakeup by start bit */
  171. USART_WAKEUP_SOURCE_RXNE = ((uint8_t)3) /*!< usart wakeup by RXNE */
  172. } USART_WAKEUP_SOURCE_T;
  173. /**
  174. * @brief USART driver enable polarity select
  175. */
  176. typedef enum
  177. {
  178. USART_DE_POL_HIGH = ((uint8_t)0), /*!< driver enable polarity is high */
  179. USART_DE_POL_LOW = ((uint8_t)1) /*!< driver enable polarity is low */
  180. } USART_DE_POL_T;
  181. /**
  182. * @brief USART inversion Pins
  183. */
  184. typedef enum
  185. {
  186. USART_INVERSION_RX = BIT16, /*!< usart RX Pins active level inversion */
  187. USART_INVERSION_TX = BIT17, /*!< usart TX Pins active level inversion */
  188. USART_INVERSION_TX_RX = BIT16 | BIT17 /*!< usart RX TX Pins active level inversion */
  189. } USART_INVERSION_T;
  190. /**
  191. * @brief USART IrDA Low Power
  192. */
  193. typedef enum
  194. {
  195. USART_IRDA_MODE_NORMAL = ((uint8_t)0), /*!< usart irda works in normal mode */
  196. USART_IRDA_MODE_LOWPOWER = ((uint8_t)1) /*!< usart irda works in low-power mode */
  197. } USART_IRDA_MODE_T;
  198. /**
  199. * @brief USART auto baud rate mode
  200. */
  201. typedef enum
  202. {
  203. USART_AUTO_BAUD_RATE_STARTBIT = ((uint8_t)0x00), /*!< auto-baud measure start bit */
  204. USART_AUTO_BAUD_RATE_FALLINGEDGE = ((uint8_t)0x01) /*!< auto-baud measure falling edge */
  205. } USART_AUTO_BAUD_RATE_T;
  206. /**
  207. * @brief USART over detection disable
  208. */
  209. typedef enum
  210. {
  211. USART_OVER_DETECTION_ENABLE = ((uint8_t)0), /*!< enable overrun detection */
  212. USART_OVER_DETECTION_DISABLE = ((uint8_t)1) /*!< disable overrun detection */
  213. } USART_OVER_DETECTION_T;
  214. /**
  215. * @brief USART request
  216. */
  217. typedef enum
  218. {
  219. USART_REQUEST_ABRQ = ((uint8_t)0x01), /*!< Auto Baud Rate Request */
  220. USART_REQUEST_SBQ = ((uint8_t)0x02), /*!< Send Break Request */
  221. USART_REQUEST_MMQ = ((uint8_t)0x04), /*!< Mute Mode Request */
  222. USART_REQUEST_RDFQ = ((uint8_t)0x08), /*!< Receive data flush Request */
  223. USART_REQUEST_TDFQ = ((uint8_t)0x10) /*!< Transmit data flush Request */
  224. } USART_REQUEST_T;
  225. /**
  226. * @brief USART flag definition
  227. */
  228. typedef enum
  229. {
  230. USART_FLAG_RXENACKF = ((uint32_t)0x00400000), /*!< Receive Enable Acknowledge Flag */
  231. USART_FLAG_TXENACKF = ((uint32_t)0x00200000), /*!< Transmit Enable Acknowledge Flag */
  232. USART_FLAG_WAKEUP = ((uint32_t)0x00100000), /*!< Wake Up from stop mode Flag (Not for APM32F030 devices) */
  233. USART_FLAG_RWF = ((uint32_t)0x00080000), /*!< Send Break flag (Not for APM32F030 devices) */
  234. USART_FLAG_SBF = ((uint32_t)0x00040000), /*!< Send Break flag */
  235. USART_FLAG_CMF = ((uint32_t)0X00020000), /*!< Character match flag */
  236. USART_FLAG_BUSY = ((uint32_t)0X00010000), /*!< Busy flag */
  237. USART_FLAG_ABRTF = ((uint32_t)0X00008000), /*!< Auto baud rate flag */
  238. USART_FLAG_ABRTE = ((uint32_t)0X00004000), /*!< Auto baud rate error flag */
  239. USART_FLAG_EOBF = ((uint32_t)0X00001000), /*!< End of block flag (Not for APM32F030 devices) */
  240. USART_FLAG_RXTOF = ((uint32_t)0X00000800), /*!< Receive time out flag */
  241. USART_FLAG_CTSF = ((uint32_t)0X00000400), /*!< CTS Change flag */
  242. USART_FLAG_CTSIF = ((uint32_t)0X00000200), /*!< CTS interrupt flag */
  243. USART_FLAG_LBDF = ((uint32_t)0x00000100), /*!< LIN Break Detection Flag (Not for APM32F030 devices) */
  244. USART_FLAG_TXBE = ((uint32_t)0X00000080), /*!< Transmit data register empty flag */
  245. USART_FLAG_TXC = ((uint32_t)0X00000040), /*!< Transmission Complete flag */
  246. USART_FLAG_RXBNE = ((uint32_t)0X00000020), /*!< Receive data buffer not empty flag */
  247. USART_FLAG_IDLEF = ((uint32_t)0X00000010), /*!< Idle Line detection flag */
  248. USART_FLAG_OVRE = ((uint32_t)0X00000008), /*!< OverRun Error flag */
  249. USART_FLAG_NEF = ((uint32_t)0X00000004), /*!< Noise Error flag */
  250. USART_FLAG_FEF = ((uint32_t)0X00000002), /*!< Framing Error flag */
  251. USART_FLAG_PEF = ((uint32_t)0X00000001), /*!< Parity Error flag */
  252. } USART_FLAG_T;
  253. /**
  254. * @brief USART interrupts source
  255. */
  256. typedef enum
  257. {
  258. USART_INT_WAKEUP = ((uint32_t)0x00400000), /*!< Wake up interrupt (Not for APM32F030 devices) */
  259. USART_INT_CMIE = ((uint32_t)0x00004000), /*!< Character match interrupt */
  260. USART_INT_EOBIE = ((uint32_t)0x08000000), /*!< End of Block interrupt (Not for APM32F030 devices) */
  261. USART_INT_RXTOIE = ((uint32_t)0x04000000), /*!< Receive time out interrupt */
  262. USART_INT_CTSIE = ((uint32_t)0x00000400), /*!< CTS change interrupt */
  263. USART_INT_LBDIE = ((uint32_t)0X00000040), /*!< LIN Break detection interrupt (Not for APM32F030 devices) */
  264. USART_INT_TXBEIE = ((uint32_t)0x00000080), /*!< Tansmit Data Register empty interrupt */
  265. USART_INT_TXCIE = ((uint32_t)0x40000040), /*!< Transmission complete interrupt */
  266. USART_INT_RXBNEIE = ((uint32_t)0x00000020), /*!< Receive Data buffer not empty interrupt */
  267. USART_INT_IDLEIE = ((uint32_t)0x00000010), /*!< Idle line detection interrupt */
  268. USART_INT_PEIE = ((uint32_t)0x00000100), /*!< Parity Error interrupt */
  269. USART_INT_ERRIE = ((uint32_t)0x00000001), /*!< Error interrupt */
  270. } USART_INT_T;
  271. /**
  272. * @brief USART Interrupt flag definition
  273. */
  274. typedef enum
  275. {
  276. USART_INT_FLAG_WAKEUP = ((uint32_t)0X00100000), /*!< Wake up flag (Not for APM32F030 devices) */
  277. USART_INT_FLAG_CMF = ((uint32_t)0X00020000), /*!< Character match flag */
  278. USART_INT_FLAG_EOBF = ((uint32_t)0X00001000), /*!< End of block flag (Not for APM32F030 devices) */
  279. USART_INT_FLAG_RXTOF = ((uint32_t)0X00000800), /*!< Receive time out flag */
  280. USART_INT_FLAG_CTSIF = ((uint32_t)0X00000200), /*!< CTS interrupt flag */
  281. USART_INT_FLAG_LBDF = ((uint32_t)0X00000100), /*!< LIN Break detection flag (Not for APM32F030 devices) */
  282. USART_INT_FLAG_TXBE = ((uint32_t)0X00000080), /*!< Transmit data register empty flag */
  283. USART_INT_FLAG_TXC = ((uint32_t)0X00000040), /*!< Transmission Complete flag */
  284. USART_INT_FLAG_RXBNE = ((uint32_t)0X00000020), /*!< Receive data buffer not empty flag */
  285. USART_INT_FLAG_IDLE = ((uint32_t)0X00000010), /*!< Idle Line detection flag */
  286. USART_INT_FLAG_OVRE = ((uint32_t)0X00000008), /*!< OverRun Error flag */
  287. USART_INT_FLAG_NE = ((uint32_t)0X00000004), /*!< Noise Error flag */
  288. USART_INT_FLAG_FE = ((uint32_t)0X00000002), /*!< Framing Error flag */
  289. USART_INT_FLAG_PE = ((uint32_t)0X00000001), /*!< Parity Error flag */
  290. } USART_INT_FLAG_T;
  291. /**@} end of group USART_Enumerations*/
  292. /** @defgroup USART_Structures Structures
  293. @{
  294. */
  295. /**
  296. * @brief USART Config struct definition
  297. */
  298. typedef struct
  299. {
  300. uint32_t baudRate; /*!< Specifies the baud rate */
  301. USART_WORD_LEN_T wordLength; /*!< Specifies the word length */
  302. USART_STOP_BITS_T stopBits; /*!< Specifies the stop bits */
  303. USART_PARITY_T parity; /*!< Specifies the parity */
  304. USART_MODE_T mode; /*!< Specifies the mode */
  305. USART_HARDWARE_FLOW_CTRL_T hardwareFlowCtrl;
  306. } USART_Config_T;
  307. /**
  308. * @brief USART synchronous communication clock config struct definition
  309. */
  310. typedef struct
  311. {
  312. USART_CLKEN_T enable; /*!< Enable or Disable Clock */
  313. USART_CLKPOL_T polarity; /*!< Specifies the clock polarity */
  314. USART_CLKPHA_T phase; /*!< Specifies the clock phase */
  315. USART_LBCP_T lastBitClock; /*!< Enable or Disable last bit clock */
  316. } USART_SyncClockConfig_T;
  317. /**@} end of group USART_Structures*/
  318. /** @defgroup USART_Variables Variables
  319. @{
  320. */
  321. /**@} end of group USART_Variables */
  322. /** @addtogroup USART_Functions Functions
  323. @{
  324. */
  325. /* USART peripheral Reset and Configuration */
  326. void USART_Reset(USART_T* usart);
  327. void USART_Config(USART_T* uart, USART_Config_T* configStruct);
  328. void USART_ConfigStructInit(USART_Config_T* configStruct);
  329. void USART_ConfigSyncClock(USART_T* usart, USART_SyncClockConfig_T* SyncClockConfig);
  330. void USART_ConfigSyncClockStructInit(USART_SyncClockConfig_T* SyncClockConfig);
  331. void USART_Enable(USART_T* usart);
  332. void USART_Disable(USART_T* usart);
  333. void USART_EnableDirectionMode(USART_T* usart, USART_MODE_T mode);
  334. void USART_DisableDirectionMode(USART_T* usart, USART_MODE_T mode);
  335. void USART_ConfigDivider(USART_T* usart, uint8_t divider); /*!< Not for APM32F030 devices */
  336. void USART_EnableOverSampling8(USART_T* usart);
  337. void USART_DisableOverSampling8(USART_T* usart);
  338. void USART_EnableMSBFirst(USART_T* usart);
  339. void USART_DisableMSBFirst(USART_T* usart);
  340. void USART_EnableOneBitMethod(USART_T* usart);
  341. void USART_DisableOneBitMethod(USART_T* usart);
  342. void USART_EnableDataInv(USART_T* usart);
  343. void USART_DisableDataInv(USART_T* usart);
  344. void USART_EnableInvPin(USART_T* usart, USART_INVERSION_T invPin);
  345. void USART_DisableInvPin(USART_T* usart, USART_INVERSION_T invPin);
  346. void USART_EnableSWAPPin(USART_T* usart);
  347. void USART_DisableSWAPPin(USART_T* usart);
  348. void USART_EnableReceiverTimeOut(USART_T* usart);
  349. void USART_DisableReceiverTimeOut(USART_T* usart);
  350. void USART_ReceiverTimeOutValue(USART_T* usart, uint32_t timeOut);
  351. void USART_EnableAutoBaudRate(USART_T* usart);
  352. void USART_DisableAutoBaudRate(USART_T* usart);
  353. void USART_ConfigAutoBaudRate(USART_T* usart, USART_AUTO_BAUD_RATE_T mode);
  354. void USART_ConfigOverrunDetection(USART_T* usart, USART_OVER_DETECTION_T overDetection);
  355. /* Stop mode */
  356. void USART_EnableStopMode(USART_T* usart);
  357. void USART_DisableStopMode(USART_T* usart);
  358. void USART_ConfigStopModeWakeUpSource(USART_T* usart, USART_WAKEUP_SOURCE_T source); /*!< Not for APM32F030 devices */
  359. /* Address */
  360. void USART_Address(USART_T* usart, uint8_t address);
  361. void USART_ConfigAddressDetection(USART_T* usart, USART_ADDRESS_MODE_T address);
  362. /* Transmit and receive */
  363. void USART_TxData(USART_T* usart, uint16_t data);
  364. uint16_t USART_RxData(USART_T* usart);
  365. /* Mute mode */
  366. void USART_EnableMuteMode(USART_T* usart);
  367. void USART_DisableMuteMode(USART_T* usart);
  368. void USART_ConfigMuteModeWakeUp(USART_T* usart, USART_WAKEUP_T wakeup);
  369. /* LIN mode */
  370. void USART_EnableLINmode(USART_T* usart); /*!< Not for APM32F030 devices */
  371. void USART_DisableLINmode(USART_T* usart); /*!< Not for APM32F030 devices */
  372. void USART_ConfigLINbreakDetectLength(USART_T* usart, USART_BREAK_LENGTH_T length); /*!< Not for APM32F030 devices */
  373. /* Half-duplex mode */
  374. void USART_EnableHalfDuplex(USART_T* usart);
  375. void USART_DisableHalfDuplex(USART_T* usart);
  376. /* Smartcard mode */
  377. void USART_EnableSmartCard(USART_T* usart); /*!< Not for APM32F030 devices */
  378. void USART_DisableSmartCard(USART_T* usart); /*!< Not for APM32F030 devices */
  379. void USART_EnableSmartCardNACK(USART_T* usart); /*!< Not for APM32F030 devices */
  380. void USART_DisableSmartCardNACK(USART_T* usart); /*!< Not for APM32F030 devices */
  381. void USART_ConfigGuardTime(USART_T* usart, uint8_t guardTime); /*!< Not for APM32F030 devices */
  382. void USART_ConfigAutoCount(USART_T* usart, uint8_t autoCount); /*!< Not for APM32F030 devices */
  383. void USART_ConfigBlockSize(USART_T* usart, uint8_t blockSize); /*!< Not for APM32F030 devices */
  384. /* IrDA mode */
  385. void USART_EnableIrDA(USART_T* usart); /*!< Not for APM32F030 devices */
  386. void USART_DisableIrDA(USART_T* usart); /*!< Not for APM32F030 devices */
  387. void USART_ConfigIrDAMode(USART_T* usart, USART_IRDA_MODE_T IrDAMode); /*!< Not for APM32F030 devices */
  388. /* Driver enable Configuration */
  389. void USART_EnableDE(USART_T* usart);
  390. void USART_DisableDE(USART_T* usart);
  391. void USART_ConfigDEPolarity(USART_T* usart, USART_DE_POL_T polarity);
  392. void USART_DEAssertionTimeValue(USART_T* usart, uint8_t value);
  393. void USART_DEDeassertionTimeValue(USART_T* usart, uint8_t value);
  394. /* DMA */
  395. void USART_EnableDMA(USART_T* usart, uint32_t dmaReq);
  396. void USART_DisableDMA(USART_T* usart, uint32_t dmaReq);
  397. void USART_ConfigDMAReceptionError(USART_T* usart, USART_DMA_RXERR_T error);
  398. /* Request */
  399. void USART_EnableRequest(USART_T* usart, USART_REQUEST_T request);
  400. void USART_DisableRequest(USART_T* usart, USART_REQUEST_T request);
  401. /* Interrupt */
  402. void USART_EnableInterrupt(USART_T* usart, USART_INT_T interrupt);
  403. void USART_DisableInterrupt(USART_T* usart, USART_INT_T interrupt);
  404. uint8_t USART_ReadIntFlag(USART_T* usart, USART_INT_FLAG_T flag);
  405. void USART_ClearIntFlag(USART_T* usart, uint32_t flag);
  406. /* Flag */
  407. uint8_t USART_ReadStatusFlag(USART_T* usart, USART_FLAG_T flag);
  408. void USART_ClearStatusFlag(USART_T* usart, uint32_t flag);
  409. #ifdef __cplusplus
  410. }
  411. #endif
  412. #endif /* __APM32F0XX_USART_H */
  413. /**@} end of group USART_Functions */
  414. /**@} end of group USART_Driver */
  415. /**@} end of group APM32F0xx_StdPeriphDriver */