单片机解密STM32 128128液晶屏驱动 UC1617S 控制器
- 单片机解密#include "128128driver.h"
- //#include "stm32f10x_gpio.h"
- //#include "stm32f10x_rcc.h"
- 单片机解密单片机解密#include "ziku.h"
- #include "chziku.h"
- 单片机解密#include "systick.h"
- /************* 定义函数变量******************************/
- void lcd_busy(void);
- void SysTick_Init(void);
- void lcd_clear(void);
- extern const struct typFont16 Font16lib[];
-
- /**********************************************************
- ****************** 配置LCD写命令IO口**********************
- **********************************************************/
- void lcd_writecmminit(void)
- {
- GPIO_InitTypeDef GPIO_InitStructure; //通用接口配置
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE); //使能PC引脚时钟
- GPIO_InitStructure.GPIO_Pin = WR|RD; //使能读写控制引脚
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出
- GPIO_Init(GPIOC, &GPIO_InitStructure);
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE); //使能PA引脚时钟
- GPIO_InitStructure.GPIO_Pin = RS|RST|GPIO_Pin_5|GPIO_Pin_4; //使能控制引脚
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出
- GPIO_Init(GPIOA, &GPIO_InitStructure);
- }
- /**********************************************************
- ****************** 配置LCD写IO口**************************
- **********************************************************/
- void lcd_writeinit(void)
- {
- GPIO_InitTypeDef GPIO_InitStructure; //通用接口配置
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOE,ENABLE); //使能PE引脚时钟
- GPIO_InitStructure.GPIO_Pin = D7|D6|D5|D4|D3|D2|D1|D0; //使能IO口
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出
- GPIO_Init(GPIOE, &GPIO_InitStructure);
- }
- /**********************************************************
- ****************** 液晶写数据函数**************************
- **********************************************************/
- void write_lcddat(uint16_t da) //sm命令还是数据,命令还是数据
- {
- lcd_writecmminit();
- lcd_writeinit();
- PS1_L(); //8080协议
- CSB_L(); //片选
- Delay_us(2); //延时20us
- RS_H(); //数据有效
- RD_H();
- WR_L(); //写控制命令
- Delay_us(1);
- GPIO_Write(GPIOE,(GPIOE->ODR&0x00ff)|(da<<8));
- da=0;
- Delay_us(1);
- WR_H();
- Delay_us(1);
- CSB_H();
- }
- /**********************************************************
- ****************** 液晶写命令函数**************************
- **********************************************************/
- void write_lcdcom(uint16_t cm)
- {
- lcd_writecmminit();
- lcd_writeinit();
- PS1_L(); //8080协议
- CSB_L(); //片选
- Delay_us(2);
- RS_L(); //命令有效
- RD_H();
- WR_L(); //写控制命令
- Delay_us(1);
- GPIO_Write(GPIOE,(GPIOE->ODR&0x00ff)|(cm<<8));
- cm=0;
- Delay_us(1); //_nop_();
- WR_H();
- Delay_us(1);
- CSB_H();
- }

芯片解密