|
#define LCD_CtrlWrite_HX8306A(_data1,_data2) { *(volatile kal_uint32 *) LCD_HX8306A_CTRL_ADDR= (((_data1&0xff)<<8)|(_data2&0xff)); LCD_delay_HX8306A(); }LCD的初始化不是给_data1的寄存器地址发送_data2的值吗?
可这个又代表什么意思?跟下面的有什么区别?
void LCD_set_reg(kal_uint16 reg_index, kal_uint16 reg_data)
{
LCD_CtrlWrite_HX8306A(reg_index);
LCD_DataWrite_HX8306A(reg_data);
}
#define LCD_CtrlWrite_HX8306A(_data) { SET_LCD_CMD_PARAMETER(0, LCD_CMD, (_data >> 8)); LCD_SEND_DMA_CMD(1); myLCD_delay_HX8306A(); SET_LCD_CMD_PARAMETER(0, LCD_CMD, (_data & 0x00FF)); LCD_SEND_DMA_CMD(1); }
#define LCD_DataWrite_HX8306A(_data) { SET_LCD_CMD_PARAMETER(0, LCD_DATA, (_data >> 8)); LCD_SEND_DMA_CMD(1); myLCD_delay_HX8306A(); SET_LCD_CMD_PARAMETER(0, LCD_DATA, (_data & 0x00FF)); LCD_SEND_DMA_CMD(1); }
谁能给我解答解答?这两者什么区别?
第一段代码能否直接改成第二段代码这样? |
|