]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/src/rpp/rpp.c
2967907cf8dcc73c8c6048c972430d9539ee5808
[pes-rpp/rpp-lib.git] / rpp / src / rpp / rpp.c
1 /* Copyright (C) 2013, 2015 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 #ifndef FREERTOS_POSIX
24 #include "drv/drv.h"
25 #endif
26
27 static boolean_t rpp_initialized = FALSE;
28
29 int8_t rpp_init()
30 {
31
32         if (rpp_initialized)
33                 return FAILURE;
34         rpp_initialized = TRUE;
35
36 #ifndef FREERTOS_POSIX
37
38         dmmInit();
39         gioInit();
40         hetInit();
41         rpp_adc_init();
42         rpp_sci_init();
43 #if defined(TARGET_TMS570_RPP)
44         linInit();
45         rpp_din_init();
46         rpp_lout_init();
47         rpp_dac_init();
48         rpp_hbr_init();
49         rpp_mout_init();
50         rpp_hout_init();
51         rpp_lin_init();
52         rpp_sdr_init();
53         rpp_irc_init();
54         rpp_eth_init();
55 #endif
56         rpp_gio_init(RPP_GIO_PORT_ALL);
57 #ifdef TARGET_HAS_SPI
58         rpp_spi_init();
59 #endif
60         _enable_IRQ();
61
62 #endif
63
64         return SUCCESS;
65 }