dev-board-io.cpp 895 B

12345678910111213141516171819202122232425262728
  1. #include "all-headers.h"
  2. static void configurePorts (INIT_MODE) {
  3. // Leds
  4. pinMode (L0_LED, DigitalMode::OUTPUT) ;
  5. pinMode (L1_LED, DigitalMode::OUTPUT) ;
  6. pinMode (L2_LED, DigitalMode::OUTPUT) ;
  7. pinMode (L3_LED, DigitalMode::OUTPUT) ;
  8. pinMode (L4_LED, DigitalMode::OUTPUT) ;
  9. // Push buttons
  10. pinMode (P0_PUSH_BUTTON, DigitalMode::INPUT_PULLUP) ;
  11. pinMode (P1_PUSH_BUTTON, DigitalMode::INPUT_PULLUP) ;
  12. pinMode (P2_PUSH_BUTTON, DigitalMode::INPUT_PULLUP) ;
  13. pinMode (P3_PUSH_BUTTON, DigitalMode::INPUT_PULLUP) ;
  14. pinMode (P4_PUSH_BUTTON, DigitalMode::INPUT_PULLUP) ;
  15. // Encoder
  16. pinMode (ENCODER_A, DigitalMode::INPUT_PULLUP) ;
  17. pinMode (ENCODER_B, DigitalMode::INPUT_PULLUP) ;
  18. pinMode (ENCODER_CLIC, DigitalMode::INPUT_PULLUP) ;
  19. // Teensy Led
  20. pinMode (DigitalPort::D13, DigitalMode::OUTPUT) ;
  21. digitalWrite (DigitalPort::D13, true) ; // On
  22. }
  23. MACRO_INIT_ROUTINE (configurePorts) ;