You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

610 lines
19 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32l0xx_hal_lcd.c
  4. * @author MCD Application Team
  5. * @brief LCD Controller HAL module driver.
  6. * This file provides firmware functions to manage the following
  7. * functionalities of the LCD Controller (LCD) peripheral:
  8. * + Initialization/de-initialization methods
  9. * + I/O operation methods
  10. * + Peripheral State methods
  11. *
  12. @verbatim
  13. ==============================================================================
  14. ##### How to use this driver #####
  15. ==============================================================================
  16. [..] The LCD HAL driver can be used as follow:
  17. (#) Declare a LCD_HandleTypeDef handle structure.
  18. (#) Prepare the initialization of the LCD low level resources by implementing your HAL_LCD_MspInit() API:
  19. (##) Enable the LCDCLK (same as RTCCLK): to configure the RTCCLK/LCDCLK, use the RCC function
  20. HAL_RCCEx_PeriphCLKConfig, indicating here RCC_PERIPHCLK_LCD and the selected clock
  21. source (HSE, LSI or LSE)
  22. (##) The frequency generator allows you to achieve various LCD frame rates starting from an
  23. LCD input clock frequency (LCDCLK) which can vary from 32 kHz up to 1 MHz.
  24. (##) LCD pins configuration:
  25. - Enable the clock for the LCD GPIOs
  26. - Configure these LCD pins as alternate function no-pull.
  27. (##) Enable the LCD interface clock.
  28. (#) Set the Prescaler, Divider, Blink mode, Blink Frequency Duty, Bias, Voltage Source,
  29. Dead Time, Pulse On Duration and Contrast in the hlcd Init structure.
  30. (#) Initialize the LCD registers by calling the HAL_LCD_Init() API.
  31. (##) The HAL_LCD_Init() API configures the low level Hardware (GPIO, CLOCK, ...etc)
  32. by calling the user customized HAL_LCD_MspInit() API.
  33. (#) After calling the HAL_LCD_Init() the LCD RAM memory is cleared
  34. (#) Optionally you can update the LCD configuration using these macros:
  35. (##) LCD High Drive using the __HAL_LCD_HIGHDRIVER_ENABLE() and __HAL_LCD_HIGHDRIVER_DISABLE() macros
  36. (##) LCD Pulse ON Duration using the __HAL_LCD_PULSEONDURATION_CONFIG() macro
  37. (##) LCD Dead Time using the __HAL_LCD_DEADTIME_CONFIG() macro
  38. (##) The LCD Blink mode and frequency using the __HAL_LCD_BLINK_CONFIG() macro
  39. (##) The LCD Contrast using the __HAL_LCD_CONTRAST_CONFIG() macro
  40. (#) Write to the LCD RAM memory using the HAL_LCD_Write() API, this API can be called
  41. several times to update the different LCD RAM registers before calling
  42. HAL_LCD_UpdateDisplayRequest() API.
  43. (#) The HAL_LCD_Clear() API can be used to clear the LCD RAM memory.
  44. (#) When the LCD RAM memory is updated, enable the update display request calling
  45. the HAL_LCD_UpdateDisplayRequest() API.
  46. [..] LCD and low power modes: The LCD remain active during STOP mode.
  47. @endverbatim
  48. ******************************************************************************
  49. * @attention
  50. *
  51. * <h2><center>&copy; Copyright(c) 2016 STMicroelectronics.
  52. * All rights reserved.</center></h2>
  53. *
  54. * This software component is licensed by ST under BSD 3-Clause license,
  55. * the "License"; You may not use this file except in compliance with the
  56. * License. You may obtain a copy of the License at:
  57. * opensource.org/licenses/BSD-3-Clause
  58. *
  59. ******************************************************************************
  60. */
  61. /* Includes ------------------------------------------------------------------*/
  62. #include "stm32l0xx_hal.h"
  63. #if defined (STM32L053xx) || defined (STM32L063xx) || defined (STM32L073xx) || defined (STM32L083xx)
  64. /** @addtogroup STM32L0xx_HAL_Driver
  65. * @{
  66. */
  67. #ifdef HAL_LCD_MODULE_ENABLED
  68. /** @addtogroup LCD
  69. * @brief LCD HAL module driver
  70. * @{
  71. */
  72. /* Private typedef -----------------------------------------------------------*/
  73. /* Private define ------------------------------------------------------------*/
  74. /** @addtogroup LCD_Private
  75. * @{
  76. */
  77. #define LCD_TIMEOUT_VALUE 1000U
  78. /**
  79. * @}
  80. */
  81. /* Private macro -------------------------------------------------------------*/
  82. /* Private variables ---------------------------------------------------------*/
  83. /* Private function prototypes -----------------------------------------------*/
  84. /* Private functions ---------------------------------------------------------*/
  85. /** @addtogroup LCD_Exported_Functions
  86. * @{
  87. */
  88. /** @addtogroup LCD_Exported_Functions_Group1
  89. * @brief Initialization and Configuration functions
  90. *
  91. @verbatim
  92. ===============================================================================
  93. ##### Initialization and Configuration functions #####
  94. ===============================================================================
  95. [..]
  96. @endverbatim
  97. * @{
  98. */
  99. /**
  100. * @brief DeInitializes the LCD peripheral.
  101. * @param hlcd LCD handle
  102. * @retval HAL status
  103. */
  104. HAL_StatusTypeDef HAL_LCD_DeInit(LCD_HandleTypeDef *hlcd)
  105. {
  106. /* Check the LCD handle allocation */
  107. if(hlcd == NULL)
  108. {
  109. return HAL_ERROR;
  110. }
  111. /* Check the parameters */
  112. assert_param(IS_LCD_ALL_INSTANCE(hlcd->Instance));
  113. /* Check the LCD peripheral state */
  114. if(hlcd->State == HAL_LCD_STATE_BUSY)
  115. {
  116. return HAL_BUSY;
  117. }
  118. hlcd->State = HAL_LCD_STATE_BUSY;
  119. /* Disable the peripheral */
  120. __HAL_LCD_DISABLE(hlcd);
  121. /*Disable Highdrive by default*/
  122. __HAL_LCD_HIGHDRIVER_DISABLE(hlcd);
  123. /* DeInit the low level hardware */
  124. HAL_LCD_MspDeInit(hlcd);
  125. hlcd->ErrorCode = HAL_LCD_ERROR_NONE;
  126. hlcd->State = HAL_LCD_STATE_RESET;
  127. /* Release Lock */
  128. __HAL_UNLOCK(hlcd);
  129. return HAL_OK;
  130. }
  131. /**
  132. * @brief Initializes the LCD peripheral according to the specified parameters
  133. * in the LCD_InitStruct.
  134. * @note This function can be used only when the LCD is disabled.
  135. * The LCD HighDrive can be enabled/disabled using related macros up to user.
  136. * @param hlcd LCD handle
  137. * @retval None
  138. */
  139. HAL_StatusTypeDef HAL_LCD_Init(LCD_HandleTypeDef *hlcd)
  140. {
  141. uint32_t tickstart = 0x00U;
  142. uint8_t counter = 0U;
  143. /* Check the LCD handle allocation */
  144. if(hlcd == NULL)
  145. {
  146. return HAL_ERROR;
  147. }
  148. /* Check function parameters */
  149. assert_param(IS_LCD_ALL_INSTANCE(hlcd->Instance));
  150. assert_param(IS_LCD_PRESCALER(hlcd->Init.Prescaler));
  151. assert_param(IS_LCD_DIVIDER(hlcd->Init.Divider));
  152. assert_param(IS_LCD_DUTY(hlcd->Init.Duty));
  153. assert_param(IS_LCD_BIAS(hlcd->Init.Bias));
  154. assert_param(IS_LCD_VOLTAGE_SOURCE(hlcd->Init.VoltageSource));
  155. assert_param(IS_LCD_PULSE_ON_DURATION(hlcd->Init.PulseOnDuration));
  156. assert_param(IS_LCD_HIGHDRIVE(hlcd->Init.HighDrive));
  157. assert_param(IS_LCD_DEAD_TIME(hlcd->Init.DeadTime));
  158. assert_param(IS_LCD_CONTRAST(hlcd->Init.Contrast));
  159. assert_param(IS_LCD_BLINK_FREQUENCY(hlcd->Init.BlinkFrequency));
  160. assert_param(IS_LCD_BLINK_MODE(hlcd->Init.BlinkMode));
  161. assert_param(IS_LCD_MUXSEGMENT(hlcd->Init.MuxSegment));
  162. if(hlcd->State == HAL_LCD_STATE_RESET)
  163. {
  164. /* Allocate lock resource and initialize it */
  165. __HAL_UNLOCK(hlcd);
  166. /* Initialize the low level hardware (MSP) */
  167. HAL_LCD_MspInit(hlcd);
  168. }
  169. hlcd->State = HAL_LCD_STATE_BUSY;
  170. /* Disable the peripheral */
  171. __HAL_LCD_DISABLE(hlcd);
  172. /* Clear the LCD_RAM registers and enable the display request by setting the UDR bit
  173. in the LCD_SR register */
  174. for(counter = LCD_RAM_REGISTER0; counter <= LCD_RAM_REGISTER15; counter++)
  175. {
  176. hlcd->Instance->RAM[counter] = 0U;
  177. }
  178. /* Enable the display request */
  179. SET_BIT(hlcd->Instance->SR, LCD_SR_UDR);
  180. /* Configure the LCD Prescaler, Divider, Blink mode and Blink Frequency:
  181. Set PS[3:0] bits according to hlcd->Init.Prescaler value
  182. Set DIV[3:0] bits according to hlcd->Init.Divider value
  183. Set BLINK[1:0] bits according to hlcd->Init.BlinkMode value
  184. Set BLINKF[2:0] bits according to hlcd->Init.BlinkFrequency value
  185. Set DEAD[2:0] bits according to hlcd->Init.DeadTime value
  186. Set PON[2:0] bits according to hlcd->Init.PulseOnDuration value
  187. Set CC[2:0] bits according to hlcd->Init.Contrast value
  188. Set HD[0] bit according to hlcd->Init.HighDrive value*/
  189. MODIFY_REG(hlcd->Instance->FCR, \
  190. (LCD_FCR_PS | LCD_FCR_DIV | LCD_FCR_BLINK| LCD_FCR_BLINKF | \
  191. LCD_FCR_DEAD | LCD_FCR_PON | LCD_FCR_CC), \
  192. (hlcd->Init.Prescaler | hlcd->Init.Divider | hlcd->Init.BlinkMode | hlcd->Init.BlinkFrequency | \
  193. hlcd->Init.DeadTime | hlcd->Init.PulseOnDuration | hlcd->Init.Contrast | hlcd->Init.HighDrive));
  194. /* Wait until LCD Frame Control Register Synchronization flag (FCRSF) is set in the LCD_SR register
  195. This bit is set by hardware each time the LCD_FCR register is updated in the LCDCLK
  196. domain. It is cleared by hardware when writing to the LCD_FCR register.*/
  197. LCD_WaitForSynchro(hlcd);
  198. /* Configure the LCD Duty, Bias, Voltage Source, Dead Time:
  199. Set DUTY[2:0] bits according to hlcd->Init.Duty value
  200. Set BIAS[1:0] bits according to hlcd->Init.Bias value
  201. Set VSEL bit according to hlcd->Init.VoltageSource value
  202. Set MUX_SEG bit according to hlcd->Init.MuxSegment value */
  203. MODIFY_REG(hlcd->Instance->CR, \
  204. (LCD_CR_DUTY | LCD_CR_BIAS | LCD_CR_VSEL | LCD_CR_MUX_SEG), \
  205. (hlcd->Init.Duty | hlcd->Init.Bias | hlcd->Init.VoltageSource | hlcd->Init.MuxSegment));
  206. /* Enable the peripheral */
  207. __HAL_LCD_ENABLE(hlcd);
  208. /* Get timeout */
  209. tickstart = HAL_GetTick();
  210. /* Wait Until the LCD is enabled */
  211. while(__HAL_LCD_GET_FLAG(hlcd, LCD_FLAG_ENS) == RESET)
  212. {
  213. if((HAL_GetTick() - tickstart ) > LCD_TIMEOUT_VALUE)
  214. {
  215. hlcd->ErrorCode = HAL_LCD_ERROR_ENS;
  216. return HAL_TIMEOUT;
  217. }
  218. }
  219. /* Get timeout */
  220. tickstart = HAL_GetTick();
  221. /*!< Wait Until the LCD Booster is ready */
  222. while(__HAL_LCD_GET_FLAG(hlcd, LCD_FLAG_RDY) == RESET)
  223. {
  224. if((HAL_GetTick() - tickstart ) > LCD_TIMEOUT_VALUE)
  225. {
  226. hlcd->ErrorCode = HAL_LCD_ERROR_RDY;
  227. return HAL_TIMEOUT;
  228. }
  229. }
  230. /* Initialize the LCD state */
  231. hlcd->ErrorCode = HAL_LCD_ERROR_NONE;
  232. hlcd->State= HAL_LCD_STATE_READY;
  233. return HAL_OK;
  234. }
  235. /**
  236. * @brief LCD MSP DeInit.
  237. * @param hlcd LCD handle
  238. * @retval None
  239. */
  240. __weak void HAL_LCD_MspDeInit(LCD_HandleTypeDef *hlcd)
  241. {
  242. /* Prevent unused argument(s) compilation warning */
  243. UNUSED(hlcd);
  244. /* NOTE: This function Should not be modified, when the callback is needed,
  245. the HAL_LCD_MspDeInit could be implemented in the user file
  246. */
  247. }
  248. /**
  249. * @brief LCD MSP Init.
  250. * @param hlcd LCD handle
  251. * @retval None
  252. */
  253. __weak void HAL_LCD_MspInit(LCD_HandleTypeDef *hlcd)
  254. {
  255. /* Prevent unused argument(s) compilation warning */
  256. UNUSED(hlcd);
  257. /* NOTE: This function Should not be modified, when the callback is needed,
  258. the HAL_LCD_MspInit could be implemented in the user file
  259. */
  260. }
  261. /**
  262. * @}
  263. */
  264. /** @addtogroup LCD_Exported_Functions_Group2
  265. * @brief LCD RAM functions
  266. *
  267. @verbatim
  268. ===============================================================================
  269. ##### IO operation functions #####
  270. ===============================================================================
  271. [..] Using its double buffer memory the LCD controller ensures the coherency of the
  272. displayed information without having to use interrupts to control LCD_RAM
  273. modification.
  274. The application software can access the first buffer level (LCD_RAM) through
  275. the APB interface. Once it has modified the LCD_RAM using the HAL_LCD_Write() API,
  276. it sets the UDR flag in the LCD_SR register using the HAL_LCD_UpdateDisplayRequest() API.
  277. This UDR flag (update display request) requests the updated information to be
  278. moved into the second buffer level (LCD_DISPLAY).
  279. This operation is done synchronously with the frame (at the beginning of the
  280. next frame), until the update is completed, the LCD_RAM is write protected and
  281. the UDR flag stays high.
  282. Once the update is completed another flag (UDD - Update Display Done) is set and
  283. generates an interrupt if the UDDIE bit in the LCD_FCR register is set.
  284. The time it takes to update LCD_DISPLAY is, in the worst case, one odd and one
  285. even frame.
  286. The update will not occur (UDR = 1 and UDD = 0) until the display is
  287. enabled (LCDEN = 1).
  288. @endverbatim
  289. * @{
  290. */
  291. /**
  292. * @brief Writes a word in the specific LCD RAM.
  293. * @param hlcd LCD handle
  294. * @param RAMRegisterIndex specifies the LCD RAM Register.
  295. * This parameter can be one of the following values:
  296. * @arg LCD_RAM_REGISTER0: LCD RAM Register 0
  297. * @arg LCD_RAM_REGISTER1: LCD RAM Register 1
  298. * @arg LCD_RAM_REGISTER2: LCD RAM Register 2
  299. * @arg LCD_RAM_REGISTER3: LCD RAM Register 3
  300. * @arg LCD_RAM_REGISTER4: LCD RAM Register 4
  301. * @arg LCD_RAM_REGISTER5: LCD RAM Register 5
  302. * @arg LCD_RAM_REGISTER6: LCD RAM Register 6
  303. * @arg LCD_RAM_REGISTER7: LCD RAM Register 7
  304. * @arg LCD_RAM_REGISTER8: LCD RAM Register 8
  305. * @arg LCD_RAM_REGISTER9: LCD RAM Register 9
  306. * @arg LCD_RAM_REGISTER10: LCD RAM Register 10
  307. * @arg LCD_RAM_REGISTER11: LCD RAM Register 11
  308. * @arg LCD_RAM_REGISTER12: LCD RAM Register 12
  309. * @arg LCD_RAM_REGISTER13: LCD RAM Register 13
  310. * @arg LCD_RAM_REGISTER14: LCD RAM Register 14
  311. * @arg LCD_RAM_REGISTER15: LCD RAM Register 15
  312. * @param RAMRegisterMask specifies the LCD RAM Register Data Mask.
  313. * @param Data specifies LCD Data Value to be written.
  314. * @note For LCD glass COM*SEG as 8*40 for example, the LCD common terminals COM[0,7]
  315. * are mapped on 32bits LCD_RAM_REGISTER[0,14] according to rules: COM(n) spread
  316. * on LCD_RAM_REGISTER(2*n) and LCD_RAM_REGISTER(2*n+1).The segment terminals
  317. * SEG[0,39] of COM(n) correspond to LSB bits of related LCD_RAM_REGISTER(2*n)[0,31]
  318. * and LCD_RAM_REGISTER(2*n+1)[0,7]
  319. * @retval None
  320. */
  321. HAL_StatusTypeDef HAL_LCD_Write(LCD_HandleTypeDef *hlcd, uint32_t RAMRegisterIndex, uint32_t RAMRegisterMask, uint32_t Data)
  322. {
  323. uint32_t tickstart = 0x00U;
  324. if((hlcd->State == HAL_LCD_STATE_READY) || (hlcd->State == HAL_LCD_STATE_BUSY))
  325. {
  326. /* Check the parameters */
  327. assert_param(IS_LCD_RAM_REGISTER(RAMRegisterIndex));
  328. if(hlcd->State == HAL_LCD_STATE_READY)
  329. {
  330. /* Process Locked */
  331. __HAL_LOCK(hlcd);
  332. hlcd->State = HAL_LCD_STATE_BUSY;
  333. /* Get timeout */
  334. tickstart = HAL_GetTick();
  335. /*!< Wait Until the LCD is ready */
  336. while(__HAL_LCD_GET_FLAG(hlcd, LCD_FLAG_UDR) != RESET)
  337. {
  338. if((HAL_GetTick() - tickstart) > LCD_TIMEOUT_VALUE)
  339. {
  340. hlcd->ErrorCode = HAL_LCD_ERROR_UDR;
  341. /* Process Unlocked */
  342. __HAL_UNLOCK(hlcd);
  343. return HAL_TIMEOUT;
  344. }
  345. }
  346. }
  347. /* Copy the new Data bytes to LCD RAM register */
  348. MODIFY_REG(hlcd->Instance->RAM[RAMRegisterIndex], ~(RAMRegisterMask), Data);
  349. return HAL_OK;
  350. }
  351. else
  352. {
  353. return HAL_ERROR;
  354. }
  355. }
  356. /**
  357. * @brief Clears the LCD RAM registers.
  358. * @param hlcd: LCD handle
  359. * @retval None
  360. */
  361. HAL_StatusTypeDef HAL_LCD_Clear(LCD_HandleTypeDef *hlcd)
  362. {
  363. uint32_t tickstart = 0x00U;
  364. uint32_t counter = 0U;
  365. if((hlcd->State == HAL_LCD_STATE_READY) || (hlcd->State == HAL_LCD_STATE_BUSY))
  366. {
  367. /* Process Locked */
  368. __HAL_LOCK(hlcd);
  369. hlcd->State = HAL_LCD_STATE_BUSY;
  370. /* Get timeout */
  371. tickstart = HAL_GetTick();
  372. /*!< Wait Until the LCD is ready */
  373. while(__HAL_LCD_GET_FLAG(hlcd, LCD_FLAG_UDR) != RESET)
  374. {
  375. if( (HAL_GetTick() - tickstart) > LCD_TIMEOUT_VALUE)
  376. {
  377. hlcd->ErrorCode = HAL_LCD_ERROR_UDR;
  378. /* Process Unlocked */
  379. __HAL_UNLOCK(hlcd);
  380. return HAL_TIMEOUT;
  381. }
  382. }
  383. /* Clear the LCD_RAM registers */
  384. for(counter = LCD_RAM_REGISTER0; counter <= LCD_RAM_REGISTER15; counter++)
  385. {
  386. hlcd->Instance->RAM[counter] = 0U;
  387. }
  388. /* Update the LCD display */
  389. HAL_LCD_UpdateDisplayRequest(hlcd);
  390. return HAL_OK;
  391. }
  392. else
  393. {
  394. return HAL_ERROR;
  395. }
  396. }
  397. /**
  398. * @brief Enables the Update Display Request.
  399. * @param hlcd LCD handle
  400. * @note Each time software modifies the LCD_RAM it must set the UDR bit to
  401. * transfer the updated data to the second level buffer.
  402. * The UDR bit stays set until the end of the update and during this
  403. * time the LCD_RAM is write protected.
  404. * @note When the display is disabled, the update is performed for all
  405. * LCD_DISPLAY locations.
  406. * When the display is enabled, the update is performed only for locations
  407. * for which commons are active (depending on DUTY). For example if
  408. * DUTY = 1/2, only the LCD_DISPLAY of COM0 and COM1 will be updated.
  409. * @retval None
  410. */
  411. HAL_StatusTypeDef HAL_LCD_UpdateDisplayRequest(LCD_HandleTypeDef *hlcd)
  412. {
  413. uint32_t tickstart = 0x00U;
  414. /* Clear the Update Display Done flag before starting the update display request */
  415. __HAL_LCD_CLEAR_FLAG(hlcd, LCD_FLAG_UDD);
  416. /* Enable the display request */
  417. hlcd->Instance->SR |= LCD_SR_UDR;
  418. /* Get timeout */
  419. tickstart = HAL_GetTick();
  420. /*!< Wait Until the LCD display is done */
  421. while(__HAL_LCD_GET_FLAG(hlcd, LCD_FLAG_UDD) == RESET)
  422. {
  423. if((HAL_GetTick() - tickstart ) > LCD_TIMEOUT_VALUE)
  424. {
  425. hlcd->ErrorCode = HAL_LCD_ERROR_UDD;
  426. /* Process Unlocked */
  427. __HAL_UNLOCK(hlcd);
  428. return HAL_TIMEOUT;
  429. }
  430. }
  431. hlcd->State = HAL_LCD_STATE_READY;
  432. /* Process Unlocked */
  433. __HAL_UNLOCK(hlcd);
  434. return HAL_OK;
  435. }
  436. /**
  437. * @}
  438. */
  439. /** @addtogroup LCD_Exported_Functions_Group3
  440. * @brief LCD State functions
  441. *
  442. @verbatim
  443. ===============================================================================
  444. ##### Peripheral State functions #####
  445. ===============================================================================
  446. [..]
  447. This subsection provides a set of functions allowing to control the LCD:
  448. (+) HAL_LCD_GetState() API can be helpful to check in run-time the state of the LCD peripheral State.
  449. (+) HAL_LCD_GetError() API to return the LCD error code.
  450. @endverbatim
  451. * @{
  452. */
  453. /**
  454. * @brief Returns the LCD state.
  455. * @param hlcd: LCD handle
  456. * @retval HAL state
  457. */
  458. HAL_LCD_StateTypeDef HAL_LCD_GetState(LCD_HandleTypeDef *hlcd)
  459. {
  460. return hlcd->State;
  461. }
  462. /**
  463. * @brief Return the LCD error code
  464. * @param hlcd: LCD handle
  465. * @retval LCD Error Code
  466. */
  467. uint32_t HAL_LCD_GetError(LCD_HandleTypeDef *hlcd)
  468. {
  469. return hlcd->ErrorCode;
  470. }
  471. /**
  472. * @}
  473. */
  474. /**
  475. * @}
  476. */
  477. /** @addtogroup LCD_Private
  478. * @{
  479. */
  480. /**
  481. * @brief Waits until the LCD FCR register is synchronized in the LCDCLK domain.
  482. * This function must be called after any write operation to LCD_FCR register.
  483. * @param hlcd LCD handle
  484. * @retval None
  485. */
  486. HAL_StatusTypeDef LCD_WaitForSynchro(LCD_HandleTypeDef *hlcd)
  487. {
  488. uint32_t tickstart = 0x00U;
  489. /* Get timeout */
  490. tickstart = HAL_GetTick();
  491. /* Loop until FCRSF flag is set */
  492. while(__HAL_LCD_GET_FLAG(hlcd, LCD_FLAG_FCRSF) == RESET)
  493. {
  494. if((HAL_GetTick() - tickstart) > LCD_TIMEOUT_VALUE)
  495. {
  496. hlcd->ErrorCode = HAL_LCD_ERROR_FCRSF;
  497. return HAL_TIMEOUT;
  498. }
  499. }
  500. return HAL_OK;
  501. }
  502. /**
  503. * @}
  504. */
  505. /**
  506. * @}
  507. */
  508. #endif /* HAL_LCD_MODULE_ENABLED */
  509. /**
  510. * @}
  511. */
  512. #endif /* #if defined (STM32L053xx) || defined (STM32L063xx) || defined (STM32L073xx) || defined (STM32L083xx) */
  513. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/