usb_key.h File Reference

#include "config.h"

Include dependency graph for usb_key.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_up()   ((PINB & (1<<PINB7)) ? FALSE : TRUE)
#define Is_joy_left()   ((PINB & (1<<PINB6)) ? 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_8_MB
#define DF_NB_MEM   2
#define Df_init_spi()
#define Df_select_0()   (PORTE &= ~(1<<PINE0))
#define Df_select_1()   (PORTE &= ~(1<<PINE1))
#define Df_desel_all()   (PORTE |= ((1<<PINE1)|(1<<PINE0)))
#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 USB KEY board - Compiler: IAR EWAVR and GNU GCC for AVR

Definition in file usb_key.h.


Define Documentation

#define ADC_TEMP_CH   0x00

this define is set in config.h file

Definition at line 182 of file usb_key.h.


Generated on Mon Sep 14 13:51:28 2009 for ATMEL by  doxygen 1.5.3