MCUXpresso SDK : led component

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

MCUXpresso SDK : led component

Jump to solution
1,366 Views
gph
Contributor III

Hi,

I'm trying to use the "led component" of SDK on LPC54606.

On/Off are working well.

But LED_Flash & LED_Dimmer only made On state.

Here my code :

   Console_Print("Test LED_\r\n");

    uint32_t s_ledMonochromeHandleBuffer[((LED_HANDLE_SIZE + sizeof(uint32_t) - 1) / sizeof(uint32_t))];
    led_handle_t s_ledMonochromeHandle = (led_handle_t)&s_ledMonochromeHandleBuffer[0];

    led_config_t ledMonochromeConfig;
    ledMonochromeConfig.type = kLED_TypeMonochrome;
    ledMonochromeConfig.ledMonochrome.monochromePin.dimmingEnable = 1;
    ledMonochromeConfig.ledMonochrome.monochromePin.dimming.sourceClock = 48000000;
    ledMonochromeConfig.ledMonochrome.monochromePin.dimming.instance = 0;
    ledMonochromeConfig.ledMonochrome.monochromePin.dimming.channel = 1;
    ledMonochromeConfig.ledMonochrome.monochromePin.dimming.pinStateDefault = 1;
    ledMonochromeConfig.ledMonochrome.monochromePin.gpio.port =0;
    ledMonochromeConfig.ledMonochrome.monochromePin.gpio.pin =1;
    ledMonochromeConfig.ledMonochrome.monochromePin.gpio.level =0;
    ledMonochromeConfig.ledMonochrome.monochromePin.gpio.direction =kHAL_GpioDirectionOut;
    LED_Init(s_ledMonochromeHandle, &ledMonochromeConfig);

    Console_Print("LED OFF\r\n");
    LED_TurnOnOff(s_ledMonochromeHandle, 0);
    SW3_WaitKey();
    Console_Print("LED Flash\r\n");
    led_flash_config_t ledFlash;
    ledFlash.times = LED_FLASH_CYCLE_FOREVER;
    ledFlash.period = 500;
    ledFlash.duty = 50;
    ledFlash.flashType = kLED_FlashOneColor;
    LED_Flash(s_ledMonochromeHandle, &ledFlash);
    SW3_WaitKey();
    Console_Print("LED Dimming\r\n");
    LED_Dimming(s_ledMonochromeHandle, 500, 0);
    SW3_WaitKey();

Probably i miss timer/pwm initialization, but i don't find what to do.

Thanks for your help, Philippe.

0 Kudos
Reply
1 Solution
1,352 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

 

How about refer to the LED_control_bm demo routine under SDK for lpc54628 ?

Alice_Yang_0-1663557536144.png

 

 

BR

Alice

View solution in original post

2 Replies
1,334 Views
gph
Contributor III

Good suggestion,Thanks

0 Kudos
Reply
1,353 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

 

How about refer to the LED_control_bm demo routine under SDK for lpc54628 ?

Alice_Yang_0-1663557536144.png

 

 

BR

Alice