Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 1469 → Rev 1470

/Transportables_Koptertool/branch/GPL_PKT_V3_5_8a_FC086/HAL_HW3_1.h
0,0 → 1,108
/*****************************************************************************
* Copyright (C) 2008 Thomas Kaiser, thomas@ft-fanpage.de *
* Copyright (C) 2009 Peter "woggle" Mack, mac@denich.net *
* Copyright (C) 2011 Christian "Cebra" Brandtner, brandtner@brandtner.net *
* Copyright (C) 2011 Harald Bongartz *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* 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. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
* *
* Credits to: *
* Holger Buss & Ingo Busker from mikrokopter.de for the MK project + SVN *
* http://www.mikrokopter.de *
* Gregor "killagreg" Stobrawa for his version of the MK code *
* Thomas Kaiser "thkais" for the original project. See *
* http://www.ft-fanpage.de/mikrokopter/ *
* http://forum.mikrokopter.de/topic-4061-1.html *
* Claas Anders "CaScAdE" Rathje for providing the font and his C-OSD code *
* http://www.mylifesucks.de/oss/c-osd/ *
* Harald Bongartz "HaraldB" for providing his Ideas and Code for usibility*
*****************************************************************************/
 
 
// * Hardwareabhängige Definitionen und Prozeduren
// * Hardware Leiterplatte V3.2 Cebra
// * USB,Wi232,LED
 
 
/* Hardware 3.1 Portbelegung
 
Servo PD4 Pin 13
Servo PD5 Pin 14
Wi.232 CMD PD6 Pin 15 aktiv low
Displaybeleuchtung PD7 Pin 16 LED an +
I2C PC0 Pin 19
I2C PC1 Pin 20
LED2 PC2 Pin 21 LED an +
LED1 PC3 Pin 22 LED an +
Summer PC6 Pin 25 Summer an +
LED3 PB1 Pin 41 LED an +
LED4 PB0 Pin 40 LED an +
 
*/
#ifndef HAL_HW3_2_H_
#define HAL_HW3_2_H_
 
#define set_cs() (PORTB |= (1 << PB4)) // Display
#define clr_cs() (PORTB &= ~(1 << PB4))
#define set_reset() (PORTB |= (1 << PB2))
#define clr_reset() (PORTB &= ~(1 << PB2))
#define set_A0() (PORTB |= (1 << PB3)) // Data
#define clr_A0() (PORTB &= ~(1 << PB3)) // Command
#define set_scl() (PORTB |= (1 << PB7))
#define clr_scl() (PORTB &= ~(1 << PB7))
#define set_si() (PORTB |= (1 << PB5))
#define clr_si() (PORTB &= ~(1 << PB5))
 
#define set_LED1() (PORTC &= ~(1 << PC3)) // Leds
#define clr_LED1() (PORTC |= (1 << PC3))
#define set_LED2() (PORTC &= ~(1 << PC2))
#define clr_LED2() (PORTC |= (1 << PC2))
#define set_LED3() (PORTB &= ~(1 << PB1))
#define clr_LED3() (PORTB |= (1 << PB1))
#define set_LED4() (PORTB &= ~(1 << PB0))
#define clr_LED4() (PORTB |= (1 << PB0))
 
 
#define set_BEEP() (PORTC &= ~(1 << PC6)) //Summer
#define clr_BEEP() (PORTC |= (1 << PC6))
 
 
#define set_D_LIGHT() (PORTD |= (1 << PD7)) // Displaybeleuchtung
#define clr_D_LIGHT() (PORTD &= ~(1 << PD7))
#define set_WI232CMD() (PORTD &= ~(1 << PD6))
#define clr_WI232CMD() (PORTD |= (1 << PD6))
 
 
#define KEY_PIN PINA
 
//#if defined HWVERSION1_2 || defined HWVERSION1_3 || defined HWVERSION3_2
//#define KEY_ENTER PA7
//#define KEY_ESC PA6
//#define KEY_PLUS PA5
//#define KEY_MINUS PA4
//#endif
 
/*in der Hardwareversion sind die Tasten im Layout verdreht*/
#define KEY_ENTER PA4
#define KEY_ESC PA5
#define KEY_PLUS PA6
#define KEY_MINUS PA7
 
 
 
void InitHWPorts(void);
 
#endif /* HAL_HW3_2_H_ */