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.

78 lines
3.6 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_add(uint32_t adc_channel);
/***********************************************************************
* BRIEF: *
* INFORMATION: *
***********************************************************************/
void adc_start();
/***********************************************************************
* BRIEF: *
* INFORMATION: *
***********************************************************************/
uint32_t adc_read_int();
/***********************************************************************
* BRIEF: *
* INFORMATION: *
***********************************************************************/
//void HAL_ADC_ConvCpltCallback();
/***********************************************************************
* BRIEF: *
* INFORMATION: *
***********************************************************************/
//void D**MA2_Stream4_IRQHandler();
/***********************************************************************
* BRIEF: *
* INFORMATION: *
***********************************************************************/
void ADC_IRQHandler();
#endif /* DRIVERS_ADC_H_ */