12345678910111213141516171819202122232425262728293031323334353637383940 |
- /**
- ******************************************************************************
- * @file VAPC-meter/lib/adc.h
- * @author "Vladimir N. Shilov" <shilow@ukr.net>
- * @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****/
|