/* * Copyright (C) OpenTX * * Based on code named * th9x - http://code.google.com/p/th9x * er9x - http://code.google.com/p/er9x * gruvin9x - http://code.google.com/p/gruvin9x * * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef _BOARD_MEGA2560_H_ #define _BOARD_MEGA2560_H_ #include "../common/avr/board_avr.h" //Mods for futur use ? Beta tester love it //#define ROTENC_DIV2 // rotenc resolution/2 // Board driver void boardInit(void); #define boardOff() pwrOff() // Keys #define KEYS_GPIO_REG_MENU pinl #define KEYS_GPIO_PIN_MENU (1<<4) #define KEYS_GPIO_REG_EXIT pinl #define KEYS_GPIO_PIN_EXIT (1<<5) #define KEYS_GPIO_REG_RIGHT pinl #define KEYS_GPIO_PIN_RIGHT (1<<2) #define KEYS_GPIO_REG_LEFT pinl #define KEYS_GPIO_PIN_LEFT (1<<3) #define KEYS_GPIO_REG_UP pinl #define KEYS_GPIO_PIN_UP (1<<1) #define KEYS_GPIO_REG_DOWN pinl #define KEYS_GPIO_PIN_DOWN (1<<0) // Trims #define TRIMS_GPIO_REG_LHL pinf #define TRIMS_GPIO_PIN_LHL (1<<7) #define TRIMS_GPIO_REG_LVD pinf #define TRIMS_GPIO_PIN_LVD (1<<5) #define TRIMS_GPIO_REG_RVU pinf #define TRIMS_GPIO_PIN_RVU (1<<2) #define TRIMS_GPIO_REG_RHL pinf #define TRIMS_GPIO_PIN_RHL (1<<1) #define TRIMS_GPIO_REG_LHR pinf #define TRIMS_GPIO_PIN_LHR (1<<6) #define TRIMS_GPIO_REG_LVU pinf #define TRIMS_GPIO_PIN_LVU (1<<4) #define TRIMS_GPIO_REG_RVD pinf #define TRIMS_GPIO_PIN_RVD (1<<3) #define TRIMS_GPIO_REG_RHR pinf #define TRIMS_GPIO_PIN_RHR (1<<0) #define TIMER_16KHZ_VECT TIMER2_OVF_vect #define COUNTER_16KHZ TCNT2 #define TIMER_10MS_VECT TIMER2_COMPA_vect #define TIMER_10MS_COMPVAL OCR2A #define PAUSE_10MS_INTERRUPT() TIMSK2 &= ~(1<