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 #ifndef FREERTOS_POSIX
23 #include "sys/ti_drv_het2.h"
24 #include "sys/sys_pinmux.h"
26 #define setMuxForIRC(a, b)
31 static boolean_t initialized = FALSE;
33 boolean_t rpp_irc1_enabled = FALSE;
34 boolean_t rpp_irc2_enabled = FALSE;
42 #ifndef FREERTOS_POSIX
50 int8_t rpp_irc_enable(uint8_t irc)
56 if (irc < 1 || irc > 2)
61 rpp_irc1_enabled = TRUE;
64 rpp_irc2_enabled = TRUE;
68 setMuxForIRC(irc, TRUE);
74 int8_t rpp_irc_status(uint8_t irc)
80 if (irc < 1 || irc > 2)
85 return rpp_irc1_enabled ? 1 : 0;
87 return rpp_irc2_enabled ? 1 : 0;
92 int32_t rpp_irc_get(uint8_t irc)
98 if (irc < 1 || irc > 2)
101 if (rpp_irc_status(irc) != 1)
104 #ifndef FREERTOS_POSIX
111 int8_t rpp_irc_disable(uint8_t irc)
117 if (irc < 1 || irc > 2)
120 if (rpp_irc_status(irc) != 1)
124 setMuxForIRC(irc, FALSE);
127 rpp_irc1_enabled = FALSE;
130 rpp_irc2_enabled = FALSE;