Start Programming
This commit is contained in:
parent
879ef241cb
commit
2a2ba7693e
@ -20,139 +20,148 @@
|
||||
<OverrideVtor>false</OverrideVtor>
|
||||
<CacheFlash>true</CacheFlash>
|
||||
<ProgFlashFromRam>true</ProgFlashFromRam>
|
||||
<RamSnippetAddress />
|
||||
<RamSnippetAddress>0x20000000</RamSnippetAddress>
|
||||
<UncachedRange />
|
||||
<preserveEEPROM>true</preserveEEPROM>
|
||||
<OverrideVtorValue />
|
||||
<OverrideVtorValue>exception_table</OverrideVtorValue>
|
||||
<BootSegment>2</BootSegment>
|
||||
<ResetRule>0</ResetRule>
|
||||
<eraseonlaunchrule>0</eraseonlaunchrule>
|
||||
<EraseKey />
|
||||
<AsfFrameworkConfig>
|
||||
<framework-data xmlns="">
|
||||
<options />
|
||||
<configurations />
|
||||
<files />
|
||||
<documentation help="" />
|
||||
<offline-documentation help="" />
|
||||
<dependencies>
|
||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.48.0" />
|
||||
</dependencies>
|
||||
</framework-data>
|
||||
<options />
|
||||
<configurations />
|
||||
<files />
|
||||
<documentation help="" />
|
||||
<offline-documentation help="" />
|
||||
<dependencies>
|
||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.48.0" />
|
||||
</dependencies>
|
||||
</framework-data>
|
||||
</AsfFrameworkConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<ToolchainSettings>
|
||||
<AvrGccCpp>
|
||||
<avrgcc.common.Device>-mmcu=atmega48pa -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\gcc\dev\atmega48pa"</avrgcc.common.Device>
|
||||
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
|
||||
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
|
||||
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
|
||||
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
|
||||
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
|
||||
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||
<avrgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>NDEBUG</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.symbols.DefSymbols>
|
||||
<avrgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.directories.IncludePaths>
|
||||
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
|
||||
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
|
||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>NDEBUG</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
||||
<avrgcccpp.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.compiler.directories.IncludePaths>
|
||||
<avrgcccpp.compiler.optimization.level>Optimize for size (-Os)</avrgcccpp.compiler.optimization.level>
|
||||
<avrgcccpp.compiler.optimization.PackStructureMembers>True</avrgcccpp.compiler.optimization.PackStructureMembers>
|
||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
||||
<avrgcccpp.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.linker.libraries.Libraries>
|
||||
<avrgcccpp.assembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.assembler.general.IncludePaths>
|
||||
</AvrGccCpp>
|
||||
<avrgcc.common.Device>-mmcu=atmega48pa -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\gcc\dev\atmega48pa"</avrgcc.common.Device>
|
||||
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
|
||||
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
|
||||
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
|
||||
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
|
||||
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
|
||||
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||
<avrgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>NDEBUG</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.symbols.DefSymbols>
|
||||
<avrgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.directories.IncludePaths>
|
||||
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
|
||||
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
|
||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>NDEBUG</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
||||
<avrgcccpp.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.compiler.directories.IncludePaths>
|
||||
<avrgcccpp.compiler.optimization.level>Optimize for size (-Os)</avrgcccpp.compiler.optimization.level>
|
||||
<avrgcccpp.compiler.optimization.PackStructureMembers>True</avrgcccpp.compiler.optimization.PackStructureMembers>
|
||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
||||
<avrgcccpp.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.linker.libraries.Libraries>
|
||||
<avrgcccpp.assembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.assembler.general.IncludePaths>
|
||||
</AvrGccCpp>
|
||||
</ToolchainSettings>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<ToolchainSettings>
|
||||
<AvrGccCpp>
|
||||
<avrgcc.common.Device>-mmcu=atmega48pa -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\gcc\dev\atmega48pa"</avrgcc.common.Device>
|
||||
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
|
||||
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
|
||||
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
|
||||
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
|
||||
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
|
||||
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||
<avrgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>DEBUG</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.symbols.DefSymbols>
|
||||
<avrgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.directories.IncludePaths>
|
||||
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
|
||||
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
|
||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
||||
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
|
||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>DEBUG</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
||||
<avrgcccpp.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.compiler.directories.IncludePaths>
|
||||
<avrgcccpp.compiler.optimization.level>Optimize (-O1)</avrgcccpp.compiler.optimization.level>
|
||||
<avrgcccpp.compiler.optimization.PackStructureMembers>True</avrgcccpp.compiler.optimization.PackStructureMembers>
|
||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
||||
<avrgcccpp.compiler.optimization.DebugLevel>Default (-g2)</avrgcccpp.compiler.optimization.DebugLevel>
|
||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
||||
<avrgcccpp.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.linker.libraries.Libraries>
|
||||
<avrgcccpp.assembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.assembler.general.IncludePaths>
|
||||
<avrgcccpp.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcccpp.assembler.debugging.DebugLevel>
|
||||
</AvrGccCpp>
|
||||
<avrgcc.common.Device>-mmcu=atmega48pa -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\gcc\dev\atmega48pa"</avrgcc.common.Device>
|
||||
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
|
||||
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
|
||||
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
|
||||
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
|
||||
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
|
||||
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||
<avrgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>DEBUG</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.symbols.DefSymbols>
|
||||
<avrgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.directories.IncludePaths>
|
||||
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
|
||||
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
|
||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
||||
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
|
||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>DEBUG</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
||||
<avrgcccpp.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.compiler.directories.IncludePaths>
|
||||
<avrgcccpp.compiler.optimization.level>Optimize (-O1)</avrgcccpp.compiler.optimization.level>
|
||||
<avrgcccpp.compiler.optimization.PackStructureMembers>True</avrgcccpp.compiler.optimization.PackStructureMembers>
|
||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
||||
<avrgcccpp.compiler.optimization.DebugLevel>Default (-g2)</avrgcccpp.compiler.optimization.DebugLevel>
|
||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
||||
<avrgcccpp.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.linker.libraries.Libraries>
|
||||
<avrgcccpp.assembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include</Value>
|
||||
</ListValues>
|
||||
</avrgcccpp.assembler.general.IncludePaths>
|
||||
<avrgcccpp.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcccpp.assembler.debugging.DebugLevel>
|
||||
</AvrGccCpp>
|
||||
</ToolchainSettings>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="io\AudioSwitcher.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="io\Comperator.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="io\LED.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="io\ports\pin.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
@ -165,6 +174,15 @@
|
||||
<Compile Include="io\ports\portd.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="io\PTT.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="io\Relais.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="io\Timer.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="main.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
|
@ -8,24 +8,50 @@
|
||||
#define F_CPU 8000000
|
||||
|
||||
#include "peripheral.h"
|
||||
#include "io/AudioSwitcher.hpp"
|
||||
#include "io/LED.hpp"
|
||||
|
||||
template <int delay_plus>
|
||||
class ProgrammT {
|
||||
private:
|
||||
void ResetTimer() {
|
||||
led.SetColor(Led::CYAN);
|
||||
if(!this->timer_running) {
|
||||
audio.SetFunk();
|
||||
}
|
||||
this->timer_running = true;
|
||||
}
|
||||
void TimerEnd() {
|
||||
audio.SetRadio();
|
||||
this->timer_running = false;
|
||||
}
|
||||
protected:
|
||||
public:
|
||||
ProgrammT() {
|
||||
|
||||
ProgrammT() : timer_running(false) {
|
||||
|
||||
}
|
||||
|
||||
void Setup() {
|
||||
|
||||
led.SetColor(Led::RED);
|
||||
}
|
||||
|
||||
void Loop() {
|
||||
if(this->timer_running) {
|
||||
led.SetColor(Led::YELLOW);
|
||||
} else {
|
||||
led.SetColor(Led::GREEN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PttVect() {
|
||||
|
||||
void Vect_Ptt() {
|
||||
this->ResetTimer();
|
||||
}
|
||||
private:
|
||||
AudioSwitcher audio;
|
||||
Led led;
|
||||
protected:
|
||||
bool timer_running;
|
||||
public:
|
||||
};
|
||||
typedef ProgrammT<settings_prog_delay_plus> Programm;
|
56
Programm/Audio-Switch/io/AudioSwitcher.hpp
Normal file
56
Programm/Audio-Switch/io/AudioSwitcher.hpp
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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_ */
|
24
Programm/Audio-Switch/io/Comperator.hpp
Normal file
24
Programm/Audio-Switch/io/Comperator.hpp
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Comperator.hpp
|
||||
*
|
||||
* Created: 30.10.2020 19:01:31
|
||||
* Author: netz
|
||||
*/
|
||||
|
||||
|
||||
#ifndef COMPERATOR_HPP_
|
||||
#define COMPERATOR_HPP_
|
||||
|
||||
class Comperator {
|
||||
// Methods
|
||||
private:
|
||||
protected:
|
||||
public:
|
||||
|
||||
// Variables
|
||||
private:
|
||||
protected:
|
||||
public:
|
||||
};
|
||||
|
||||
#endif /* COMPERATOR_HPP_ */
|
66
Programm/Audio-Switch/io/LED.hpp
Normal file
66
Programm/Audio-Switch/io/LED.hpp
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* LED.hpp
|
||||
*
|
||||
* Created: 30.10.2020 22:05:41
|
||||
* Author: netz
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LED_HPP_
|
||||
#define LED_HPP_
|
||||
|
||||
#include "ports/pin.hpp"
|
||||
#include "ports/portc.hpp"
|
||||
|
||||
template<typename led_pin_r, typename led_pin_g, typename led_pin_b>
|
||||
class LedT {
|
||||
//ENUMS
|
||||
public:
|
||||
enum Led_Color {
|
||||
BLACK = 0,
|
||||
RED = 1,
|
||||
GREEN = 2,
|
||||
YELLOW = 3,
|
||||
BLUE = 4,
|
||||
MAGENTA = 5,
|
||||
CYAN = 6,
|
||||
WHITE = 7
|
||||
};
|
||||
// Methods
|
||||
private:
|
||||
void Init() {
|
||||
led_r.MakeLow();
|
||||
led_g.MakeLow();
|
||||
led_b.MakeLow();
|
||||
}
|
||||
protected:
|
||||
public:
|
||||
LedT() {
|
||||
this->Init();
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief
|
||||
* Set a color in the RGB Led
|
||||
* \param color
|
||||
*
|
||||
* \return void
|
||||
*/
|
||||
void SetColor(Led_Color color) {
|
||||
led_r.Set(color & (1<<0) ? true : false);
|
||||
led_g.Set(color & (1<<1) ? true : false);
|
||||
led_b.Set(color & (1<<2) ? true : false);
|
||||
}
|
||||
|
||||
// Variables
|
||||
private:
|
||||
led_pin_r led_r;
|
||||
led_pin_g led_g;
|
||||
led_pin_b led_b;
|
||||
protected:
|
||||
public:
|
||||
};
|
||||
|
||||
typedef LedT<blubblib::pin<blubblib::portc, PINC1>, blubblib::pin<blubblib::portc, PINC2>, blubblib::pin<blubblib::portc, PINC0> > Led;
|
||||
|
||||
#endif /* LED_HPP_ */
|
26
Programm/Audio-Switch/io/PTT.hpp
Normal file
26
Programm/Audio-Switch/io/PTT.hpp
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* PTT.hpp
|
||||
*
|
||||
* Created: 30.10.2020 22:03:26
|
||||
* Author: netz
|
||||
*/
|
||||
|
||||
|
||||
#ifndef PTT_HPP_
|
||||
#define PTT_HPP_
|
||||
|
||||
|
||||
class PttT {
|
||||
// Methods
|
||||
private:
|
||||
protected:
|
||||
public:
|
||||
|
||||
// Variables
|
||||
private:
|
||||
protected:
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
#endif /* PTT_HPP_ */
|
54
Programm/Audio-Switch/io/Relais.hpp
Normal file
54
Programm/Audio-Switch/io/Relais.hpp
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Relais.hpp
|
||||
*
|
||||
* Created: 30.10.2020 19:46:30
|
||||
* Author: netz
|
||||
*/
|
||||
|
||||
#ifndef RELAIS_HPP_
|
||||
#define RELAIS_HPP_
|
||||
|
||||
#include <util/delay.h>
|
||||
#include "ports/pin.hpp"
|
||||
|
||||
template <typename relais_port, int relais_pin_set, int relais_pin_reset>
|
||||
class RelaisT {
|
||||
// Methods
|
||||
public:
|
||||
RelaisT() {
|
||||
r_set::MakeLow();
|
||||
r_reset::MakeLow();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief
|
||||
* Trigger the Set Pin
|
||||
*
|
||||
* \return void
|
||||
*/
|
||||
void Set() {
|
||||
r_set::SetHigh();
|
||||
_delay_ms(10);
|
||||
r_set::SetLow();
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief
|
||||
* Trigger the Reset Pin
|
||||
*
|
||||
* \return void
|
||||
*/
|
||||
void Reset() {
|
||||
r_reset::SetHigh();
|
||||
_delay_ms(10);
|
||||
r_reset::SetLow();
|
||||
}
|
||||
|
||||
// Variables
|
||||
private:
|
||||
const typedef blubblib::pin<relais_port, relais_pin_set> r_set;
|
||||
const typedef blubblib::pin<relais_port, relais_pin_reset> r_reset;
|
||||
};
|
||||
|
||||
#endif /* RELAIS_HPP_ */
|
26
Programm/Audio-Switch/io/Timer.hpp
Normal file
26
Programm/Audio-Switch/io/Timer.hpp
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Timer.h
|
||||
*
|
||||
* Created: 30.10.2020 19:46:04
|
||||
* Author: netz
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TIMER_H_
|
||||
#define TIMER_H_
|
||||
|
||||
class Timer {
|
||||
// Methods
|
||||
private:
|
||||
protected:
|
||||
public:
|
||||
|
||||
// Variables
|
||||
private:
|
||||
protected:
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* TIMER_H_ */
|
@ -13,6 +13,13 @@
|
||||
namespace blubblib {
|
||||
template <typename PortT, uint8_t Pin>
|
||||
struct pin {
|
||||
/**
|
||||
* \brief
|
||||
* Set or Unset the Output
|
||||
* \param value
|
||||
* true = set, false = unset
|
||||
* \return void
|
||||
*/
|
||||
static void Set(bool value = true) {
|
||||
if (value) {
|
||||
PortT::Port(PortT::Port() | (1<<Pin));
|
||||
@ -58,6 +65,12 @@ namespace blubblib {
|
||||
Clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief
|
||||
* Set Output and Low
|
||||
*
|
||||
* \return void
|
||||
*/
|
||||
static void MakeLow() {
|
||||
Clear();
|
||||
Output(true);
|
||||
@ -72,10 +85,23 @@ namespace blubblib {
|
||||
Set(value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief
|
||||
* Set High
|
||||
*
|
||||
* \return void
|
||||
*/
|
||||
static void SetHigh() {
|
||||
Set(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief
|
||||
* Set Low
|
||||
*
|
||||
* \return void
|
||||
*/
|
||||
static void SetLow() {
|
||||
Set(false);
|
||||
}
|
||||
|
@ -19,5 +19,5 @@ int main(void) {
|
||||
}
|
||||
|
||||
ISR(INT0_vect) {
|
||||
p.PttVect();
|
||||
p.Vect_Ptt();
|
||||
}
|
Loading…
Reference in New Issue
Block a user