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


#include <eCxx/eCxx.h>

#include "AVR_Common.h"


//
// Pin numbers
//
#ifndef __AVR_ATmega2560__

static constexpr eCxx::uint8_t PLL = 12; // Parallel data latch/load
static constexpr eCxx::uint8_t SDO = 13; // Serial data output
static constexpr eCxx::uint8_t SDI = 14; // Serial data input
static constexpr eCxx::uint8_t SCK = 15; // Serial data clock

#else

static constexpr eCxx::uint8_t PLL = 53; // Parallel data latch/load
static constexpr eCxx::uint8_t SDO = 51; // Serial data output
static constexpr eCxx::uint8_t SDI = 50; // Serial data input
static constexpr eCxx::uint8_t SCK = 52; // Serial data clock

#endif


//
// Include common source code for IOExpanderRW test application
//
#include "../CommonCode/IOExpanderRW_Common.h"


//
// The init function
//
void eCxx_user_init()
{
    // Initialize application
    initBasicAVRApp();

    // Initialize the IO expander
    eCxx_user_init_IOExpander();
}


//
// The task function
//
void eCxx_user_task()
{
    // Process event and handle the IO expander
    eCxx_user_task_IOExpander();
}
