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


#include <eCxx/eCxx_DDX.h>


//
// Test application
//
int main()
{
    // Pin 13 is PB 5 in ATmega328P
    const eCxx::PinDDX<13> pinDDX;

    // Output
    pinDDX.pinModeOutput();
    pinDDX.digitalWrite(true );
    pinDDX.digitalWrite(false);

    // NOPs
    eCxx::asmNOP< 1>(); eCxx::asmNOP< 2>(); eCxx::asmNOP< 3>(); eCxx::asmNOP< 4>(); eCxx::asmNOP< 5>();
    eCxx::asmNOP< 6>(); eCxx::asmNOP< 7>(); eCxx::asmNOP< 8>(); eCxx::asmNOP< 9>();
    eCxx::asmNOP<10>(); eCxx::asmNOP<20>(); eCxx::asmNOP<30>(); eCxx::asmNOP<40>(); eCxx::asmNOP<50>();
    eCxx::asmNOP<60>(); eCxx::asmNOP<70>(); eCxx::asmNOP<80>(); eCxx::asmNOP<90>();

    // Input with pull-up
    pinDDX.pinModeInput(true);
    return pinDDX.digitalRead();
}
