1 /* Copyright (C) 2013-2014 Czech Technical University in Prague
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.
13 * IRC sensor input driver RPP API implementation file.
17 * RPP API documentation.
22 #if rppCONFIG_INCLUDE_IRC == 1
24 #if rppCONFIG_DRV == 1
25 #include "sys/ti_drv_het2.h"
26 #include "sys/sys_pinmux.h"
29 static boolean_t initialized = FALSE;
31 boolean_t rpp_irc1_enabled = FALSE;
32 boolean_t rpp_irc2_enabled = FALSE;
34 int8_t rpp_irc_init() {
40 #if rppCONFIG_DRV == 1
48 int8_t rpp_irc_enable(uint8_t irc) {
53 if (irc < 1 || irc > 2)
58 rpp_irc1_enabled = TRUE;
61 rpp_irc2_enabled = TRUE;
65 setMuxForIRC(irc, TRUE);
71 int8_t rpp_irc_status(uint8_t irc) {
76 if (irc < 1 || irc > 2)
81 return rpp_irc1_enabled ? 1 : 0;
83 return rpp_irc2_enabled ? 1 : 0;
88 int32_t rpp_irc_get(uint8_t irc) {
93 if (irc < 1 || irc > 2)
96 if (rpp_irc_status(irc) != 1)
99 #if rppCONFIG_DRV == 1
106 int8_t rpp_irc_disable(uint8_t irc) {
111 if (irc < 1 || irc > 2)
114 if (rpp_irc_status(irc) != 1)
118 setMuxForIRC(irc, FALSE);
121 rpp_irc1_enabled = FALSE;
124 rpp_irc2_enabled = FALSE;
130 #endif /* rppCONFIG_INCLUDE_IRC */