include/liblpfk.h

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