2 * Logic Output RPP API header file.
6 * @copyright Copyright (C) 2013 Czech Technical University in Prague
8 * @author Carlos Jenkins <carlos@jenkins.co.cr>
16 * LOUT module initialization.
18 * Call this method before using this module.
20 * This function is not thread safe. Do not call it from multiple threads.
22 * @return SUCCESS if initialization successful.\n
23 * FAILURE if module already initialized.
25 int8_t rpp_lout_init();
29 * Set the output cache of given pin to given value.
31 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
33 * Call rpp_lout_update() to flush cached values to real hardware.
35 * @param[in] pin The pin number to set [1-8].
36 * @param[in] val The value to be set [HIGH|LOW].
38 * @return SUCCESS when success.\n
39 * -1 if pin number is out of range.
41 int8_t rpp_lout_set(uint8_t pin, uint8_t val);
45 * Get the diagnostic cached value for given pin.
47 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
49 * Call rpp_lout_update() to update cached values.
51 * @param[in] pin The pin number to read [1-8].
53 * @return HIGH or LOW if successful.\n
54 * -1 if pin number is out of range.
56 int8_t rpp_lout_diag(uint8_t pin);
60 * Flush cached output values and read back diagnostic values of all pins.
62 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
64 * @return SUCCESS when transaction was successful.\n
65 * FAILURE if transaction could not be confirmed.
67 int8_t rpp_lout_update();
70 #endif /* __RPP_LOUT_H */