IkokaNrf52Board.cpp 956 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifdef IKOKA_NRF52
  2. #include <Arduino.h>
  3. #include <Wire.h>
  4. #include "IkokaNrf52Board.h"
  5. void IkokaNrf52Board::begin() {
  6. NRF52Board::begin();
  7. // ensure we have pull ups on the screen i2c, this isn't always available
  8. // in hardware and it should only be 20k ohms. Disable the pullups if we
  9. // are using the rotated lcd breakout board
  10. #if defined(DISPLAY_CLASS) && DISPLAY_ROTATION == 0
  11. pinMode(PIN_WIRE_SDA, INPUT_PULLUP);
  12. pinMode(PIN_WIRE_SCL, INPUT_PULLUP);
  13. #endif
  14. pinMode(PIN_VBAT, INPUT);
  15. pinMode(VBAT_ENABLE, OUTPUT);
  16. digitalWrite(VBAT_ENABLE, HIGH);
  17. // required button pullup is handled as part of button initilization
  18. // in target.cpp
  19. #if defined(PIN_WIRE_SDA) && defined(PIN_WIRE_SCL)
  20. Wire.setPins(PIN_WIRE_SDA, PIN_WIRE_SCL);
  21. #endif
  22. Wire.begin();
  23. #ifdef P_LORA_TX_LED
  24. pinMode(P_LORA_TX_LED, OUTPUT);
  25. digitalWrite(P_LORA_TX_LED, HIGH);
  26. #endif
  27. delay(10); // give sx1262 some time to power up
  28. }
  29. #endif