board.h 765 B

1234567891011121314151617181920212223242526
  1. #ifndef __BOARD_H
  2. #define __BOARD_H
  3. /* MACROs for SET, RESET or TOGGLE Output port */
  4. #define GPIO_HIGH(a,b) a->ODR |= b
  5. #define GPIO_LOW(a,b) a->ODR &= ~b
  6. #define GPIO_TOGGLE(a,b) a->ODR ^= b
  7. /* ADC */
  8. #define ADC_PORT GPIOD
  9. #define ADC_PINU GPIO_PIN_2
  10. #define ADC_CHNLU ADC1_CHANNEL_3
  11. #define ADC_SCHTU ADC1_SCHMITTTRIG_CHANNEL3
  12. #define ADC_PINI GPIO_PIN_3
  13. #define ADC_CHNLI ADC1_CHANNEL_4
  14. #define ADC_SCHTI ADC1_SCHMITTTRIG_CHANNEL4
  15. #define ADC_SMPLS 64
  16. // Supply voltage in mili volts
  17. #define ADC_VREF 3335
  18. // Сопротивление резисторов ОУ усилителя сигнала шунта
  19. #define CURRENT_MULT_TOP 3600
  20. #define CURRENT_MULT_BOT 680
  21. // shunt resistance in mili Ohms
  22. #define ADC_SHUNT 50
  23. #endif /* __BOARD_H */