#ifndef __BOARD_H
#define __BOARD_H

/* MACROs for SET, RESET or TOGGLE Output port */
#define GPIO_HIGH(a,b)    a->ODR |= b
#define GPIO_LOW(a,b)     a->ODR &= ~b
#define GPIO_TOGGLE(a,b)  a->ODR ^= b

/* ADC */
#define ADC_PORT  GPIOD
#define ADC_PINU  GPIO_PIN_2
#define ADC_CHNLU ADC1_CHANNEL_3
#define ADC_SCHTU ADC1_SCHMITTTRIG_CHANNEL3
#define ADC_PINI  GPIO_PIN_3
#define ADC_CHNLI ADC1_CHANNEL_4
#define ADC_SCHTI ADC1_SCHMITTTRIG_CHANNEL4
#define ADC_SMPLS 64
// Supply voltage in mili volts
#define ADC_VREF  3335
// Сопротивление резисторов ОУ усилителя сигнала шунта
#define CURRENT_MULT_TOP  3600
#define CURRENT_MULT_BOT  680
// shunt resistance in mili Ohms
#define ADC_SHUNT 50

#endif /* __BOARD_H */
