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

# stk_525.h File Reference

`#include "config.h"`

Include dependency graph for stk_525.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## 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)
#define | Joy_init() (DDRB &= ~((1<<PINB7)|(1<<PINB6)|(1<<PINB5)), PORTB |= ((1<<PINB7)|(1<<PINB6)|(1<<PINB5)), DDRE &= ~((1<<PINE5)|(1<<PINE4)), PORTE |= ((1<<PINE5)|(1<<PINE4)))
#define | Is_btn_left() Is_hwb()
#define | Is_btn_middle() ((PINB & (1<<PINB5)) ? FALSE : TRUE)
#define | Is_btn_right() FALSE
#define | Is_joy_left() ((PINB & (1<<PINB6)) ? FALSE : TRUE)
#define | Is_joy_up() ((PINB & (1<<PINB7)) ? FALSE : TRUE)
#define | Is_joy_down() ((PINE & (1<<PINE5)) ? FALSE : TRUE)
#define | Is_joy_right() ((PINE & (1<<PINE4)) ? FALSE : TRUE)
#define | Is_btn_not_left() Is_not_hwb()
#define | Is_btn_not_middle() ((PINB & (1<<PINB5)) ? TRUE : FALSE)
#define | Is_btn_not_right() TRUE
#define | Is_joy_not_up() ((PINB & (1<<PINB7)) ? TRUE : FALSE)
#define | Is_joy_not_left() ((PINB & (1<<PINB6)) ? TRUE : FALSE)
#define | Is_joy_not_down() ((PINE & (1<<PINE5)) ? TRUE : FALSE)
#define | Is_joy_not_right() ((PINE & (1<<PINE4)) ? TRUE : FALSE)
#define | Switches_enable_it()
| Enable interrupts for switches (PINB5 to PINB7) Set up interrupts for switches clear flag enable interrupt.
#define | Switches_disable_it()
| Disable interrupts for switches (PINB5 to PINB7) disable interrupt clear flag Clear mask.
#define | Hwb_button_init() (DDRE &= ~(1<<PINE2), PORTE |= (1<<PINE2))
#define | Is_hwb() ((PINE & (1<<PINE2)) ? FALSE : TRUE)
#define | Is_not_hwb() ((PINE & (1<<PINE2)) ? TRUE : FALSE)
#define | DF_4_MB
#define | DF_NB_MEM 1
#define | Df_init_spi()
#define | Df_select_0() (PORTB &= ~(1<<PINB4))
#define | Df_desel_all() (PORTB |= (1<<PINB4))
#define | ADC_POT_CH 0x01
#define | ADC_MIC_CH 0x02
#define | ADC_TEMP_CH 0x00
| this define is set in config.h file

## Detailed Description

This file contains the low level macros and definition for stk525 board - Compiler: IAR EWAVR and GNU GCC for AVR

- Supported devices: AT90USB1287, AT90USB1286, AT90USB647, AT90USB646
  Author:
    Atmel Corporation: http://www.atmel.com
    Support and FAQ: http://support.atmel.no/

Definition in file stk_525.h.

## Define Documentation

#define ADC_POT_CH 0x01

STK 525 ADC Potentiometer Channel Definition

Definition at line 172 of file stk_525.h.

#define ADC_MIC_CH 0x02

Definition at line 173 of file stk_525.h.

#define ADC_TEMP_CH 0x00

this define is set in config.h file

Definition at line 174 of file stk_525.h.