Files
hsb/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/IODevice.c
mmi a73154a5e6 Fixed issue with external DAC handlign from repair process
repair process implemented. Simple regulation without feedback (must be addeed, yet)

HW validation menu functional but buggy (IOs not OK)

Added ClearLine functionality to displayDevice

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@244 05563f52-14a8-4384-a975-3d1654cca0fa
2017-10-09 15:29:23 +00:00

92 lines
2.6 KiB
C

// -----------------------------------------------------------------------------
/// @file IODevice.c
/// @brief Description
// -----------------------------------------------------------------------------
// Micro-Key bv
// Industrieweg 28, 9804 TG Noordhorn
// Postbus 92, 9800 AB Zuidhorn
// The Netherlands
// Tel: +31 594 503020
// Fax: +31 594 505825
// Email: support@microkey.nl
// Web: www.microkey.nl
// -----------------------------------------------------------------------------
/// $Revision$
/// $Author$
/// $Date$
// (c) 2017 Micro-Key bv
// -----------------------------------------------------------------------------
/// @file IODevice.c
/// @ingroup {group_name}
// -----------------------------------------------------------------------------
// Include files
// -----------------------------------------------------------------------------
#include "IODevice.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Type definitions
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// File-scope variables
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Function declarations
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Function definitions
// -----------------------------------------------------------------------------
ErrorStatus IODevice_construct (struct IODevice* self, ReadFunction read, WriteFunction write)
{
ErrorStatus returnValue = SUCCESS;
self->_write = write;
self->_read = read;
return returnValue;
}
ErrorStatus IODevice_write(const struct IODevice* self, const char* buffer, size_t length)
{
ErrorStatus returnValue = SUCCESS;
if (self->_write != NULL)
{
returnValue = self->_write(self, buffer, length);
}
return returnValue;
}
ErrorStatus IODevice_read(const struct IODevice* self, char* buffer, size_t length, size_t* actualLength)
{
ErrorStatus returnValue = SUCCESS;
if (self->_read != NULL)
{
returnValue = self->_read(self, buffer, length, actualLength);
}
return returnValue;
}