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.
解決済! 解決策の投稿を見る。
Hello,
How about refer to the LED_control_bm demo routine under SDK for lpc54628 ?
BR
Alice
Good suggestion,Thanks
Hello,
How about refer to the LED_control_bm demo routine under SDK for lpc54628 ?
BR
Alice