/*

Module:  getconfig_thisboard.cpp

Function:
                Return a suitable LMIC config for this board.

Copyright & License:
                See accompanying LICENSE file.

Author:
                Terry Moore, MCCI       November 2018

*/
#include "pins_arduino.h"

#include "lmic/arduino_lmic_hal_boards.h"
#include "lmic/lmic.h"
namespace TTN_esp32_LMIC
{

    const HalPinmap_t* GetPinmap_ThisBoard(void)
    {
        /*
        || Adafruit BSPs are not consistent -- m0 express defs ARDUINO_SAMD_FEATHER_M0,
        || m0 defs ADAFRUIT_FEATHER_M0
        */
#if defined(ARDUINO_SAMD_FEATHER_M0) || defined(ADAFRUIT_FEATHER_M0)
#if defined(ARDUINO_MCCI_CATENA_4420)
        // this uses a radiowing and an odd configuration
        return GetPinmap_Catena4420();
#else
        // others use Feather M0 LoRa
        return GetPinmap_FeatherM0LoRa();
#endif
#elif defined(ARDUINO_AVR_FEATHER32U4)
        return GetPinmap_Feather32U4LoRa();
#elif defined(ARDUINO_MCCI_CATENA_4551) || /* legacy names */                                                          \
    defined(ARDUINO_CATENA_4551)
        return GetPinmap_Catena4551();
#elif defined(ARDUINO_MCCI_CATENA_4610)
        return GetPinmap_Catena4610();
#elif defined(ARDUINO_MCCI_CATENA_4611) || /* legacy names */                                                          \
    defined(ARDUINO_CATENA_4611)
        return GetPinmap_Catena4611();
#elif defined(ARDUINO_MCCI_CATENA_4612) || /* legacy names */                                                          \
    defined(ARDUINO_CATENA_4612)
        return GetPinmap_Catena4612();
#elif defined(ARDUINO_MCCI_CATENA_4617)
        return GetPinmap_Catena4617();
#elif defined(ARDUINO_MCCI_CATENA_4618)
        return GetPinmap_Catena4618();
#elif defined(ARDUINO_MCCI_CATENA_4630)
        return GetPinmap_Catena4630();
#elif defined(ARDUINO_MCCI_CATENA_4801)
        return GetPinmap_Catena4801();
#elif defined(PINNOCHIO_SCOUT)
        return GetPinmap_PinnochioScount();
#elif defined(ARDUINO_HELTEC_WIFI_LORA_32) || defined(WIFI_LoRa_32)
        return GetPinmap_heltec_wifi_lora_32();
#elif defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) || defined(WIFI_LoRa_32_V2)
        return GetPinmap_heltec_wifi_lora_32_V2();
#elif defined(ARDUINO_TTGO_LoRa32_V1)
        return GetPinmap_ttgo_lora32_v1();
#elif defined(ARDUINO_HELTEC_WIRELESS_STICK) || defined(Wireless_Stick) || defined(Wireless_Stick_Lite)
        return GetPinmap_heltec_wireless_stick(); //
#elif defined(ARDUINO_M5STACK_FIRE)
        return GetPinmap_M5stack_Lora();
#elif defined(ARDUINO_TBeam)
		return GetPinmap_ttgo_TBEAM();
#else

#pragma message("Board not supported -- use an explicit pinmap")
        return nullptr;

#endif
    }

}; // namespace TTN_esp32_LMIC
