#ifndef LED_H
#define LED_H

#include "gd32f30x.h"
/* exported types */
typedef enum 
{
    LED_DEV = 0,
		LED_485STATE,
		LED_NETSTATE
} led_typedef_enum;


/* eval board low layer led */
#define LEDn                             3U

#define LED_DEV_PIN                      GPIO_PIN_4
#define LED_DEV_GPIO_PORT                GPIOB
#define LED_DEV_GPIO_CLK                 RCU_GPIOB

#define LED_485STATE_PIN                 GPIO_PIN_2
#define LED_485STATE_GPIO_PORT           GPIOD
#define LED_485STATE_GPIO_CLK            RCU_GPIOD

#define LED_NETSTATE_PIN                 GPIO_PIN_3
#define LED_NETSTATE_GPIO_PORT           GPIOB
#define LED_NETSTATE_GPIO_CLK            RCU_GPIOB
/* configure led GPIO */
void gd_eval_led_init(led_typedef_enum lednum);
/* turn on selected led */
void gd_eval_led_on(led_typedef_enum lednum);
/* turn off selected led */
void gd_eval_led_off(led_typedef_enum lednum);
/* toggle the selected led */
void gd_eval_led_toggle(led_typedef_enum lednum);

#endif
