/*
|
* File : lcd_cfg_api.c
|
* This file is part of Sizhu Ultrasonic Gas-Meter
|
* COPYRIGHT (C) 2022,Sizhu Ultrasonic Gas-Meter Development Team
|
*
|
* Brief : Header file of lcd_io_api.
|
* http://www.ideacreated.com/
|
*
|
* Change Logs:
|
* Date Author Notes
|
* 2022-08-22 Sizhu_J1anG the first version
|
* 2022-08-30 Sizhu_Ye targeted modification
|
*/
|
|
#ifndef _LCD_IO_API_H_
|
#define _LCD_IO_API_H_
|
|
#include "define_all.h"
|
#include "lcd_segmentcode.h"
|
|
|
#define Segnum 48
|
|
#define LCD_WRITE 0x7C //¼ûÎĵµ20/35
|
#define LCD_READ 0x7D
|
|
#define LCD_REG_DATA 0x80 //ÏÔʾÊý¾ÝÊäÈëÊä³öµÄÃüÁî
|
|
//#define LCD_DRIVE_MODE_COMMAND_ADDR 0x82 //22/35 Çý¶¯Ä£Ê½ÃüÁî 0x82
|
|
//#define LCD_SYSTEM_MODE_COMMAND_ADDR 0x84
|
|
#define LCD_PWR_GPIO_PORT GPIOB
|
#define LCD_PWR_PIN GPIO_Pin_6
|
|
#define LCD_BACKLIGHT_PWR_GPIO_PORT GPIOB
|
#define LCD_BACKLIGHT_PWR_PIN GPIO_Pin_5
|
|
//ÏÔʾÆÁµçÔ´
|
#define LCD_PWR_ON GPIO_SetBits(LCD_PWR_GPIO_PORT,LCD_PWR_PIN)
|
#define LCD_PWR_OFF GPIO_ResetBits(LCD_PWR_GPIO_PORT,LCD_PWR_PIN)
|
|
//±³¹â¿ª¹Ø
|
#define LCD_BACKLIGHT_ON GPIO_SetBits(LCD_BACKLIGHT_PWR_GPIO_PORT,LCD_BACKLIGHT_PWR_PIN)
|
#define LCD_BACKLIGHT_OFF GPIO_ResetBits(LCD_BACKLIGHT_PWR_GPIO_PORT,LCD_BACKLIGHT_PWR_PIN)
|
|
/***********************************************************************
|
* Ãû³Æ£ºLcd_DisplaySeg()
|
* ¹¦ÄÜ£ºÏÔʾһ¶Î¶ÎÂë
|
* ´«Èë²ÎÊý£ºSegNum:0~127¶ÎºÅÂë
|
* ¾ÙÀý£ºLcd_DisplaySeg(_LCD_TI_logo)£¬ÏÔʾTI logo
|
********************************************************************** */
|
//Ìí¼ÓÖ¸¶¨Êý¾Ýµ½Êý×é
|
#define LCD_DISPLAY_SEG(__SEG_NUM__) LCD_buffer[__SEG_NUM__ >> 3] |= 1 << (__SEG_NUM__ % 8)
|
|
/***********************************************************************
|
* Ãû³Æ£ºLcd_ClearSeg()
|
* ¹¦ÄÜ£ºÇå³ýÒ»¶Î¶ÎÂë
|
* ´«Èë²ÎÊý£ºSegNum:0~127¶ÎºÅÂë
|
* ¾ÙÀý£ºLcd_ClearSeg(_LCD_TI_logo)£¬ÏÔʾTI logo ÕâÀïµÄÔÀí¾ÍÊÇ»º´æµÄ°ËλÊýÅųɶþ½øÖÆ£¬½«¶ÔӦλÖÃÒ»
|
********************************************************************** */
|
//Çå³ýÖ¸¶¨Êý¾Ýµ½Êý×é
|
#define LCD_CLEAR_SEG(__SEG_NUM__) LCD_buffer[__SEG_NUM__ >> 3] &= ~(1 << (uint8_t)(__SEG_NUM__ % 8))
|
|
|
typedef enum{
|
LCD_A = 0U,
|
LCD_B,
|
LCD_C,
|
LCD_D,
|
LCD_E,
|
LCD_F,
|
LCD_G,
|
LCD_H,
|
LCD_I,
|
LCD_J,
|
LCD_K,
|
LCD_L,
|
LCD_M,
|
LCD_N,
|
LCD_O,
|
LCD_P,
|
LCD_Q,
|
LCD_R,
|
LCD_S,
|
LCD_T,
|
LCD_U,
|
LCD_V,
|
LCD_W,
|
LCD_X,
|
LCD_Y,
|
LCD_Z
|
}LCD_LETTERS_T;
|
|
extern uint8_t LCD_buffer[Segnum];
|
|
|
void Lcd_Write_Reg(uint8_t sadd,uint8_t * pBuffer,uint8_t len);
|
void Lcd_Write(uint8_t cmd_add,uint8_t * pBuffer,uint8_t len);
|
|
void Lcd_DisplayFirstLine_23A(u8 show_type,double number);
|
void Lcd_DisplaySecondLine_23A(u8 show_type,double number);
|
|
void Lcd_DisplayDigit_23A(unsigned char Position ,u8 Digit);
|
void Lcd_ClearDigit_23A(unsigned char Position);
|
|
void Lcd_DisplayLetter(uint8_t position,LCD_LETTERS_T letter);
|
void Lcd_IO_Init(void);
|
|
|
#endif
|