summaryrefslogtreecommitdiff
path: root/src/pin.cpp
diff options
context:
space:
mode:
authorvlapa <vlapa@ya.ru>2026-06-13 17:15:14 +0300
committervlapa <vlapa@ya.ru>2026-06-13 17:15:14 +0300
commita147451733364217c9f380e0a22099b58155383f (patch)
treeed743dbf05c102d08c740ff19dee05f9dab24a37 /src/pin.cpp
Firstmain
Diffstat (limited to 'src/pin.cpp')
-rw-r--r--src/pin.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/pin.cpp b/src/pin.cpp
new file mode 100644
index 0000000..d0e1e98
--- /dev/null
+++ b/src/pin.cpp
@@ -0,0 +1,44 @@
+#include <avr/io.h>
+#include "pin.h"
+
+//===============================================================
+// Инициализация всех ПИНов:
+void init_pin()
+{
+ DDR_A |= (1 << SEG_A);
+ PORT_A |= (1 << SEG_A);
+ DDR_B |= (1 << SEG_B);
+ PORT_B |= (1 << SEG_B);
+ DDR_C |= (1 << SEG_C);
+ PORT_C |= (1 << SEG_C);
+ DDR_D |= (1 << SEG_D);
+ PORT_D |= (1 << SEG_D);
+ DDR_E |= (1 << SEG_E);
+ PORT_E |= (1 << SEG_E);
+ DDR_F |= (1 << SEG_F);
+ PORT_F |= (1 << SEG_F);
+ DDR_G |= (1 << SEG_G);
+ PORT_G |= (1 << SEG_G);
+ DDR_H |= (1 << SEG_H);
+ PORT_H |= (1 << SEG_H);
+
+ DDR_RAZ1 |= (1 << RAZ_1);
+ PORT_RAZ1 |= (1 << RAZ_1);
+ DDR_RAZ2 |= (1 << RAZ_2);
+ PORT_RAZ2 |= (1 << RAZ_2);
+ DDR_RAZ3 |= (1 << RAZ_3);
+ PORT_RAZ3 |= (1 << RAZ_3);
+ DDR_RAZ4 |= (1 << RAZ_4);
+ PORT_RAZ4 |= (1 << RAZ_4);
+
+ DDR_TAHO &= ~(1 << BTN);
+ PORT_TAHO |= (1 << BTN);
+
+ DDR_BTN &= ~(1 << BTN);
+ PORT_BTN |= (1 << BTN);
+
+ DDR_IGN_ON &= ~(1 << IGN_ON);
+ PORT_IGN_ON |= (1 << IGN_ON);
+}
+
+//===============================================================