#include "hdl_led.h"

#define LED_PORT (GPIO_PORT_H)
#define LED_PIN (GPIO_PIN_02)

void hdl_led_init(void){

    LL_PERIPH_WE(LL_PERIPH_GPIO);

    stc_gpio_init_t stcGpioInit={0};

    //GPIO_StructInit(&stcGpioInit);
    
    stcGpioInit.u16PinDir = PIN_DIR_OUT;

    stcGpioInit.u16PinState = PIN_STAT_SET;

    stcGpioInit.u16PinDrv = PIN_HIGH_DRV;
        
    (void)GPIO_Init( LED_PORT ,LED_PIN, &stcGpioInit);
  
    LL_PERIPH_WP(LL_PERIPH_GPIO);
    
}

void hdl_led_on(hdl_led_id_t id){
    
    GPIO_SetPins(LED_PORT ,LED_PIN );
}

void hdl_led_off(hdl_led_id_t id){

    GPIO_ResetPins(LED_PORT ,LED_PIN);
}

void hdl_led_toggle(hdl_led_id_t id){

   GPIO_ResetPins(LED_PORT ,LED_PIN);
}

