KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
power.h
Go to the documentation of this file.
1 /*
2  * KM3NeT CLB v2 Firmware
3  * ----------------------
4  *
5  * Copyright 2013 KM3NeT Collaboration
6  *
7  * All Rights Reserved.
8  *
9  *
10  * File : power.h
11  * Created : 21 jan. 2014
12  * Author : Vincent van Beveren
13  */
14 
15 #ifndef POWER_H_
16 #define POWER_H_
17 
18 /**
19  * @file
20  *
21  * @ingroup modules
22  *
23  * This module provides access to the peripherals on the power board.
24  */
25 
26 
27 #include <stdint.h>
28 #include <stdbool.h>
29 
30 #define POWER_OVERFLOW 0x7FFFFFFF
31 #define POWER_UNDERFLOW 0x80000000
32 
33 #define POWER_12V_CUR 0
34 #define POWER_1V_CUR 1
35 #define POWER_1V8_CUR 2
36 #define POWER_2V5_CUR 3
37 #define POWER_3V3_CUR 4
38 #define POWER_5V_CUR 5
39 #define POWER_3V3PMT_CUR 6
40 #define POWER_VLED_CUR 7
41 #define POWER_VLED_LVL 8
42 #define POWER_12V_LVL 9
43 #define POWER_TEMP_LVL 10
44 #define POWER_1V_LVL 11
45 #define POWER_1V8_LVL 12
46 #define POWER_2V5_LVL 13
47 #define POWER_3V3_LVL 14
48 #define POWER_5V_LVL 15
49 #define POWER_3V3PMT_LVL 16
50 #define POWER_DACCTL_LVL 17
51 
52 #define POWER_COUNT 18
53 
54 #define POWER_VLED_MAX_MV 30026 //!< Maximum power which can be supplied to the LED.
55 
56 /**
57  * Initializes the powerboard.
58  *
59  * @retval true Success
60  * @retval false Failure, check error module for error.
61  */
62 bool pwrInit();
63 
64 
65 /**
66  * Initiates a conversion for the given channel. Levels are in mV, Currents in mA and
67  * temperature in mC.
68  *
69  * @param results Array of 18 entries filled with each value in milli units.
70  *
71  * @retval true Success
72  * @retval false Failure, check error module for error.
73  */
74 bool pwrMeasureAll(uint16_t * results);
75 
76 
77 /**
78  * Set the LED output in millivolts. 0 - POWER_VLED_MAX_MV.
79  *
80  * @param mv LED voltage
81  *
82  * @retval true Success
83  * @retval false Failure, see error module for error code and message.
84  */
85 bool pwrSetLED(uint32_t mv);
86 
87 
88 #endif /* NESTOR_H_ */
bool pwrMeasureAll(uint16_t *results)
Initiates a conversion for the given channel.
Definition: power.c:73
bool pwrInit()
Initializes the powerboard.
Definition: power.c:63
bool pwrSetLED(uint32_t mv)
Set the LED output in millivolts.
Definition: power.c:91