#ifndef BSP_BOARD_H_
#define BSP_BOARD_H_

/**** Includes ****/
#include <stdint.h>

#include "mcu/mcu_hal.h"
#include "ain.h"
#include "din.h"
#include "dout.h"
#include "dio.h"
#include "halfbridge.h"
#include "pwm.h"

static bsp::AnalogIn dccd_i = bsp::AnalogIn(mcu::ADC0);
static bsp::AnalogIn dccd_u = bsp::AnalogIn(mcu::ADC1);
static bsp::AnalogIn bat_u = bsp::AnalogIn(mcu::ADC2);
static bsp::AnalogIn bat_i = bsp::AnalogIn(mcu::ADC3);
static bsp::Hafbridge hbridge =  bsp::Hafbridge(mcu::PWM0, mcu::GPIO15, 95);
static bsp::AnalogIn ain1 = bsp::AnalogIn(mcu::ADC5); // mode
static bsp::AnalogIn ain2 = bsp::AnalogIn(mcu::ADC4); // pot
static bsp::DigitalIn din1 = bsp::DigitalIn(mcu::GPIO0, 0, bsp::DIN_HIGH); //mode
static bsp::DigitalIn din2 = bsp::DigitalIn(mcu::GPIO1, 0, bsp::DIN_HIGH); //pot
static bsp::DigitalIn din3 = bsp::DigitalIn(mcu::GPIO2, 0, bsp::DIN_HIGH); //down
static bsp::DigitalIn din4 = bsp::DigitalIn(mcu::GPIO3, 0, bsp::DIN_HIGH); //up
static bsp::DigitalIn hvdin1 = bsp::DigitalIn(mcu::GPIO4, 1, bsp::DIN_LOW); //dimm
static bsp::DigitalIn hvdin2 = bsp::DigitalIn(mcu::GPIO5, 1, bsp::DIN_LOW); //brakes
static bsp::DigitalIn hvdin3 = bsp::DigitalIn(mcu::GPIO6, 1, bsp::DIN_LOW); //hbrake
static bsp::DigitalIO hvdin3_pull = bsp::DigitalIO(mcu::GPIO7, bsp::DIN_HIGH); //hbrake pull
static bsp::DigitalOut odout1 = bsp::DigitalOut(mcu::GPIO9,  1);
static bsp::DigitalOut odout2 = bsp::DigitalOut(mcu::GPIO10, 1);
static bsp::DigitalOut odout3 = bsp::DigitalOut(mcu::GPIO11, 1);
static bsp::DigitalOut odout4 = bsp::DigitalOut(mcu::GPIO12, 1);
static bsp::DigitalOut odout5 = bsp::DigitalOut(mcu::GPIO13, 1);
static bsp::DigitalOut odout6 = bsp::DigitalOut(mcu::GPIO14, 1);
static bsp::PWMout od_pwm = bsp::PWMout(mcu::PWM1);

void board_init(void);
void board_read(void);

#endif /* BSP_BOARD_H_ */