Zeitschaltung/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/peripheral.h
2014-05-10 16:10:01 +00:00

69 lines
1.6 KiB
C

/*
* peripheral.h
*
* Created: 07.05.2014 14:02:16
* Author: netz
*/
#ifndef PERIPHERAL_H_
#define PERIPHERAL_H_
#define F_CPU 8000000
#include "io/hardware/portb.hpp"
#include "io/hardware/portc.hpp"
#include "io/hardware/portd.hpp"
#include "io/Led.hpp"
typedef Led<
avrlib::portd, //LED an PORTD
PIND7, //Rot
PIND6 //Grün
> ledclass;
#include "io/Servo.hpp"
typedef Servo< //<640, 105, 210, 8> Blaue Servos
avrlib::portb, //Servo an PORTB
PINB2, //Datenpin des Servos
PINB1, //Mosfetpin des Servos
640, //Links
105, //Mitte
210, //Rechts
8 //Schrittweite
> servoclass;
#include "io/Input.hpp"
typedef Input<
avrlib::portd, //Startknopf an PORTD
PIND3 //Pin an dem der Startknopf hängt
> startclass;
typedef Input<
avrlib::portd, //Bewegungsmelder an PORTD
PIND2 //Pin an dem der Bewegungsmelder hängt
> moveclass;
#include "io/Spi.hpp"
typedef Spi< //<typename Port, int cspin, int misopin, int mosipin, int sckpin, int mode>
avrlib::portc, //Funkmodul an PORTC
PINC4, //CS Pin (nSEL)
PINC3, //MISO Pin (SDO)
PINC0, //MOSI Pin (SDI)
PINC1, //SCK Pin
1 //0 Hardware, 1 Software
> spiclass;
#include "io/rfm12.hpp"
typedef Rfm12<
spiclass, //SPI Hardware
1, //Bandwidth // 400kHz Bandbreite, 0dB Verstärkung, DRSSI threshold: -61dBm
0, //Gain
7, //DRRSI
433920,//(uint16_t)RF12FREQ(433.92), // Sende/Empfangsfrequenz auf 433,92MHz einstellen
9600, //Baudrate // 9600 baud
0, //Power // 1mW Ausgangsleistung, 120kHz Frequenzshift
6 //Mod
> rfm12class;
#endif /* PERIPHERAL_H_ */