git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@245 05563f52-14a8-4384-a975-3d1654cca0fa
78 lines
2.3 KiB
C
78 lines
2.3 KiB
C
// -----------------------------------------------------------------------------
|
|
/// @file KeyboardDevice.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 KeyboardDevice.h
|
|
/// @ingroup {group_name}
|
|
|
|
#ifndef INC_KEYBOARDDEVICE_H_
|
|
#define INC_KEYBOARDDEVICE_H_
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Include files
|
|
// -----------------------------------------------------------------------------
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "stm32f10x.h"
|
|
|
|
#include "keypadMatrix.h"
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Constant and macro definitions
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Type definitions.
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
struct KeyboardDevice;
|
|
|
|
|
|
typedef ErrorStatus (*KeyboardReadFunction)(const struct KeyboardDevice* self, char* buffer, Keypad_KeyState* keyState);
|
|
|
|
|
|
struct KeyboardDeviceParameters
|
|
{
|
|
int numberOfKeys;
|
|
};
|
|
|
|
struct KeyboardDevice
|
|
{
|
|
KeyboardReadFunction _read;
|
|
struct KeyboardDeviceParameters parameters;
|
|
bool initialized;
|
|
};
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Function declarations
|
|
// -----------------------------------------------------------------------------
|
|
|
|
extern ErrorStatus KeyboardDevice_construct (struct KeyboardDevice* self, struct KeyboardDeviceParameters* parameters, KeyboardReadFunction read);
|
|
|
|
extern ErrorStatus KeyboardDevice_read(const struct KeyboardDevice* self, char* buffer, Keypad_KeyState* keyState);
|
|
|
|
#endif /* INC_KEYBOARDDEVICE_H_ */
|