Browse Source

Partially initialize digital ports

DricomDragon 5 years ago
parent
commit
46f0c03968
2 changed files with 23 additions and 0 deletions
  1. 13 0
      prog/sources/dev-board-io.cpp
  2. 10 0
      prog/sources/dev-board-io.h

+ 13 - 0
prog/sources/dev-board-io.cpp

@@ -0,0 +1,13 @@
+#include "all-headers.h"
+
+static void setupIO (INIT_MODE) {
+	pinMode (L0_LED, DigitalMode::OUTPUT);
+	pinMode (TEENSY_LED, DigitalMode::OUTPUT);
+
+	pinMode (P0_PUSH_BUTTON, DigitalMode::INPUT_PULLUP);
+
+	// Start teensy led
+	digitalWrite (TEENSY_LED, true);
+}
+
+MACRO_INIT_ROUTINE (setupIO);

+ 10 - 0
prog/sources/dev-board-io.h

@@ -0,0 +1,10 @@
+#pragma once
+
+#include "teensy-3-6-digital-io.h"
+
+static const DigitalPort L0_LED = DigitalPort::D3 ;
+
+static const DigitalPort P0_PUSH_BUTTON = DigitalPort::D8 ;
+
+static const DigitalPort TEENSY_LED = DigitalPort::D13;
+