From 72def895431ad7a08e635b11f3da738e2b2c4618 Mon Sep 17 00:00:00 2001
From: wujiazhi <1147861305@qq.com>
Date: Thu, 13 Jun 2024 11:31:04 +0800
Subject: [PATCH] add lower model test

---
 Function/LCD/lcd_io_api.h |  112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 112 insertions(+), 0 deletions(-)

diff --git a/Function/LCD/lcd_io_api.h b/Function/LCD/lcd_io_api.h
new file mode 100644
index 0000000..a67ddb4
--- /dev/null
+++ b/Function/LCD/lcd_io_api.h
@@ -0,0 +1,112 @@
+/*
+ * 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
+

--
Gitblit v1.9.3