/*
 * 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 "NodeMCU_Common.h"


//
// Pin numbers
//
static constexpr eCxx::uint8_t OWSU_PIN = eCxx::NodeMCU::TWI_SDA;


//
// Include common source code for BasicOWSUMaster test application
//
#include "../CommonCode/BasicOWSUMaster_Common.h"


//
// The init function
//
void eCxx_user_init()

{
    // Initialize application
    initBasicNodeMCUApp();

    // There is no need to enable the 74LVC541 buffers on the eCxx NodeMCU development board because
    // this test application uses the SDA pin that is not buffered but routed through a bidirectional
    // logic level translators and the UART is only used for communication with the host PC

    // Initialize UART and one-wire software UART
    initUARTAndOWSU();
}


//
// The task function
//
void eCxx_user_task()
{
    // Process event and send-receive data
    eCxx_user_task_OWSUMaster_TxRx();
}
