KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
xadc.h
Go to the documentation of this file.
1 /*
2  * KM3NeT CLB v2 Firmware
3  * ----------------------
4  *
5  * Copyright 2014 KM3NeT Collaboration
6  *
7  * All Rights Reserved.
8  *
9  *
10  * File : xadc.h
11  * Created : 15 apr 2014
12  * Author : Riccardo Travaglini
13  */
14 
15 
16 #ifndef XADC_H_
17 #define XADC_H_
18 
19 #include <stdint.h>
20 #include <stdbool.h>
21 #include "lm32soc/dev_soc.h"
22 
23 /**
24  * @file
25  *
26  * @ingroup wbdrivers
27  *
28  * XADC Driver.
29  */
30 
31 typedef enum
32 {
33  xadcChanTemp = 0,
34  xadcChanVccInt,
35  xadcChanVccAux,
36  xadcChanVccBRAM,
37  xadcChanOT
38 } XadcChan;
39 
40 typedef enum
41 {
42  xadcTypeCur = 0,
43  xadcTypeMax,
44  xadcTypeMin
45 } XadcType;
46 
47 typedef enum
48 {
49  xadcAvgOff,
50  xadcAvg16,
51  xadcAvg64,
52  xadcAvg256
53 } XadcAvg;
54 
55 typedef enum
56 {
57  xadcPowerStateUp,
58  xadcPowerStateDown,
59  xadcPowerStateBDown
60 } XadcPowerState;
61 
62 typedef enum
63 {
64  xadcModeDefault,
65  xadcModeAutoSequence
66 } XadcMode;
67 
68 uint16_t xadcGetMeas(XadcChan ch, XadcType ty);
69 
70 bool xadcGetAlarm(XadcChan ch);
71 
72 void xadcSetAveraging(XadcAvg av);
73 
74 XadcAvg xadcGetAveraging();
75 
76 void xadcEnaAlarm(XadcChan ch, bool enable);
77 
78 void xadcPowerDown(XadcPowerState ps);
79 
80 bool xadcSetAlarmValue(XadcChan ch, XadcType ty, uint16_t val);
81 //bool XadcGetAlarmFlag(enum CHAN ch,bool resetFlag);
82 
83 void xadcSetMode(XadcMode mo);
84 
85 #endif /* XADC_H_ */
86 
This file assigns all device structures to memory mapped structures.