adc.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. ******************************************************************************
  3. * @file VAPC-meter/lib/adc.h
  4. * @author "Vladimir N. Shilov" <shilow@ukr.net>
  5. * @version V1
  6. * @date 24-March-2016
  7. * @brief This file contains the headers of the ADC functions.
  8. ******************************************************************************
  9. */
  10. /* Define to prevent recursive inclusion -------------------------------------*/
  11. #pragma once
  12. #ifndef __ADC_H
  13. #define __ADC_H
  14. /* Includes ------------------------------------------------------------------*/
  15. #include "stm8l15x.h"
  16. /* Exported types ------------------------------------------------------------*/
  17. /* Exported defines ----------------------------------------------------------*/
  18. #define VOLTAGE_CHANNEL ADC_Channel_17
  19. #define CURRENT_CHANNEL ADC_Channel_18
  20. #define ADC1_DR_ADDRESS ((uint16_t)0x5344)
  21. #define BUFFER_SIZE ((uint8_t) 0x03)
  22. #define BUFFER_ADDRESS ((uint16_t)(&Buffer))
  23. /* Exported constants --------------------------------------------------------*/
  24. __near __no_init const unsigned char Factory_VREFINT @ 0x4910;
  25. /* Exported macro ------------------------------------------------------------*/
  26. /* Exported variables --------------------------------------------------------*/
  27. /* Exported functions ------------------------------------------------------- */
  28. void Init_ADC(void);
  29. #endif /* __ADC_H */
  30. /************************ (C) Vladimir N. Shilov *****END OF FILE****/