Joystick

Description

The EVK1101 provides a joystick to design Human to Machine Interface for software developments.


Back to the Hardware Reference Page

Pinout

The joystick inputs are low level active. (ie : the PVR register value is 0 when the joystick is set in a direction and/or pressed, and 1 otherwise)
The pinout is as follow :

Joystick Pin Joystick Direction GPIO Name Alternate function used
Joy_A LEFT PB 6 SCAN_4
Joy_B UP PB 7 SCAN_5
Joy_C DOWN PB 8 SCAN_6
Joy_D RIGHT PB 9 SCAN_7
EXTINT PUSH PA 13 EXTINT_8

Back to the Hardware Reference Page

Using Interrupts

In order to use the joystick, two ways are available :

  • Polling on the GPIO Port Value Register
  • Using GPIO interrupts to get state changes

Using GPIO interrupts need to :

  • Register an interrupt handler for the input (depending on the compiler you are using),
  • Set the GPIO control bit for the input,
  • Set the GPIO glitch filter bit for the input,
  • Configure the GPIO interrupt mask bit for the input to act either on rising edge, falling edge or input change (this mode should be the better for the joystick),
  • Set the GPIO interrupt enable bit for the input.


Back to the Hardware Reference Page