aboutsummaryrefslogtreecommitdiffstats
path: root/boards/base/Olimex-SAM7EX256-GE8/ginput_lld_toggle_board.h
blob: adc60f1357f8df1668b2f8268500de35049e26bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * This file is subject to the terms of the GFX License. If a copy of
 * the license was not distributed with this file, you can obtain one at:
 *
 *              http://ugfx.io/license.html
 */

/**
 * @file    boards/base/Olimex-SAM7EX256-GE8/ginput_lld_toggle_board.h
 * @brief   GINPUT Toggle low level driver source for the ChibiOS PAL hardware on the Olimex SAM7EX256 board.
 */

#ifndef _GDISP_LLD_TOGGLE_BOARD_H
#define _GDISP_LLD_TOGGLE_BOARD_H

#define GINPUT_TOGGLE_NUM_PORTS			7			// The total number of toggle inputs
#define GINPUT_TOGGLE_CONFIG_ENTRIES	2			// The total number of GToggleConfig entries

#define GINPUT_TOGGLE_SW1			0				// Switch 1
#define GINPUT_TOGGLE_SW2			1				// Switch 2
#define GINPUT_TOGGLE_LEFT			2				// Joystick Left
#define GINPUT_TOGGLE_DOWN			3				// Joystick Down
#define GINPUT_TOGGLE_UP			4				// Joystick Up
#define GINPUT_TOGGLE_RIGHT			5				// Joystick Right
#define GINPUT_TOGGLE_CENTER		6				// Joystick Center

#define GINPUT_TOGGLE_DECLARE_STRUCTURE()											\
	const GToggleConfig GInputToggleConfigTable[GINPUT_TOGGLE_CONFIG_ENTRIES] = {	\
		{AT91C_BASE_PIOB,								/* Switch 1 and Switch 2 */	\
			PIOB_SW1_MASK|PIOB_SW2_MASK,											\
			PIOB_SW1_MASK|PIOB_SW2_MASK,											\
			PAL_MODE_INPUT},														\
		{AT91C_BASE_PIOA,								/* B1..4 Joystick */		\
			PIOA_B1_MASK|PIOA_B2_MASK|PIOA_B3_MASK|PIOA_B4_MASK|PIOA_B5_MASK,		\
			PIOA_B1_MASK|PIOA_B2_MASK|PIOA_B3_MASK|PIOA_B4_MASK|PIOA_B5_MASK,		\
			PAL_MODE_INPUT},														\
	}

#endif /* _GDISP_LLD_TOGGLE_BOARD_H */