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
25 #define setMuxForIRC(a, b)
30 static boolean_t initialized = FALSE;
32 boolean_t rpp_irc1_enabled = FALSE;
33 boolean_t rpp_irc2_enabled = FALSE;
41 #ifndef FREERTOS_POSIX
49 int8_t rpp_irc_enable(uint8_t irc)
55 if (irc < 1 || irc > 2)
60 rpp_irc1_enabled = TRUE;
63 rpp_irc2_enabled = TRUE;
67 setMuxForIRC(irc, TRUE);
73 int8_t rpp_irc_status(uint8_t irc)
79 if (irc < 1 || irc > 2)
84 return rpp_irc1_enabled ? 1 : 0;
86 return rpp_irc2_enabled ? 1 : 0;
91 int32_t rpp_irc_get(uint8_t irc)
97 if (irc < 1 || irc > 2)
100 if (rpp_irc_status(irc) != 1)
103 #ifndef FREERTOS_POSIX
110 int8_t rpp_irc_disable(uint8_t irc)
116 if (irc < 1 || irc > 2)
119 if (rpp_irc_status(irc) != 1)
123 setMuxForIRC(irc, FALSE);
126 rpp_irc1_enabled = FALSE;
129 rpp_irc2_enabled = FALSE;