56 lines
1.0 KiB
C++
56 lines
1.0 KiB
C++
/*
|
|
* AudioSwitcher.hpp
|
|
*
|
|
* Created: 30.10.2020 19:47:31
|
|
* Author: netz
|
|
*/
|
|
|
|
|
|
#ifndef AUDIOSWITCHER_HPP_
|
|
#define AUDIOSWITCHER_HPP_
|
|
|
|
#include "Relais.hpp"
|
|
#include "ports/pin.hpp"
|
|
#include "ports/portb.hpp"
|
|
#include "ports/portd.hpp"
|
|
|
|
template<typename Relais1, typename Relais2>
|
|
class AudioSwitcherT {
|
|
// Methods
|
|
public:
|
|
AudioSwitcherT() {
|
|
this->SetRadio();
|
|
}
|
|
|
|
/**
|
|
* \brief
|
|
* Set the Relais to Radio output
|
|
*
|
|
* \return void
|
|
*/
|
|
void SetRadio() {
|
|
relais_right.Reset();
|
|
relais_left.Reset();
|
|
}
|
|
|
|
|
|
/**
|
|
* \brief
|
|
* Set the Relais to Funk output
|
|
*
|
|
* \return void
|
|
*/
|
|
void SetFunk() {
|
|
relais_right.Set();
|
|
relais_left.Set();
|
|
}
|
|
|
|
// Variables
|
|
private:
|
|
Relais1 relais_right;
|
|
Relais2 relais_left;
|
|
};
|
|
|
|
typedef AudioSwitcherT<RelaisT<blubblib::portb, PINB6, PINB7>, RelaisT<blubblib::portd, PIND3, PIND4> > AudioSwitcher;
|
|
|
|
#endif /* AUDIOSWITCHER_HPP_ */ |