Defines | |
#define | Switches_init() (DDRB &= ~0xFF, PORTB |= 0xFF) |
#define | Is_switch_7() ((PINB & (1<<PINB7)) ? FALSE : TRUE) |
#define | Is_switch_6() ((PINB & (1<<PINB6)) ? FALSE : TRUE) |
#define | Is_switch_5() ((PINB & (1<<PINB5)) ? FALSE : TRUE) |
#define | Is_switch_4() ((PINB & (1<<PINB4)) ? FALSE : TRUE) |
#define | Is_switch_3() ((PINB & (1<<PINB3)) ? FALSE : TRUE) |
#define | Is_switch_2() ((PINB & (1<<PINB2)) ? FALSE : TRUE) |
#define | Is_switch_1() ((PINB & (1<<PINB1)) ? FALSE : TRUE) |
#define | Is_switch_0() ((PINB & (1<<PINB0)) ? FALSE : TRUE) |
#define | Is_not_switch_7() ((PINB & (1<<PINB7)) ? TRUE : FALSE) |
#define | Is_not_switch_6() ((PINB & (1<<PINB6)) ? TRUE : FALSE) |
#define | Is_not_switch_5() ((PINB & (1<<PINB5)) ? TRUE : FALSE) |
#define | Is_not_switch_4() ((PINB & (1<<PINB4)) ? TRUE : FALSE) |
#define | Is_not_switch_3() ((PINB & (1<<PINB3)) ? TRUE : FALSE) |
#define | Is_not_switch_2() ((PINB & (1<<PINB2)) ? TRUE : FALSE) |
#define | Is_not_switch_1() ((PINB & (1<<PINB1)) ? TRUE : FALSE) |
#define | Is_not_switch_0() ((PINB & (1<<PINB0)) ? TRUE : FALSE) |
#define | Joy_init() Switches_init() |
#define | Push_button_init() Joy_init() |
#define | Is_btn_left() Is_switch_6() |
#define | Is_btn_middle() Is_switch_5() |
#define | Is_btn_right() Is_switch_4() |
#define | Is_joy_left() Is_switch_3() |
#define | Is_joy_right() Is_switch_2() |
#define | Is_joy_up() Is_switch_1() |
#define | Is_joy_down() Is_switch_0() |
#define | Is_btn_not_left() Is_not_switch_6() |
#define | Is_btn_not_middle() Is_not_switch_5() |
#define | Is_btn_not_right() Is_not_switch_4() |
#define | Is_joy_not_left() Is_not_switch_3() |
#define | Is_joy_not_right() Is_not_switch_2() |
#define | Is_joy_not_up() Is_not_switch_1() |
#define | Is_joy_not_down() Is_not_switch_0() |
#define | Switches_enable_it() |
Enable interrupts for switches (PINB0 to PINB7)
| |
#define | Switches_disable_it() |
Disable interrupts for switches (PINB0 to PINB7)
|
The switchs are associated at a key name like STK525 or USB KEY :
#define Is_switch_7 | ( | ) | ((PINB & (1<<PINB7)) ? FALSE : TRUE) |
#define Is_switch_6 | ( | ) | ((PINB & (1<<PINB6)) ? FALSE : TRUE) |
#define Is_switch_5 | ( | ) | ((PINB & (1<<PINB5)) ? FALSE : TRUE) |
#define Is_switch_4 | ( | ) | ((PINB & (1<<PINB4)) ? FALSE : TRUE) |
#define Is_switch_3 | ( | ) | ((PINB & (1<<PINB3)) ? FALSE : TRUE) |
#define Is_switch_2 | ( | ) | ((PINB & (1<<PINB2)) ? FALSE : TRUE) |
#define Is_switch_1 | ( | ) | ((PINB & (1<<PINB1)) ? FALSE : TRUE) |
#define Is_switch_0 | ( | ) | ((PINB & (1<<PINB0)) ? FALSE : TRUE) |
#define Is_not_switch_7 | ( | ) | ((PINB & (1<<PINB7)) ? TRUE : FALSE) |
#define Is_not_switch_6 | ( | ) | ((PINB & (1<<PINB6)) ? TRUE : FALSE) |
#define Is_not_switch_5 | ( | ) | ((PINB & (1<<PINB5)) ? TRUE : FALSE) |
#define Is_not_switch_4 | ( | ) | ((PINB & (1<<PINB4)) ? TRUE : FALSE) |
#define Is_not_switch_3 | ( | ) | ((PINB & (1<<PINB3)) ? TRUE : FALSE) |
#define Is_not_switch_2 | ( | ) | ((PINB & (1<<PINB2)) ? TRUE : FALSE) |
#define Is_not_switch_1 | ( | ) | ((PINB & (1<<PINB1)) ? TRUE : FALSE) |
#define Is_not_switch_0 | ( | ) | ((PINB & (1<<PINB0)) ? TRUE : FALSE) |
#define Switches_enable_it | ( | ) |
Value:
{ \ PCMSK0 |= (1<<PCINT0)|(1<<PCINT1)|(1<<PCINT2)|(1<<PCINT3)|(1<<PCINT4)|(1<<PCINT5)|(1<<PCINT6)|(1<<PCINT7);\ PCIFR |= (1<<PCIF0); \ PCICR |= (1<<PCIE0);}
#define Switches_disable_it | ( | ) |