]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/src/rpp/rpp.c
Starting to implement AOUT RPP API, test application, etc.
[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 program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  * File : rpp.c
20  * Abstract:
21  *     RPP API library implementation file.
22  *
23  * References:
24  *     rpp.h
25  *     RPP API documentation.
26  */
27
28
29 #include "rpp/rpp.h"
30
31 #if rppCONFIG_DRV == 1
32 #include "drv/drv.h"
33 #endif
34
35 boolean_t initialized = FALSE;
36
37 int8_t rpp_init() {
38
39     if(initialized) {
40         return FAILURE;
41     }
42     initialized = TRUE;
43
44 #if rppCONFIG_INCLUDE_DIN == 1
45     rpp_din_init();
46 #endif
47
48 #if rppCONFIG_INCLUDE_LOUT == 1
49     rpp_lout_init();
50 #endif
51
52 #if rppCONFIG_INCLUDE_AIN == 1
53     rpp_ain_init();
54 #endif
55
56 #if rppCONFIG_INCLUDE_AOUT == 1
57     rpp_aout_init();
58 #endif
59
60 #if rppCONFIG_INCLUDE_HBR == 1
61     rpp_hbr_init();
62 #endif
63
64 #if rppCONFIG_INCLUDE_MOUT == 1
65     rpp_mout_init();
66 #endif
67
68 #if rppCONFIG_INCLUDE_HOUT == 1
69     rpp_hout_init();
70 #endif
71
72 #if rppCONFIG_INCLUDE_CAN == 1
73     rpp_can_init();
74 #endif
75
76 #if rppCONFIG_INCLUDE_LIN == 1
77     rpp_lin_init();
78 #endif
79
80 #if rppCONFIG_INCLUDE_FR == 1
81     rpp_fr_init();
82 #endif
83
84 #if rppCONFIG_INCLUDE_SCI == 1
85     rpp_sci_init();
86 #endif
87
88 #if rppCONFIG_INCLUDE_ETH == 1
89     rpp_eth_init();
90 #endif
91
92 #if rppCONFIG_INCLUDE_SDC == 1
93     rpp_sdc_init();
94 #endif
95
96 #if rppCONFIG_INCLUDE_SDR == 1
97     rpp_sdr_init();
98 #endif
99
100     // FIXME This is horrible
101     #if rppCONFIG_DRV == 1
102     dmmInit();
103     gioInit();
104     hetInit();
105     canInit();
106     linInit();
107     emif_SDRAMInit();
108     spi_tms570_init();
109
110     _enable_IRQ();
111     #endif
112
113    return SUCCESS;
114 }
115