LED API: Difference between revisions
(Created page with "== Functions == The calling sequence is open>turn_on/turn_off/get_status>close === open === int led_open() Op...") |
|||
Line 30: | Line 30: | ||
{| | {| | ||
|- | |- | ||
| ''nLedIndex'' || Index of led, >= 0 && < MAX_LED_COUNT | | ''nLedIndex'' || unsigned int || Index of led, >= 0 && < MAX_LED_COUNT | ||
|} | |} | ||
'''Returns''' | '''Returns''' | ||
Line 44: | Line 44: | ||
{| | {| | ||
|- | |- | ||
| ''nLedIndex'' || Index of led, >= 0 && < MAX_LED_COUNT | | ''nLedIndex'' || unsigned int || Index of led, >= 0 && < MAX_LED_COUNT | ||
|} | |} | ||
'''Returns''' | '''Returns''' | ||
Line 58: | Line 58: | ||
{| | {| | ||
|- | |- | ||
| ''nLedIndex'' || Index of led, >= 0 && < MAX_LED_COUNT | | ''nLedIndex'' || unsigned int || Index of led, >= 0 && < MAX_LED_COUNT | ||
|} | |} | ||
'''Returns''' | '''Returns''' | ||
The result code, > 0, LED on; = 0, LED off; <0 [[Error_code|error code]]. | The result code, > 0, LED on; = 0, LED off; <0 [[Error_code|error code]]. |
Revision as of 07:16, 19 April 2018
Functions
The calling sequence is open>turn_on/turn_off/get_status>close
open
int led_open()
Open the LED device, which contains all the LEDs’ service. This operation should be used before other operations.
Parameters
Returns
The result code, >= 0, success; <0 error code.
close
int led_close()
Close the LED device, which contains all the LEDs’ service. The open and close apis are pair operations. If you don’t want to use this device, you should call the close api to release this device.
Parameters
Returns
The result code, >= 0, success; <0 error code.
turn_on
int led_on(unsigned int nLedIndex)
Turn on the specified LED.
Parameters
nLedIndex | unsigned int | Index of led, >= 0 && < MAX_LED_COUNT |
Returns
The result code, >= 0, success; <0 error code.
turn_off
int led_off(unsigned int nLedIndex)
Turn off the specified LED.
Parameters
nLedIndex | unsigned int | Index of led, >= 0 && < MAX_LED_COUNT |
Returns
The result code, >= 0, success; <0 error code.
get_status
int led_get_status(unsigned int nLedIndex)
Get the status of the specified LED.
Parameters
nLedIndex | unsigned int | Index of led, >= 0 && < MAX_LED_COUNT |
Returns
The result code, > 0, LED on; = 0, LED off; <0 error code.