#ifndef __DEBUG_H__
#define __DEBUG_H__

#ifdef __cplusplus
 extern "C" {
#endif

#include "stm32f4xx.h"

#define DEBUG_ENABLE (1)

#define DEBUG_UART_PORT     (GPIOC)
#define DEBUG_UART_PIN      (GPIO_Pin_6)
#define DEBUG_UART_BAUDRATE (2 * 1000 * 1000)

#define DEBUG_CH_REF        (0)
#define DEBUG_CH_SIG        (1)
#define DEBUG_CH_CNT        (2)
#define DEBUG_CHAN_MAX      (3)

struct debug_data_s {
    uint8_t enable;
    uint8_t busy;
};

extern struct debug_data_s debug_data;

void debug_init(void);
void debug_send_frame(void);
void debug_write_data(uint16_t ch, float data);

#ifdef __cplusplus
}
#endif

#endif /* __DEBUG_H__ */
