新手入门
- 积分
- 11
- 金钱
- 11
- 注册时间
- 2022-3-5
- 在线时间
- 1 小时
|

楼主 |
发表于 2022-3-5 20:10:38
|
显示全部楼层
就是如下两种写法
1、 base->I2CR |= (1 << 5) | (1 << 4); /*设置寄存器I2CR bit[5]: 1 主模式 bit[4]: 1 发送*/
/*产生start信号*/
/*bit[7:0] : 要发送的数据,这里写入从设备地址*/
base->I2DR = ((unsigned int)address << 1) | ((direction == kI2C_Read)? 1 : 0);
return IIC_STATUS_OK;
2、 if(lcdid == ATKVGA) { //VGA需要特殊处理
LCDIF->VDCTRL0 = (0 << 29) | (1 << 28) | (0 << 27) |
(0 << 26) | (1 << 25) | (0 << 24) |
(1 << 21) | (1 << 20) | (tftlcd_dev.vspw << 0);
} else {
LCDIF->VDCTRL0 = (0 << 29) | (1 << 28) | (0 << 27) |
(0 << 26) | (0 << 25) | (1 << 24) |
(1 << 21) | (1 << 20) | (tftlcd_dev.vspw << 0);
} |
|