ATMEL: Leds Management

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# Leds Management
[STK525]

Macros to manage Leds on STK525. More...

## Defines

#define | LED_PORT PORTD
#define | LED_DDR DDRD
#define | LED_PIN PIND
#define | LED0_BIT PIND4
#define | LED1_BIT PIND5
#define | LED2_BIT PIND6
#define | LED3_BIT PIND7
#define | Leds_init() (LED_DDR |= (1<<LED0_BIT) | (1<<LED1_BIT) | (1<<LED2_BIT) | (1<<LED3_BIT))
#define | Leds_on() (LED_PORT |= (1<<LED0_BIT) | (1<<LED1_BIT) | (1<<LED2_BIT) | (1<<LED3_BIT))
#define | Leds_off() (LED_PORT &= ~((1<<LED0_BIT) | (1<<LED1_BIT) | (1<<LED2_BIT) | (1<<LED3_BIT)))
#define | Leds_set_val(c) (Leds_off(),LED_PORT |= (c<<4)&((1<<LED0_BIT) | (1<<LED1_BIT) | (1<<LED2_BIT) | (1<<LED3_BIT)))
#define | Leds_get_val() (LED_PORT>>4)
#define | Led0_on() (LED_PORT |= (1<<LED0_BIT))
#define | Led1_on() (LED_PORT |= (1<<LED1_BIT))
#define | Led2_on() (LED_PORT |= (1<<LED2_BIT))
#define | Led3_on() (LED_PORT |= (1<<LED3_BIT))
#define | Led0_off() (LED_PORT &= ~(1<<LED0_BIT))
#define | Led1_off() (LED_PORT &= ~(1<<LED1_BIT))
#define | Led2_off() (LED_PORT &= ~(1<<LED2_BIT))
#define | Led3_off() (LED_PORT &= ~(1<<LED3_BIT))
#define | Led0_toggle() (LED_PIN |= (1<<LED0_BIT))
#define | Led1_toggle() (LED_PIN |= (1<<LED1_BIT))
#define | Led2_toggle() (LED_PIN |= (1<<LED2_BIT))
#define | Led3_toggle() (LED_PIN |= (1<<LED3_BIT))
#define | Is_led0_on() (LED_PIN & (1<<LED0_BIT) ? TRUE : FALSE)
#define | Is_led1_on() (LED_PIN & (1<<LED1_BIT) ? TRUE : FALSE)
#define | Is_led2_on() (LED_PIN & (1<<LED2_BIT) ? TRUE : FALSE)
#define | Is_led3_on() (LED_PIN & (1<<LED3_BIT) ? TRUE : FALSE)

## Detailed Description

Macros to manage Leds on STK525.

## Define Documentation

#define LED_PORT PORTD

Definition at line 63 of file stk_525.h.

#define LED_DDR DDRD

Definition at line 64 of file stk_525.h.

#define LED_PIN PIND

Definition at line 65 of file stk_525.h.

#define LED0_BIT PIND4

Definition at line 66 of file stk_525.h.

#define LED1_BIT PIND5

Definition at line 67 of file stk_525.h.

#define LED2_BIT PIND6

Definition at line 68 of file stk_525.h.

#define LED3_BIT PIND7

Definition at line 69 of file stk_525.h.

#define Leds_init | ( |  | ) | (LED_DDR |= (1<<LED0_BIT) | (1<<LED1_BIT) | (1<<LED2_BIT) | (1<<LED3_BIT))

Definition at line 71 of file stk_525.h.

Referenced by device_mouse_task_init(), hid_task_init(), host_dfu_task_init(), host_mouse_task_init(), host_ms_task_init(), and storage_task_init().

#define Leds_on | ( |  | ) | (LED_PORT |= (1<<LED0_BIT) | (1<<LED1_BIT) | (1<<LED2_BIT) | (1<<LED3_BIT))

Definition at line 72 of file stk_525.h.

Referenced by dfu_flush_prog().

