]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/include/drv/_tms570_rpp/port_def.h
Uncrustify
[pes-rpp/rpp-lib.git] / rpp / include / drv / _tms570_rpp / 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 _TMS570_RPP_PORT_DEF_H
15 #define _TMS570_RPP_PORT_DEF_H
16
17 #include <stdint.h>
18
19 /* Port names */
20 enum port_id {
21         PORT_ID_DINMCU,
22         PORT_ID_DINSPI,
23         PORT_ID_HOUTDIAG,
24         PORT_ID_HOUTIN,
25         PORT_ID_HOUTIFBK,
26         PORT_ID_ADC,
27         PORT_ID_LOUT,
28         PORT_ID_DAC1_2,
29         PORT_ID_DAC3_4,
30         PORT_ID_DACDREF,
31         PORT_ID_HBR,
32         PORT_ID_FRAY1,
33         PORT_ID_FRAY2,
34         PORT_ID_MOUTEN,
35         PORT_ID_MOUTIN,
36
37         _PORT_COUNT,
38 };
39
40 #define PORT_ADC_CHANNELS 12
41
42 static double port_adc_lsb2volts(uint16_t lsb)
43 {
44         return ((double)lsb + 0.0)*2.5/4095*10;
45 }
46
47 #endif /* ifndef _TMS570_RPP_PORT_DEF_H */