GPIO_DRV_SetPinOutput not working?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO_DRV_SetPinOutput not working?

Jump to solution
1,111 Views
christopherira
Contributor III

I'm using processor expert and the sdk fsl_gpio for my frdm-kl43z. The commands gpio_drv_setpinoutput, gpio_drv_writepinoutput and gpio_drv_clearpinoutput, all are not working.

I've gotten gpio_drv_togglepinoutput to work, but these other functions have not worked. I've done 10 or so projects and just have had to suffer without the use of these commands.

 

Any ideas?

 

Thanks,

 

Chris

Labels (1)
0 Kudos
1 Solution
713 Views
DavidS
NXP Employee
NXP Employee

Hi Chris,

I just tested the following code using KDS_3.0+KSDK_1.3+PE for frdm-kl43z successfully.

  /* Write your code here */

  /* For example: for(;;) { } */

  uint32_t pinstate;

  while(1) {

  pinstate = GPIO_DRV_ReadPinInput(LED2_RED);

  pinstate = !pinstate;

     GPIO_DRV_WritePinOutput(LED2_RED, pinstate);

  pinstate = GPIO_DRV_ReadPinInput(LED2_RED);

     GPIO_DRV_SetPinOutput(LED2_RED);

  pinstate = GPIO_DRV_ReadPinInput(LED2_RED);

     GPIO_DRV_ClearPinOutput(LED2_RED);

  pinstate = GPIO_DRV_ReadPinInput(LED2_RED);

     GPIO_DRV_TogglePinOutput(LED2_RED);

  }

Is your KDS Help->Install new software....  up-to-date?

Attached is my working project.

Regards,

David

View solution in original post

0 Kudos
3 Replies
714 Views
DavidS
NXP Employee
NXP Employee

Hi Chris,

I just tested the following code using KDS_3.0+KSDK_1.3+PE for frdm-kl43z successfully.

  /* Write your code here */

  /* For example: for(;;) { } */

  uint32_t pinstate;

  while(1) {

  pinstate = GPIO_DRV_ReadPinInput(LED2_RED);

  pinstate = !pinstate;

     GPIO_DRV_WritePinOutput(LED2_RED, pinstate);

  pinstate = GPIO_DRV_ReadPinInput(LED2_RED);

     GPIO_DRV_SetPinOutput(LED2_RED);

  pinstate = GPIO_DRV_ReadPinInput(LED2_RED);

     GPIO_DRV_ClearPinOutput(LED2_RED);

  pinstate = GPIO_DRV_ReadPinInput(LED2_RED);

     GPIO_DRV_TogglePinOutput(LED2_RED);

  }

Is your KDS Help->Install new software....  up-to-date?

Attached is my working project.

Regards,

David

0 Kudos
713 Views
christopherira
Contributor III

Hi,

Everything is up to date, but the functions other than toggle do not work.

0 Kudos
713 Views
christopherira
Contributor III

Actually it's working now

0 Kudos