From 4bb0f0854a5aa7467512e0bd1e5bf4c724437d4e Mon Sep 17 00:00:00 2001 From: Wintermute Date: Sat, 12 Oct 2013 14:13:14 +0200 Subject: [PATCH] =?utf8?q?Entwurf=20einer=20pinconfig.h,=20die=20von=20IOC?= =?utf8?q?ON=5F-Sondernamen=20unabh=C3=A4ngig=20benutzbar=20ist.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- pinconfig.h | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 pinconfig.h diff --git a/pinconfig.h b/pinconfig.h new file mode 100644 index 0000000..a499d84 --- /dev/null +++ b/pinconfig.h @@ -0,0 +1,87 @@ +#ifndef INCLUDED_HACKOVER_2013_BADGE_PINCONFIG_H +#define INCLUDED_HACKOVER_2013_BADGE_PINCONFIG_H + +#include "lpc134x.h" + +#define HOB_TEST (1, 2) + +#define HOB_BTN_RIGHT (1, 5) +#define HOB_BTN_DOWN (1, 6) +#define HOB_BTN_UP (3, 2) +#define HOB_BTN_LEFT (3, 3) +#define HOB_BTN_CENTER (1, 7) +#define HOB_BTN_A (1, 11) +#define HOB_BTN_B (1, 4) + +#define HOB_LCD_CS (1, 0) +#define HOB_LCD_RST (1, 1) + +#define HOB_DATAFLASH_CS (0, 7) + +#define HOB_RADIO_CE (2, 10) +#define HOB_RADIO_CS (2, 9) +#define HOB_RADIO_IRQ (2, 2) + +#define HOB_IOCON_PIO0_0 IOCON_nRESET_PIO0_0 +#define HOB_IOCON_PIO0_1 IOCON_PIO0_1 +#define HOB_IOCON_PIO0_2 IOCON_PIO0_2 +#define HOB_IOCON_PIO0_3 IOCON_PIO0_3 +#define HOB_IOCON_PIO0_4 IOCON_PIO0_4 +#define HOB_IOCON_PIO0_5 IOCON_PIO0_5 +#define HOB_IOCON_PIO0_6 IOCON_PIO0_6 +#define HOB_IOCON_PIO0_7 IOCON_PIO0_7 +#define HOB_IOCON_PIO0_8 IOCON_PIO0_8 +#define HOB_IOCON_PIO0_9 IOCON_PIO0_9 +#define HOB_IOCON_PIO0_10 IOCON_JTAG_TCK_PIO0_10 +#define HOB_IOCON_PIO0_11 IOCON_JTAG_TDI_PIO0_11 + +#define HOB_IOCON_PIO1_0 IOCON_JTAG_TMS_PIO1_0 +#define HOB_IOCON_PIO1_1 IOCON_JTAG_TDO_PIO1_1 +#define HOB_IOCON_PIO1_2 IOCON_JTAG_nTRST_PIO1_2 +#define HOB_IOCON_PIO1_3 IOCON_SWDIO_PIO1_3 +#define HOB_IOCON_PIO1_4 IOCON_PIO1_4 +#define HOB_IOCON_PIO1_5 IOCON_PIO1_5 +#define HOB_IOCON_PIO1_6 IOCON_PIO1_6 +#define HOB_IOCON_PIO1_7 IOCON_PIO1_7 +#define HOB_IOCON_PIO1_8 IOCON_PIO1_8 +#define HOB_IOCON_PIO1_9 IOCON_PIO1_9 +#define HOB_IOCON_PIO1_10 IOCON_PIO1_10 +#define HOB_IOCON_PIO1_11 IOCON_PIO1_11 + +#define HOB_IOCON_PIO2_0 IOCON_PIO2_0 +#define HOB_IOCON_PIO2_1 IOCON_PIO2_1 +#define HOB_IOCON_PIO2_2 IOCON_PIO2_2 +#define HOB_IOCON_PIO2_3 IOCON_PIO2_3 +#define HOB_IOCON_PIO2_4 IOCON_PIO2_4 +#define HOB_IOCON_PIO2_5 IOCON_PIO2_5 +#define HOB_IOCON_PIO2_6 IOCON_PIO2_6 +#define HOB_IOCON_PIO2_7 IOCON_PIO2_7 +#define HOB_IOCON_PIO2_8 IOCON_PIO2_8 +#define HOB_IOCON_PIO2_9 IOCON_PIO2_9 +#define HOB_IOCON_PIO2_10 IOCON_PIO2_10 +#define HOB_IOCON_PIO2_11 IOCON_PIO2_11 + +#define HOB_IOCON_PIO3_0 IOCON_PIO3_0 +#define HOB_IOCON_PIO3_1 IOCON_PIO3_1 +#define HOB_IOCON_PIO3_2 IOCON_PIO3_2 +#define HOB_IOCON_PIO3_3 IOCON_PIO3_3 +#define HOB_IOCON_PIO3_4 IOCON_PIO3_4 +#define HOB_IOCON_PIO3_5 IOCON_PIO3_5 + +#define HOB_EXPAND(foo) foo + +#define HOB_PORT_I(port, pin) port +#define HOB_PIN_I(port, pin) pin +#define HOB_PORT(spec) HOB_EXPAND(HOB_PORT_I HOB_TEST) +#define HOB_PIN(spec) HOB_EXPAND(HOB_PIN_I HOB_TEST) + +#define HOB_BUILD_IOREG_NAME_I(port, pin) HOB_IOCON_PIO ## port ## _ ## pin +#define HOB_BUILD_IOREG_NAME(port, pin) HOB_BUILD_IOREG_NAME_I(port, pin) +#define HOB_IOREG(spec) HOB_BUILD_IOREG_NAME(HOB_PORT(spec), HOB_PIN(spec)) + +#define R0KET_SPEC_I(x, y) x,y +#define R0KET_SPEC(hobspec) HOB_EXPAND(R0KET_SPEC_I hobspec) + +#define RB_SPI_CS_DF R0KET_SPEC(HOB_DATAFLASH_CS) + +#endif -- 2.20.1