Set GPIO

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,502件の閲覧回数
stdcerr
Contributor IV

Hi,

 

I'm back at the very basics, why do my GPIOs PORTC15 & PORTC18 not get set high with the following code?

 

 

 

    gpio_pin_config_t ConfigC15 = { .pinDirection = kGPIO_DigitalOutput, .outputLogic = 0 };
    gpio_pin_config_t ConfigC18 = { .pinDirection = kGPIO_DigitalOutput, .outputLogic = 0 };
    GPIO_PinInit(GPIOC,15,&ConfigC15);
    GPIO_PinInit(GPIOC,18,&ConfigC18);
    GPIO_PinWrite(GPIOC,15,1);
    GPIO_PinWrite(GPIOC,18,1);

 

 

 

  What am I missing?

Same resiult when I set the default outputLogic to 1 instead.

Hm, I added

 CLOCK_EnableClock(kCLOCK_PortC);

before the lines above but still no luck.

ラベル(1)
0 件の賞賛
返信
1 解決策
1,492件の閲覧回数
nxf56274
NXP Employee
NXP Employee

Hi,

Which mcu do you use? Do you configure the pin multiplexing? Configure the pin as GPIO ? The sdk has gpio example. You can refer it.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,493件の閲覧回数
nxf56274
NXP Employee
NXP Employee

Hi,

Which mcu do you use? Do you configure the pin multiplexing? Configure the pin as GPIO ? The sdk has gpio example. You can refer it.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信