]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/include/drv/_tms570_hydctr/port_def.h
b264b88fd152c6e55963c6cacd08999dff2471c2
[pes-rpp/rpp-lib.git] / rpp / include / drv / _tms570_hydctr / port_def.h
1 /*
2  * Copyright (C) 2015 Czech Technical University in Prague
3  *
4  * Authors:
5  *     - Michal Sojka <sojkam1@fel.cvut.cz>
6  *
7  * This document contains proprietary information belonging to Czech
8  * Technical University in Prague. Passing on and copying of this
9  * document, and communication of its contents is not permitted
10  * without prior written authorization.
11  *
12  */
13
14 #ifndef DRV_TGT_PORT_DEF_H
15 #define DRV_TGT_PORT_DEF_H
16
17 #include <stdint.h>
18
19 /* Port names */
20 enum port_id {
21         PORT_ID_GIOA,
22         PORT_ID_GIOB,
23         PORT_ID_NHET1,
24         PORT_ID_ADC,
25         PORT_ID_THERMISTOR1,
26         PORT_ID_THERMISTOR2,
27         PORT_ID_ADC_COND,
28         PORT_ID_POWER_SUPPLY,
29         PORT_ID_SENSOR_SUPPLY,
30         PORT_ID_DAC_ADC_LOOPBACK,
31         _PORT_COUNT,
32 };
33
34 #define PORT_ADC_CHANNELS 16
35
36 static double port_adc_lsb2volts(uint16_t lsb)
37 {
38         return ((double)lsb + 0.0)*2.5/4095*2;
39 }
40
41 #endif