stk_526.h File Reference

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

Go to the source code of this file.

Defines

#define VBUS_SENSE_PORT   PORTC
#define VBUS_SENSE_PIN   PINC
#define VBUS_SENSE_DDR   DDRC
#define VBUS_SENSE_IO   4
#define LED_PORT   PORTD
#define LED_DDR   DDRD
#define LED_PIN   PIND
#define LED0_BIT   PIND0
#define LED1_BIT   PIND1
#define LED2_BIT   PIND4
#define LED3_BIT   PIND5
#define Leds_init()   (LED_DDR |= (1<<LED0_BIT)|(1<<LED1_BIT)|(1<<LED2_BIT)|(1<<LED3_BIT), Leds_off())
#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)|(1<<PINB4)|(1<<PINB0)), PORTB |= ((1<<PINB7)|(1<<PINB6)|(1<<PINB5)|(1<<PINB4)|(1<<PINB0)))
#define Push_button_init()   Joy_init()
#define Is_btn_left()   Is_hwb()
#define Is_btn_middle()   ((PINB & (1<<PINB0)) ? FALSE : TRUE)
#define Is_btn_right()   FALSE
#define Is_joy_down()   ((PINB & (1<<PINB7)) ? FALSE : TRUE)
#define Is_joy_right()   ((PINB & (1<<PINB6)) ? FALSE : TRUE)
#define Is_joy_up()   ((PINB & (1<<PINB5)) ? FALSE : TRUE)
#define Is_joy_left()   ((PINB & (1<<PINB4)) ? FALSE : TRUE)
#define Is_btn_not_left()   Is_not_hwb()
#define Is_btn_not_middle()   ((PINB & (1<<PINB0)) ? TRUE : FALSE)
#define Is_btn_not_right()   TRUE
#define Is_joy_not_down()   ((PINB & (1<<PINB7)) ? TRUE : FALSE)
#define Is_joy_not_right()   ((PINB & (1<<PINB6)) ? TRUE : FALSE)
#define Is_joy_not_up()   ((PINB & (1<<PINB5)) ? TRUE : FALSE)
#define Is_joy_not_left()   ((PINB & (1<<PINB4)) ? TRUE : FALSE)
#define Switches_enable_it()
 Enable interrupts for switches (PINB0 and PINB4 to PINB7)
  • Set up interrupts for switches
  • clear flag
  • enable interrupt.

#define Switches_disable_it()
 Disable interrupts for switches (PINB0 and PINB4 to PINB7)
  • disable interrupt
  • clear flag
  • Clear mask.

#define Hwb_button_init()   (DDRD &= ~(1<<PIND7))
#define Is_hwb()   ((PIND & (1<<PIND7)) ? FALSE : TRUE)
#define Is_not_hwb()   ((PIND & (1<<PIND7)) ? TRUE : FALSE)
#define DF_8_MB
#define DF_NB_MEM   1
#define Df_init_spi()
#define Df_select_0()   (PORTC &= ~(1<<PINC2))
#define Df_desel_all()   (PORTC |= (1<<PINC2))


Detailed Description

Library for the board STK526 - Compiler: IAR EWAVR and GNU GCC for AVR

Definition in file stk_526.h.


Generated on Fri Sep 11 14:25:28 2009 for ATMEL by  doxygen 1.5.3