summaryrefslogtreecommitdiff
path: root/src/pin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pin.cpp')
-rw-r--r--src/pin.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/pin.cpp b/src/pin.cpp
new file mode 100644
index 0000000..5c12a4c
--- /dev/null
+++ b/src/pin.cpp
@@ -0,0 +1,37 @@
+#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_RAZ5 |= (1 << RAZ_5);
+ PORT_RAZ5 |= (1 << RAZ_5);
+}
+
+//===============================================================