LCD驱动芯片——BL55072A驱动程序

初始化子程序:
START
0x7C; I2C子地址
0xEA;ICSET,软件复位芯片
0xC0;MODSET,关显示
0xF0;BLKCTL,关闪烁
0xA3;DISCTL,80Hz Line inversion,High Power mode
0xE8;ICSET,清复位bit1
STOP

显示刷新子程序:
START
0x7C;I2C子地址
0xF0;BLKCTL,关闪烁
0xA3;DISCTL,80Hz Line inversion,High Power mode
0xE8或0xEC;ICSET,显存高位地址为0或1
0xXX;ADSET,设置显存刷新起始地址,通常为0x00,从头开始刷新,此时上一条指令一般为0xE8


STOP

START
0x7C
0xC8;MODSET,开显示
STOP

最后附上简单的测试程序:

#define Address_BL55072   0x7C
void BL55072_Init(void)
{
	uint8_t BL5502_Init_BUFF[5];
	BL5502_Init_BUFF[0]= 0xEA;
	BL5502_Init_BUFF[1]= 0xC0;
	BL5502_Init_BUFF[2]= 0xF0;
	BL5502_Init_BUFF[3]= 0xA3;
	BL5502_Init_BUFF[4]= 0xE8;
	
	HAL_I2C_Master_Transmit(&hi2c1, Address_BL55072, (uint8_t *)BL5502_Init_BUFF, 5, 100);
}

uint8_t BL5502_BUFF[23];
void SEG_WriteBuffer(uint8_t data)
{
	BL5502_BUFF[0]= 0xF0;
	BL5502_BUFF[1]= 0xA3;
	BL5502_BUFF[2]= 0xE8;
	BL5502_BUFF[3]= 0x00;

	for(int i=4;i<22;i++) 
	{
		BL5502_BUFF[i] = data;//
	}

	HAL_I2C_Master_Transmit(&hi2c1, Address_BL55072, (uint8_t *)BL5502_BUFF, 22, 100);
	BL5502_BUFF[0]= 0xC8;
	HAL_I2C_Master_Transmit(&hi2c1, Address_BL55072, (uint8_t *)BL5502_BUFF, 1, 100);	
}

你可能感兴趣的:(STM32)