//############################################################################# // // FILE: i2c_ex1_master.c // // TITLE: I2C Example Master. // //############################################################################# // // Included Files // #include "f28x_project.h" #include "i2c_oled.h" typedef unsigned char uint8_t; typedef unsigned short uint16_t; extern uint16_t I2C_TXdata[]; extern uint16_t I2C_RXdata[]; //////////////////////////////////////////////////////////// // // Main // void main(void) { // // Locals // uint16_t index = 0U; uint16_t count = 0U; // // Initialize System Control: // PLL, WatchDog, enable Peripheral Clocks // InitSysCtrl(); // // Initialize GPIO // InitGpio(); // //Configure I2C pins // GPIO_SetupPinMux(GPIO_PIN_SDAA, GPIO_MUX_CPU1, 6); GPIO_SetupPinOptions(GPIO_PIN_SDAA, GPIO_OUTPUT, GPIO_PULLUP); GPIO_SetupPinMux(GPIO_PIN_SCLA, GPIO_MUX_CPU1, 6); GPIO_SetupPinOptions(GPIO_PIN_SCLA, GPIO_OUTPUT, GPIO_PULLUP); // // Initialize the PIE control registers to their default state. // The default state is all PIE interrupts disabled and flags // are cleared. // InitPieCtrl(); // // Disable CPU interrupts and clear all CPU interrupt flags // IER = 0x0000; IFR = 0x0000; // // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR) // InitPieVectTable(); // // Set the buffer to some default non-zero value // for (index=0; index