From da2c79f81af62acbf94f357714a32054ba9dd21a Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Mon, 19 Oct 2020 18:16:51 +0200 Subject: [PATCH] Start Programm --- .gitignore | 1 + Programm/Audio-Switch.atsln | 22 +++ Programm/Audio-Switch/Audio-Switch.cppproj | 183 +++++++++++++++++++++ Programm/Audio-Switch/Programm.hpp | 31 ++++ Programm/Audio-Switch/io/ports/pin.hpp | 93 +++++++++++ Programm/Audio-Switch/io/ports/portb.hpp | 40 +++++ Programm/Audio-Switch/io/ports/portc.hpp | 40 +++++ Programm/Audio-Switch/io/ports/portd.hpp | 40 +++++ Programm/Audio-Switch/main.cpp | 23 +++ Programm/Audio-Switch/peripheral.h | 19 +++ 10 files changed, 492 insertions(+) create mode 100644 Programm/Audio-Switch.atsln create mode 100644 Programm/Audio-Switch/Audio-Switch.cppproj create mode 100644 Programm/Audio-Switch/Programm.hpp create mode 100644 Programm/Audio-Switch/io/ports/pin.hpp create mode 100644 Programm/Audio-Switch/io/ports/portb.hpp create mode 100644 Programm/Audio-Switch/io/ports/portc.hpp create mode 100644 Programm/Audio-Switch/io/ports/portd.hpp create mode 100644 Programm/Audio-Switch/main.cpp create mode 100644 Programm/Audio-Switch/peripheral.h diff --git a/.gitignore b/.gitignore index 17d2734..320697d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /Platine/*.T3000OPEN /Aisler /Gehäuse/PCB +/Programm/Audio-Switch/Audio-Switch.componentinfo.xml diff --git a/Programm/Audio-Switch.atsln b/Programm/Audio-Switch.atsln new file mode 100644 index 0000000..3f34170 --- /dev/null +++ b/Programm/Audio-Switch.atsln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Atmel Studio Solution File, Format Version 11.00 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "Audio-Switch", "Audio-Switch\Audio-Switch.cppproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|AVR = Debug|AVR + Release|AVR = Release|AVR + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Programm/Audio-Switch/Audio-Switch.cppproj b/Programm/Audio-Switch/Audio-Switch.cppproj new file mode 100644 index 0000000..7bc29ec --- /dev/null +++ b/Programm/Audio-Switch/Audio-Switch.cppproj @@ -0,0 +1,183 @@ + + + + 2.0 + 7.0 + com.Atmel.AVRGCC8.CPP + dce6c7e3-ee26-4d79-826b-08594b9ad897 + ATmega48PA + none + Executable + CPP + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + Audio-Switch + Audio-Switch + Audio-Switch + Native + true + false + true + true + + + true + + 2 + 0 + 0 + + + + + + + + + + + + + + + + + + -mmcu=atmega48pa -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\gcc\dev\atmega48pa" + True + True + True + True + False + True + True + + + NDEBUG + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include + + + Optimize for size (-Os) + True + True + True + True + True + + + NDEBUG + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include + + + + + + + + + -mmcu=atmega48pa -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\gcc\dev\atmega48pa" + True + True + True + True + False + True + True + + + DEBUG + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include + + + Optimize (-O1) + True + True + Default (-g2) + True + True + True + + + DEBUG + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include + + + Optimize (-O1) + True + True + Default (-g2) + True + + + libm + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.351\include + + + Default (-Wa,-g) + + + + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + + + + + + \ No newline at end of file diff --git a/Programm/Audio-Switch/Programm.hpp b/Programm/Audio-Switch/Programm.hpp new file mode 100644 index 0000000..d249efd --- /dev/null +++ b/Programm/Audio-Switch/Programm.hpp @@ -0,0 +1,31 @@ +/* + * Programm.hpp + * + * Created: 19.10.2020 18:03:50 + * Author: netz + */ + +#define F_CPU 8000000 + +#include "peripheral.h" + +template +class ProgrammT { + public: + ProgrammT() { + + } + + void Setup() { + + } + + void Loop() { + + } + + void PttVect() { + + } +}; +typedef ProgrammT Programm; \ No newline at end of file diff --git a/Programm/Audio-Switch/io/ports/pin.hpp b/Programm/Audio-Switch/io/ports/pin.hpp new file mode 100644 index 0000000..05f92de --- /dev/null +++ b/Programm/Audio-Switch/io/ports/pin.hpp @@ -0,0 +1,93 @@ +/* + * pin.cpp + * + * Created: 25.01.2020 21:02:41 + * Author: netz + */ + +#ifndef BLUBBLIB_PIN_HPP +#define BLUBBLIB_PIN_HPP + +#include + +namespace blubblib { + template + struct pin { + static void Set(bool value = true) { + if (value) { + PortT::Port(PortT::Port() | (1< + +namespace blubblib { + struct portb { + static uint8_t Port() { + return PORTB; + } + + static void Port(uint8_t v) { + PORTB = v; + } + + static uint8_t Pin() { + return PINB; + } + + static void Pin(uint8_t v) { + PINB = v; + } + + static uint8_t Dir() { + return DDRB; + } + + static void Dir(uint8_t v) { + DDRB = v; + } + }; +} +#endif \ No newline at end of file diff --git a/Programm/Audio-Switch/io/ports/portc.hpp b/Programm/Audio-Switch/io/ports/portc.hpp new file mode 100644 index 0000000..2c8f311 --- /dev/null +++ b/Programm/Audio-Switch/io/ports/portc.hpp @@ -0,0 +1,40 @@ +/* + * portc.cpp + * + * Created: 19.10.2020 17:46:58 + * Author: netz + */ + +#ifndef BLUBBLIB_PORTC_HPP +#define BLUBBLIB_PORTC_HPP + +#include + +namespace blubblib { + struct portc { + static uint8_t Port() { + return PORTC; + } + + static void Port(uint8_t v) { + PORTC = v; + } + + static uint8_t Pin() { + return PINC; + } + + static void Pin(uint8_t v) { + PINC = v; + } + + static uint8_t Dir() { + return DDRC; + } + + static void Dir(uint8_t v) { + DDRC = v; + } + }; +} +#endif \ No newline at end of file diff --git a/Programm/Audio-Switch/io/ports/portd.hpp b/Programm/Audio-Switch/io/ports/portd.hpp new file mode 100644 index 0000000..82af6e9 --- /dev/null +++ b/Programm/Audio-Switch/io/ports/portd.hpp @@ -0,0 +1,40 @@ +/* + * portd.cpp + * + * Created: 19.10.2020 17:46:58 + * Author: netz + */ + +#ifndef BLUBBLIB_PORTD_HPP +#define BLUBBLIB_PORTD_HPP + +#include + +namespace blubblib { + struct portd { + static uint8_t Port() { + return PORTD; + } + + static void Port(uint8_t v) { + PORTD = v; + } + + static uint8_t Pin() { + return PIND; + } + + static void Pin(uint8_t v) { + PIND = v; + } + + static uint8_t Dir() { + return DDRD; + } + + static void Dir(uint8_t v) { + DDRD = v; + } + }; +} +#endif \ No newline at end of file diff --git a/Programm/Audio-Switch/main.cpp b/Programm/Audio-Switch/main.cpp new file mode 100644 index 0000000..3f9ff80 --- /dev/null +++ b/Programm/Audio-Switch/main.cpp @@ -0,0 +1,23 @@ +/* + * Audio-Switch.cpp + * + * Created: 19.10.2020 17:26:46 + * Author : netz + */ + +#include "Programm.hpp" +#include + +Programm p; + +int main(void) { + sei(); + p.Setup(); + while (1) { + p.Loop(); + } +} + +ISR(INT0_vect) { + p.PttVect(); +} \ No newline at end of file diff --git a/Programm/Audio-Switch/peripheral.h b/Programm/Audio-Switch/peripheral.h new file mode 100644 index 0000000..01ec538 --- /dev/null +++ b/Programm/Audio-Switch/peripheral.h @@ -0,0 +1,19 @@ +/* + * peripheral.h + * + * Created: 19.10.2020 18:08:27 + * Author: netz + */ + + +#ifndef PERIPHERAL_H_ +#define PERIPHERAL_H_ + +namespace { + //Programm settings + extern int const settings_prog_delay_plus = 5000; +} + + + +#endif /* PERIPHERAL_H_ */ \ No newline at end of file