// // Main // void main(void) { // Step 1. Initialize System Control: // PLL, WatchDog, enable Peripheral Clocks // This example function is found in the F2837xD_SysCtrl.c file. // InitSysCtrl(); // // Step 2. Initialize GPIO: // This example function is found in the F2837xD_Gpio.c file and // illustrates how to set the GPIO to it's default state. // InitGpio(); //LED//////////////////////////////////////// GPIO_SetupPinMux(BLINKY_LED_GPIO, GPIO_MUX_CPU1, 0); GPIO_SetupPinOptions(BLINKY_LED_GPIO, GPIO_OUTPUT, GPIO_PUSHPULL); GPIO_SetupPinMux(BLINKY_LED_GPIO1, GPIO_MUX_CPU1, 0); GPIO_SetupPinOptions(BLINKY_LED_GPIO1, GPIO_OUTPUT, GPIO_PUSHPULL); // // For this example, only init the pins for the SCI-A port. // GPIO_SetupPinMux() - Sets the GPxMUX1/2 and GPyMUX1/2 register bits // GPIO_SetupPinOptions() - Sets the direction and configuration of the GPIOS // These functions are found in the F2837xD_Gpio.c file. // #ifdef scia //SCI-A UART GPIO_SetupPinMux(64, GPIO_MUX_CPU1, 6); //GPIO_SetupPinMux(43, GPIO_MUX_CPU1, 15); Rx GPIO_SetupPinOptions(64, GPIO_INPUT, GPIO_PUSHPULL); //GPIO_SetupPinOptions(43, GPIO_INPUT, GPIO_PUSHPULL); GPIO_SetupPinMux(84, GPIO_MUX_CPU1, 5); //GPIO_SetupPinMux(42, GPIO_MUX_CPU1, 15); Tx GPIO_SetupPinOptions(84, GPIO_OUTPUT, GPIO_ASYNC); //GPIO_SetupPinOptions(42, GPIO_OUTPUT, GPIO_ASYNC); #endif #ifdef scib //SCI-B UART GPIO_SetupPinMux(55, GPIO_MUX_CPU1, 6); //GPIO_SetupPinMux(19, GPIO_MUX_CPU1, 2); Rx GPIO_SetupPinOptions(55, GPIO_INPUT, GPIO_PUSHPULL); //GPIO_SetupPinOptions(19, GPIO_INPUT, GPIO_PUSHPULL); GPIO_SetupPinMux(54, GPIO_MUX_CPU1, 6); //GPIO_SetupPinMux(18, GPIO_MUX_CPU1, 2); Tx GPIO_SetupPinOptions(54, GPIO_OUTPUT, GPIO_ASYNC); //GPIO_SetupPinOptions(18, GPIO_OUTPUT, GPIO_ASYNC); #endif #ifdef scic //SCI-C UART GPIO_SetupPinMux(90, GPIO_MUX_CPU1, 6); //GPIO_SetupPinMux(139, GPIO_MUX_CPU1, 6); Rx Arya GPIO_SetupPinOptions(90, GPIO_INPUT, GPIO_PUSHPULL); //GPIO_SetupPinOptions(139, GPIO_INPUT, GPIO_PUSHPULL); GPIO_SetupPinMux(89, GPIO_MUX_CPU1, 6); //GPIO_SetupPinMux(56, GPIO_MUX_CPU1, 6); Tx Arya GPIO_SetupPinOptions(89, GPIO_OUTPUT, GPIO_ASYNC); //GPIO_SetupPinOptions(56, GPIO_OUTPUT, GPIO_ASYNC); #endif