hw_uart.h 90 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361
  1. /******************************************************************************
  2. * Filename: hw_uart.h
  3. * Revised: $Date: 2013-04-30 17:13:44 +0200 (Tue, 30 Apr 2013) $
  4. * Revision: $Revision: 9943 $
  5. *
  6. * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
  7. *
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. *
  13. * Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. *
  16. * Redistributions in binary form must reproduce the above copyright
  17. * notice, this list of conditions and the following disclaimer in the
  18. * documentation and/or other materials provided with the distribution.
  19. *
  20. * Neither the name of Texas Instruments Incorporated nor the names of
  21. * its contributors may be used to endorse or promote products derived
  22. * from this software without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  27. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  28. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  30. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  31. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  32. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. *
  36. ******************************************************************************/
  37. #ifndef __HW_UART_H__
  38. #define __HW_UART_H__
  39. //*****************************************************************************
  40. //
  41. // The following are defines for the UART register offsets.
  42. //
  43. //*****************************************************************************
  44. #define UART_O_DR 0x00000000 // UART data Important: This
  45. // register is read-sensitive. See
  46. // the register description for
  47. // details. This register is the
  48. // data register (the interface to
  49. // the FIFOs). For transmitted
  50. // data, if the FIFO is enabled,
  51. // data written to this location is
  52. // pushed onto the transmit FIFO.
  53. // If the FIFO is disabled, data is
  54. // stored in the transmitter
  55. // holding register (the bottom
  56. // word of the transmit FIFO). A
  57. // write to this register initiates
  58. // a transmission from the UART.
  59. // For received data, if the FIFO
  60. // is enabled, the data byte and
  61. // the 4-bit status (break, frame,
  62. // parity, and overrun) is pushed
  63. // onto the 12-bit wide receive
  64. // FIFO. If the FIFO is disabled,
  65. // the data byte and status are
  66. // stored in the receiving holding
  67. // register (the bottom word of the
  68. // receive FIFO). The received data
  69. // can be retrieved by reading this
  70. // register.
  71. #define UART_O_RSR 0x00000004 // UART receive status and error
  72. // clear The RSR/ECR register is
  73. // the receive status register and
  74. // error clear register. In
  75. // addition to the DR register,
  76. // receive status can also be read
  77. // from the RSR register. If the
  78. // status is read from this
  79. // register, then the status
  80. // information corresponds to the
  81. // entry read from DR before
  82. // reading RSR. The status
  83. // information for overrun is set
  84. // immediately when an overrun
  85. // condition occurs. The RSR
  86. // register cannot be written.
  87. // Read-only status register
  88. #define UART_O_ECR 0x00000004 // UART receive status and error
  89. // clear The RSR/ECR register is
  90. // the receive status
  91. // register/error clear register. A
  92. // write of any value to the ECR
  93. // register clears the framing,
  94. // parity, break, and overrun
  95. // errors. All the bits are cleared
  96. // on reset. Write-only error clear
  97. // register
  98. #define UART_O_FR 0x00000018 // UART flag The FR register is
  99. // the flag register. After reset,
  100. // the TXFF, RXFF, and BUSY bits
  101. // are 0, and TXFE and RXFE bits
  102. // are 1. The CTS bit indicate the
  103. // modem flow control. Note that
  104. // the modem bits are only
  105. // implemented on UART1 and are
  106. // tied inactive on UART0. Due to
  107. // this difference, the reset state
  108. // of the UART0 FR register is
  109. // 0x90, while UART1 FR register
  110. // reset state 0x197 .
  111. #define UART_O_ILPR 0x00000020 // UART IrDA low-power register
  112. // The ILPR register stores the
  113. // 8-bit low-power counter divisor
  114. // value used to derive the
  115. // low-power SIR pulse width clock
  116. // by dividing down the system
  117. // clock (SysClk). All the bits are
  118. // cleared when reset. The internal
  119. // IrLPBaud16 clock is generated by
  120. // dividing down SysClk according
  121. // to the low-power divisor value
  122. // written to ILPR. The duration of
  123. // SIR pulses generated when
  124. // low-power mode is enabled is
  125. // three times the period of the
  126. // IrLPBaud16 clock. The low-power
  127. // divisor value is calculated as
  128. // follows: ILPDVSR = SysClk /
  129. // FIrLPBaud16 where FIrLPBaud16 is
  130. // nominally 1.8432 MHz The divisor
  131. // must be programmed such that
  132. // FIrLPBaud16 is in the range 1.42
  133. // MHz to 2.12 MHz, resulting in a
  134. // low-power pulse duration of
  135. // 1.41-2.11 us (three times the
  136. // period of IrLPBaud16). The
  137. // minimum frequency of IrLPBaud16
  138. // ensures that pulses less than
  139. // one period of IrLPBaud16 are
  140. // rejected, but pulses greater
  141. // than 1.4 us are accepted as
  142. // valid pulses. Note: Zero is an
  143. // illegal value. Programming a
  144. // zero value results in no
  145. // IrLPBaud16 pulses being
  146. // generated.
  147. #define UART_O_IBRD 0x00000024 // UART integer baud-rate divisor
  148. // The IBRD register is the integer
  149. // part of the baud-rate divisor
  150. // value. All the bits are cleared
  151. // on reset. The minimum possible
  152. // divide ratio is 1 (when IBRD =
  153. // 0), in which case the FBRD
  154. // register is ignored. When
  155. // changing the IBRD register, the
  156. // new value does not take effect
  157. // until transmission or reception
  158. // of the current character is
  159. // complete. Any changes to the
  160. // baud-rate divisor must be
  161. // followed by a write to the LCRH
  162. // register.
  163. #define UART_O_FBRD 0x00000028 // UART fractional baud-rate
  164. // divisor The FBRD register is the
  165. // fractional part of the baud-rate
  166. // divisor value. All the bits are
  167. // cleared on reset. When changing
  168. // the FBRD register, the new value
  169. // does not take effect until
  170. // transmission or reception of the
  171. // current character is complete.
  172. // Any changes to the baud-rate
  173. // divisor must be followed by a
  174. // write to the LCRH register.
  175. #define UART_O_LCRH 0x0000002C // UART line control The LCRH
  176. // register is the line control
  177. // register. Serial parameters such
  178. // as data length, parity, and stop
  179. // bit selection are implemented in
  180. // this register. When updating the
  181. // baud-rate divisor (IBRD and/or
  182. // IFRD), the LCRH register must
  183. // also be written. The write
  184. // strobe for the baud-rate divisor
  185. // registers is tied to the LCRH
  186. // register.
  187. #define UART_O_CTL 0x00000030 // UART control The CTL register
  188. // is the control register. All the
  189. // bits are cleared on reset except
  190. // for the transmit enable (TXE)
  191. // and receive enable (RXE) bits,
  192. // which are set. To enable the
  193. // UART module, the UARTEN bit must
  194. // be set. If software requires a
  195. // configuration change in the
  196. // module, the UARTEN bit must be
  197. // cleared before the configuration
  198. // changes are written. If the UART
  199. // is disabled during a transmit or
  200. // receive operation, the current
  201. // transaction is completed before
  202. // the UART stopping. Note: The
  203. // UARTCTL register should not be
  204. // changed while the UART is
  205. // enabled or else the results are
  206. // unpredictable. The following
  207. // sequence is recommended for
  208. // making changes to the UARTCTL
  209. // register: 1. Disable the UART.
  210. // 2. Wait for the end of
  211. // transmission or reception of the
  212. // current character. 3. Flush the
  213. // transmit FIFO by clearing bit 4
  214. // (FEN) in the line control
  215. // register (UARTLCRH). 4.
  216. // Reprogram the control register.
  217. // 5. Enable the UART.
  218. #define UART_O_IFLS 0x00000034 // UART interrupt FIFO level
  219. // select The IFLS register is the
  220. // interrupt FIFO level select
  221. // register. This register can be
  222. // used to define the FIFO level at
  223. // which the TXRIS and RXRIS bits
  224. // in the RIS register are
  225. // triggered. The interrupts are
  226. // generated based on a transition
  227. // through a level rather than
  228. // being based on the level. That
  229. // is, the interrupts are generated
  230. // when the fill level progresses
  231. // through the trigger level. For
  232. // example, if the receive trigger
  233. // level is set to the half-way
  234. // mark, the interrupt is triggered
  235. // as the module is receiving the
  236. // 9th character. Out of reset, the
  237. // TXIFLSEL and RXIFLSEL bits are
  238. // configured so that the FIFOs
  239. // trigger an interrupt at the
  240. // half-way mark.
  241. #define UART_O_IM 0x00000038 // UART interrupt mask The IM
  242. // register is the interrupt mask
  243. // set/clear register. On a read,
  244. // this register gives the current
  245. // value of the mask on the
  246. // relevant interrupt. Setting a
  247. // bit allows the corresponding raw
  248. // interrupt signal to be routed to
  249. // the interrupt controller.
  250. // Clearing a bit prevents the raw
  251. // interrupt signal from being sent
  252. // to the interrupt controller.
  253. #define UART_O_RIS 0x0000003C // UART raw interrupt status The
  254. // RIS register is the raw
  255. // interrupt status register. On a
  256. // read, this register gives the
  257. // current raw status value of the
  258. // corresponding interrupt. A write
  259. // has no effect. Note that the HW
  260. // modem flow control bits are only
  261. // implemented on UART1 and are
  262. // tied inactive on UART0.
  263. #define UART_O_MIS 0x00000040 // UART masked interrupt status
  264. // The MIS register is the masked
  265. // interrupt status register. On a
  266. // read, this register gives the
  267. // current masked status value of
  268. // the corresponding interrupt. A
  269. // write has no effect.
  270. #define UART_O_ICR 0x00000044 // UART interrupt clear The ICR
  271. // register is the interrupt clear
  272. // register. On a write of 1, the
  273. // corresponding interrupt (both
  274. // raw interrupt and masked
  275. // interrupt, if enabled) is
  276. // cleared. A write of 0 has no
  277. // effect.
  278. #define UART_O_DMACTL 0x00000048 // UART DMA control The DMACTL
  279. // register is the DMA control
  280. // register.
  281. #define UART_O_LCTL 0x00000090 // UART LIN control The LCTL
  282. // register is the configures the
  283. // operation of the UART when in
  284. // LIN mode.
  285. #define UART_O_LSS 0x00000094 // LIN snap shot The LSS register
  286. // captures the free-running timer
  287. // value when either the sync edge
  288. // 1 or the sync edge 5 is detected
  289. // in LIN mode.
  290. #define UART_O_LTIM 0x00000098 // UART LIN timer The LTIM
  291. // register contains the current
  292. // timer value for the free-running
  293. // timer that is used to calculate
  294. // the baud rate when in LIN slave
  295. // mode. The value in this register
  296. // is used along with the value in
  297. // the UART LIN snap shot (LSS)
  298. // register to adjust the baud rate
  299. // to match that of the master.
  300. #define UART_O_NINEBITADDR 0x000000A4 // UART 9-bit self address The
  301. // NINEBITADDR register is used to
  302. // write the specific address that
  303. // should be matched with the
  304. // receiving byte when the 9-bit
  305. // address mask (NINEBITAMASK) is
  306. // set to 0xFF. This register is
  307. // used in conjunction with
  308. // NINEBITAMASK to form a match for
  309. // address-byte received.
  310. #define UART_O_NINEBITAMASK 0x000000A8 // UART 9-bit self address mask
  311. // The NINEBITAMASK register is
  312. // used to enable the address mask
  313. // for 9-bit mode. The lower
  314. // address bits are masked to
  315. // create a range of address to be
  316. // matched with the received
  317. // address byte.
  318. #define UART_O_PP 0x00000FC0 // UART peripheral properties The
  319. // PP register provides information
  320. // regarding the properties of the
  321. // UART module.
  322. #define UART_O_CC 0x00000FC8 // UART clock configuration The CC
  323. // register controls the baud and
  324. // system clocks sources for the
  325. // UART module. For more
  326. // information, see the section
  327. // called "Baud-Rate Generation".
  328. // Note: If the PIOSC is used for
  329. // the UART baud clock, the system
  330. // clock frequency must be at least
  331. // 9 MHz in run mode.
  332. //*****************************************************************************
  333. //
  334. // The following are defines for the bit fields in the UART_O_DR register.
  335. //
  336. //*****************************************************************************
  337. #define UART_DR_OE 0x00000800 // UART overrun error 1: New data
  338. // was received when the FIFO was
  339. // full, resulting in data loss. 0:
  340. // No data has been lost due to a
  341. // FIFO overrun.
  342. #define UART_DR_OE_M 0x00000800
  343. #define UART_DR_OE_S 11
  344. #define UART_DR_BE 0x00000400 // UART break error 1: A break
  345. // condition has been detected,
  346. // indicating that the receive data
  347. // input was held low for longer
  348. // than a full-word transmission
  349. // time (defined as start, data,
  350. // parity, and stop bits). 0: No
  351. // break condition has occurred. In
  352. // FIFO mode, this error is
  353. // associated with the character at
  354. // the top of the FIFO. When a
  355. // break occurs, only the one 0
  356. // character is loaded into the
  357. // FIFO. The next character is only
  358. // enabled after the received data
  359. // input goes to a 1 (marking
  360. // state), and the next valid start
  361. // bit is received.
  362. #define UART_DR_BE_M 0x00000400
  363. #define UART_DR_BE_S 10
  364. #define UART_DR_PE 0x00000200 // UART parity error 1: The parity
  365. // of the received data character
  366. // does not match the parity
  367. // defined by bits 2 and 7 of the
  368. // UARTLCRH register 0: No parity
  369. // error has occurred. In FIFO
  370. // mode, this error is associated
  371. // with the character at the top of
  372. // the FIFO.
  373. #define UART_DR_PE_M 0x00000200
  374. #define UART_DR_PE_S 9
  375. #define UART_DR_FE 0x00000100 // UART framing error 1: The
  376. // received character does not have
  377. // a valid stop bit (a valid stop
  378. // bit is 1). 0: No framing error
  379. // has occurred.
  380. #define UART_DR_FE_M 0x00000100
  381. #define UART_DR_FE_S 8
  382. #define UART_DR_DATA_M 0x000000FF // Data transmitted or received
  383. // Data that is to be transmitted
  384. // via the UART is written to this
  385. // field. When read, this field
  386. // contains the data that was
  387. // received by the UART.
  388. #define UART_DR_DATA_S 0
  389. //*****************************************************************************
  390. //
  391. // The following are defines for the bit fields in the UART_O_RSR register.
  392. //
  393. //*****************************************************************************
  394. #define UART_RSR_OE 0x00000008 // UART overrun error 1: New data
  395. // was received when the FIFO was
  396. // full, resulting in data loss. 0:
  397. // No data has been lost due to a
  398. // FIFO overrun. This bit is
  399. // cleared by a write to UARTECR.
  400. // The FIFO contents remain valid
  401. // because no further data is
  402. // written when the FIFO is full,
  403. // only the contents of the shift
  404. // register are overwritten. The
  405. // CPU must read the data in order
  406. // to empty the FIFO.
  407. #define UART_RSR_OE_M 0x00000008
  408. #define UART_RSR_OE_S 3
  409. #define UART_RSR_BE 0x00000004 // UART break error 1: A break
  410. // condition has been detected,
  411. // indicating that the receive data
  412. // input was held low for longer
  413. // than a full-word transmission
  414. // time (defined as start, data,
  415. // parity, and stop bits). 0: No
  416. // break condition has occurred.
  417. // This bit is cleared to 0 by a
  418. // write to UARTECR. In FIFO mode,
  419. // this error is associated with
  420. // the character at the top of the
  421. // FIFO. When a break occurs, only
  422. // one 0 character is loaded into
  423. // the FIFO. The next character is
  424. // only enabled after the receive
  425. // data input goes to a 1 (marking
  426. // state) and the next valid start
  427. // bit is received.
  428. #define UART_RSR_BE_M 0x00000004
  429. #define UART_RSR_BE_S 2
  430. #define UART_RSR_PE 0x00000002 // UART parity error 1: The parity
  431. // of the received data character
  432. // does not match the parity
  433. // defined by bits 2 and 7 of the
  434. // UARTLCRH register. 0: No parity
  435. // error has occurred. This bit is
  436. // cleared to 0 by a write to
  437. // UARTECR.
  438. #define UART_RSR_PE_M 0x00000002
  439. #define UART_RSR_PE_S 1
  440. #define UART_RSR_FE 0x00000001 // UART framing error 1: The
  441. // received character does not have
  442. // a valid stop bit (a valid stop
  443. // bit is 1). 0: No framing error
  444. // has occurred. This bit is
  445. // cleared to 0 by a write to
  446. // UARTECR. In FIFO mode, this
  447. // error is associated with the
  448. // character at the top of the
  449. // FIFO.
  450. #define UART_RSR_FE_M 0x00000001
  451. #define UART_RSR_FE_S 0
  452. //*****************************************************************************
  453. //
  454. // The following are defines for the bit fields in the UART_O_ECR register.
  455. //
  456. //*****************************************************************************
  457. #define UART_ECR_DATA_M 0x000000FF // Error clear A write to this
  458. // register of any data clears the
  459. // framing, parity, break, and
  460. // overrun flags.
  461. #define UART_ECR_DATA_S 0
  462. //*****************************************************************************
  463. //
  464. // The following are defines for the bit fields in the UART_O_FR register.
  465. //
  466. //*****************************************************************************
  467. #define UART_FR_TXFE 0x00000080 // UART transmit FIFO empty The
  468. // meaning of this bit depends on
  469. // the state of the FEN bit in the
  470. // UARTLCRH register. 1: If the
  471. // FIFO is disabled (FEN is 0), the
  472. // transmit holding register is
  473. // empty. If the FIFO is enabled
  474. // (FEN is 1), the transmit FIFO is
  475. // empty. 0: The transmitter has
  476. // data to transmit.
  477. #define UART_FR_TXFE_M 0x00000080
  478. #define UART_FR_TXFE_S 7
  479. #define UART_FR_RXFF 0x00000040 // UART receive FIFO full The
  480. // meaning of this bit depends on
  481. // the state of the FEN bit in the
  482. // UARTLCRH register. 1: If the
  483. // FIFO is disabled (FEN is 0), the
  484. // receive holding register is
  485. // full. If the FIFO is enabled
  486. // (FEN is 1), the receive FIFO is
  487. // full. 0: The receiver can
  488. // receive data.
  489. #define UART_FR_RXFF_M 0x00000040
  490. #define UART_FR_RXFF_S 6
  491. #define UART_FR_TXFF 0x00000020 // UART transmit FIFO full The
  492. // meaning of this bit depends on
  493. // the state of the FEN bit in the
  494. // UARTLCRH register. 1: If the
  495. // FIFO is disabled (FEN is 0), the
  496. // transmit holding register is
  497. // full. If the FIFO is enabled
  498. // (FEN is 1), the transmit FIFO is
  499. // full. 0: The transmitter is not
  500. // full.
  501. #define UART_FR_TXFF_M 0x00000020
  502. #define UART_FR_TXFF_S 5
  503. #define UART_FR_RXFE 0x00000010 // UART receive FIFO empty The
  504. // meaning of this bit depends on
  505. // the state of the FEN bit in the
  506. // UARTLCRH register. 1: If the
  507. // FIFO is disabled (FEN is 0), the
  508. // receive holding register is
  509. // empty. If the FIFO is enabled
  510. // (FEN is 1), the receive FIFO is
  511. // empty. 0: The receiver is not
  512. // empty.
  513. #define UART_FR_RXFE_M 0x00000010
  514. #define UART_FR_RXFE_S 4
  515. #define UART_FR_BUSY 0x00000008 // UART busy 1: The UART is busy
  516. // transmitting data. This bit
  517. // remains set until the complete
  518. // byte, including all stop bits,
  519. // has been sent from the shift
  520. // register. 0: The UART is not
  521. // busy. This bit is set as soon as
  522. // the transmit FIFO becomes
  523. // non-empty (regardless of whether
  524. // UART is enabled).
  525. #define UART_FR_BUSY_M 0x00000008
  526. #define UART_FR_BUSY_S 3
  527. #define UART_FR_CTS 0x00000001 // Clear to send (UART1 only,
  528. // reserved for UART0). 1: The
  529. // U1CTS signal is asserted. 0: The
  530. // U1CTS signal is not asserted.
  531. #define UART_FR_CTS_M 0x00000001
  532. #define UART_FR_CTS_S 0
  533. //*****************************************************************************
  534. //
  535. // The following are defines for the bit fields in the UART_O_ILPR register.
  536. //
  537. //*****************************************************************************
  538. #define UART_ILPR_ILPDVSR_M 0x000000FF // IrDA low-power divisor This
  539. // field contains the 8-bit
  540. // low-power divisor value.
  541. #define UART_ILPR_ILPDVSR_S 0
  542. //*****************************************************************************
  543. //
  544. // The following are defines for the bit fields in the UART_O_IBRD register.
  545. //
  546. //*****************************************************************************
  547. #define UART_IBRD_DIVINT_M 0x0000FFFF // Integer baud-rate divisor
  548. #define UART_IBRD_DIVINT_S 0
  549. //*****************************************************************************
  550. //
  551. // The following are defines for the bit fields in the UART_O_FBRD register.
  552. //
  553. //*****************************************************************************
  554. #define UART_FBRD_DIVFRAC_M 0x0000003F // Fractional baud-rate divisor
  555. #define UART_FBRD_DIVFRAC_S 0
  556. //*****************************************************************************
  557. //
  558. // The following are defines for the bit fields in the UART_O_LCRH register.
  559. //
  560. //*****************************************************************************
  561. #define UART_LCRH_SPS 0x00000080 // UART stick parity select When
  562. // bits 1, 2, and 7 of UARTLCRH are
  563. // set, the parity bit is
  564. // transmitted and checked as a 0.
  565. // When bits 1 and 7 are set and 2
  566. // is cleared, the parity bit is
  567. // transmitted and checked as a 1.
  568. // When this bit is cleared, stick
  569. // parity is disabled.
  570. #define UART_LCRH_SPS_M 0x00000080
  571. #define UART_LCRH_SPS_S 7
  572. #define UART_LCRH_WLEN_M 0x00000060 // UART word length The bits
  573. // indicate the number of data bits
  574. // transmitted or received in a
  575. // frame as follows: 0x0: 5 bits
  576. // (default) 0x1: 6 bits 0x2: 7
  577. // bits 0x3: 8 bits
  578. #define UART_LCRH_WLEN_S 5
  579. #define UART_LCRH_FEN 0x00000010 // UART enable FIFOs 1: The
  580. // transmit and receive FIFObuffers
  581. // are enabled (FIFOmode). 0: The
  582. // FIFOs are disabled (Character
  583. // mode). The FIFOs become
  584. // 1-byte-deep holding registers.
  585. #define UART_LCRH_FEN_M 0x00000010
  586. #define UART_LCRH_FEN_S 4
  587. #define UART_LCRH_STP2 0x00000008 // UART two stop bits select 1:
  588. // Two stop bits are transmitted at
  589. // the end of a frame. The receive
  590. // logic does not check for two
  591. // stop bits being received. 0: One
  592. // stop bit is transmitted at the
  593. // end of a frame.
  594. #define UART_LCRH_STP2_M 0x00000008
  595. #define UART_LCRH_STP2_S 3
  596. #define UART_LCRH_EPS 0x00000004 // UART even parity select 1: Even
  597. // parity generation and checking
  598. // is performed during transmission
  599. // and reception, which checks for
  600. // an even number of 1s in data and
  601. // parity bits. 0: Odd parity is
  602. // performed, which checks for an
  603. // odd number of 1s. This bit has
  604. // no effect when parity is
  605. // disabled by the PEN bit.
  606. #define UART_LCRH_EPS_M 0x00000004
  607. #define UART_LCRH_EPS_S 2
  608. #define UART_LCRH_PEN 0x00000002 // UART parity enable 1: Parity
  609. // checking and generation is
  610. // enabled. 0: Parity is disabled
  611. // and no parity bit is added to
  612. // the data frame.
  613. #define UART_LCRH_PEN_M 0x00000002
  614. #define UART_LCRH_PEN_S 1
  615. #define UART_LCRH_BRK 0x00000001 // UART send break 1: A low level
  616. // is continually output on the
  617. // UnTx signal, after completing
  618. // transmission of the current
  619. // character. For the proper
  620. // execution of the break command,
  621. // software must set this bit for
  622. // at least two frames (character
  623. // periods). 0: Normal use
  624. #define UART_LCRH_BRK_M 0x00000001
  625. #define UART_LCRH_BRK_S 0
  626. //*****************************************************************************
  627. //
  628. // The following are defines for the bit fields in the UART_O_CTL register.
  629. //
  630. //*****************************************************************************
  631. #define UART_CTL_CTSEN 0x00008000 // U1CTS Hardware Flow control
  632. // enable 1: When U1CTS input is
  633. // asserted, UART1 can transmit
  634. // data. 0: U1CTS does not control
  635. // UART1 data transmission. Note:
  636. // Only used for UART1. This bit is
  637. // reserved RO for UART0.
  638. #define UART_CTL_CTSEN_M 0x00008000
  639. #define UART_CTL_CTSEN_S 15
  640. #define UART_CTL_RTSEN 0x00004000 // U1RTS Hardware Flow control
  641. // enable 1: U1RTS indicates the
  642. // state of UART1 receive FIFO.
  643. // U1RTS remains asserted until the
  644. // preprogrammed watermark level is
  645. // reached, indicating that the
  646. // UART1 RXFIFO has no space to
  647. // store additional characters. 0:
  648. // U1RTS does not indicate state of
  649. // UART1 RX FIFO. Note: Only used
  650. // for UART1. This bit is reserved
  651. // RO for UART0.
  652. #define UART_CTL_RTSEN_M 0x00004000
  653. #define UART_CTL_RTSEN_S 14
  654. #define UART_CTL_RXE 0x00000200 // UART receive enable 1: The
  655. // receive section of the UART is
  656. // enabled. 0: The receive section
  657. // of the UART is disabled. If the
  658. // UART is disabled in the middle
  659. // of a receive, it completes the
  660. // current character before
  661. // stopping. Note: To enable
  662. // reception, the UARTEN bit must
  663. // also be set.
  664. #define UART_CTL_RXE_M 0x00000200
  665. #define UART_CTL_RXE_S 9
  666. #define UART_CTL_TXE 0x00000100 // UART transmit enable 1: The
  667. // transmit section of the UART is
  668. // enabled. 0: The transmit section
  669. // of the UART is disabled. If the
  670. // UART is disabled in the middle
  671. // of a transmission, it completes
  672. // the current character before
  673. // stopping. Note: To enable
  674. // transmission, the UARTEN bit
  675. // must also be set.
  676. #define UART_CTL_TXE_M 0x00000100
  677. #define UART_CTL_TXE_S 8
  678. #define UART_CTL_LBE 0x00000080 // UART loop back enable 1: The
  679. // UnTx path is fed through the
  680. // UnRx path. 0: Normal operation
  681. #define UART_CTL_LBE_M 0x00000080
  682. #define UART_CTL_LBE_S 7
  683. #define UART_CTL_LIN 0x00000040 // LIN mode enable 1: The UART
  684. // operates in LIN mode. 0: Normal
  685. // operation
  686. #define UART_CTL_LIN_M 0x00000040
  687. #define UART_CTL_LIN_S 6
  688. #define UART_CTL_HSE 0x00000020 // High-speed enable 0: The UART
  689. // is clocked using the system
  690. // clock divided by 16. 1: The UART
  691. // is clocked using the system
  692. // clock divided by 8. Note: System
  693. // clock used is also dependent on
  694. // the baud-rate divisor
  695. // configuration (See Universal
  696. // Asynchronous
  697. // Receivers/Transmitters -
  698. // Baud-Rate Generation).
  699. #define UART_CTL_HSE_M 0x00000020
  700. #define UART_CTL_HSE_S 5
  701. #define UART_CTL_EOT 0x00000010 // End of transmission This bit
  702. // determines the behavior of the
  703. // TXRIS bit in the UARTRIS
  704. // register. 1: The TXRIS bit is
  705. // set only after all transmitted
  706. // data, including stop bits, have
  707. // cleared the serializer. 0: The
  708. // TXRIS bit is set when the
  709. // transmit FIFO condition
  710. // specified in UARTIFLS is met.
  711. #define UART_CTL_EOT_M 0x00000010
  712. #define UART_CTL_EOT_S 4
  713. #define UART_CTL_SIRLP 0x00000004 // UART SIR low-power mode This
  714. // bit selects the IrDA encoding
  715. // mode. 1: The UART operates in
  716. // SIR Low-Power mode. Low-level
  717. // bits are transmitted with a
  718. // pulse width which is 3 times the
  719. // period of the IrLPBaud16 input
  720. // signal, regardless of the
  721. // selected bit rate. 0: Low-level
  722. // bits are transmitted as an
  723. // active high pulse with a width
  724. // of 3/16th of the bit period.
  725. // Setting this bit uses less
  726. // power, but might reduce
  727. // transmission distances.
  728. #define UART_CTL_SIRLP_M 0x00000004
  729. #define UART_CTL_SIRLP_S 2
  730. #define UART_CTL_SIREN 0x00000002 // UART SIR enable 1: The IrDA SIR
  731. // block is enabled, and the UART
  732. // transmits and receives data
  733. // using SIR protocol. 0: Normal
  734. // operation.
  735. #define UART_CTL_SIREN_M 0x00000002
  736. #define UART_CTL_SIREN_S 1
  737. #define UART_CTL_UARTEN 0x00000001 // UART enable 1: The UART is
  738. // enabled. 0: The UART is
  739. // disabled. If the UART is
  740. // disabled in the middle of
  741. // transmission or reception, it
  742. // completes the current character
  743. // before stopping.
  744. #define UART_CTL_UARTEN_M 0x00000001
  745. #define UART_CTL_UARTEN_S 0
  746. //*****************************************************************************
  747. //
  748. // The following are defines for the bit fields in the UART_O_IFLS register.
  749. //
  750. //*****************************************************************************
  751. #define UART_IFLS_RXIFLSEL_M 0x00000038 // UART receive interrupt FIFO
  752. // level select The trigger points
  753. // for the receive interrupt are as
  754. // follows: 0x0: RX FIFO >= 1/8
  755. // full 0x1: RX FIFO >= 1/4 full
  756. // 0x2: RX FIFO >= 1/2 full
  757. // (default) 0x3: RX FIFO >= 3/4
  758. // full 0x4: RX FIFO >= 7/8 full
  759. // 0x5-0x7: Reserved
  760. #define UART_IFLS_RXIFLSEL_S 3
  761. #define UART_IFLS_TXIFLSEL_M 0x00000007 // UART Transmit Interrupt FIFO
  762. // Level Select The trigger points
  763. // for the transmit interrupt are
  764. // as follows: 0x0: TX FIFO <= 7/8
  765. // empty 0x1: TX FIFO <= 3/4 empty
  766. // 0x2: TX FIFO <= 1/2 empty
  767. // (default) 0x3: TX FIFO <= 1/4
  768. // empty 0x4: TX FIFO <= 1/8 empty
  769. // 0x5-0x7: Reserved Note: If the
  770. // EOT bit in UARTCTL is set, the
  771. // transmit interrupt is generated
  772. // once the FIFO is completely
  773. // empty and all data including
  774. // stop bits have left the transmit
  775. // serializer. In this case, the
  776. // setting of TXIFLSEL is ignored.
  777. #define UART_IFLS_TXIFLSEL_S 0
  778. //*****************************************************************************
  779. //
  780. // The following are defines for the bit fields in the UART_O_IM register.
  781. //
  782. //*****************************************************************************
  783. #define UART_IM_LME5IM 0x00008000 // LIN mode edge 5 interrupt mask
  784. // 1: An interrupt is sent to the
  785. // interrupt controller when the
  786. // LME5RIS bit in the UARTRIS
  787. // register is set. 0: The LME5RIS
  788. // interrupt is suppressed and not
  789. // sent to the interrupt
  790. // controller.
  791. #define UART_IM_LME5IM_M 0x00008000
  792. #define UART_IM_LME5IM_S 15
  793. #define UART_IM_LME1IM 0x00004000 // LIN mode edge 1 interrupt mask
  794. // 1: An interrupt is sent to the
  795. // interrupt controller when the
  796. // LME1RIS bit in the UARTRIS
  797. // register is set. 0: The LME1RIS
  798. // interrupt is suppressed and not
  799. // sent to the interrupt
  800. // controller.
  801. #define UART_IM_LME1IM_M 0x00004000
  802. #define UART_IM_LME1IM_S 14
  803. #define UART_IM_LMSBIM 0x00002000 // LIN mode sync break interrupt
  804. // mask 1: An interrupt is sent to
  805. // the interrupt controller when
  806. // the LMSBRIS bit in the UARTRIS
  807. // register is set. 0: The LMSBRIS
  808. // interrupt is suppressed and not
  809. // sent to the interrupt
  810. // controller.
  811. #define UART_IM_LMSBIM_M 0x00002000
  812. #define UART_IM_LMSBIM_S 13
  813. #define UART_IM_NINEBITIM 0x00001000 // 9-bit mode interrupt mask 1: An
  814. // interrupt is sent to the
  815. // interrupt controller when the
  816. // 9BITRIS bit in the UARTRIS
  817. // register is set. 0: The 9BITRIS
  818. // interrupt is suppressed and not
  819. // sent to the interrupt
  820. // controller.
  821. #define UART_IM_NINEBITIM_M 0x00001000
  822. #define UART_IM_NINEBITIM_S 12
  823. #define UART_IM_OEIM 0x00000400 // UART overrun error interrupt
  824. // mask 1: An interrupt is sent to
  825. // the interrupt controller when
  826. // the OERIS bit in the UARTRIS
  827. // register is set. 0: The OERIS
  828. // interrupt is suppressed and not
  829. // sent to the interrupt
  830. // controller.
  831. #define UART_IM_OEIM_M 0x00000400
  832. #define UART_IM_OEIM_S 10
  833. #define UART_IM_BEIM 0x00000200 // UART break error interrupt mask
  834. // 1: An interrupt is sent to the
  835. // interrupt controller when the
  836. // BERIS bit in the UARTRIS
  837. // register is set. 0: The BERIS
  838. // interrupt is suppressed and not
  839. // sent to the interrupt
  840. // controller.
  841. #define UART_IM_BEIM_M 0x00000200
  842. #define UART_IM_BEIM_S 9
  843. #define UART_IM_PEIM 0x00000100 // UART parity error interrupt
  844. // mask 1: An interrupt is sent to
  845. // the interrupt controller when
  846. // the PERIS bit in the UARTRIS
  847. // register is set. 0: The PERIS
  848. // interrupt is suppressed and not
  849. // sent to the interrupt
  850. // controller.
  851. #define UART_IM_PEIM_M 0x00000100
  852. #define UART_IM_PEIM_S 8
  853. #define UART_IM_FEIM 0x00000080 // UART framing error interrupt
  854. // mask 1: An interrupt is sent to
  855. // the interrupt controller when
  856. // the FERIS bit in the UARTRIS
  857. // register is set. 0: The FERIS
  858. // interrupt is suppressed and not
  859. // sent to the interrupt
  860. // controller.
  861. #define UART_IM_FEIM_M 0x00000080
  862. #define UART_IM_FEIM_S 7
  863. #define UART_IM_RTIM 0x00000040 // UART receive time-out interrupt
  864. // mask 1: An interrupt is sent to
  865. // the interrupt controller when
  866. // the RTRIS bit in the UARTRIS
  867. // register is set. 0: The RTRIS
  868. // interrupt is suppressed and not
  869. // sent to the interrupt
  870. // controller.
  871. #define UART_IM_RTIM_M 0x00000040
  872. #define UART_IM_RTIM_S 6
  873. #define UART_IM_TXIM 0x00000020 // UART transmit interrupt mask 1:
  874. // An interrupt is sent to the
  875. // interrupt controller when the
  876. // TXRIS bit in the UARTRIS
  877. // register is set. 0: The TXRIS
  878. // interrupt is suppressed and not
  879. // sent to the interrupt
  880. // controller.
  881. #define UART_IM_TXIM_M 0x00000020
  882. #define UART_IM_TXIM_S 5
  883. #define UART_IM_RXIM 0x00000010 // UART receive interrupt mask 1:
  884. // An interrupt is sent to the
  885. // interrupt controller when the
  886. // RXRIS bit in the UARTRIS
  887. // register is set. 0: The RXRIS
  888. // interrupt is suppressed and not
  889. // sent to the interrupt
  890. // controller.
  891. #define UART_IM_RXIM_M 0x00000010
  892. #define UART_IM_RXIM_S 4
  893. //*****************************************************************************
  894. //
  895. // The following are defines for the bit fields in the UART_O_RIS register.
  896. //
  897. //*****************************************************************************
  898. #define UART_RIS_LME5RIS 0x00008000 // LIN mode edge 5 raw interrupt
  899. // status 1: The timer value at the
  900. // 5th falling edge of the LIN sync
  901. // field has been captured. 0: No
  902. // interrupt This bit is cleared by
  903. // writing 1 to the LME5IC bit in
  904. // the UARTICR register.
  905. #define UART_RIS_LME5RIS_M 0x00008000
  906. #define UART_RIS_LME5RIS_S 15
  907. #define UART_RIS_LME1RIS 0x00004000 // LIN mode edge 1 raw interrupt
  908. // status 1: The timer value at the
  909. // 1st falling edge of the LIN Sync
  910. // Field has been captured. 0: No
  911. // interrupt This bit is cleared by
  912. // writing 1 to the LME1IC bit in
  913. // the UARTICR register.
  914. #define UART_RIS_LME1RIS_M 0x00004000
  915. #define UART_RIS_LME1RIS_S 14
  916. #define UART_RIS_LMSBRIS 0x00002000 // LIN mode sync break raw
  917. // interrupt status 1: A LIN sync
  918. // break has been detected. 0: No
  919. // interrupt This bit is cleared by
  920. // writing 1 to the LMSBIC bit in
  921. // the UARTICR register.
  922. #define UART_RIS_LMSBRIS_M 0x00002000
  923. #define UART_RIS_LMSBRIS_S 13
  924. #define UART_RIS_NINEBITRIS 0x00001000 // 9-mit mode raw interrupt status
  925. // 1: A receive address match has
  926. // occurred. 0: No interrupt This
  927. // bit is cleared by writing 1 to
  928. // the 9BITIC bit in the UARTICR
  929. // register.
  930. #define UART_RIS_NINEBITRIS_M 0x00001000
  931. #define UART_RIS_NINEBITRIS_S 12
  932. #define UART_RIS_OERIS 0x00000400 // UART overrun error raw
  933. // interrupt status 1: An overrun
  934. // error has occurred. 0: No
  935. // interrupt This bit is cleared by
  936. // writing 1 to the OEIC bit in the
  937. // UARTICR register.
  938. #define UART_RIS_OERIS_M 0x00000400
  939. #define UART_RIS_OERIS_S 10
  940. #define UART_RIS_BERIS 0x00000200 // UART break error raw interrupt
  941. // status 1: A break error has
  942. // occurred. 0: No interrupt This
  943. // bit is cleared by writing 1 to
  944. // the BEIC bit in the UARTICR
  945. // register.
  946. #define UART_RIS_BERIS_M 0x00000200
  947. #define UART_RIS_BERIS_S 9
  948. #define UART_RIS_PERIS 0x00000100 // UART parity error raw interrupt
  949. // status 1: A parity error has
  950. // occurred. 0: No interrupt This
  951. // bit is cleared by writing 1 to
  952. // the PEIC bit in the UARTICR
  953. // register.
  954. #define UART_RIS_PERIS_M 0x00000100
  955. #define UART_RIS_PERIS_S 8
  956. #define UART_RIS_FERIS 0x00000080 // UART framing error raw
  957. // interrupt status 1: A framing
  958. // error has occurred. 0: No
  959. // interrupt This bit is cleared by
  960. // writing 1 to the FEIC bit in the
  961. // UARTICR register.
  962. #define UART_RIS_FERIS_M 0x00000080
  963. #define UART_RIS_FERIS_S 7
  964. #define UART_RIS_RTRIS 0x00000040 // UART receive time-out raw
  965. // interrupt status 1: A receive
  966. // time out has occurred. 0: No
  967. // interrupt This bit is cleared by
  968. // writing 1 to the RTIC bit in the
  969. // UARTICR register.
  970. #define UART_RIS_RTRIS_M 0x00000040
  971. #define UART_RIS_RTRIS_S 6
  972. #define UART_RIS_TXRIS 0x00000020 // UART transmit raw interrupt
  973. // status 1: If the EOT bit in the
  974. // UARTCTL register is clear, the
  975. // transmit FIFO level has passed
  976. // through the condition defined in
  977. // the UARTIFLS register. If the
  978. // EOT bit is set, the last bit of
  979. // all transmitted data and flags
  980. // has left the serializer. 0: No
  981. // interrupt This bit is cleared by
  982. // writing 1 to the TXIC bit in the
  983. // UARTICR register.
  984. #define UART_RIS_TXRIS_M 0x00000020
  985. #define UART_RIS_TXRIS_S 5
  986. #define UART_RIS_RXRIS 0x00000010 // UART receive raw interrupt
  987. // status 1: The receive FIFO level
  988. // has passed through the condition
  989. // defined in the UARTIFLS
  990. // register. 0: No interrupt This
  991. // bit is cleared by writing 1 to
  992. // the RXIC bit in the UARTICR
  993. // register.
  994. #define UART_RIS_RXRIS_M 0x00000010
  995. #define UART_RIS_RXRIS_S 4
  996. //*****************************************************************************
  997. //
  998. // The following are defines for the bit fields in the UART_O_MIS register.
  999. //
  1000. //*****************************************************************************
  1001. #define UART_MIS_LME5MIS 0x00008000 // LIN mode edge 5 masked
  1002. // interrupt status 1: An unmasked
  1003. // interrupt was signaled due to
  1004. // the 5th falling edge of the LIN
  1005. // sync field. 0: An interrupt has
  1006. // not occurred or is masked. This
  1007. // bit is cleared by writing 1 to
  1008. // the LME5IC bit in the UARTICR
  1009. // register.
  1010. #define UART_MIS_LME5MIS_M 0x00008000
  1011. #define UART_MIS_LME5MIS_S 15
  1012. #define UART_MIS_LME1MIS 0x00004000 // LIN mode edge 1 masked
  1013. // interrupt status 1: An unmasked
  1014. // interrupt was signaled due to
  1015. // the 1st falling edge of the LIN
  1016. // sync field. 0: An interrupt has
  1017. // not occurred or is masked. This
  1018. // bit is cleared by writing 1 to
  1019. // the LME1IC bit in the UARTICR
  1020. // register.
  1021. #define UART_MIS_LME1MIS_M 0x00004000
  1022. #define UART_MIS_LME1MIS_S 14
  1023. #define UART_MIS_LMSBMIS 0x00002000 // LIN mode sync break masked
  1024. // interrupt status 1: An unmasked
  1025. // interrupt was signaled due to
  1026. // the receipt of a LIN sync break.
  1027. // 0: An interrupt has not occurred
  1028. // or is masked. This bit is
  1029. // cleared by writing 1 to the
  1030. // LMSBIC bit in the UARTICR
  1031. // register.
  1032. #define UART_MIS_LMSBMIS_M 0x00002000
  1033. #define UART_MIS_LMSBMIS_S 13
  1034. #define UART_MIS_NINEBITMIS 0x00001000 // 9-bit mode masked interrupt
  1035. // status 1: An unmasked interrupt
  1036. // was signaled due to a receive
  1037. // address match. 0: An interrupt
  1038. // has not occurred or is masked.
  1039. // This bit is cleared by writing 1
  1040. // to the 9BITIC bit in the UARTICR
  1041. // register.
  1042. #define UART_MIS_NINEBITMIS_M 0x00001000
  1043. #define UART_MIS_NINEBITMIS_S 12
  1044. #define UART_MIS_OEMIS 0x00000400 // UART overrun error masked
  1045. // interrupt status 1: An unmasked
  1046. // interrupt was signaled due to an
  1047. // overrun error. 0: An interrupt
  1048. // has not occurred or is masked.
  1049. // This bit is cleared by writing 1
  1050. // to the OEIC bit in the UARTICR
  1051. // register.
  1052. #define UART_MIS_OEMIS_M 0x00000400
  1053. #define UART_MIS_OEMIS_S 10
  1054. #define UART_MIS_BEMIS 0x00000200 // UART break error masked
  1055. // interrupt status 1: An unmasked
  1056. // interrupt was signaled due to a
  1057. // break error. 0: An interrupt has
  1058. // not occurred or is masked. This
  1059. // bit is cleared by writing 1 to
  1060. // the BEIC bit in the UARTICR
  1061. // register.
  1062. #define UART_MIS_BEMIS_M 0x00000200
  1063. #define UART_MIS_BEMIS_S 9
  1064. #define UART_MIS_PEMIS 0x00000100 // UART parity error masked
  1065. // interrupt status 1: An unmasked
  1066. // interrupt was signaled due to a
  1067. // parity error. 0: An interrupt
  1068. // has not occurred or is masked.
  1069. // This bit is cleared by writing 1
  1070. // to the PEIC bit in the UARTICR
  1071. // register.
  1072. #define UART_MIS_PEMIS_M 0x00000100
  1073. #define UART_MIS_PEMIS_S 8
  1074. #define UART_MIS_FEMIS 0x00000080 // UART framing error masked
  1075. // interrupt status 1: An unmasked
  1076. // interrupt was signaled due to a
  1077. // framing error. 0: An interrupt
  1078. // has not occurred or is masked.
  1079. // This bit is cleared by writing 1
  1080. // to the FEIC bit in the UARTICR
  1081. // register.
  1082. #define UART_MIS_FEMIS_M 0x00000080
  1083. #define UART_MIS_FEMIS_S 7
  1084. #define UART_MIS_RTMIS 0x00000040 // UART receive time-out masked
  1085. // interrupt status 1: An unmasked
  1086. // interrupt was signaled due to a
  1087. // receive time out. 0: An
  1088. // interrupt has not occurred or is
  1089. // masked. This bit is cleared by
  1090. // writing 1 to the RTIC bit in the
  1091. // UARTICR register.
  1092. #define UART_MIS_RTMIS_M 0x00000040
  1093. #define UART_MIS_RTMIS_S 6
  1094. #define UART_MIS_TXMIS 0x00000020 // UART transmit masked interrupt
  1095. // status 1: An unmasked interrupt
  1096. // was signaled due to passing
  1097. // through the specified transmit
  1098. // FIFO level (if the EOT bit is
  1099. // clear) or due to the
  1100. // transmission of the last data
  1101. // bit (if the EOT bit is set). 0:
  1102. // An interrupt has not occurred or
  1103. // is masked. This bit is cleared
  1104. // by writing 1 to the TXIC bit in
  1105. // the UARTICR register.
  1106. #define UART_MIS_TXMIS_M 0x00000020
  1107. #define UART_MIS_TXMIS_S 5
  1108. #define UART_MIS_RXMIS 0x00000010 // UART receive masked interrupt
  1109. // status 1: An unmasked interrupt
  1110. // was signaled due to passing
  1111. // through the specified receive
  1112. // FIFO level. 0: An interrupt has
  1113. // not occurred or is masked. This
  1114. // bit is cleared by writing 1 to
  1115. // the RXIC bit in the UARTICR
  1116. // register.
  1117. #define UART_MIS_RXMIS_M 0x00000010
  1118. #define UART_MIS_RXMIS_S 4
  1119. //*****************************************************************************
  1120. //
  1121. // The following are defines for the bit fields in the UART_O_ICR register.
  1122. //
  1123. //*****************************************************************************
  1124. #define UART_ICR_LME5IC 0x00008000 // LIN mode edge 5 interrupt clear
  1125. // Writing 1 to this bit clears the
  1126. // LME5RIS bit in the UARTRIS
  1127. // register and the LME5MIS bit in
  1128. // the UARTMIS register.
  1129. #define UART_ICR_LME5IC_M 0x00008000
  1130. #define UART_ICR_LME5IC_S 15
  1131. #define UART_ICR_LME1IC 0x00004000 // LIN mode edge 1 interrupt clear
  1132. // Writing 1 to this bit clears the
  1133. // LME1RIS bit in the UARTRIS
  1134. // register and the LME1MIS bit in
  1135. // the UARTMIS register.
  1136. #define UART_ICR_LME1IC_M 0x00004000
  1137. #define UART_ICR_LME1IC_S 14
  1138. #define UART_ICR_LMSBIC 0x00002000 // LIN mode sync break interrupt
  1139. // clear Writing 1 to this bit
  1140. // clears the LMSBRIS bit in the
  1141. // UARTRIS register and the LMSBMIS
  1142. // bit in the UARTMIS register.
  1143. #define UART_ICR_LMSBIC_M 0x00002000
  1144. #define UART_ICR_LMSBIC_S 13
  1145. #define UART_ICR_NINEBITIC 0x00001000 // 9-bit mode interrupt clear
  1146. // Writing 1 to this bit clears the
  1147. // 9BITRIS bit in the UARTRIS
  1148. // register and the 9BITMIS bit in
  1149. // the UARTMIS register.
  1150. #define UART_ICR_NINEBITIC_M 0x00001000
  1151. #define UART_ICR_NINEBITIC_S 12
  1152. #define UART_ICR_OEIC 0x00000400 // Overrun error interrupt clear
  1153. // Writing 1 to this bit clears the
  1154. // OERIS bit in the UARTRIS
  1155. // register and the OEMIS bit in
  1156. // the UARTMIS register.
  1157. #define UART_ICR_OEIC_M 0x00000400
  1158. #define UART_ICR_OEIC_S 10
  1159. #define UART_ICR_BEIC 0x00000200 // Break error interrupt clear
  1160. // Writing 1 to this bit clears the
  1161. // BERIS bit in the UARTRIS
  1162. // register and the BEMIS bit in
  1163. // the UARTMIS register.
  1164. #define UART_ICR_BEIC_M 0x00000200
  1165. #define UART_ICR_BEIC_S 9
  1166. #define UART_ICR_PEIC 0x00000100 // Parity error interrupt clear
  1167. // Writing 1 to this bit clears the
  1168. // PERIS bit in the UARTRIS
  1169. // register and the PEMIS bit in
  1170. // the UARTMIS register.
  1171. #define UART_ICR_PEIC_M 0x00000100
  1172. #define UART_ICR_PEIC_S 8
  1173. #define UART_ICR_FEIC 0x00000080 // Framing error interrupt clear
  1174. // Writing 1 to this bit clears the
  1175. // FERIS bit in the UARTRIS
  1176. // register and the FEMIS bit in
  1177. // the UARTMIS register.
  1178. #define UART_ICR_FEIC_M 0x00000080
  1179. #define UART_ICR_FEIC_S 7
  1180. #define UART_ICR_RTIC 0x00000040 // Receive time-out interrupt
  1181. // clear Writing 1 to this bit
  1182. // clears the RTRIS bit in the
  1183. // UARTRIS register and the RTMIS
  1184. // bit in the UARTMIS register.
  1185. #define UART_ICR_RTIC_M 0x00000040
  1186. #define UART_ICR_RTIC_S 6
  1187. #define UART_ICR_TXIC 0x00000020 // Transmit interrupt clear
  1188. // Writing 1 to this bit clears the
  1189. // TXRIS bit in the UARTRIS
  1190. // register and the TXMIS bit in
  1191. // the UARTMIS register.
  1192. #define UART_ICR_TXIC_M 0x00000020
  1193. #define UART_ICR_TXIC_S 5
  1194. #define UART_ICR_RXIC 0x00000010 // Receive interrupt clear Writing
  1195. // 1 to this bit clears the RXRIS
  1196. // bit in the UARTRIS register and
  1197. // the RXMIS bit in the UARTMIS
  1198. // register.
  1199. #define UART_ICR_RXIC_M 0x00000010
  1200. #define UART_ICR_RXIC_S 4
  1201. //*****************************************************************************
  1202. //
  1203. // The following are defines for the bit fields in the UART_O_DMACTL register.
  1204. //
  1205. //*****************************************************************************
  1206. #define UART_DMACTL_DMAERR 0x00000004 // DMA on error 1: uDMA receive
  1207. // requests are automatically
  1208. // disabled when a receive error
  1209. // occurs. 0: uDMA receive requests
  1210. // are unaffected when a receive
  1211. // error occurs.
  1212. #define UART_DMACTL_DMAERR_M 0x00000004
  1213. #define UART_DMACTL_DMAERR_S 2
  1214. #define UART_DMACTL_TXDMAE 0x00000002 // Transmit DMA enable 1: uDMA for
  1215. // the transmit FIFO is enabled. 0:
  1216. // uDMA for the transmit FIFO is
  1217. // disabled.
  1218. #define UART_DMACTL_TXDMAE_M 0x00000002
  1219. #define UART_DMACTL_TXDMAE_S 1
  1220. #define UART_DMACTL_RXDMAE 0x00000001 // Receive DMA enable 1: uDMA for
  1221. // the receive FIFO is enabled. 0:
  1222. // uDMA for the receive FIFO is
  1223. // disabled.
  1224. #define UART_DMACTL_RXDMAE_M 0x00000001
  1225. #define UART_DMACTL_RXDMAE_S 0
  1226. //*****************************************************************************
  1227. //
  1228. // The following are defines for the bit fields in the UART_O_LCTL register.
  1229. //
  1230. //*****************************************************************************
  1231. #define UART_LCTL_BLEN_M 0x00000030 // Sync break length 0x3: Sync
  1232. // break length is 16T bits 0x2:
  1233. // Sync break length is 15T bits
  1234. // 0x1: Sync break length is 14T
  1235. // bits 0x0: Sync break length is
  1236. // 13T bits (default)
  1237. #define UART_LCTL_BLEN_S 4
  1238. #define UART_LCTL_MASTER 0x00000001 // LIN master enable 1: The UART
  1239. // operates as a LIN master. 0: The
  1240. // UART operates as a LIN slave.
  1241. #define UART_LCTL_MASTER_M 0x00000001
  1242. #define UART_LCTL_MASTER_S 0
  1243. //*****************************************************************************
  1244. //
  1245. // The following are defines for the bit fields in the UART_O_LSS register.
  1246. //
  1247. //*****************************************************************************
  1248. #define UART_LSS_TSS_M 0x0000FFFF // Timer snap shot This field
  1249. // contains the value of the
  1250. // free-running timer when either
  1251. // the sync edge 5 or the sync edge
  1252. // 1 was detected.
  1253. #define UART_LSS_TSS_S 0
  1254. //*****************************************************************************
  1255. //
  1256. // The following are defines for the bit fields in the UART_O_LTIM register.
  1257. //
  1258. //*****************************************************************************
  1259. #define UART_LTIM_TIMER_M 0x0000FFFF // Timer value This field contains
  1260. // the value of the free-running
  1261. // timer.
  1262. #define UART_LTIM_TIMER_S 0
  1263. //*****************************************************************************
  1264. //
  1265. // The following are defines for the bit fields in the
  1266. // UART_O_NINEBITADDR register.
  1267. //
  1268. //*****************************************************************************
  1269. #define UART_NINEBITADDR_NINEBITEN \
  1270. 0x00008000 // Enable 9-bit mode 1: 9-bit mode
  1271. // is enabled. 0: 9-bit mode is
  1272. // disabled.
  1273. #define UART_NINEBITADDR_NINEBITEN_M \
  1274. 0x00008000
  1275. #define UART_NINEBITADDR_NINEBITEN_S 15
  1276. #define UART_NINEBITADDR_ADDR_M 0x000000FF // Self address for 9-bit mode
  1277. // This field contains the address
  1278. // that should be matched when
  1279. // UART9BITAMASK is 0xFF.
  1280. #define UART_NINEBITADDR_ADDR_S 0
  1281. //*****************************************************************************
  1282. //
  1283. // The following are defines for the bit fields in the
  1284. // UART_O_NINEBITAMASK register.
  1285. //
  1286. //*****************************************************************************
  1287. #define UART_NINEBITAMASK_RANGE_M \
  1288. 0x0000FF00 // Self address range for 9-bit
  1289. // mode Writing to the RANGE field
  1290. // does not have any effect;
  1291. // reading it reflects the ANDed
  1292. // output of the ADDR field in the
  1293. // UART9BITADDR register and the
  1294. // MASK field.
  1295. #define UART_NINEBITAMASK_RANGE_S 8
  1296. #define UART_NINEBITAMASK_MASK_M \
  1297. 0x000000FF // Self Address Mask for 9-Bit
  1298. // Mode This field contains the
  1299. // address mask that creates a
  1300. // range of addresses that should
  1301. // be matched.
  1302. #define UART_NINEBITAMASK_MASK_S 0
  1303. //*****************************************************************************
  1304. //
  1305. // The following are defines for the bit fields in the UART_O_PP register.
  1306. //
  1307. //*****************************************************************************
  1308. #define UART_PP_NB 0x00000002 // 9-bit support 1: The UART
  1309. // module provides support for the
  1310. // transmission of 9-bit data for
  1311. // RS-485 support. 0: The UART
  1312. // module does not provide support
  1313. // for the transmission of 9-bit
  1314. // data for RS-485 support.
  1315. #define UART_PP_NB_M 0x00000002
  1316. #define UART_PP_NB_S 1
  1317. #define UART_PP_SC 0x00000001 // Smart card support 1: The UART
  1318. // module provides smart card
  1319. // support. 0: The UART module does
  1320. // not provide smart card support.
  1321. #define UART_PP_SC_M 0x00000001
  1322. #define UART_PP_SC_S 0
  1323. //*****************************************************************************
  1324. //
  1325. // The following are defines for the bit fields in the UART_O_CC register.
  1326. //
  1327. //*****************************************************************************
  1328. #define UART_CC_CS_M 0x00000007 // UART baud and system clock
  1329. // source The following bits
  1330. // determine the clock source that
  1331. // generates the baud and system
  1332. // clocks for the UART. bit0
  1333. // (PIOSC): 1: The UART baud clock
  1334. // is determined by the IO DIV
  1335. // setting in the system
  1336. // controller. 0: The UART baud
  1337. // clock is determined by the SYS
  1338. // DIV setting in the system
  1339. // controller. bit1: Unused bit2:
  1340. // (DSEN) Only meaningful when the
  1341. // system is in deep sleep mode.
  1342. // This bit is a don't care when
  1343. // not in sleep mode. 1: The UART
  1344. // system clock is running on the
  1345. // same clock as the baud clock, as
  1346. // per PIOSC setting above. 0: The
  1347. // UART system clock is determined
  1348. // by the SYS DIV setting in the
  1349. // system controller.
  1350. #define UART_CC_CS_S 0
  1351. #endif // __HW_UART_H__