git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@427 05563f52-14a8-4384-a975-3d1654cca0fa
123 lines
3.8 KiB
C
123 lines
3.8 KiB
C
// -----------------------------------------------------------------------------
|
|
/// @file hwValidationMenu.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
|
|
// -----------------------------------------------------------------------------
|
|
|
|
/**
|
|
* %HwValidationMenu implementation
|
|
* \defgroup HwValidationMenu Package HwValidationMenu
|
|
* \ingroup hsb-mrts
|
|
* @{
|
|
*/
|
|
|
|
#ifndef INC_HWVALIDATIONMENU_H_
|
|
#define INC_HWVALIDATIONMENU_H_
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Include files
|
|
// -----------------------------------------------------------------------------
|
|
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
|
|
#include <stdbool.h>
|
|
#include "stm32f10x.h"
|
|
|
|
#include "IODevice.h"
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Constant and macro definitions
|
|
// -----------------------------------------------------------------------------
|
|
|
|
#define ANSI_TERMINAL_RESET "\x1b[2J"
|
|
#define ANSI_TERMINAL_HOME "\x1b[H"
|
|
|
|
#define CON_INF_MAX_MENU_ITEMS (15)
|
|
|
|
#define HW_VAL_MENU_OUTPUT_BUFFER_SIZE (64)
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Type definitions.
|
|
// -----------------------------------------------------------------------------
|
|
|
|
struct HwValidationMenuItems
|
|
{
|
|
struct DisplayDevice* display; // DisplayDevice to talk to
|
|
struct Adc* internalADC; // Internal ADC with channel array
|
|
struct MAX5715* externalDAC; // External DAC with channel array
|
|
struct Gpio* interlockNO;
|
|
struct Gpio* interlockNC;
|
|
struct Gpio* TeslaSecurity;
|
|
struct Gpio* solenoid;
|
|
struct Gpio* mcp0Relay;
|
|
struct Gpio* mcp1Relay;
|
|
struct Gpio* mcp2Relay;
|
|
struct Gpio* cat0Relay;
|
|
struct Gpio* cat1Relay;
|
|
struct Gpio* cat2Relay;
|
|
struct Gpio* hv0;
|
|
struct Gpio* hv1;
|
|
struct Gpio* hv2;
|
|
struct Gpio* bicolourGreen;
|
|
struct Gpio* bicolourRed;
|
|
struct Pcba* pcba;
|
|
struct Keypad *keypad;
|
|
struct Buzzer* buzzer;
|
|
};
|
|
|
|
struct HwValidationMenu
|
|
{
|
|
TaskHandle_t taskHandle;
|
|
int taskPriority;
|
|
uint16_t stackSize;
|
|
bool runTask;
|
|
struct HwValidationMenuItems* testItems;
|
|
int menuItemSelected;
|
|
struct IODevice* ioDevice;
|
|
bool initialized;
|
|
char outputBuffer[HW_VAL_MENU_OUTPUT_BUFFER_SIZE];
|
|
};
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Function declarations
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
/** ----------------------------------------------------------------------------
|
|
* HwValidationMenu_construct
|
|
* Constructor for HW validation menu (usually used on a terminal)
|
|
*
|
|
* @param self The validation menu object
|
|
* @param ioDevice IODevice to communicate with
|
|
* @param testItems list of items to test
|
|
*
|
|
* @return ErrorStatus SUCCESS if construction was successful
|
|
* ERROR otherwise
|
|
*
|
|
* @todo
|
|
* -----------------------------------------------------------------------------
|
|
*/
|
|
extern ErrorStatus HwValidationMenu_construct(struct HwValidationMenu* self, struct IODevice* ioDevice, struct HwValidationMenuItems* testItems, int taskPriority, uint16_t stackSize);
|
|
|
|
|
|
#endif /* INC_HWVALIDATIONMENU_H_ */
|
|
|
|
/** @} */
|