|
IIC时钟、速度相关
#define IICCON_ACKEN (1<<7) //IIC-bus acknowledge enable bit.
#define IICCON_CLK512 (1<<6) // 1 = IICCLK = fPCLK /512
#define IICCON_INTR (1<<5) // IIC-Bus Tx/Rx interrupt enable/disable bit.
#define FInsrt(Value, Field) \
(UData (Value) << FShft (Field))
#define IICCON_CLKPRE(x) FInsrt((x), Fld(4, 0))
//Enable ACK, Prescaler IICCLK=PCLK/512, Enable interrupt, Transmit clock value Tx clock=IICCLK/4
// If PCLK 50.7MHz, IICCLK = 99KHz, Tx Clock = 25KHz
v_pIICregs->rIICCON = IICCON_ACKEN |IICCON_CLK512 | IICCON_INTR | IICCON_CLKPRE(0x6);
这个速度也不算慢啊。并且这个程序在4.2跑是运行正常的。我提速一半试试。 |
|