/*
 * Copyright (C) 2020-2021 Aloysius Indrayanto
 *
 * This file is part of the eCxx library, see LICENSE file for the license details.
 */


#ifndef ECXX_PLATFORM_AVRX_PIN_NAME_H
#define ECXX_PLATFORM_AVRX_PIN_NAME_H


namespace eCxx {


//
// Define some predefined pin names for convenience
//
namespace AVR {


//
// For convenience
//
static constexpr uint8_t InvalidPin = Application_Base::InvalidPin;


//
// Builtin LED pin
//
static constexpr uint8_t BuiltinLED = 13;


//
// Measure temperature using ADC
//     # Measured using the on-chip temperature sensor.
//     # The result is in (Kelvin * 100) and it may need further user calibration.
static constexpr uint8_t A_TempSenseK = 0x1C;


//
// Measure AC0's DAC voltage using ADC
//     # Measured against the currently active ADCVRef.
//     # The result is in raw ADC value.
static constexpr uint8_t A_DACRef0 = 0x1E;


//
// Include the appropriate standard pin naming header file
//
#define INCLUDE_ECXX_PLATFORM_AVRX_PIN_NAME_STD_H


#if defined(__AVR_ATmega808__) || defined(__AVR_ATmega1608__) || defined(__AVR_ATmega3208__) || defined(__AVR_ATmega4808__)

    #include "PinName_Std_AXCDXF.h"


#elif defined(__AVR_ATmega809__) || defined(__AVR_ATmega1609__) || defined(__AVR_ATmega3209__) || defined(__AVR_ATmega4809__)

    #include "PinName_Std_ABCDEF.h"


#endif


#ifdef INCLUDE_ECXX_PLATFORM_AVRX_PIN_NAME_STD_H
    #error "unsupported AVR MCU"
#endif


} // namespace AVR


} // namespace eCxx


#endif
