2 * IRC sensor signal input RPP API header file.
6 * @copyright Copyright (C) 2013-2014 Czech Technical University in Prague
15 * IRC sensor 1 connected on DIN10 and DIN11
20 * IRC sensor 2 connected on DIN14 and DIN15
25 * IRC module initialization.
27 * This function is not thread safe. Do not call it from multiple threads.
29 * Call this function before using this module.
31 * @return SUCCESS if initialization successful.\n
32 * FAILURE if module already initialized.
34 int8_t rpp_irc_init();
39 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
41 * Call this function to enable IRC.
42 * Reconfigures PINMUX register and enables N2HET program for specified IRC.
43 * After calling this method corresponding pins are not usable as DIN.
45 * @param[in] irc IRC sensor connection number.\n
46 * RPP_IRC_1 IRC connected to DIN10, DIN11\n
47 * RPP_IRC_2 IRC connected to DIN14, DIN15\n
49 * @return SUCCESS if IRC start is successful.\n
50 * -RPP_EINVAL if irc is out of range.\n
51 * FAILURE if modules is not initialized.
53 int8_t rpp_irc_enable(uint8_t irc);
58 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
60 * @param[in] irc IRC sensor connection number.\n
61 * RPP_IRC_1 IRC connected to DIN10, DIN11\n
62 * RPP_IRC_2 IRC connected to DIN14, DIN15\n
64 * @return 1 if IRC is running.\n
65 * 0 if IRC is not running.\n
66 * -RPP_EINVAL if irc is out of range.\n
67 * FAILURE if module is not initialized
69 int8_t rpp_irc_status(uint8_t irc);
72 * Get the current value.
74 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
76 * @param[in] irc IRC sensor connection number.\n
77 * RPP_IRC_1 IRC connected to DIN10, DIN11\n
78 * RPP_IRC_2 IRC connected to DIN14, DIN15\n
80 * @return Curent value or 0 if invalid irc is passed.
82 int32_t rpp_irc_get(uint8_t irc);
87 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
89 * Call this function to disable IRC.
90 * This function reenables the DIN functionality.
92 * @param[in] irc IRC sensor connection number.\n
93 * RPP_IRC_1 IRC connected to DIN10, DIN11\n
94 * RPP_IRC_2 IRC connected to DIN14, DIN15\n
96 * @return SUCCESS if IRC disable is successful.\n
97 * -RPP_EINVAL if irc is out of range.\n
98 * FAILURE if modules is not initialized.
100 int8_t rpp_irc_disable(uint8_t irc);
102 #endif /* __RPP_IRC_H_ */