1.1 diff -r 745037d69d81 -r 3e775df109e6 include/liblpfk.h 1.2 --- a/include/liblpfk.h Tue Aug 26 12:45:33 2008 +0100 1.3 +++ b/include/liblpfk.h Tue Aug 26 13:18:18 2008 +0100 1.4 @@ -69,7 +69,8 @@ 1.5 LPFK_E_PORT_OPEN, ///< Could not open comm port. 1.6 LPFK_E_NOT_PRESENT, ///< LPFK not present on specified port. 1.7 LPFK_E_COMMS, ///< Communication error. 1.8 - LPFK_E_PARAM ///< Invalid function parameter. 1.9 + LPFK_E_PARAM, ///< Invalid function parameter. 1.10 + LPFK_E_NOT_ENABLED ///< Attempt to read key when LPFK disabled 1.11 }; 1.12 1.13 /** 1.14 @@ -99,12 +100,40 @@ 1.15 int lpfk_enable(LPFK_CTX *ctx, int val); 1.16 1.17 /** 1.18 + * @brief Set or clear an LED in the cached LED mask buffer. 1.19 + * @param ctx Pointer to an LPFK_CTX struct initialised by lpfk_open(). 1.20 + * @param num LED/key number, from 0 to 31. 1.21 + * @param state State, true for on, false for off. 1.22 + * @return LPFK_E_OK on success, LPFK_E_PARAM on bad parameter, LPFK_E_COMMS 1.23 + * on comms error. 1.24 + */ 1.25 +int lpfk_set_led_cached(LPFK_CTX *ctx, const int num, const int state); 1.26 + 1.27 +/** 1.28 + * @brief Set or clear all the LEDs in the shadow register. 1.29 + * @param ctx Pointer to an LPFK_CTX struct initialised by lpfk_open(). 1.30 + * @param state State, true for on, false for off. 1.31 + * @return LPFK_E_OK on success. 1.32 + */ 1.33 +int lpfk_set_leds_cached(LPFK_CTX *ctx, const int state); 1.34 + 1.35 +/** 1.36 + * @brief Set the LPFK's LED state from the cached LED mask. 1.37 + * @param ctx Pointer to an LPFK_CTX struct initialised by lpfk_open(). 1.38 + * @return LPFK_E_OK on success, LPFK_E_PARAM on bad parameter, LPFK_E_COMMS 1.39 + * on comms error. 1.40 + */ 1.41 +int lpfk_update_leds(LPFK_CTX *ctx); 1.42 + 1.43 +/** 1.44 * @brief Set or clear an LED on the LPFK. 1.45 * @param ctx Pointer to an LPFK_CTX struct initialised by lpfk_open(). 1.46 * @param num LED/key number, from 0 to 31. 1.47 * @param state State, true for on, false for off. 1.48 * @return LPFK_E_OK on success, LPFK_E_PARAM on bad parameter, LPFK_E_COMMS 1.49 * on comms error. 1.50 + * @note Equivalent to a call to lpfk_set_led_cached() followed by a call 1.51 + * to lpfk_update_leds(). 1.52 */ 1.53 int lpfk_set_led(LPFK_CTX *ctx, const int num, const int state); 1.54 1.55 @@ -114,6 +143,8 @@ 1.56 * @param state State, true for on, false for off. 1.57 * @return LPFK_E_OK on success, LPFK_E_PARAM on bad parameter, LPFK_E_COMMS 1.58 * on comms error. 1.59 + * @note Equivalent to a call to lpfk_set_leds_cached() followed by a call 1.60 + * to lpfk_update_leds(). 1.61 */ 1.62 int lpfk_set_leds(LPFK_CTX *ctx, const int state); 1.63