#pragma once
#include <windows.h>
#include "json.hpp"
using json = nlohmann::json;
using namespace std;

#ifdef __cplusplus    // If used by C++ code, 
extern "C" {          // we need to export the C interface
#endif

	HANDLE OpenGeneralIo();
	void CloseGeneralIo(HANDLE fd);
	int GetGpioValue(WORD address, int bit);
	int SetGpioValue(WORD address, int bit, int status);
	int GetGpioUartMode(int* address, int* bit);
	int SetGpioUartMode(int port, int* address, int* bit, int mode);
	bool CheckBoardConfigByGpio(const char* jsonObject);

#ifdef __cplusplus    // If used by C++ code, 
}
#endif