SPRUJ26A September 2021 – April 2024
The HAL_setupGPIOs() function located in the hal.c file configures the function of the GPIO pins and sets the direction and mode of the specified pin according to the hardware motor driver board/kit that is used. For modifying the code for a custom board, a TI motor driver EVM that doesn't currently have universal lab code support, or for use with a different C2000 MCU, these GPIO assignments will need to be changed to correspond properly with the motor driver board. Be careful to set the proper pad configuration for the specified pin, especially for GPIOs that will be used as PWM outputs. An example configuration of the EPWM1A GPIO0 pin is shown below.
// GPIO0->EPWM1A->M1_UH*
GPIO_setPinConfig(GPIO_0_EPWM1_A);
GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);