efm32_lcd.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. /***************************************************************************//**
  2. * @file
  3. * @brief Liquid Crystal Display (LCD) peripheral API for EFM32
  4. * @author Energy Micro AS
  5. * @version 2.0.0
  6. *******************************************************************************
  7. * @section License
  8. * <b>(C) Copyright 2010 Energy Micro AS, http://www.energymicro.com</b>
  9. *******************************************************************************
  10. *
  11. * This source code is the property of Energy Micro AS. The source and compiled
  12. * code may only be used on Energy Micro "EFM32" microcontrollers.
  13. *
  14. * This copyright notice may not be removed from the source code nor changed.
  15. *
  16. * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Energy Micro AS has no
  17. * obligation to support this Software. Energy Micro AS is providing the
  18. * Software "AS IS", with no express or implied warranties of any kind,
  19. * including, but not limited to, any implied warranties of merchantability
  20. * or fitness for any particular purpose or warranties against infringement
  21. * of any proprietary rights of a third party.
  22. *
  23. * Energy Micro AS will not be liable for any consequential, incidental, or
  24. * special damages, or any other relief, or for any claim by any third party,
  25. * arising from your use of this Software.
  26. *
  27. ******************************************************************************/
  28. #ifndef __EFM32_LCD_H
  29. #define __EFM32_LCD_H
  30. #include "efm32.h"
  31. #if defined(LCD_COUNT) && (LCD_COUNT > 0)
  32. #include <stdint.h>
  33. #include <stdbool.h>
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /***************************************************************************//**
  38. * @addtogroup EFM32_Library
  39. * @{
  40. ******************************************************************************/
  41. /***************************************************************************//**
  42. * @addtogroup LCD
  43. * @{
  44. ******************************************************************************/
  45. /*******************************************************************************
  46. ******************************** ENUMS ************************************
  47. ******************************************************************************/
  48. /** MUX setting */
  49. typedef enum
  50. {
  51. /** Static (segments can be multiplexed with LCD_COM[0]) */
  52. lcdMuxStatic = LCD_DISPCTRL_MUX_STATIC,
  53. /** Duplex / 1/2 Duty cycle (segments can be multiplexed with LCD_COM[0:1]) */
  54. lcdMuxDuplex = LCD_DISPCTRL_MUX_DUPLEX,
  55. /** Triplex / 1/3 Duty cycle (segments can be multiplexed with LCD_COM[0:2]) */
  56. lcdMuxTriplex = LCD_DISPCTRL_MUX_TRIPLEX,
  57. /** Quadruplex / 1/4 Duty cycle (segments can be multiplexed with LCD_COM[0:3]) */
  58. lcdMuxQuadruplex = LCD_DISPCTRL_MUX_QUADRUPLEX,
  59. #if defined(_EFM32_TINY_FAMILY) || defined(_EFM32_GIANT_FAMILY)
  60. /** Sextaplex / 1/6 Duty cycle (segments can be multiplexed with LCD_COM[0:5]) */
  61. lcdMuxSextaplex = LCD_DISPCTRL_MUXE_MUXE | LCD_DISPCTRL_MUX_DUPLEX,
  62. /** Octaplex / 1/6 Duty cycle (segments can be multiplexed with LCD_COM[0:5]) */
  63. lcdMuxOctaplex = LCD_DISPCTRL_MUXE_MUXE | LCD_DISPCTRL_MUX_QUADRUPLEX
  64. #endif
  65. } LCD_Mux_TypeDef;
  66. /** Bias setting */
  67. typedef enum
  68. {
  69. /** Static (2 levels) */
  70. lcdBiasStatic = LCD_DISPCTRL_BIAS_STATIC,
  71. /** 1/2 Bias (3 levels) */
  72. lcdBiasOneHalf = LCD_DISPCTRL_BIAS_ONEHALF,
  73. /** 1/3 Bias (4 levels) */
  74. lcdBiasOneThird = LCD_DISPCTRL_BIAS_ONETHIRD,
  75. #if defined(_EFM32_TINY_FAMILY) || defined(_EFM32_GIANT_FAMILY)
  76. /** 1/4 Bias (5 levels) */
  77. lcdBiasOneFourth = LCD_DISPCTRL_BIAS_ONEFOURTH,
  78. #endif
  79. } LCD_Bias_TypeDef;
  80. /** Wave type */
  81. typedef enum
  82. {
  83. /** Low power optimized waveform output */
  84. lcdWaveLowPower = LCD_DISPCTRL_WAVE_LOWPOWER,
  85. /** Regular waveform output */
  86. lcdWaveNormal = LCD_DISPCTRL_WAVE_NORMAL
  87. } LCD_Wave_TypeDef;
  88. /** VLCD Voltage Source */
  89. typedef enum
  90. {
  91. /** VLCD Powered by VDD */
  92. lcdVLCDSelVDD = LCD_DISPCTRL_VLCDSEL_VDD,
  93. /** VLCD Powered by external VDD / Voltage Boost */
  94. lcdVLCDSelVExtBoost = LCD_DISPCTRL_VLCDSEL_VEXTBOOST
  95. } LCD_VLCDSel_TypeDef;
  96. /** Contrast Configuration */
  97. typedef enum
  98. {
  99. /** Contrast is adjusted relative to VDD (VLCD) */
  100. lcdConConfVLCD = LCD_DISPCTRL_CONCONF_VLCD,
  101. /** Contrast is adjusted relative to Ground */
  102. lcdConConfGND = LCD_DISPCTRL_CONCONF_GND
  103. } LCD_ConConf_TypeDef;
  104. /** Voltage Boost Level - Datasheets document setting for each part number */
  105. typedef enum
  106. {
  107. lcdVBoostLevel0 = LCD_DISPCTRL_VBLEV_LEVEL0, /**< Voltage boost LEVEL0 */
  108. lcdVBoostLevel1 = LCD_DISPCTRL_VBLEV_LEVEL1, /**< Voltage boost LEVEL1 */
  109. lcdVBoostLevel2 = LCD_DISPCTRL_VBLEV_LEVEL2, /**< Voltage boost LEVEL2 */
  110. lcdVBoostLevel3 = LCD_DISPCTRL_VBLEV_LEVEL3, /**< Voltage boost LEVEL3 */
  111. lcdVBoostLevel4 = LCD_DISPCTRL_VBLEV_LEVEL4, /**< Voltage boost LEVEL4 */
  112. lcdVBoostLevel5 = LCD_DISPCTRL_VBLEV_LEVEL5, /**< Voltage boost LEVEL5 */
  113. lcdVBoostLevel6 = LCD_DISPCTRL_VBLEV_LEVEL6, /**< Voltage boost LEVEL6 */
  114. lcdVBoostLevel7 = LCD_DISPCTRL_VBLEV_LEVEL7 /**< Voltage boost LEVEL7 */
  115. } LCD_VBoostLevel_TypeDef;
  116. /** Frame Counter Clock Prescaler, FC-CLK = FrameRate (Hz) / this factor */
  117. typedef enum
  118. {
  119. /** Prescale Div 1 */
  120. lcdFCPrescDiv1 = LCD_BACTRL_FCPRESC_DIV1,
  121. /** Prescale Div 2 */
  122. lcdFCPrescDiv2 = LCD_BACTRL_FCPRESC_DIV2,
  123. /** Prescale Div 4 */
  124. lcdFCPrescDiv4 = LCD_BACTRL_FCPRESC_DIV4,
  125. /** Prescale Div 8 */
  126. lcdFCPrescDiv8 = LCD_BACTRL_FCPRESC_DIV8
  127. } LCD_FCPreScale_TypeDef;
  128. /** Segment selection */
  129. typedef enum
  130. {
  131. /** Select segment lines 0 to 3 */
  132. lcdSegment0_3 = (1 << 0),
  133. /** Select segment lines 4 to 7 */
  134. lcdSegment4_7 = (1 << 1),
  135. /** Select segment lines 8 to 11 */
  136. lcdSegment8_11 = (1 << 2),
  137. /** Select segment lines 12 to 15 */
  138. lcdSegment12_15 = (1 << 3),
  139. /** Select segment lines 16 to 19 */
  140. lcdSegment16_19 = (1 << 4),
  141. /** Select segment lines 20 to 23 */
  142. lcdSegment20_23 = (1 << 5),
  143. #if defined(_EFM32_TINY_FAMILY)
  144. /** Select all segment lines */
  145. lcdSegmentAll = (0x003f)
  146. #endif
  147. #if defined(_EFM32_GECKO_FAMILY) || defined(_EFM32_GIANT_FAMILY)
  148. /** Select segment lines 24 to 27 */
  149. lcdSegment24_27 = (1 << 6),
  150. /** Select segment lines 28 to 31 */
  151. lcdSegment28_31 = (1 << 7),
  152. /** Select segment lines 32 to 35 */
  153. lcdSegment32_35 = (1 << 8),
  154. /** Select segment lines 36 to 39 */
  155. lcdSegment36_39 = (1 << 9),
  156. /** Select all segment lines */
  157. lcdSegmentAll = (0x03ff)
  158. #endif
  159. } LCD_SegmentRange_TypeDef;
  160. /** Update Data Control */
  161. typedef enum
  162. {
  163. /** Regular update, data transfer done immediately */
  164. lcdUpdateCtrlRegular = LCD_CTRL_UDCTRL_REGULAR,
  165. /** Data transfer done at Frame Counter event */
  166. lcdUpdateCtrlFCEvent = LCD_CTRL_UDCTRL_FCEVENT,
  167. /** Data transfer done at Frame Start */
  168. lcdUpdateCtrlFrameStart = LCD_CTRL_UDCTRL_FRAMESTART
  169. } LCD_UpdateCtrl_TypeDef;
  170. /** Animation Shift operation; none, left or right */
  171. typedef enum
  172. {
  173. /** No shift */
  174. lcdAnimShiftNone = _LCD_BACTRL_AREGASC_NOSHIFT,
  175. /** Shift segment bits left */
  176. lcdAnimShiftLeft = _LCD_BACTRL_AREGASC_SHIFTLEFT,
  177. /** Shift segment bits right */
  178. lcdAnimShiftRight = _LCD_BACTRL_AREGASC_SHIFTRIGHT
  179. } LCD_AnimShift_TypeDef;
  180. /** Animation Logic Control, how AReg and BReg should be combined */
  181. typedef enum
  182. {
  183. /** Use bitwise logic AND to mix animation register A (AREGA) and B (AREGB) */
  184. lcdAnimLogicAnd = LCD_BACTRL_ALOGSEL_AND,
  185. /** Use bitwise logic OR to mix animation register A (AREGA) and B (AREGB) */
  186. lcdAnimLogicOr = LCD_BACTRL_ALOGSEL_OR
  187. } LCD_AnimLogic_TypeDef;
  188. /*******************************************************************************
  189. ******************************* STRUCTS ***********************************
  190. ******************************************************************************/
  191. /** LCD Animation Configuration */
  192. typedef struct
  193. {
  194. /** Enable Animation at end of initialization */
  195. bool enable;
  196. /** Initial Animation Register A Value */
  197. uint32_t AReg;
  198. /** Shift operation of Animation Register A */
  199. LCD_AnimShift_TypeDef AShift;
  200. /** Initial Animation Register B Value */
  201. uint32_t BReg;
  202. /** Shift operation of Animation Register B */
  203. LCD_AnimShift_TypeDef BShift;
  204. /** A and B Logical Operation to use for mixing and outputting resulting segments */
  205. LCD_AnimLogic_TypeDef animLogic;
  206. } LCD_AnimInit_TypeDef;
  207. /** LCD Frame Control Initialization */
  208. typedef struct
  209. {
  210. /** Enable at end */
  211. bool enable;
  212. /** Frame Counter top value */
  213. uint32_t top;
  214. /** Frame Counter clock prescaler */
  215. LCD_FCPreScale_TypeDef prescale;
  216. } LCD_FrameCountInit_TypeDef;
  217. /** LCD Controller Initialization structure */
  218. typedef struct
  219. {
  220. /** Enable controller at end of initialization */
  221. bool enable;
  222. /** Mux configuration */
  223. LCD_Mux_TypeDef mux;
  224. /** Bias configuration */
  225. LCD_Bias_TypeDef bias;
  226. /** Wave configuration */
  227. LCD_Wave_TypeDef wave;
  228. /** VLCD Select */
  229. LCD_VLCDSel_TypeDef vlcd;
  230. /** Contrast Configuration */
  231. LCD_ConConf_TypeDef contrast;
  232. } LCD_Init_TypeDef;
  233. /** Default config for LCD init structure, enables all 160 segments */
  234. #define LCD_INIT_DEFAULT \
  235. { true, \
  236. lcdMuxQuadruplex, \
  237. lcdBiasOneThird, \
  238. lcdWaveLowPower, \
  239. lcdVLCDSelVDD, \
  240. lcdConConfVLCD \
  241. }
  242. /*******************************************************************************
  243. ***************************** PROTOTYPES **********************************
  244. ******************************************************************************/
  245. void LCD_Init(const LCD_Init_TypeDef *lcdInit);
  246. void LCD_VLCDSelect(LCD_VLCDSel_TypeDef vlcd);
  247. void LCD_UpdateCtrl(LCD_UpdateCtrl_TypeDef ud);
  248. void LCD_FrameCountInit(const LCD_FrameCountInit_TypeDef *fcInit);
  249. void LCD_AnimInit(const LCD_AnimInit_TypeDef *animInit);
  250. void LCD_SegmentRangeEnable(LCD_SegmentRange_TypeDef segment, bool enable);
  251. void LCD_SegmentSet(int com, int bit, bool enable);
  252. void LCD_SegmentSetLow(int com, uint32_t mask, uint32_t bits);
  253. #if defined(_EFM32_GECKO_FAMILY) || defined(_EFM32_GIANT_FAMILY)
  254. void LCD_SegmentSetHigh(int com, uint32_t mask, uint32_t bits);
  255. #endif
  256. void LCD_ContrastSet(int level);
  257. void LCD_VBoostSet(LCD_VBoostLevel_TypeDef vboost);
  258. #if defined(_EFM32_TINY_FAMILY) || defined(_EFM32_GIANT_FAMILY)
  259. void LCD_BiasSegmentSet(int segment, int biasLevel);
  260. void LCD_BiasComSet(int com, int biasLevel);
  261. #endif
  262. static __INLINE void LCD_Enable(bool enable);
  263. static __INLINE void LCD_AnimEnable(bool enable);
  264. static __INLINE void LCD_BlinkEnable(bool enable);
  265. static __INLINE void LCD_BlankEnable(bool enable);
  266. static __INLINE void LCD_FrameCountEnable(bool enable);
  267. static __INLINE int LCD_AnimState(void);
  268. static __INLINE int LCD_BlinkState(void);
  269. static __INLINE void LCD_FreezeEnable(bool enable);
  270. static __INLINE uint32_t LCD_SyncBusyGet(void);
  271. static __INLINE void LCD_SyncBusyDelay(uint32_t flags);
  272. static __INLINE uint32_t LCD_IntGet(void);
  273. static __INLINE uint32_t LCD_IntGetEnabled(void);
  274. static __INLINE void LCD_IntSet(uint32_t flags);
  275. static __INLINE void LCD_IntEnable(uint32_t flags);
  276. static __INLINE void LCD_IntDisable(uint32_t flags);
  277. static __INLINE void LCD_IntClear(uint32_t flags);
  278. #if defined(_EFM32_TINY_FAMILY) || defined(_EFM32_GIANT_FAMILY)
  279. static __INLINE void LCD_DSCEnable(bool enable);
  280. #endif
  281. /***************************************************************************//**
  282. * @brief
  283. * Enable or disable LCD controller
  284. *
  285. * @param[in] enable
  286. * If true, enables LCD controller with current configuration, if false
  287. * disables LCD controller. CMU clock for LCD must be enabled for correct
  288. * operation.
  289. ******************************************************************************/
  290. static __INLINE void LCD_Enable(bool enable)
  291. {
  292. if (enable)
  293. {
  294. LCD->CTRL |= LCD_CTRL_EN;
  295. }
  296. else
  297. {
  298. LCD->CTRL &= ~(LCD_CTRL_EN);
  299. }
  300. }
  301. /***************************************************************************//**
  302. * @brief
  303. * Enables or disables LCD Animation feature
  304. *
  305. * @param[in] enable
  306. * Boolean true enables animation, false disables animation
  307. ******************************************************************************/
  308. static __INLINE void LCD_AnimEnable(bool enable)
  309. {
  310. if (enable)
  311. {
  312. LCD->BACTRL |= LCD_BACTRL_AEN;
  313. }
  314. else
  315. {
  316. LCD->BACTRL &= ~(LCD_BACTRL_AEN);
  317. }
  318. }
  319. /***************************************************************************//**
  320. * @brief
  321. * Enables or disables LCD blink
  322. *
  323. * @param[in] enable
  324. * Boolean true enables blink, false disables blink
  325. ******************************************************************************/
  326. static __INLINE void LCD_BlinkEnable(bool enable)
  327. {
  328. if (enable)
  329. {
  330. LCD->BACTRL |= LCD_BACTRL_BLINKEN;
  331. }
  332. else
  333. {
  334. LCD->BACTRL &= ~(LCD_BACTRL_BLINKEN);
  335. }
  336. }
  337. /***************************************************************************//**
  338. * @brief
  339. * Disables all segments, while keeping segment state
  340. *
  341. * @param[in] enable
  342. * Boolean true clears all segments, boolean false restores all segment lines
  343. ******************************************************************************/
  344. static __INLINE void LCD_BlankEnable(bool enable)
  345. {
  346. if (enable)
  347. {
  348. LCD->BACTRL |= LCD_BACTRL_BLANK;
  349. }
  350. else
  351. {
  352. LCD->BACTRL &= ~(LCD_BACTRL_BLANK);
  353. }
  354. }
  355. /***************************************************************************//**
  356. * @brief
  357. * Enables or disables LCD Frame Control
  358. *
  359. * @param[in] enable
  360. * Boolean true enables frame counter, false disables frame counter
  361. ******************************************************************************/
  362. static __INLINE void LCD_FrameCountEnable(bool enable)
  363. {
  364. if (enable)
  365. {
  366. LCD->BACTRL |= LCD_BACTRL_FCEN;
  367. }
  368. else
  369. {
  370. LCD->BACTRL &= ~(LCD_BACTRL_FCEN);
  371. }
  372. }
  373. /***************************************************************************//**
  374. * @brief
  375. * Returns current animation state
  376. *
  377. * @return
  378. * Animation state, in range 0-15
  379. ******************************************************************************/
  380. static __INLINE int LCD_AnimState(void)
  381. {
  382. return (int)(LCD->STATUS & _LCD_STATUS_ASTATE_MASK) >> _LCD_STATUS_ASTATE_SHIFT;
  383. }
  384. /***************************************************************************//**
  385. * @brief
  386. * Returns current blink state
  387. *
  388. * @return
  389. * Return value is 1 if segments are enabled, 0 if disabled
  390. ******************************************************************************/
  391. static __INLINE int LCD_BlinkState(void)
  392. {
  393. return (int)(LCD->STATUS & _LCD_STATUS_BLINK_MASK) >> _LCD_STATUS_BLINK_SHIFT;
  394. }
  395. /***************************************************************************//**
  396. * @brief
  397. * When set, LCD registers will not be updated until cleared,
  398. *
  399. * @param[in] enable
  400. * When enable is true, update is stopped, when false all registers are
  401. * updated
  402. ******************************************************************************/
  403. static __INLINE void LCD_FreezeEnable(bool enable)
  404. {
  405. if (enable)
  406. {
  407. LCD->FREEZE = LCD_FREEZE_REGFREEZE_FREEZE;
  408. }
  409. else
  410. {
  411. LCD->FREEZE = LCD_FREEZE_REGFREEZE_UPDATE;
  412. }
  413. }
  414. /***************************************************************************//**
  415. * @brief
  416. * Returns SYNCBUSY bits, indicating which registers have pending updates
  417. *
  418. * @return
  419. * Bit fields for LCD registers which have pending updates
  420. ******************************************************************************/
  421. static __INLINE uint32_t LCD_SyncBusyGet(void)
  422. {
  423. return(LCD->SYNCBUSY);
  424. }
  425. /***************************************************************************//**
  426. * @brief
  427. * Polls LCD SYNCBUSY flags, until flag has been cleared
  428. *
  429. * @param[in] flags
  430. * Bit fields for LCD registers that shall be updated before we continue
  431. ******************************************************************************/
  432. static __INLINE void LCD_SyncBusyDelay(uint32_t flags)
  433. {
  434. while (LCD->SYNCBUSY & flags)
  435. ;
  436. }
  437. /***************************************************************************//**
  438. * @brief
  439. * Get pending LCD interrupt flags
  440. *
  441. * @return
  442. * Pending LCD interrupt sources. Returns a set of interrupt flags OR-ed
  443. * together for multiple interrupt sources in the LCD module (LCD_IFS_nnn).
  444. ******************************************************************************/
  445. static __INLINE uint32_t LCD_IntGet(void)
  446. {
  447. return(LCD->IF);
  448. }
  449. /***************************************************************************//**
  450. * @brief
  451. * Get enabled and pending LCD interrupt flags.
  452. *
  453. * @details
  454. * Useful for handling more interrupt sources in the same interrupt handler.
  455. *
  456. * @note
  457. * The event bits are not cleared by the use of this function.
  458. *
  459. * @return
  460. * Pending and enabled LCD interrupt sources.
  461. * The return value is the bitwise AND combination of
  462. * - the OR combination of enabled interrupt sources in LCD_IEN_nnn
  463. * register (LCD_IEN_nnn) and
  464. * - the bitwise OR combination of valid interrupt flags of the LCD module
  465. * (LCD_IF_nnn).
  466. ******************************************************************************/
  467. static __INLINE uint32_t LCD_IntGetEnabled(void)
  468. {
  469. uint32_t tmp = 0U;
  470. /* Store LCD->IEN in temporary variable in order to define explicit order
  471. * of volatile accesses. */
  472. tmp = LCD->IEN;
  473. /* Bitwise AND of pending and enabled interrupts */
  474. return LCD->IF & tmp;
  475. }
  476. /***************************************************************************//**
  477. * @brief
  478. * Set one or more pending LCD interrupts from SW.
  479. *
  480. * @param[in] flags
  481. * LCD interrupt sources to set to pending. Use a set of interrupt flags
  482. * OR-ed together to set multiple interrupt sources for the LCD module
  483. * (LCD_IFS_nnn).
  484. ******************************************************************************/
  485. static __INLINE void LCD_IntSet(uint32_t flags)
  486. {
  487. LCD->IFS = flags;
  488. }
  489. /***************************************************************************//**
  490. * @brief
  491. * Enable LCD interrupts
  492. *
  493. * @param[in] flags
  494. * LCD interrupt sources to enable. Use a set of interrupt flags OR-ed
  495. * together to set multiple interrupt sources for the LCD module
  496. * (LCD_IFS_nnn).
  497. ******************************************************************************/
  498. static __INLINE void LCD_IntEnable(uint32_t flags)
  499. {
  500. LCD->IEN |= flags;
  501. }
  502. /***************************************************************************//**
  503. * @brief
  504. * Disable LCD interrupts
  505. *
  506. * @param[in] flags
  507. * LCD interrupt sources to disable. Use a set of interrupt flags OR-ed
  508. * together to disable multiple interrupt sources for the LCD module
  509. * (LCD_IFS_nnn).
  510. ******************************************************************************/
  511. static __INLINE void LCD_IntDisable(uint32_t flags)
  512. {
  513. LCD->IEN &= ~(flags);
  514. }
  515. /***************************************************************************//**
  516. * @brief
  517. * Clear one or more interrupt flags
  518. *
  519. * @param[in] flags
  520. * LCD interrupt sources to clear. Use a set of interrupt flags OR-ed
  521. * together to clear multiple interrupt sources for the LCD module
  522. * (LCD_IFS_nnn).
  523. ******************************************************************************/
  524. static __INLINE void LCD_IntClear(uint32_t flags)
  525. {
  526. LCD->IFC = flags;
  527. }
  528. #if defined(_EFM32_TINY_FAMILY) || defined(_EFM32_GIANT_FAMILY)
  529. /***************************************************************************//**
  530. * @brief
  531. * Enable or disable LCD Direct Segment Control
  532. *
  533. * @param[in] enable
  534. * If true, enables LCD controller Direct Segment Control
  535. * Segment and COM line bias levels needs to be set explicitly with the
  536. * LCD_BiasSegmentSet() and LCD_BiasComSet() function calls.
  537. ******************************************************************************/
  538. static __INLINE void LCD_DSCEnable(bool enable)
  539. {
  540. if (enable)
  541. {
  542. LCD->CTRL |= LCD_CTRL_DSC;
  543. }
  544. else
  545. {
  546. LCD->CTRL &= ~(LCD_CTRL_DSC);
  547. }
  548. }
  549. #endif
  550. /** @} (end addtogroup LCD) */
  551. /** @} (end addtogroup EFM32_Library) */
  552. #ifdef __cplusplus
  553. }
  554. #endif
  555. #endif /* defined(LCD_COUNT) && (LCD_COUNT > 0) */
  556. #endif /* __EFM32_LCD_H */