PicoWAN SDK Documentation
|
LED driver. More...
#include <stdint.h>
Go to the source code of this file.
Enumerations | |
enum | led_state { LED_OFF = 0, LED_ON = 1, LED_BLINK = 2 } |
enum | led_mode { LED_ACTIVE_LOW = 0, LED_ACTIVE_HIGH = 1 } |
Functions | |
void | led_init (void) |
Initializes the LED driver. | |
void | led_set (uint8_t num, enum led_state state) |
Enables or disable an LED. More... | |
void | led_blink (uint8_t num, uint16_t led_on_mask, uint8_t repeat) |
Makes an LED blink. More... | |
enum led_state | led_get (uint8_t num) |
Gets the current state of an LED. More... | |
void | led_toggle (uint8_t num) |
Toggles an LED. More... | |
LED driver.
Copyright (c) 2018, Archos S.A. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND AND EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARCHOS S.A. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void led_blink | ( | uint8_t | num, |
uint16_t | led_on_mask, | ||
uint8_t | repeat | ||
) |
Makes an LED blink.
This function makes an LED blink. A timer will wake up 16 times in 1.2s, giving 16 slots where the LED can be on or off. Slots are numbered from 0 to 15 and last for 75 ms each.
num | The number of the LED. |
led_on_mask | A mask of all 16 slots. Set only the slots where the LED will be on. |
repeat | Number of repeats. 0 forever. |
enum led_state led_get | ( | uint8_t | num | ) |
Gets the current state of an LED.
num | The number of the LED. |
led_state | The current state of the LED. |
void led_set | ( | uint8_t | num, |
enum led_state | state | ||
) |
Enables or disable an LED.
num | The number of the LED. |
state | The new state of the LED. This can be LED_OFF, LED_ON, or LED_BLINK. |
void led_toggle | ( | uint8_t | num | ) |
Toggles an LED.
This function toggles an LED. A blinking LED will be toggled OFF.
num | The number of the LED. |