void DispDataWrOneNibble (CPU_INT08U data){ CPU_INT32U value;
BSP_LCD_DISP_RW_LO(); /* Set R/W write LOW to write to the LCD module. */
BSP_LCD_DISP_E_HI(); /* Write the UPPER nibble to the LCD module. */ value = ((data >> 4) & 0x0F); GPIOPinWrite(GPIO_PORTA_BASE, BSP_GPIO_LCD_DB, value << 2);
DispDly_uS(1000); BSP_LCD_DISP_E_LO();}
此帖出自
小平头技术问答
#if (APP_CFG_LCD_EN == DEF_ENABLED)
void DispDataWr (CPU_INT08U data)
{
CPU_INT32U value;
BSP_LCD_DISP_RW_LO(); /* Set R/W write LOW to write to the LCD module. */
BSP_LCD_DISP_E_HI(); //拉高 PB4 /* Write the UPPER nibble to the LCD module. */
value = ((data >> 4) & 0x0F);
GPIOPinWrite(GPIO_PORTA_BASE, BSP_GPIO_LCD_DB, value << 2);
DispDly_uS(1000);
BSP_LCD_DISP_E_LO();
DispDly_uS(1000); /* Write the LOWER nibble to the LCD module. */
BSP_LCD_DISP_E_HI();
value = (data & 0x0F);
GPIOPinWrite(GPIO_PORTA_BASE, BSP_GPIO_LCD_DB, value << 2);
DispDly_uS(1000);
BSP_LCD_DISP_E_LO();
}
BSP_LCD_DISP_RW_LO();
BSP_LCD_DISP_E_HI();
为什么要左移 2 为呢?
一周热门 更多>