/** ****************************************************************************** * @file VAPC-meter/lib/adc.h * @author "Vladimir N. Shilov" * @version V1 * @date 24-March-2016 * @brief This file contains the headers of the ADC functions. ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #pragma once #ifndef __ADC_H #define __ADC_H /* Includes ------------------------------------------------------------------*/ #include "stm8l15x.h" /* Exported types ------------------------------------------------------------*/ /* Exported defines ----------------------------------------------------------*/ #define VOLTAGE_CHANNEL ADC_Channel_17 #define CURRENT_CHANNEL ADC_Channel_18 #define ADC1_DR_ADDRESS ((uint16_t)0x5344) #define BUFFER_SIZE ((uint8_t) 0x03) #define BUFFER_ADDRESS ((uint16_t)(&Buffer)) // (Частота МК (16 МHz) / Предделитель таймера (128) * Нужное время в секундах (0.01)) - 1 #define TIM_PERIOD ((uint16_t)1249) /* Exported constants --------------------------------------------------------*/ __near __no_init const unsigned char Factory_VREFINT @ 0x4910; /* Exported macro ------------------------------------------------------------*/ /* Exported variables --------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void Init_ADC(void); #endif /* __ADC_H */ /************************ (C) Vladimir N. Shilov *****END OF FILE****/