Defines

# Joystick Management
[STK600]

Macros to manage Joystick on stk600. More...

## 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 | Switches_enable_it()
| Enable interrupts for switches (PINB0 to PINB7) Set up interrupts for switches clear flag enable interrupt.
#define | Switches_disable_it()
| Disable interrupts for switches (PINB0 to PINB7) disable interrupt clear flag Clear mask.

## Detailed Description

Macros to manage Joystick on stk600.

## Define Documentation

#define Switches_init | ( | ) | (DDRB &= ~0xFF, PORTB |= 0xFF)

Definition at line 99 of file stk_600.h.

Referenced by mouse_task_init().

#define Is_switch_7 | ( | ) | ((PINB & (1<<PINB7)) ? FALSE : TRUE)

Definition at line 100 of file stk_600.h.

#define Is_switch_6 | ( | ) | ((PINB & (1<<PINB6)) ? FALSE : TRUE)

Definition at line 101 of file stk_600.h.

#define Is_switch_5 | ( | ) | ((PINB & (1<<PINB5)) ? FALSE : TRUE)

Definition at line 102 of file stk_600.h.

#define Is_switch_4 | ( | ) | ((PINB & (1<<PINB4)) ? FALSE : TRUE)

Definition at line 103 of file stk_600.h.

#define Is_switch_3 | ( | ) | ((PINB & (1<<PINB3)) ? FALSE : TRUE)

Definition at line 104 of file stk_600.h.

#define Is_switch_2 | ( | ) | ((PINB & (1<<PINB2)) ? FALSE : TRUE)

Definition at line 105 of file stk_600.h.

#define Is_switch_1 | ( | ) | ((PINB & (1<<PINB1)) ? FALSE : TRUE)

Definition at line 106 of file stk_600.h.

#define Is_switch_0 | ( | ) | ((PINB & (1<<PINB0)) ? FALSE : TRUE)

Definition at line 107 of file stk_600.h.

#define Is_not_switch_7 | ( | ) | ((PINB & (1<<PINB7)) ? TRUE : FALSE)

Definition at line 108 of file stk_600.h.

#define Is_not_switch_6 | ( | ) | ((PINB & (1<<PINB6)) ? TRUE : FALSE)

Definition at line 109 of file stk_600.h.

#define Is_not_switch_5 | ( | ) | ((PINB & (1<<PINB5)) ? TRUE : FALSE)

Definition at line 110 of file stk_600.h.

#define Is_not_switch_4 | ( | ) | ((PINB & (1<<PINB4)) ? TRUE : FALSE)

Definition at line 111 of file stk_600.h.

#define Is_not_switch_3 | ( | ) | ((PINB & (1<<PINB3)) ? TRUE : FALSE)

Definition at line 112 of file stk_600.h.

#define Is_not_switch_2 | ( | ) | ((PINB & (1<<PINB2)) ? TRUE : FALSE)

Definition at line 113 of file stk_600.h.

#define Is_not_switch_1 | ( | ) | ((PINB & (1<<PINB1)) ? TRUE : FALSE)

Definition at line 114 of file stk_600.h.

#define Is_not_switch_0 | ( | ) | ((PINB & (1<<PINB0)) ? TRUE : FALSE)

Definition at line 115 of file stk_600.h.

#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);}

Enable interrupts for switches (PINB0 to PINB7)

- Set up interrupts for switches
- clear flag
- enable interrupt.

Definition at line 121 of file stk_600.h.

Referenced by suspend_action().

#define Switches_disable_it | ( | ) |

Value:

    { \
          PCICR  &= ~(1<<PCIE0);     \
          PCIFR  |= (1<<PCIF0);      \
          PCMSK0 &= ~((1<<PCINT0)|(1<<PCINT1)|(1<<PCINT2)|(1<<PCINT3)|(1<<PCINT4)|(1<<PCINT5)|(1<<PCINT6)|(1<<PCINT7));}

Disable interrupts for switches (PINB0 to PINB7)

- disable interrupt
- clear flag
- Clear mask.

Definition at line 130 of file stk_600.h.

Referenced by switch_event_int().