#define Leds_off | ( |  | ) | (LED_PORT &= ~((1<<LED0_BIT) | (1<<LED1_BIT) | (1<<LED2_BIT) | (1<<LED3_BIT)))

Definition at line 73 of file stk_525.h.

Referenced by hid_report_out(), host_hid_task(), and host_mouse_task().

#define Leds_set_val | ( | c |  | ) | (Leds_off(),LED_PORT |= (c<<4)&((1<<LED0_BIT) | (1<<LED1_BIT) | (1<<LED2_BIT) | (1<<LED3_BIT)))

Definition at line 74 of file stk_525.h.

Referenced by hid_report_out().

#define Leds_get_val | ( |  | ) | (LED_PORT>>4)

Definition at line 75 of file stk_525.h.

Referenced by hid_report_in().

#define Led0_on | ( |  | ) | (LED_PORT |= (1<<LED0_BIT))

Definition at line 77 of file stk_525.h.

Referenced by hid_report_out(), host_dfu_task(), host_mouse_task(), and host_ms_task().

#define Led1_on | ( |  | ) | (LED_PORT |= (1<<LED1_BIT))

Definition at line 78 of file stk_525.h.

Referenced by hid_report_out(), host_mouse_task(), and host_ms_task().

#define Led2_on | ( |  | ) | (LED_PORT |= (1<<LED2_BIT))

Definition at line 79 of file stk_525.h.

Referenced by hid_report_out(), host_dfu_task(), and host_mouse_task().

#define Led3_on | ( |  | ) | (LED_PORT |= (1<<LED3_BIT))

Definition at line 80 of file stk_525.h.

Referenced by hid_report_out(), and host_mouse_task().

#define Led0_off | ( |  | ) | (LED_PORT &= ~(1<<LED0_BIT))

Definition at line 81 of file stk_525.h.

Referenced by dfu_load_hex(), hid_report_out(), host_dfu_task(), host_mouse_task(), and host_ms_task().

#define Led1_off | ( |  | ) | (LED_PORT &= ~(1<<LED1_BIT))

Definition at line 82 of file stk_525.h.

Referenced by hid_report_out(), host_mouse_task(), and host_ms_task().

#define Led2_off | ( |  | ) | (LED_PORT &= ~(1<<LED2_BIT))

Definition at line 83 of file stk_525.h.

Referenced by hid_report_out(), host_dfu_task(), and host_mouse_task().

#define Led3_off | ( |  | ) | (LED_PORT &= ~(1<<LED3_BIT))

Definition at line 84 of file stk_525.h.

Referenced by hid_report_out(), host_mouse_task(), and host_ms_task().

#define Led0_toggle | ( |  | ) | (LED_PIN |= (1<<LED0_BIT))

Definition at line 85 of file stk_525.h.

Referenced by dfu_flush_prog().

#define Led1_toggle | ( |  | ) | (LED_PIN |= (1<<LED1_BIT))

Definition at line 86 of file stk_525.h.

#define Led2_toggle | ( |  | ) | (LED_PIN |= (1<<LED2_BIT))

Definition at line 87 of file stk_525.h.

#define Led3_toggle | ( |  | ) | (LED_PIN |= (1<<LED3_BIT))

Definition at line 88 of file stk_525.h.

Referenced by host_sof_action().

#define Is_led0_on | ( |  | ) | (LED_PIN & (1<<LED0_BIT) ? TRUE : FALSE)

Definition at line 89 of file stk_525.h.

#define Is_led1_on | ( |  | ) | (LED_PIN & (1<<LED1_BIT) ? TRUE : FALSE)

Definition at line 90 of file stk_525.h.

#define Is_led2_on | ( |  | ) | (LED_PIN & (1<<LED2_BIT) ? TRUE : FALSE)

Definition at line 91 of file stk_525.h.

#define Is_led3_on | ( |  | ) | (LED_PIN & (1<<LED3_BIT) ? TRUE : FALSE)

Definition at line 92 of file stk_525.h.