Files
firmware/src/platform/nrf52/architecture.h

99 lines
2.1 KiB
C
Raw Normal View History

#pragma once
#define ARCH_NRF52
//
// defaults for NRF52 architecture
//
#ifndef HAS_BLUETOOTH
2023-01-21 14:34:29 +01:00
#define HAS_BLUETOOTH 1
#endif
#ifndef HAS_SCREEN
2023-01-21 14:34:29 +01:00
#define HAS_SCREEN 1
#endif
#ifndef HAS_WIRE
2023-01-21 14:34:29 +01:00
#define HAS_WIRE 1
#endif
#ifndef HAS_GPS
2023-01-21 14:34:29 +01:00
#define HAS_GPS 1
#endif
#ifndef HAS_BUTTON
2023-01-21 14:34:29 +01:00
#define HAS_BUTTON 1
#endif
#ifndef HAS_TELEMETRY
2023-01-21 14:34:29 +01:00
#define HAS_TELEMETRY 1
#endif
#ifndef HAS_RADIO
2023-01-21 14:34:29 +01:00
#define HAS_RADIO 1
#endif
#ifdef HAS_CPU_SHUTDOWN
2023-01-21 14:34:29 +01:00
#define HAS_CPU_SHUTDOWN 1
#endif
//
// set HW_VENDOR
//
// This string must exactly match the case used in release file names or the android updater won't work
#ifdef ARDUINO_NRF52840_PCA10056
2023-01-21 14:34:29 +01:00
#define HW_VENDOR HardwareModel_NRF52840DK
#elif defined(ARDUINO_NRF52840_PPR)
2023-01-21 14:34:29 +01:00
#define HW_VENDOR HardwareModel_PPR
#elif defined(RAK4630)
2023-01-21 14:34:29 +01:00
#define HW_VENDOR HardwareModel_RAK4631
#elif defined(TTGO_T_ECHO)
2023-01-21 14:34:29 +01:00
#define HW_VENDOR HardwareModel_T_ECHO
#elif defined(NORDIC_PCA10059)
2023-01-21 14:34:29 +01:00
#define HW_VENDOR HardwareModel_NRF52840_PCA10059
#elif defined(PRIVATE_HW) || defined(FEATHER_DIY)
2023-01-21 14:34:29 +01:00
#define HW_VENDOR HardwareModel_PRIVATE_HW
#else
2023-01-21 14:34:29 +01:00
#define HW_VENDOR HardwareModel_NRF52_UNKNOWN
#endif
//
// Standard definitions for NRF52 targets
//
#ifdef ARDUINO_NRF52840_PCA10056
// This board uses 0 to be mean LED on
#undef LED_INVERTED
#define LED_INVERTED 1
#endif
#ifndef TTGO_T_ECHO
#define GPS_UBLOX
#endif
#define LED_PIN PIN_LED1 // LED1 on nrf52840-DK
#ifdef PIN_BUTTON1
#define BUTTON_PIN PIN_BUTTON1
#endif
#ifdef PIN_BUTTON2
#define BUTTON_PIN_ALT PIN_BUTTON2
#endif
#ifdef PIN_BUTTON_TOUCH
#define BUTTON_PIN_TOUCH PIN_BUTTON_TOUCH
#endif
// Always include the SEGGER code on NRF52 - because useful for debugging
#include "SEGGER_RTT.h"
// The channel we send stdout data to
#define SEGGER_STDOUT_CH 0
// Debug printing to segger console
#define SEGGER_MSG(...) SEGGER_RTT_printf(SEGGER_STDOUT_CH, __VA_ARGS__)
// If we are not on a NRF52840 (which has built in USB-ACM serial support) and we don't have serial pins hooked up, then we MUST
// use SEGGER for debug output
#if !defined(PIN_SERIAL_RX) && !defined(NRF52840_XXAA)
// No serial ports on this board - ONLY use segger in memory console
#define USE_SEGGER
#endif