Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 1733 → Rev 1734

/Transportables_Koptertool/branch/PKT_V363a_V088n_MartinR/HAL_HW1_3.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 V1.3 sebseb7
// * USB,LED
 
 
/*Hardware 1.3.1 Portbelegung
 
Servo PD4 Pin 13
Servo PD5 Pin 14
Bootlader LED PC3 Pin 22 LED an GND
Summer PC6 Pin 25 Summer an GND
Displaybeleuchtung PD6 Pin 15 LED an +
Displaybeleuchtung PD7 Pin 16 LED an +
Displaybeleuchtung PC2 Pin 21 LED an +
Wi232 PC7 Pin 26 Wi232 CMD Pin
 
 
*/
 
 
 
 
#ifndef HAL_HW1_3_H_
#define HAL_HW1_3_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 clr_LED1() (PORTC &= ~(1 << PC3)) // Leds
#define set_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 clr_BEEP() (PORTC &= ~(1 << PC6)) //Summer
#define set_BEEP() (PORTC |= (1 << PC6))
 
 
#define set_WI232CMD() (PORTC &= ~(1 << PC7))
#define clr_WI232CMD() (PORTC |= (1 << PC7))
 
 
#define KEY_PIN PINA
 
 
#define KEY_ENTER PA7
#define KEY_ESC PA6
#define KEY_PLUS PA5
#define KEY_MINUS PA4
 
 
 
 
void set_D_LIGHT(void); /* Displaybeleuchtung ein*/
void clr_D_LIGHT(void); /* Displaybeleuchtung aus*/
 
 
void InitHWPorts(void);
void Port_USB2FC(void);
 
#endif /* HAL_HW1_3_H_ */