// Filename : input_reader.h
//
// This file was initially generated by SpaceStudio but is meant to be modified
// by the user.
#ifndef INPUT_READER_H
#define INPUT_READER_H

#include "spacecomp.h"
#include "abstract_module.h"
#include "application_definitions.h"

#ifdef SPACE_ARCHITECTURE_IMPLEMENTATION
#include <iostream>
#include <string>
#else
#include "command_generator.h"
#endif

#include <stdint.h>

class input_reader: public abstract_module {
	SPACECOMP_START(input_reader, INDEX, input_reader);

public:
	input_reader(SPACECOMP_CTOR_PARAMS(input_reader, INDEX));

	void thread(SPACECOMP_THREAD_PARAMS(input_reader, INDEX, thread));

#ifndef SPACE_ARCHITECTURE_IMPLEMENTATION
	void stop_simulation();
#endif

private:

uint8_t read_uart();
void send_to_fifo(uint8_t character);

#ifdef SPACE_ARCHITECTURE_IMPLEMENTATION
	unsigned short m_size;
	std::string m_input;
	bool m_reading;
#else
	command_generator m_generator;
#endif

	SPACECOMP_END(input_reader, INDEX, input_reader);
};

#endif
