#ifndef __USER_MISC_H__
#define __USER_MISC_H__

#ifdef __cplusplus
 extern "C" {
#endif

#include "stm32f4xx.h"

#define PORT_LED  (GPIOB)
#define LED1      (GPIO_Pin_12)
#define LED2      (GPIO_Pin_13)

#define PORT_HEAT (GPIOB)
#define PIN_HEAT  (GPIO_Pin_1)

#define GAS_ID_REF     0
#define GAS_ID_INVALID 0xFFFFFFFF

#define GAS_COMB_NULL 0
#define GAS_COMB_1_1  1
#define GAS_COMB_2_2  2
#define GAS_COMB_3_1  3
#define GAS_COMB_2_1  4

struct data_gas_info_s {
    uint32_t id[4];
    uint8_t ref[4];
    uint8_t comb;
};

extern struct data_gas_info_s data_gas_info;

void led_init(uint16_t led);
void led_off(uint16_t led);
void led_on(uint16_t led);
void led_toggle(uint16_t led);

void heat_init(void);
void heat_on(void);
void heat_off(void);

void gas_id_init(void);

#ifdef __cplusplus
}
#endif

#endif /* __USER_MISC_H__ */
