Commit for SWO for HW validation menu updates

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@245 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-10-10 12:46:41 +00:00
parent a73154a5e6
commit a688a6549a
19 changed files with 720 additions and 89 deletions

View File

@@ -31,6 +31,11 @@
// Include files
// -----------------------------------------------------------------------------
#include <stdbool.h>
#include "stm32f10x.h"
#include "keypadMatrix.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
@@ -43,10 +48,30 @@
// -----------------------------------------------------------------------------
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_ */

View File

@@ -0,0 +1,93 @@
// -----------------------------------------------------------------------------
/// @file PID.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 PID.h
/// @ingroup {group_name}
#ifndef INC_PID_H_
#define INC_PID_H_
// -----------------------------------------------------------------------------
// Include files
// -----------------------------------------------------------------------------
#include <stdbool.h>
#include "stm32f10x.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Type definitions.
// -----------------------------------------------------------------------------
struct Pid
{
int Kp; // proportional constant
int Ki; // integration constant
int Kd; // differential constant
int input_d1; // Input t-1
bool initialized;
};
// -----------------------------------------------------------------------------
// Function declarations
// -----------------------------------------------------------------------------
/** ----------------------------------------------------------------------------
* PID_construct
* Constructor for a PID regulator
*
* @param self PID object to construct
* @param Kp proportional constant
* @param Ki integration constant
* @param Kd differential constant
*
* @return ErrorStatus SUCCESS if initialisation was successful
* ERRROR otherwise
*
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus PID_construct(struct Pid* self, int Kp, int Ki, int Kd);
/** ----------------------------------------------------------------------------
* PID_calculate
* Calculate
*
* @param self The PID object
* @param error the error input to calculate
*
* @return int calculated value
*
* @todo
* -----------------------------------------------------------------------------
*/
extern int PID_calculate(struct Pid* self, int error);
#endif /* INC_PID_H_ */

View File

@@ -148,7 +148,7 @@ extern ErrorStatus NHD0420_construct(struct NHD0420* self, const struct IODevice
* NHD0420_destruct
* Destructor for the NHD0420 instance
*
* @param interface The interface to use
* @param interface The object to destruct
*
* @return void
*

View File

@@ -0,0 +1,110 @@
// -----------------------------------------------------------------------------
/// @file storm700.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 storm700.h
/// @ingroup {group_name}
#ifndef INC_STORM700_H_
#define INC_STORM700_H_
// -----------------------------------------------------------------------------
// Include files
// -----------------------------------------------------------------------------
#include "stm32f10x.h"
#include "KeyboardDevice.h"
#include "keypadMatrix.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
// -----------------------------------------------------------------------------
#define STORM700_NUMBER_OF_ROWS (4)
#define STORM700_NUMBER_OF_COLUMNS (4)
// -----------------------------------------------------------------------------
// Type definitions.
// -----------------------------------------------------------------------------
struct Storm700
{
struct KeyboardDevice keyboardDevice;
const struct IODevice* device;
bool initialized;
};
// -----------------------------------------------------------------------------
// Function declarations
// -----------------------------------------------------------------------------
/** ----------------------------------------------------------------------------
* Storm700_construct
* Constructor for Storm700 keypad
*
* @param self Keypad object to construct
* @param device The IO device that is used to communicate
*
* @return ErrorStatus SUCCESS if initialisation was successful
* ERROR otherwise
*
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus Storm700_construct(struct Storm700* self, const struct IODevice* device);
/** ----------------------------------------------------------------------------
* Storm700_destruct
* Destructor for the Storm700 instance
*
* @param self The object to destruct
*
* @return void
*
* @todo
* -----------------------------------------------------------------------------
*/
extern void Storm700_destruct(struct Storm700* self);
/** ----------------------------------------------------------------------------
* Storm700_readKey
* Read a key from the storm700 keypad
*
* @param self Keypad instance
* @param key The key that has been read. Will be
* formatted ins ASCII code
* @param keyState Indicates whether key was pressed or
* released
*
* @return ErrorStatus SUCCESS if reading was successful
* ERROR otherwise
*
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus Storm700_readKey(const struct Storm700* self, char* key, Keypad_KeyState* keyState);
#endif /* INC_STORM700_H_ */