Hi
My config: TM4C123GH6PM on TivaC Series TM4C123G Launchpad, TivaWare C Series-2.1.1.71, TI-RTOS TivaC 2.14.00.10
Code Composer Studio Version: 6.0.1.00040
I have to initialize an I2C Slave on a TI-RTOS application, but TI-RTOS does not support I2C Slave at this time. This means I have to write the code for this application by myself. The initialization I've adopted from the exaple at the following link.
https://e2e.ti.com/support/embedded/tirtos/f/355/t/371621
My revised initialization
/* I2C3 Init */
/*
* NOTE: TI-RTOS examples configure pins PD0 & PD1 for SSI3 or I2C3. Thus,
* a conflict occurs when the I2C & SPI drivers are used simultaneously in
* an application. Modify the pin mux settings in this file and resolve the
* conflict before running your the application.
*/
/* Enable the peripheral */
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C3);
// Configure the pin muxing for I2C3 functions on port D0 and D1.
GPIOPinConfigure(GPIO_PD0_I2C3SCL);
GPIOPinConfigure(GPIO_PD1_I2C3SDA);
// Select the I2C function for these pins. This function will also
// configure the GPIO pins pins for I2C operation, setting them to
// open-drain operation with weak pull-ups.
GPIOPinTypeI2CSCL(GPIO_PORTD_BASE, GPIO_PIN_0);
GPIOPinTypeI2C(GPIO_PORTD_BASE, GPIO_PIN_1);
GPIOPadConfigSet(GPIO_PORTD_BASE, GPIO_PIN_1, GPIO_STRENGTH_8MA_SC,
GPIO_DIR_MODE_HW | GPIO_PIN_TYPE_OD);
// Configure and turn on the I2C0 slave interrupt. The I2CSlaveIntEnableEx()
// gives you the ability to only enable specific interrupts. For this case
I2CSlaveIntEnableEx(I2C3_BASE, I2C_SLAVE_INT_DATA);
// Enable the I2C3 slave module.
I2CSlaveEnable(I2C3_BASE);
// Set the slave address to SLAVE_ADDRESS.
I2CSlaveInit(I2C3_BASE, 0b1010100);
//These GPIOs are connected to PD0 and PD1 and need to be brought into a
//GPIO input state so they don't interfere with I2C communications.
GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_6);
GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_7);
I2C_init();
Now i have no idea how to mange the slave in the TI-RTOS with the functons from \tirtos_tivac_2_14_00_10\products\TivaWare_C_Series-2.1.1.71b\driverlib\i2c.h
Can anyone help me?
Thanks a lot
Manuel