This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Launchxl-F28069M pin toggle with API



Hi,

I've been trying to toggle a Pin (P12, pin 5 on J1) with the API, but with no success. What I'm doing wrong?

GPIO_Handle gpioHandle;

// init

  GPIO_init(gpioHandle,sizeof(GPIO_Obj));
  GPIO_setMode(gpioHandle, GPIO_Number_12, GPIO_12_Mode_GeneralPurpose);
  GPIO_setDirection(gpioHandle, GPIO_Number_12, GPIO_Direction_Output);
  GPIO_setLow(gpioHandle, GPIO_Number_12);


// (in ISR)

GPIO_toggle(gpioHandle, GPIO_Number_12);

 

Thank you,

Carsten

 

 

 

  • Hi Carsten,

    Looking at this code you've posted, your gpioHandle is not being initialized properly. GPIO_init() returns a handle value. So that function call should look like this:

    gpioHandle = GPIO_init((void *)GPIO_BASE_ADDR, sizeof(GPIO_Obj));

    - Whitney