From ec1ec68ba7d175f39f5d4e066663cf29fa7c262a Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Tue, 14 May 2024 19:56:10 +0800
Subject: [PATCH] 开始增加脉冲、报警线处理

---
 Function/LCD/lcd_io_api.h |  114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 114 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..7bef53c
--- /dev/null
+++ b/Function/LCD/lcd_io_api.h
@@ -0,0 +1,114 @@
+/*
+ * 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_ADDR_WRITE    	0x7C    //���ĵ�20/35
+#define	LCD_ADDR_READ     	0x7D
+
+#define	LCD_REG_DATA_ADDR		0x80   //��ʾ�����������������
+
+#define	LCD_DRIVE_MODE_COMMAND_ADDR 0x82 //22/35 ����ģʽ���� 0x82  
+
+#define	LCD_SYSTEM_MODE_COMMAND_ADDR 0x84
+
+#define LCD_PWR_GPIO_PORT							GPIOD
+#define LCD_PWR_PIN										GPIO_Pin_7
+
+#define LCD_BACKLIGHT_PWR_GPIO_PORT		GPIOD
+#define LCD_BACKLIGHT_PWR_PIN					GPIO_Pin_8
+
+//��ʾ����Դ
+#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_PWR_IO_READ			GPIO_ReadInputDataBit(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_GPIO_Init(void);
+
+
+#endif
+

--
Gitblit v1.9.3