40 struct stTask __stChildTaskI2C, __stGrandChildTaskI2C;
41 uint8_t __esos_i2c_dataBytes[2];
68 u32_temp = (
FCY/1000L)/((uint32_t) u16_fKHz);
69 u32_temp = u32_temp -
FCY/10000000L - 1;
71 I2C1CONbits.I2CEN = 1;
78 u8_tempAck = u8_ack2Send;
86 I2C1CONbits.ACKDT = u8_tempAck;
87 I2C1CONbits.ACKEN = 1;
101 static uint16_t u16_tempCnt, u16_i;
107 __PIC24_I2C1_START();
108 __PIC24_I2C1_PUT(I2C_WADDR(u8_tempAddr));
109 for (u16_i=0; u16_i < u16_tempCnt; u16_i++) {
110 __PIC24_I2C1_PUT(*pu8_tempPtr);
127 static uint16_t u16_tempCnt, u16_i;
133 __PIC24_I2C1_START();
134 __PIC24_I2C1_PUT(I2C_RADDR(u8_tempAddr));
135 for (u16_i=0; u16_i < u16_tempCnt-1; u16_i++) {
136 ESOS_TASK_WAIT_ON_GETI2C1(pu8_tempD, I2C_ACK);
139 ESOS_TASK_WAIT_ON_GETI2C1(pu8_tempD, I2C_NAK);
void esos_pic24_configI2C1(uint16_t u16_FkHZ)
This file contains routines which configure and use I2C on the Microchip PIC24 MCUs.
#define ESOS_CHILD_TASK(taskname,...)
#define ESOS_TASK_WAIT_WHILE(cond)
#define ESOS_TASK_WAIT_UNTIL(condition)
#define ESOS_TASK_BEGIN()
unsigned char uint8_t
An abbreviation for an 8-bit unsigned integer.