]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/src/rpp/rpp.c
Change the license from GPL to proprietary
[pes-rpp/rpp-lib.git] / rpp / src / rpp / rpp.c
1 /* Copyright (C) 2013 Czech Technical University in Prague
2  *
3  * Authors:
4  *     - Carlos Jenkins <carlos@jenkins.co.cr>
5  *
6  * This document contains proprietary information belonging to Czech
7  * Technical University in Prague. Passing on and copying of this
8  * document, and communication of its contents is not permitted
9  * without prior written authorization.
10  *
11  * File : rpp.c
12  * Abstract:
13  *     RPP API library implementation file.
14  *
15  * References:
16  *     rpp.h
17  *     RPP API documentation.
18  */
19
20
21 #include "rpp/rpp.h"
22
23 #if rppCONFIG_DRV == 1
24 #include "drv/drv.h"
25 #endif
26
27 boolean_t initialized = FALSE;
28
29 int8_t rpp_init() {
30
31     if(initialized) {
32         return FAILURE;
33     }
34     initialized = TRUE;
35
36     // FIXME This is horrible
37     #if rppCONFIG_DRV == 1
38     dmmInit();
39     gioInit();
40     hetInit();
41     canInit();
42     linInit();
43     spi_tms570_init();
44     #endif
45
46     #if rppCONFIG_INCLUDE_DIN == 1
47     rpp_din_init();
48     #endif
49
50     #if rppCONFIG_INCLUDE_LOUT == 1
51     rpp_lout_init();
52     #endif
53
54     #if rppCONFIG_INCLUDE_ADC == 1
55     rpp_adc_init();
56     #endif
57
58     #if rppCONFIG_INCLUDE_DAC == 1
59     rpp_dac_init();
60     #endif
61
62     #if rppCONFIG_INCLUDE_HBR == 1
63     rpp_hbr_init();
64     #endif
65
66     #if rppCONFIG_INCLUDE_MOUT == 1
67     rpp_mout_init();
68     #endif
69
70     #if rppCONFIG_INCLUDE_HOUT == 1
71     rpp_hout_init();
72     #endif
73
74     #if rppCONFIG_INCLUDE_LIN == 1
75     rpp_lin_init();
76     #endif
77
78     #if rppCONFIG_INCLUDE_SCI == 1
79     rpp_sci_init();
80     #endif
81
82     #if rppCONFIG_INCLUDE_ETH == 1
83     rpp_eth_init();
84     #endif
85
86     #if rppCONFIG_INCLUDE_SDC == 1
87     rpp_sdc_init();
88     #endif
89
90     #if rppCONFIG_INCLUDE_SDR == 1
91     rpp_sdr_init();
92     #endif
93
94     #if rppCONFIG_DRV == 1
95     _enable_IRQ();
96     #endif
97
98    return SUCCESS;
99 }