/*
 * 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_XBCDE_H
#define ECXX_PLATFORM_AVR_PIN_NAME_STD_XBCDE_H


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

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

// ADC pins
static constexpr uint8_t A0   = 14;
static constexpr uint8_t A1   = 15;
static constexpr uint8_t A2   = 16;
static constexpr uint8_t A3   = 17;
static constexpr uint8_t A4   = 18;
static constexpr uint8_t A5   = 19;
static constexpr uint8_t A6   = 20;
static constexpr uint8_t A7   = 21;

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

// PWM pins
static constexpr uint8_t PWM0  =  9;
static constexpr uint8_t PWM1  = 10;
static constexpr uint8_t PWM2  = 11;

// Interrupt pins
static constexpr uint8_t EINT0 = 2;
static constexpr uint8_t EINT1 = 3;

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

static constexpr uint8_t UART1_Rx  = 12;
static constexpr uint8_t UART1_Tx  = 11;

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

static constexpr uint8_t SPI0_MISO = 12;
static constexpr uint8_t SPI0_MOSI = 11;
static constexpr uint8_t SPI0_SCK  = 13;
static constexpr uint8_t SPI0_SS   = 10;

static constexpr uint8_t SPI1_MISO = 14;
static constexpr uint8_t SPI1_MOSI = 21;
static constexpr uint8_t SPI1_SCK  = 15;
static constexpr uint8_t SPI1_SS   = 20;

static constexpr uint8_t SPI_MISO  = SPI0_MISO;
static constexpr uint8_t SPI_MOSI  = SPI0_MOSI;
static constexpr uint8_t SPI_SCK   = SPI0_SCK;
static constexpr uint8_t SPI_SS    = SPI0_SS;

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

// Analog comparator pins
static constexpr uint8_t AC_InPos = 6; /* AIN0 - PD 6 */
static constexpr uint8_t AC_InNeg = 7; /* AIN1 - PD 7 */


#endif
