Hi everyone,
I'm currently working on CC2530 development kit and attempt to using I2C bus to interface external temperature sensor TMP102 with CC2530 chip. Instead of using the internal temperature sensor inside CC2530 chip, I would like to use TMP102 to measure the temperature.
I already downloaded the i2c hal drivers (hal_i2c.c, hal_i2c.h) available in RemoTi Stack for cc2530 and define my own OCM_CLK_PORT, OCM_CLK_PIN, OCM_DATA_PORT, and OCM_DATA_PIN for SCL and SDA. However, I still have several questions:
(1) in the method "void HalI2CInit( void )", there are several lines that have been commented out:
// // Set port pins as inputs
// IO_DIR_PORT_PIN( OCM_CLK_PORT, OCM_CLK_PIN, IO_IN );
// IO_DIR_PORT_PIN( OCM_DATA_PORT, OCM_DATA_PIN, IO_IN );
//
// // Set for general I/O operation
// IO_FUNC_PORT_PIN( OCM_CLK_PORT, OCM_CLK_PIN, IO_GIO );
// IO_FUNC_PORT_PIN( OCM_DATA_PORT, OCM_DATA_PIN, IO_GIO );
//
// // Set I/O mode for pull-up/pull-down
// IO_IMODE_PORT_PIN( OCM_CLK_PORT, OCM_CLK_PIN, IO_PUD );
// IO_IMODE_PORT_PIN( OCM_DATA_PORT, OCM_DATA_PIN, IO_PUD );
//
// // Set pins to pull-up
// IO_PUD_PORT( OCM_CLK_PORT, IO_PUP );
// IO_PUD_PORT( OCM_DATA_PORT, IO_PUP );
Do I have to bring them back to original code?
(2) Are there any other methods or variables that I need to revise?
Thank you for the help! ^-^