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


#ifndef INCLUDE_ECXX_PLATFORM_AVR_PIN_NAME_STD_H
#error "this file cannot be included directly"
#endif
#undef INCLUDE_ECXX_PLATFORM_AVR_PIN_NAME_STD_H


#ifndef ECXX_PLATFORM_AVR_PIN_NAME_STD_ABCDEFG_H
#define ECXX_PLATFORM_AVR_PIN_NAME_STD_ABCDEFG_H


//
// Available ports : A B C D E F G (no Arduino variant)
//

// Maximum digital pin number
static constexpr uint8_t DMax = 52;

// ADC pins
static constexpr uint8_t A0   = 45;
static constexpr uint8_t A1   = 46;
static constexpr uint8_t A2   = 47;
static constexpr uint8_t A3   = 48;
static constexpr uint8_t A4   = 49;
static constexpr uint8_t A5   = 50;
static constexpr uint8_t A6   = 51;
static constexpr uint8_t A7   = 52;

static constexpr uint8_t AMin = A0;
static constexpr uint8_t AMax = A7;

// PWM pins
static constexpr uint8_t PWM0 = 11;
static constexpr uint8_t PWM1 = 12;
static constexpr uint8_t PWM2 =  3;
static constexpr uint8_t PWM3 =  4;
static constexpr uint8_t PWM4 =  5;

// Interrupt pins
static constexpr uint8_t EINT0 = 18;
static constexpr uint8_t EINT1 = 19;
static constexpr uint8_t EINT2 = 20;
static constexpr uint8_t EINT3 = 21;
static constexpr uint8_t EINT4 =  6;
static constexpr uint8_t EINT5 =  7;
static constexpr uint8_t EINT6 =  2;
static constexpr uint8_t EINT7 =  3;

// Communication pins
static constexpr uint8_t UART0_Rx =  0;
static constexpr uint8_t UART0_Tx =  1;

static constexpr uint8_t UART1_Rx = 20;
static constexpr uint8_t UART1_Tx = 21;

static constexpr uint8_t UART_Rx  = UART0_Rx;
static constexpr uint8_t UART_Tx  = UART0_Tx;

static constexpr uint8_t SPI_MISO = 17;
static constexpr uint8_t SPI_MOSI = 16;
static constexpr uint8_t SPI_SCK  = 15;
static constexpr uint8_t SPI_SS   = 14;

static constexpr uint8_t TWI_SDA  = 19;
static constexpr uint8_t TWI_SCL  = 18;

// Analog comparator pins
static constexpr uint8_t AC_InPos = 4; /* AIN0 - PE 2 */
static constexpr uint8_t AC_InNeg = 5; /* AIN1 - PE 3 */


#endif
