aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h
blob: ac017c7a7740d1995fb7ab4e645309fa8946df31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef DRIVERS_ADC_H_
#define DRIVERS_ADC_H_

#include <stdint.h>

//*****************************************************************************
//
// The following are indexes for values returned from the ADC's. These index's
// map directly to g_pui32ADCSeq[], and inside this array there is a directly
// ADC copied data
//*****************************************************************************

/*
//TODO remove this enum and define MAX_ADC_DEVICES acording to NUM_ADC_CHANNELS
typedef enum
{
    AIR_PRESSURE_1,
    AIR_PRESSURE_2,
    DISPENSE_PRESSURE_1,
    DISPENSE_PRESSURE_2,
    DISPENSE_PRESSURE_3,
    DISPENSE_PRESSURE_4,
    DISPENSE_PRESSURE_5,
    DISPENSE_PRESSURE_6,
    DISPENSE_PRESSURE_7,
    DISPENSE_PRESSURE_8,
    CHAN_VOCSENS,
    CHAN_SPARE1,
    CHAN_SPARE2,
    LEFT_DANCER_1,
    LEFT_DANCER_2,
    RIGHT_DANCER,
    DRYER_CURRENT_1,
    DRYER_CURRENT_2,
    DRYER_CURRENT_3,
    CHAN_3V3_FPGA,
    MAX_ADC_DEVICES  //must be the same as NUM_ADC_CHANNELS
}ADC_DATA_DEVICES;
*/
//max potentiometer read in I2C protocol

//extern uint8_t Num_ADC_Channels;
//#define NUM_ADC_CHANNELS Num_ADC_Channels

//#define NUM_ADC_CHANNELS        (sizeof(g_pui32ADCSeq) /                      \
//                                 sizeof(g_pui32ADCSeq[0]))

#define  MAX_ADC_DEVICES 20
//#define MAX_ADC_DEVICES NUM_ADC_CHANNELS

#define MAX_DIGITAL_POTENTIOMETER_READ		0x660D

typedef void (*ProcessCallback)(uint32_t*  adcData);

void ADCAcquireInit(void);

uint32_t ADC_TriggerCollection(void);

uint32_t ADC_GetReading(int DataItemId);

void ADCAcquireStart(ProcessCallback _callback, uint32_t _period);

void ADCAcquireStop(void);

void ADC0SS0Handler(void);

#endif /* DRIVERS_ADC_H_ */