A31L12x F/W Packages  1.4.0
ABOV Cortex-M0+ Core based MCUs Integrated Driver
Functions
A31L12x_hal_lcd.c File Reference

Contains all functions support for lcd firmware library on A31L12x. More...

Go to the source code of this file.

Functions

HAL_Status_Type HAL_LCD_Init (LCD_CFG_Type *LCD_Config)
 Initialize the LCD peripheral with the specified parameters. More...
 
HAL_Status_Type HAL_LCD_SetRegister (uint32_t u32LCD_CR, uint32_t u32LCD_BCCR)
 Set LCD LCD_CR/LCD_BCCR Registers. More...
 
HAL_Status_Type HAL_LCD_ClearDspRam (void)
 Clear LCD Buffer. More...
 
HAL_Status_Type HAL_LCD_WriteDspRam (uint8_t *write_buf, uint32_t u32Index, uint32_t size)
 Write LCD Buffer. More...
 

Detailed Description

Contains all functions support for lcd firmware library on A31L12x.

Version
1.00
Date
2020-05-29
Author
ABOV Application Team

Copyright(C) 2019, ABOV Semiconductor All rights reserved.

ABOV Disclaimer

IMPORTANT NOTICE ? PLEASE READ CAREFULLY ABOV Semiconductor ("ABOV") reserves the right to make changes, corrections, enhancements, modifications, and improvements to ABOV products and/or to this document at any time without notice. ABOV does not give warranties as to the accuracy or completeness of the information included herein. Purchasers should obtain the latest relevant information of ABOV products before placing orders. Purchasers are entirely responsible for the choice, selection, and use of ABOV products and ABOV assumes no liability for application assistance or the design of purchasers' products. No license, express or implied, to any intellectual property rights is granted by ABOV herein. ABOV disclaims all express and implied warranties and shall not be responsible or liable for any injuries or damages related to use of ABOV products in such unauthorized applications. ABOV and the ABOV logo are trademarks of ABOV. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces the information previously supplied in any former versions of this document. 2020 ABOV Semiconductor All rights reserved

Definition in file A31L12x_hal_lcd.c.

Function Documentation

◆ HAL_LCD_ClearDspRam()

HAL_Status_Type HAL_LCD_ClearDspRam ( void  )

Clear LCD Buffer.

Returns
HAL_Status_Type

This function clear Display Data RAM.

Definition at line 108 of file A31L12x_hal_lcd.c.

109 {
110  uint8_t u32Index;
111  volatile uint8_t* lcd_dsp_ram;
112 
113  lcd_dsp_ram = &LCD->DR0;
114  for( u32Index = 0; u32Index < LCDBufSize; u32Index ++ )
115  {
116  lcd_dsp_ram[u32Index] = 0;
117  }
118 
119  return HAL_OK;
120 }

References HAL_OK.

◆ HAL_LCD_Init()

HAL_Status_Type HAL_LCD_Init ( LCD_CFG_Type LCD_Config)

Initialize the LCD peripheral with the specified parameters.

Parameters
[in]LCD_ConfigPointer to LCD_CFG_Type that contains the configuration information for the specified peripheral.
Returns
HAL_Status_Type

This function sets the LCD Bias Resistor, LCD Duty, LCD Clock, Automatic Bias Control, and Contrast Control Data.

Definition at line 57 of file A31L12x_hal_lcd.c.

58 {
59  /* Check LCD_Config */
60  if( LCD_Config == NULL )
61  {
62  return HAL_ERROR;
63  }
64 
65  // enable peripheral clock
66  HAL_SCU_Peripheral_EnableClock2( PPCLKEN2_LCDCLKE, PPxCLKE_Enable );
67 
68  LCD->CR = 0
69  | LCD_Config->Bias
70  | LCD_Config->Duty
71  | LCD_Config->Clk
72  ;
73 
74  LCD->BCCR = 0
75  | LCD_Config->AutoBiasEn
76  | LCD_Config->BiasTime
77  | LCD_Config->Contrast
78  | LCD_Config->ContrastStep
79  ;
80 
81  // return
82  return HAL_OK;
83 }
uint32_t ContrastStep
uint32_t Contrast
void HAL_SCU_Peripheral_EnableClock2(uint32_t u32PeriClk2, uint32_t u32Ind)
Set Each Peripheral Clock.
uint32_t AutoBiasEn
uint32_t BiasTime

References LCD_CFG_Type::AutoBiasEn, LCD_CFG_Type::Bias, LCD_CFG_Type::BiasTime, LCD_CFG_Type::Clk, LCD_CFG_Type::Contrast, LCD_CFG_Type::ContrastStep, LCD_CFG_Type::Duty, HAL_ERROR, HAL_OK, and HAL_SCU_Peripheral_EnableClock2().

Here is the call graph for this function:

◆ HAL_LCD_SetRegister()

HAL_Status_Type HAL_LCD_SetRegister ( uint32_t  u32LCD_CR,
uint32_t  u32LCD_BCCR 
)

Set LCD LCD_CR/LCD_BCCR Registers.

Parameters
[in]u32LCD_CRLCD Driver Control Register Setting Data
[in]u32LCD_BCCRLCD Automatic bias and Contrast Control Register Setting Data
Returns
HAL_Status_Type

This function sets the LCD Bias Resistor, LCD Duty, LCD Clock, Automatic Bias Control, and Contrast Control Data.

Definition at line 95 of file A31L12x_hal_lcd.c.

96 {
97  LCD->CR = u32LCD_CR; // Set LCD Driver Control Register
98  LCD->BCCR = u32LCD_BCCR; // Set LCD Driver Automatic Bias and Contrast Control Register
99 
100  return HAL_OK;
101 }

References HAL_OK.

◆ HAL_LCD_WriteDspRam()

HAL_Status_Type HAL_LCD_WriteDspRam ( uint8_t *  write_buf,
uint32_t  u32Index,
uint32_t  size 
)

Write LCD Buffer.

Parameters
[in]write_bufFont Data Buffer Address
[in]u32IndexFont Data Buffer Index
[in]sizeFont Data Buffer Size
Returns
HAL_Status_Type

This function writes display data to Display Data RAM.

Definition at line 133 of file A31L12x_hal_lcd.c.

134 {
135  volatile uint8_t* lcd_dsp_ram;
136  uint32_t i;
137 
138  if( ( u32Index + size ) > LCDBufSize ) // Check Buffer size
139  {
140  size = size - ( ( u32Index + size ) - LCDBufSize );
141  }
142 
143  lcd_dsp_ram = &LCD->DR0;
144  for( i = 0; i < size; i ++ )
145  {
146  lcd_dsp_ram[u32Index + i] = write_buf[i];
147  }
148 
149  return HAL_OK;
150 }

References HAL_OK.