GPIO_DRV_SetPinOutput not working?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

GPIO_DRV_SetPinOutput not working?

跳至解决方案
1,136 次查看
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

标签 (1)
标记 (3)
0 项奖励
1 解答
738 次查看
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 项奖励
3 回复数
739 次查看
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 项奖励
738 次查看
christopherira
Contributor III

Hi,

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

0 项奖励
738 次查看
christopherira
Contributor III

Actually it's working now

0 项奖励