This repository has been archived on 2020-06-14. You can view files and clone it, but cannot push or open issues or pull requests.

55 lines
2.4 KiB
C

/*
* ADC.h
*
* Created on: 13 sep. 2016
* Author: Philip
*/
/**********************************************************************
* NAME: adc.h *
* PURPOSE: Set up and read from ADC *
* INFORMATION: *
* How to use this driver is explained in page 107 of HAL driver *
* Enable the ADC clock *
* Enable the GPIO clock for the pin wanted *
* Configure the GPIO pin as analog input *
* Configure the ADC speed (prescaler/sampling time) *
* Enable continuous measurement mode *
* *
* Read more at: www.visualgdb.com/tutorials/arm/stm32/adc/ *
* *
* GLOBAL VARIABLES: *
* Variable Type Description *
* -------- ---- ----------- *
* *
**********************************************************************/
#ifndef DRIVERS_ADC_H_
#define DRIVERS_ADC_H_
#include "stm32f4xx.h"
/***********************************************************************
* BRIEF: *
* INFORMATION: *
***********************************************************************/
void adc_configure();
/***********************************************************************
* BRIEF: *
* INFORMATION: *
***********************************************************************/
void adc_pin_config(ADC_HandleTypeDef * g_AdcHandle, uint32_t adc_channel);
/***********************************************************************
* BRIEF: *
* INFORMATION: *
***********************************************************************/
uint32_t adc_read_int(ADC_HandleTypeDef * g_AdcHandle);
#endif /* DRIVERS_ADC_H_ */