#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_RAW        (0 * 4)
#define DEBUG_CH_QUADRATIC  (1 * 4)
#define DEBUG_CH_MEDIAN     (2 * 4)
#define DEBUG_CH_WINDOW     (3 * 4)
// #define DEBUG_CH_ADC_RAW    (4 * 4)
// #define DEBUG_CH_ADC_FILTER (5 * 4)
#define DEBUG_CHAN_MAX      (4 * 4)

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__ */
