#include <avr32/io.h>
#include "preprocessor.h"
#include "compiler.h"
#include "evk1105.h"
#include "led.h"
Data Structures | |
struct | tLED_DESCRIPTOR |
Structure describing LED hardware connections. More... | |
Macros | |
#define | INSERT_LED_DESCRIPTOR(LED_NO, unused) |
Functions | |
void | LED_Display (uint32_t leds) |
Sets the state of all LEDs. More... | |
void | LED_Display_Field (uint32_t field, uint32_t leds) |
Sets as a bit-field the state of the specified LEDs. More... | |
void | LED_Display_Mask (uint32_t mask, uint32_t leds) |
Sets the state of the specified LEDs. More... | |
uint8_t | LED_Get_Intensity (uint32_t led) |
Gets the intensity of the specified LED. More... | |
void | LED_Off (uint32_t leds) |
Turns off the specified LEDs. More... | |
void | LED_On (uint32_t leds) |
Turns on the specified LEDs. More... | |
uint32_t | LED_Read_Display (void) |
Gets the last state of all LEDs set through the LED API. More... | |
uint32_t | LED_Read_Display_Field (uint32_t field) |
Gets as a bit-field the last state of the specified LEDs set through the LED API. More... | |
uint32_t | LED_Read_Display_Mask (uint32_t mask) |
Gets the last state of the specified LEDs set through the LED API. More... | |
void | LED_Set_Intensity (uint32_t leds, uint8_t intensity) |
Sets the intensity of the specified LEDs. More... | |
bool | LED_Test (uint32_t leds) |
Tests the last state of the specified LEDs set through the LED API. More... | |
void | LED_Toggle (uint32_t leds) |
Toggles the specified LEDs. More... | |
Variables | |
static tLED_DESCRIPTOR | LED_DESCRIPTOR [LED_COUNT] |
Hardware descriptors of all LEDs. More... | |
static volatile uint32_t | LED_State = (1 << LED_COUNT) - 1 |
Saved state of all LEDs. More... | |
#define INSERT_LED_DESCRIPTOR | ( | LED_NO, | |
unused | |||
) |
void LED_Display | ( | uint32_t | leds | ) |
Sets the state of all LEDs.
leds | New state of all LEDs (1 bit per LED). |
References tLED_DESCRIPTOR::GPIO, LED_COUNT, LED_State, tLED_DESCRIPTOR::PIN_MASK, and tLED_DESCRIPTOR::PORT.
void LED_Display_Field | ( | uint32_t | field, |
uint32_t | leds | ||
) |
Sets as a bit-field the state of the specified LEDs.
field | LEDs of which to set the state (1 bit per LED). |
leds | New state of the specified LEDs (1 bit per LED, beginning with the first specified LED). |
References ctz, and LED_Display_Mask().
void LED_Display_Mask | ( | uint32_t | mask, |
uint32_t | leds | ||
) |
Sets the state of the specified LEDs.
mask | LEDs of which to set the state (1 bit per LED). |
leds | New state of the specified LEDs (1 bit per LED). |
References ctz, tLED_DESCRIPTOR::GPIO, LED_COUNT, LED_State, tLED_DESCRIPTOR::PIN_MASK, tLED_DESCRIPTOR::PORT, and Wr_bits.
Referenced by LED_Display_Field().
uint8_t LED_Get_Intensity | ( | uint32_t | led | ) |
Gets the intensity of the specified LED.
led | LED of which to get the intensity (1 bit per LED; only the least significant set bit is used). |
References tLED_DESCRIPTOR::CHANNEL, ctz, LED_COUNT, and tLED_DESCRIPTOR::PWM.
void LED_Off | ( | uint32_t | leds | ) |
Turns off the specified LEDs.
leds | LEDs to turn off (1 bit per LED). |
References Clr_bits, ctz, tLED_DESCRIPTOR::GPIO, LED_COUNT, LED_State, tLED_DESCRIPTOR::PIN_MASK, and tLED_DESCRIPTOR::PORT.
Referenced by main().
void LED_On | ( | uint32_t | leds | ) |
Turns on the specified LEDs.
leds | LEDs to turn on (1 bit per LED). |
References ctz, tLED_DESCRIPTOR::GPIO, LED_COUNT, LED_State, tLED_DESCRIPTOR::PIN_MASK, tLED_DESCRIPTOR::PORT, and Set_bits.
Referenced by main().
uint32_t LED_Read_Display | ( | void | ) |
Gets the last state of all LEDs set through the LED API.
References LED_State.
uint32_t LED_Read_Display_Field | ( | uint32_t | field | ) |
Gets as a bit-field the last state of the specified LEDs set through the LED API.
field | LEDs of which to get the state (1 bit per LED). |
References LED_State, and Rd_bitfield.
uint32_t LED_Read_Display_Mask | ( | uint32_t | mask | ) |
void LED_Set_Intensity | ( | uint32_t | leds, |
uint8_t | intensity | ||
) |
Sets the intensity of the specified LEDs.
leds | LEDs of which to set the intensity (1 bit per LED). |
intensity | New intensity of the specified LEDs (0x00 to 0xFF). |
References tLED_DESCRIPTOR::CHANNEL, ctz, tLED_DESCRIPTOR::FUNCTION, tLED_DESCRIPTOR::GPIO, LED_COUNT, tLED_DESCRIPTOR::PIN_MASK, tLED_DESCRIPTOR::PORT, and tLED_DESCRIPTOR::PWM.
bool LED_Test | ( | uint32_t | leds | ) |
Tests the last state of the specified LEDs set through the LED API.
leds | LEDs of which to test the state (1 bit per LED). |
true
if at least one of the specified LEDs has a state on, else false
.void LED_Toggle | ( | uint32_t | leds | ) |
Toggles the specified LEDs.
leds | LEDs to toggle (1 bit per LED). |
References ctz, tLED_DESCRIPTOR::GPIO, LED_COUNT, LED_State, tLED_DESCRIPTOR::PIN_MASK, tLED_DESCRIPTOR::PORT, and Tgl_bits.
|
static |
Hardware descriptors of all LEDs.
|
static |
Saved state of all LEDs.
Referenced by LED_Display(), LED_Display_Mask(), LED_Off(), LED_On(), LED_Read_Display(), LED_Read_Display_Field(), LED_Read_Display_Mask(), LED_Test(), and LED_Toggle().