git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@240 05563f52-14a8-4384-a975-3d1654cca0fa
123 lines
3.8 KiB
C
123 lines
3.8 KiB
C
// -----------------------------------------------------------------------------
|
|
/// @file repairProcess.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 repairProcess.h
|
|
/// @ingroup {group_name}
|
|
|
|
#ifndef REPAIRPROCESS_H_
|
|
#define REPAIRPROCESS_H_
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Include files
|
|
// -----------------------------------------------------------------------------
|
|
#include <stdbool.h>
|
|
|
|
#include "stm32f10x.h"
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Constant and macro definitions
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Type definitions.
|
|
// -----------------------------------------------------------------------------
|
|
|
|
typedef enum
|
|
{
|
|
IDLE = 0,
|
|
SOFTSTART = 1,
|
|
VOLTAGE_HOLD = 2,
|
|
PAUSE = 3
|
|
} RepairState;
|
|
|
|
|
|
struct RepairProcess
|
|
{
|
|
TaskHandle_t taskHandle;
|
|
int TaskPriority;
|
|
uint16_t stackSize;
|
|
bool runTask;
|
|
SemaphoreHandle_t secondsSyncronisation;
|
|
uint32_t secondsCounter;
|
|
RepairState currentState;
|
|
bool initialized;
|
|
};
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Function declarations
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
/** ----------------------------------------------------------------------------
|
|
* repairProcess_construct
|
|
* Description of function
|
|
*
|
|
* @param self The process object
|
|
* @param taskPriority Task priority for the repair process
|
|
* @param stackSize Stacksize of the task
|
|
*
|
|
* @return ErrorStatus SUCCESS if construction was successful
|
|
* ERROR otherwise
|
|
*
|
|
* @todo
|
|
* -----------------------------------------------------------------------------
|
|
*/
|
|
extern ErrorStatus repairProcess_construct(struct RepairProcess* self, int taskPriority, uint16_t stackSize);
|
|
|
|
|
|
/** ----------------------------------------------------------------------------
|
|
* repairProcess_feedSecondsCounter
|
|
* Feeds the seconds counter of the repair process.
|
|
* The process is designed to be run every second, so this feed function should
|
|
* be called every second.
|
|
*
|
|
* @param self The repair process
|
|
*
|
|
* @return void
|
|
*
|
|
* @todo
|
|
* -----------------------------------------------------------------------------
|
|
*/
|
|
extern void repairProcess_feedSecondsCounter(struct RepairProcess* self);
|
|
|
|
|
|
/** ----------------------------------------------------------------------------
|
|
* repairProcess_feedSecondsCounterFromISR
|
|
* Feeds the seconds counter of the repair process.
|
|
* This function should be called in an ISR context
|
|
* The process is designed to be run every second, so this feed function should
|
|
* be called every second.
|
|
*
|
|
* @param self The repair process
|
|
*
|
|
* @return void
|
|
*
|
|
* @todo
|
|
* -----------------------------------------------------------------------------
|
|
*/
|
|
extern void repairProcess_feedSecondsCounterFromISR(struct RepairProcess* self);
|
|
|
|
#endif /* REPAIRPROCESS_H_ */
|