dev_lcd.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. /***************************************************************************//**
  2. * @file dev_lcd.c
  3. * @brief LCD driver of RT-Thread RTOS for EFM32
  4. * COPYRIGHT (C) 2012, RT-Thread Development Team
  5. * @author onelife
  6. * @version 1.0
  7. *******************************************************************************
  8. * @section License
  9. * The license and distribution terms for this file may be found in the file
  10. * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE
  11. *******************************************************************************
  12. * @section Change Logs
  13. * Date Author Notes
  14. * 2011-12-16 onelife Initial creation of address mapped method (pixel
  15. * drive) for EFM32GG_DK3750 board
  16. * 2011-12-29 onelife Add direct drive method (frame buffer) support
  17. ******************************************************************************/
  18. /***************************************************************************//**
  19. * @addtogroup EFM32GG_DK3750
  20. * @{
  21. ******************************************************************************/
  22. /* Includes ------------------------------------------------------------------*/
  23. #include "board.h"
  24. #include "drv_usart.h"
  25. #include "dev_lcd.h"
  26. #if defined(EFM32_USING_LCD)
  27. #if (!defined(LCD_MAPPED) && !defined(LCD_DIRECT))
  28. #error "Unknown LCD access mode"
  29. #endif
  30. #include <rtgui/rtgui.h>
  31. #include <rtgui/driver.h>
  32. #include <dmd_ssd2119.h>
  33. /* Private typedef -----------------------------------------------------------*/
  34. /* Private define ------------------------------------------------------------*/
  35. /* Private macro -------------------------------------------------------------*/
  36. #ifdef EFM32_LCD_DEBUG
  37. #define lcd_debug(format,args...) rt_kprintf(format, ##args)
  38. #else
  39. #define lcd_debug(format,args...)
  40. #endif
  41. /* Private function prototypes -----------------------------------------------*/
  42. #if defined(LCD_MAPPED)
  43. static void efm32_spiLcd_setPixel(rtgui_color_t *c, int x, int y);
  44. static void efm32_spiLcd_getPixel(rtgui_color_t *c, int x, int y);
  45. static void efm32_spiLcd_drawRawHLine(rt_uint8_t *pixels, int x1, int x2, int y);
  46. static void efm32_spiLcd_drawHLine(rtgui_color_t *c, int x1, int x2, int y);
  47. static void efm32_spiLcd_drawVLine(rtgui_color_t *c, int x1, int x2, int y);
  48. #endif
  49. /* Private variables ---------------------------------------------------------*/
  50. static rt_device_t lcd;
  51. static struct rt_device lcd_device;
  52. static rt_bool_t lcdAutoCs = true;
  53. static struct rt_device_graphic_info lcd_info;
  54. #if defined(LCD_MAPPED)
  55. static const struct rtgui_graphic_driver_ops lcd_ops =
  56. {
  57. efm32_spiLcd_setPixel,
  58. efm32_spiLcd_getPixel,
  59. efm32_spiLcd_drawHLine,
  60. efm32_spiLcd_drawVLine,
  61. efm32_spiLcd_drawRawHLine
  62. };
  63. /* Private functions ---------------------------------------------------------*/
  64. /***************************************************************************//**
  65. * @brief
  66. * Draw a pixel with specified color
  67. *
  68. * @details
  69. *
  70. * @note
  71. *
  72. * @param[in] c
  73. * Pointer to color
  74. *
  75. * @param[in] x
  76. * Horizontal position
  77. *
  78. * @param[in] y
  79. * Vertical position
  80. ******************************************************************************/
  81. static void efm32_spiLcd_setPixel(rtgui_color_t *c, int x, int y)
  82. {
  83. rt_uint32_t ret = RT_EOK;
  84. do
  85. {
  86. /* Check if pixel is outside clipping region */
  87. if ((x < 0) || (x > lcd_info.width))
  88. {
  89. break;
  90. }
  91. if ((y < 0) || (y > lcd_info.height))
  92. {
  93. break;
  94. }
  95. /* Write color */
  96. ret = DMD_writePixel((rt_uint16_t)x, (rt_uint16_t)y, (rt_uint16_t)*c, 1);
  97. if (ret != 0)
  98. {
  99. break;
  100. }
  101. return;
  102. } while(0);
  103. // lcd_debug("LCD err: Set pixel at (%d,%d: %x) failed (%x)!\n", x, y, *c, ret);
  104. }
  105. /***************************************************************************//**
  106. * @brief
  107. * Get the color of a pixel
  108. *
  109. * @details
  110. *
  111. * @note
  112. *
  113. * @param[out] c
  114. * Pointer to color
  115. *
  116. * @param[in] x
  117. * Horizontal position
  118. *
  119. * @param[in] y
  120. * Vertical position
  121. ******************************************************************************/
  122. static void efm32_spiLcd_getPixel(rtgui_color_t *c, int x, int y)
  123. {
  124. rt_uint32_t ret = RT_EOK;
  125. do
  126. {
  127. /* Check if pixel is outside clipping region */
  128. if ((x < 0) || (x > lcd_info.width))
  129. {
  130. break;
  131. }
  132. if ((y < 0) || (y > lcd_info.height))
  133. {
  134. break;
  135. }
  136. /* Read color */
  137. ret = DMD_readPixel((rt_uint16_t)x, (rt_uint16_t)y, (rt_uint16_t *)c);
  138. if (ret != 0)
  139. {
  140. break;
  141. }
  142. return;
  143. } while(0);
  144. lcd_debug("LCD err: Get pixel at (%d,%d: %x) failed (%x)!\n",
  145. x, y, *c, ret);
  146. }
  147. /***************************************************************************//**
  148. * @brief
  149. * Draw a horizontal line with raw color
  150. *
  151. * @details
  152. *
  153. * @note
  154. *
  155. * @param[in] pixels
  156. * Pointer to raw color
  157. *
  158. * @param[in] x1
  159. * Horizontal start position
  160. *
  161. * @param[in] x2
  162. * Horizontal end position
  163. *
  164. * @param[in] y
  165. * Vertical position
  166. ******************************************************************************/
  167. static void efm32_spiLcd_drawRawHLine(rt_uint8_t *pixels, int x1, int x2, int y)
  168. {
  169. lcd_debug("LCD: RAW H LINE!\n");
  170. }
  171. /***************************************************************************//**
  172. * @brief
  173. * Draw a horizontal line with specified color
  174. *
  175. * @details
  176. *
  177. * @note
  178. *
  179. * @param[in] c
  180. * Pointer to color
  181. *
  182. * @param[in] x1
  183. * Horizontal start position
  184. *
  185. * @param[in] x2
  186. * Horizontal end position
  187. *
  188. * @param[in] y
  189. * Vertical position
  190. ******************************************************************************/
  191. static void efm32_spiLcd_drawHLine(rtgui_color_t *c, int x1, int x2, int y)
  192. {
  193. rt_uint32_t ret = RT_EOK;
  194. do
  195. {
  196. /* Check if line is outside of clipping region */
  197. if ((y < 0) || (y > lcd_info.height))
  198. {
  199. break;
  200. }
  201. /* Swap the coordinates if x1 is larger than x2 */
  202. if (x1 > x2)
  203. {
  204. int swap;
  205. swap = x1;
  206. x1 = x2;
  207. x2 = swap;
  208. }
  209. /* Check if entire line is outside clipping region */
  210. if ((x1 > lcd_info.width) || (x2 < 0))
  211. {
  212. /* Nothing to draw */
  213. break;
  214. }
  215. /* Clip the line if necessary */
  216. if (x1 < 0)
  217. {
  218. x1 = 0;
  219. }
  220. if (x2 > lcd_info.width)
  221. {
  222. x2 = lcd_info.width;
  223. }
  224. /* Write color */
  225. rt_uint32_t length = x2 - x1 + 1;
  226. ret = DMD_writePixel((rt_uint16_t)x1, (rt_uint16_t)y,
  227. (rt_uint16_t)*c, length);
  228. if (ret != 0)
  229. {
  230. break;
  231. }
  232. return;
  233. } while(0);
  234. // lcd_debug("LCD err: Draw hline at (%d-%d,%d: %x) failed (%x)!\n", x1, x2, y, *c, ret);
  235. }
  236. /***************************************************************************//**
  237. * @brief
  238. * Draw a vertical line with specified color
  239. *
  240. * @details
  241. *
  242. * @note
  243. *
  244. * @param[in] c
  245. * Pointer to color
  246. *
  247. * @param[in] x
  248. * Horizontal position
  249. *
  250. * @param[in] y1
  251. * Vertical start position
  252. *
  253. * @param[in] y2
  254. * Vertical end position
  255. ******************************************************************************/
  256. static void efm32_spiLcd_drawVLine(rtgui_color_t *c, int x , int y1, int y2)
  257. {
  258. rt_uint32_t ret = RT_EOK;
  259. do
  260. {
  261. /* Check if line is outside of clipping region */
  262. if ((x < 0) || (x > lcd_info.width))
  263. {
  264. break;
  265. }
  266. /* Swap the coordinates if y1 is larger than y2 */
  267. if (y1 > y2)
  268. {
  269. rt_uint16_t swap;
  270. swap = y1;
  271. y1 = y2;
  272. y2 = swap;
  273. }
  274. /* Check if entire line is outside clipping region */
  275. if ((y1 > lcd_info.height) || (y2 < 0))
  276. {
  277. /* Nothing to draw */
  278. break;
  279. }
  280. /* Clip the line if necessary */
  281. if (y1 < 0)
  282. {
  283. y1 = 0;
  284. }
  285. if (y2 > lcd_info.height)
  286. {
  287. y2 = lcd_info.height;
  288. }
  289. /* Set clipping area */
  290. rt_uint16_t length = y2 - y1 + 1;
  291. ret = DMD_setClippingArea((rt_uint16_t)x, (rt_uint16_t)y1, 1, length);
  292. if (ret != DMD_OK)
  293. {
  294. break;
  295. }
  296. /* Write color */
  297. ret= DMD_writePixel(0, 0, (rt_uint16_t)*c, length);
  298. if (ret != DMD_OK)
  299. {
  300. break;
  301. }
  302. /* Reset clipping area */
  303. ret = DMD_setClippingArea(0, 0, lcd_info.width, lcd_info.height);
  304. if (ret != DMD_OK)
  305. {
  306. break;
  307. }
  308. return;
  309. } while(0);
  310. // lcd_debug("LCD err: Draw vline at (%d,%d-%d: %x) failed (%x)!\n", x, y1, y2, *c, ret);
  311. }
  312. #endif
  313. /***************************************************************************//**
  314. * @brief
  315. * Configure LCD device
  316. *
  317. * @details
  318. *
  319. * @note
  320. *
  321. * @param[in] dev
  322. * Pointer to device descriptor
  323. *
  324. * @param[in] cmd
  325. * IIC control command
  326. *
  327. * @param[in] args
  328. * Arguments
  329. *
  330. * @return
  331. * Error code
  332. ******************************************************************************/
  333. static rt_err_t efm32_spiLcd_control (rt_device_t dev, int cmd, void *args)
  334. {
  335. switch (cmd)
  336. {
  337. case RTGRAPHIC_CTRL_RECT_UPDATE:
  338. break;
  339. case RTGRAPHIC_CTRL_POWERON:
  340. break;
  341. case RTGRAPHIC_CTRL_POWEROFF:
  342. break;
  343. case RTGRAPHIC_CTRL_GET_INFO:
  344. rt_memcpy(args, &lcd_info, sizeof(struct rt_device_graphic_info));
  345. break;
  346. case RTGRAPHIC_CTRL_SET_MODE:
  347. break;
  348. }
  349. return RT_EOK;
  350. }
  351. /***************************************************************************//**
  352. * @brief
  353. * Set/Clear chip select
  354. *
  355. * @details
  356. *
  357. * @note
  358. *
  359. * @param[in] enable
  360. * Chip select pin setting
  361. ******************************************************************************/
  362. static void efm32_spiLcd_cs(rt_uint8_t enable)
  363. {
  364. if (!lcdAutoCs)
  365. {
  366. if (enable)
  367. {
  368. GPIO_PinOutClear(LCD_CS_PORT, LCD_CS_PIN);
  369. }
  370. else
  371. {
  372. GPIO_PinOutSet(LCD_CS_PORT, LCD_CS_PIN);
  373. }
  374. }
  375. }
  376. /***************************************************************************//**
  377. * @brief
  378. * Write data to SSD2119 controller
  379. *
  380. * @param[in] reg
  381. * Register to write to
  382. *
  383. * @param[in] data
  384. * 16-bit data to write into register
  385. *
  386. * @note
  387. * It's not possible to read back register value through SSD2119 SPI interface
  388. ******************************************************************************/
  389. rt_err_t efm32_spiLcd_writeRegister(rt_uint8_t reg, rt_uint16_t data)
  390. {
  391. struct efm32_usart_device_t *usart;
  392. rt_uint8_t buf_ins[3];
  393. rt_uint8_t buf_res[3];
  394. RT_ASSERT(lcd != RT_NULL);
  395. usart = (struct efm32_usart_device_t *)(lcd->user_data);
  396. /* Build instruction buffer */
  397. buf_res[0] = (data & 0xff00) >> 8;
  398. buf_res[1] = data & 0x00ff;
  399. buf_ins[0] = 1; /* Instruction length */
  400. buf_ins[1] = reg; /* Instruction */
  401. *(rt_uint8_t **)(&buf_ins[2]) = buf_res; /* Data */
  402. efm32_spiLcd_cs(1);
  403. if (lcd->write(lcd, EFM32_NO_DATA, buf_ins, 2) == 0)
  404. {
  405. lcd_debug("LCD: Write data failed!\n");
  406. return -RT_ERROR;
  407. }
  408. efm32_spiLcd_cs(0);
  409. return RT_EOK;
  410. }
  411. /***************************************************************************//**
  412. * @brief
  413. * Register LCD device
  414. *
  415. * @details
  416. *
  417. * @note
  418. *
  419. * @param[in] device
  420. * Pointer to device descriptor
  421. *
  422. * @param[in] name
  423. * Device name
  424. *
  425. * @param[in] flag
  426. * Configuration flags
  427. *
  428. * @param[in] iic
  429. * Pointer to IIC device descriptor
  430. *
  431. * @return
  432. * Error code
  433. ******************************************************************************/
  434. rt_err_t efm32_spiLcd_register(
  435. rt_device_t device,
  436. const char *name,
  437. rt_uint32_t flag,
  438. void *data)
  439. {
  440. RT_ASSERT(device != RT_NULL);
  441. device->type = RT_Device_Class_Graphic;
  442. device->rx_indicate = RT_NULL;
  443. device->tx_complete = RT_NULL;
  444. device->init = RT_NULL;
  445. device->open = RT_NULL;
  446. device->close = RT_NULL;
  447. device->read = RT_NULL;
  448. device->write = RT_NULL;
  449. device->control = efm32_spiLcd_control;
  450. device->user_data = data;
  451. /* register a character device */
  452. return rt_device_register(device, name, RT_DEVICE_FLAG_RDWR | flag);
  453. }
  454. /***************************************************************************//**
  455. * @brief
  456. * Initialize LCD device
  457. *
  458. * @details
  459. *
  460. * @note
  461. *
  462. ******************************************************************************/
  463. void efm32_spiLcd_init(void)
  464. {
  465. struct efm32_usart_device_t *usart;
  466. rt_uint32_t flag;
  467. DMD_DisplayGeometry *geometry;
  468. rt_uint32_t ret;
  469. do
  470. {
  471. USART_InitSync_TypeDef init = USART_INITSYNC_DEFAULT;
  472. /* Find SPI device */
  473. lcd = rt_device_find(LCD_USING_DEVICE_NAME);
  474. if (lcd == RT_NULL)
  475. {
  476. lcd_debug("LCD err: Can't find %s!\n", LCD_USING_DEVICE_NAME);
  477. break;
  478. }
  479. lcd_debug("LCD: Find device %s\n", LCD_USING_DEVICE_NAME);
  480. /* Config CS pin */
  481. usart = (struct efm32_usart_device_t *)(lcd->user_data);
  482. if (!(usart->state & USART_STATE_AUTOCS))
  483. {
  484. GPIO_PinModeSet(LCD_CS_PORT, LCD_CS_PIN, gpioModePushPull, 1);
  485. lcdAutoCs = false;
  486. }
  487. /* TFT initialize or reinitialize. Assumes EBI has been configured
  488. correctly in DVK_init(DVK_Init_EBI) */
  489. rt_uint32_t freq = SystemCoreClockGet();
  490. rt_uint32_t i;
  491. rt_bool_t warning = RT_FALSE;
  492. /* If we are in BC_UIF_AEM_EFM state, we can redraw graphics */
  493. while (DVK_readRegister(&BC_REGISTER->UIF_AEM) != BC_UIF_AEM_EFM)
  494. {
  495. if (!warning)
  496. {
  497. lcd_debug("LCD: Please press AEM button!!!\n");
  498. warning = RT_TRUE;
  499. }
  500. }
  501. lcd_debug("LCD: Got LCD control\n");
  502. /* If we're not BC_ARB_CTRL_EBI state, we need to reconfigure display controller */
  503. if (DVK_readRegister(&BC_REGISTER->ARB_CTRL) != BC_ARB_CTRL_EBI)
  504. {
  505. lcd_debug("LCD: Set to EBI mode\n");
  506. /* Configure for EBI mode and reset display */
  507. DVK_displayControl(DVK_Display_EBI);
  508. DVK_displayControl(DVK_Display_ResetAssert);
  509. DVK_displayControl(DVK_Display_PowerDisable);
  510. /* Short delay */
  511. freq = SystemCoreClockGet();
  512. for(i = 0; i < (freq / 100); i++)
  513. {
  514. __NOP();
  515. }
  516. #if defined(LCD_MAPPED)
  517. /* Configure display for address mapped method + 3-wire SPI mode */
  518. DVK_displayControl(DVK_Display_Mode8080);
  519. DVK_displayControl(DVK_Display_PowerEnable);
  520. DVK_displayControl(DVK_Display_ResetRelease);
  521. /* Initialize graphics - abort on failure */
  522. ret = DMD_init(BC_SSD2119_BASE, BC_SSD2119_BASE + 2);
  523. if (ret == DMD_OK)
  524. {
  525. /* Make sure display is configured with correct rotation */
  526. DMD_flipDisplay(1, 1);
  527. }
  528. else if (ret != DMD_ERROR_DRIVER_ALREADY_INITIALIZED)
  529. {
  530. lcd_debug("LCD err: driver init failed %x\n", ret);
  531. break;
  532. }
  533. #elif defined(LCD_DIRECT)
  534. /* Configure TFT direct drive method from EBI BANK2 */
  535. const EBI_TFTInit_TypeDef tftInit =
  536. {
  537. ebiTFTBank2, /* Select EBI Bank 2 */
  538. ebiTFTWidthHalfWord, /* Select 2-byte (16-bit RGB565) increments */
  539. ebiTFTColorSrcMem, /* Use memory as source for mask/blending */
  540. ebiTFTInterleaveUnlimited, /* Unlimited interleaved accesses */
  541. ebiTFTFrameBufTriggerVSync, /* VSYNC as frame buffer update trigger */
  542. false, /* Drive DCLK from negative edge of internal clock */
  543. ebiTFTMBDisabled, /* No masking and alpha blending enabled */
  544. ebiTFTDDModeExternal, /* Drive from external memory */
  545. ebiActiveLow, /* CS Active Low polarity */
  546. ebiActiveHigh, /* DCLK Active High polarity */
  547. ebiActiveLow, /* DATAEN Active Low polarity */
  548. ebiActiveLow, /* HSYNC Active Low polarity */
  549. ebiActiveLow, /* VSYNC Active Low polarity */
  550. 320, /* Horizontal size in pixels */
  551. 1, /* Horizontal Front Porch */
  552. 30, /* Horizontal Back Porch */
  553. 2, /* Horizontal Synchronization Pulse Width */
  554. 240, /* Vertical size in pixels */
  555. 1, /* Vertical Front Porch */
  556. 4, /* Vertical Back Porch */
  557. 2, /* Vertical Synchronization Pulse Width */
  558. 0x0000, /* Frame Address pointer offset to EBI memory base */
  559. 4, /* DCLK Period */
  560. 0, /* DCLK Start cycles */
  561. 0, /* DCLK Setup cycles */
  562. 0, /* DCLK Hold cycles */
  563. };
  564. DVK_enablePeripheral(DVK_TFT);
  565. /* Configure display for Direct Drive + 3-wire SPI mode */
  566. DVK_displayControl(DVK_Display_ModeGeneric);
  567. DVK_displayControl(DVK_Display_PowerEnable);
  568. DVK_displayControl(DVK_Display_ResetRelease);
  569. /* Configure GPIO for EBI and TFT */
  570. /* EBI TFT DCLK/Dot Clock */
  571. GPIO_PinModeSet(gpioPortA, 8, gpioModePushPull, 0);
  572. /* EBI TFT DATAEN */
  573. GPIO_PinModeSet(gpioPortA, 9, gpioModePushPull, 0);
  574. /* EBI TFT VSYNC */
  575. GPIO_PinModeSet(gpioPortA, 10, gpioModePushPull, 0);
  576. /* EBI TFT HSYNC */
  577. GPIO_PinModeSet(gpioPortA, 11, gpioModePushPull, 0);
  578. /* Initialize display */
  579. DMD_init(0, (rt_uint32_t)EBI_BankAddress(EBI_BANK2));
  580. /* Configure EBI TFT direct drive */
  581. EBI_TFTInit(&tftInit);
  582. #endif
  583. }
  584. /* Get LCD geometry */
  585. ret = DMD_getDisplayGeometry(&geometry);
  586. if (ret != DMD_OK)
  587. {
  588. lcd_debug("LCD err: get geometry failed!\n");
  589. break;
  590. }
  591. /* Init LCD info */
  592. flag = RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_DMA_TX;
  593. lcd_info.pixel_format = RTGRAPHIC_PIXEL_FORMAT_RGB565P;
  594. lcd_info.bits_per_pixel = 16;
  595. lcd_info.width = geometry->xSize;
  596. lcd_info.height = geometry->ySize;
  597. #if defined(LCD_MAPPED)
  598. lcd_info.framebuffer = RT_NULL;
  599. efm32_spiLcd_register(&lcd_device, LCD_DEVICE_NAME, flag, (void *)&lcd_ops);
  600. #elif defined(LCD_DIRECT)
  601. lcd_info.framebuffer = (rt_uint8_t *)EBI_BankAddress(EBI_BANK2);
  602. efm32_spiLcd_register(&lcd_device, LCD_DEVICE_NAME, flag, RT_NULL);
  603. #endif
  604. /* Set clipping area */
  605. ret = DMD_setClippingArea(0, 0, geometry->xSize, geometry->ySize);
  606. if (ret != DMD_OK)
  607. {
  608. lcd_debug("LCD err: set clipping area failed!\n");
  609. break;
  610. }
  611. /* Read device code */
  612. rt_uint16_t code = 0xFFFF;
  613. #if defined(LCD_MAPPED)
  614. code = DMDIF_readDeviceCode();
  615. #endif
  616. /* Set as rtgui graphic driver */
  617. rtgui_graphic_set_device(&lcd_device);
  618. lcd_debug("LCD: H/W init OK!\n");
  619. return;
  620. } while(0);
  621. lcd_debug("LCD err: H/W init failed!\n");
  622. }
  623. #endif /* defined(EFM32_USING_LCD) */
  624. /***************************************************************************//**
  625. * @}
  626. ******************************************************************************/