/* device handle object */
typedef struct {
Uint32 allocated;
Uint32 eventId;
volatile Uint32 *baseAddr;
Uint32 i2cdrrAddr;
Uint32 i2cdxrAddr;
} I2C_Obj, *I2C_Handle;
IDEF void I2C_writeByte(I2C_Handle hI2c, Uint8 val) {
(*(volatile Uint8 *)(hI2c->i2cdxrAddr)) = val;
}
请问Uint32 i2cdxrAddr代表什么?
如果这样调用,
I2C_writeByte(hI2c, 0x55);
那么0x55写到I2C的那个寄存器了?
fengzhichang feng:
回复 noaming:
谢谢了,那是不是
IDEF Uint8 I2C_readByte(I2C_Handle hI2c) {
return (*(volatile Uint8 *)(hI2c->i2cdrrAddr));
}
Uint32 i2cdrrAddr; Uint32 i2cdxrAddr;是不是都代表寄存器I2CDXR
fengzhichang feng:
回复 noaming:
谢谢了,那是不是
IDEF Uint8 I2C_readByte(I2C_Handle hI2c) {
return (*(volatile Uint8 *)(hI2c->i2cdrrAddr));
}
Uint32 i2cdrrAddr; Uint32 i2cdxrAddr;是不是都代表寄存器I2CDXR
fengzhichang feng:
回复 noaming:
谢谢了,那是不是
IDEF Uint8 I2C_readByte(I2C_Handle hI2c) {
return (*(volatile Uint8 *)(hI2c->i2cdrrAddr));
}
Uint32 i2cdrrAddr; Uint32 i2cdxrAddr;是不是都代表寄存器I2CDXR
fengzhichang feng:
回复 noaming:
谢谢了,那是不是
IDEF Uint8 I2C_readByte(I2C_Handle hI2c) {
return (*(volatile Uint8 *)(hI2c->i2cdrrAddr));
}
Uint32 i2cdrrAddr; Uint32 i2cdxrAddr;是不是都代表寄存器I2CDXR