101 lines
2.1 KiB
C
101 lines
2.1 KiB
C
/*
|
|
* peripheral.h
|
|
*
|
|
* Created: 11.05.2014 16:22:54
|
|
* Author: netz
|
|
*/
|
|
|
|
|
|
#ifndef PERIPHERAL_H_
|
|
#define PERIPHERAL_H_
|
|
|
|
#define F_CPU 16000000
|
|
|
|
#include "io/hardware/portb.hpp"
|
|
#include "io/hardware/portc.hpp"
|
|
#include "io/hardware/portd.hpp"
|
|
#include "io/hardware/portg.hpp"
|
|
#include "io/hardware/porth.hpp"
|
|
#include "io/hardware/portj.hpp"
|
|
#include "io/hardware/portk.hpp"
|
|
#include "io/hardware/portl.hpp"
|
|
|
|
#include "io/Led.hpp"
|
|
typedef Led<
|
|
avrlib::portb, //LED an PORTB
|
|
PINB0 //Grün
|
|
> ledgruenclass;
|
|
typedef Led<
|
|
avrlib::porth, //LED an PORTB
|
|
PINH6 //Gelb
|
|
> ledgelbclass;
|
|
typedef Led<
|
|
avrlib::porth, //LED an PORTB
|
|
PINH5 //Rot
|
|
> ledrotclass;
|
|
|
|
#include "io/Input.hpp"
|
|
typedef Input<
|
|
avrlib::portk,
|
|
PINK7, //Active
|
|
PINK5, //Ilde
|
|
PINK2, //Enter
|
|
PINK6, //Back
|
|
PINK4, //Top
|
|
PINK0, //Down
|
|
PINK1, //Left
|
|
PINK3 //Right
|
|
> inputclass;
|
|
|
|
#include "io/LedPWM.hpp"
|
|
typedef LedPWM<
|
|
avrlib::portl,
|
|
PINL3
|
|
> ledlcdclass;
|
|
|
|
#include "io/mcp4151.hpp"
|
|
typedef Mcp4151< //<typename PortCS, int cspin, typename PortSDI, int sdisdopin, typename PortSCK, int sckpin>
|
|
avrlib::portc,
|
|
PINC0,
|
|
avrlib::portg,
|
|
PING0,
|
|
avrlib::portg,
|
|
PING1
|
|
> lcdpoticlass;
|
|
|
|
#include "io/Display.hpp"
|
|
typedef Display< //<typename Mcp4151, typename PortData, typename PortSettings, int pine, int pinrw, int pinrs>
|
|
lcdpoticlass,
|
|
ledlcdclass,
|
|
avrlib::portd,
|
|
avrlib::portl,
|
|
PINL7,
|
|
PINL6,
|
|
PINL5
|
|
> displayclass;
|
|
|
|
displayclass d;
|
|
|
|
#include "io/Spi.hpp"
|
|
typedef Spi< //<typename Port, int cspin, int misopin, int mosipin, int sckpin, int mode>
|
|
avrlib::portj,
|
|
PINJ4,
|
|
PINJ3,
|
|
PINJ6,
|
|
PINJ5,
|
|
1 //Software
|
|
> spiclass;
|
|
|
|
#include "io/rfm12b.hpp"
|
|
typedef Rfm12B<
|
|
spiclass, //SPI Hardware
|
|
1, //Bandwidth // 400kHz Bandbreite, 0dB Verstärkung, DRSSI threshold: -61dBm
|
|
0, //Gain
|
|
5, //DRRSI
|
|
433920,//(uint16_t)RF12FREQ(433.92), // Sende/Empfangsfrequenz auf 433,92MHz einstellen
|
|
9600, //Baudrate // 9600 baud
|
|
7, //Power // 1mW Ausgangsleistung, 120kHz Frequenzshift
|
|
7 //Shift (war 6 = 105 kHz)
|
|
> rfm12class;
|
|
|
|
#endif /* PERIPHERAL_H_ */ |