cc26xxi2c.c文件:
#include "cc26xxi2c.h"
#include <ti/sysbios/knl/Clock.h>
#include <ti/drivers/I2C.h>
#include <ti/drivers/i2c/I2CCC26XX.h>
#include <ti/drivers/power/PowerCC26XX.h>
#include "sdi_task.h"
#include "icall.h"
#include <stdlib.h>
#include <string.h>
I2CCC26XX_Object _i2cCC26xxObjects[CC2640R2_LAUNCHXL_I2CCOUNT];
const I2CCC26XX_HWAttrsV1 _i2cCC26xxHWAttrs[CC2640R2_LAUNCHXL_I2CCOUNT] =
{
{
.baseAddr = I2C0_BASE,
.powerMngrId = PowerCC26XX_PERIPH_I2C0,
.intNum = INT_I2C_IRQ,
.intPriority = ~0,
.swiPriority = 0,
.sdaPin = CC2640R2_LAUNCHXL_I2C0_SDA0,
.sclPin = CC2640R2_LAUNCHXL_I2C0_SCL0,
}
};
const I2C_Config cc26xxI2C_config[CC2640R2_LAUNCHXL_I2CCOUNT] =
{
{
.fxnTablePtr = &I2CCC26XX_fxnTable,
.object = &_i2cCC26xxObjects[CC2640R2_LAUNCHXL_I2C0],
.hwAttrs = &_i2cCC26xxHWAttrs[CC2640R2_LAUNCHXL_I2C0]