ADC debugged and functional now
Added Version interface Added DisplayDevice to create an independent bridge between display app and specific display driver git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@228 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
/// @file DisplayDevice.h
|
||||
/// @brief File 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) 2015 Micro-Key bv
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @defgroup {group_name} {group_description}
|
||||
/// Description
|
||||
|
||||
/// @file DisplayDevice.h
|
||||
/// @ingroup {group_name}
|
||||
|
||||
#ifndef INC_DISPLAYDEVICE_H_
|
||||
#define INC_DISPLAYDEVICE_H_
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Include files
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "stm32f10x.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
typedef enum
|
||||
{
|
||||
OFF = 0,
|
||||
ON = !OFF
|
||||
} DisplayDevice_functionalState;
|
||||
|
||||
struct DisplayDevice;
|
||||
|
||||
typedef ErrorStatus (*DisplayResetFunction)(const struct DisplayDevice* self);
|
||||
typedef ErrorStatus (*DisplaySetStateFunction)(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||
typedef ErrorStatus (*DisplayWriteFunction)(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column);
|
||||
typedef ErrorStatus (*DisplayClearFunction)(const struct DisplayDevice* self);
|
||||
typedef ErrorStatus (*DisplaySetBrightnessFunction)(const struct DisplayDevice* self, size_t brightness);
|
||||
typedef ErrorStatus (*DisplaySetContrastFunction)(const struct DisplayDevice* self, size_t contrast);
|
||||
typedef ErrorStatus (*DisplayInvertFunction)(const struct DisplayDevice* self);
|
||||
|
||||
struct DisplayDeviceParameters
|
||||
{
|
||||
size_t numberOfRows;
|
||||
size_t numberOfColumns;
|
||||
size_t contrastMin;
|
||||
size_t contrastMax;
|
||||
size_t brightnessMin;
|
||||
size_t brightnessMax;
|
||||
};
|
||||
|
||||
struct DisplayDevice
|
||||
{
|
||||
DisplayResetFunction _reset;
|
||||
DisplaySetStateFunction _setState;
|
||||
DisplayWriteFunction _write;
|
||||
DisplayClearFunction _clear;
|
||||
DisplaySetBrightnessFunction _setBrightness;
|
||||
DisplaySetContrastFunction _setContrast;
|
||||
DisplayInvertFunction _invert;
|
||||
struct DisplayDeviceParameters parameters;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
extern ErrorStatus DisplayDevice_construct (struct DisplayDevice* self, struct DisplayDeviceParameters* parameters,
|
||||
DisplayResetFunction reset,
|
||||
DisplaySetStateFunction setState,
|
||||
DisplayWriteFunction write,
|
||||
DisplayClearFunction clear,
|
||||
DisplaySetBrightnessFunction setBrightness,
|
||||
DisplaySetContrastFunction setContrast,
|
||||
DisplayInvertFunction invert);
|
||||
|
||||
extern ErrorStatus DisplayDevice_reset(const struct DisplayDevice* self);
|
||||
extern ErrorStatus DisplayDevice_setState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||
extern ErrorStatus DisplayDevice_write(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column);
|
||||
extern ErrorStatus DisplayDevice_clear(const struct DisplayDevice* self);
|
||||
extern ErrorStatus DisplayDevice_setBrightness(const struct DisplayDevice* self, size_t brightness);
|
||||
extern ErrorStatus DisplayDevice_setContrast(const struct DisplayDevice* self, size_t contrast);
|
||||
extern ErrorStatus DisplayDevice_invert(const struct DisplayDevice* self);
|
||||
|
||||
#endif /* INC_DISPLAYDEVICE_H_ */
|
||||
Reference in New Issue
Block a user