aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control/control.h
blob: 78e24f495429b94d285afabf3f21c874737f3c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Si
/************************************************************************************************************************
 * control.c
 **************************************************************************************************************************/
#ifndef MODULES_CONTROL_CONTROL_H_
#define MODULES_CONTROL_CONTROL_H_

////////////////////////////////State machine operation////////////////////////////////////
//the state machine operation is used to operate in runtime correct profile flow execution
//by recieved esign flow of the user from the UI
///////////////////////////////////////////////////////////////////////////////////////////
#include "include.h"

//typedef  uint32_t (* DeviceDataFunction)(uint32_t deviceID, uint32_t *Value);
typedef  uint32_t (* ControlCBFunction)(uint32_t IfIndex, uint32_t ReadValue);
typedef  uint32_t (* DataReadCBFunction)( uint32_t Parameter1);
typedef enum {
    eNoControl = 0,
    eOneMillisecond = 1,
    eTenMillisecond = 10,
    eFiftyMillisecond = 50,
    eHundredMillisecond = 100,
    eOneSecond = 1000,
    eOneMinute = 60000,
    eOneHour = 3600000
}CTRL_TIMING_ENUM;
typedef enum
{
    IfTypeNone,
    IfTypeThread,
    IfTypeWinder,
    IfTypeIDS,
    IfTypeHeaters,
    IfTypeWaste,
    IfTypeMotors,
    MAX_INTERFACE_TYPES
}SYSTEM_INTERFACE_TYPES_ID_ENUM;


void        ControlInit(void);
void        ControlStop(void);
void        ControlStart(void);
uint32_t    AddControlCallback(char *Name, ControlCBFunction Callback, uint32_t CtrlFrequency, DataReadCBFunction DriverfPtr, uint16_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 );
int         RemoveControlCallback(uint32_t deviceId, ControlCBFunction Callback );
//The safe remove command can be used ONLY when called from the control callback itself
int         SafeRemoveControlCallback(uint32_t deviceId , ControlCBFunction Callback);
int         SafeRemoveHighControlCallback(uint32_t deviceId , ControlCBFunction Callback);

uint32_t    TemplateDataReadCBFunction (uint32_t deviceId, uint32_t Parameter1);
uint32_t    GetControlDevice_i(void);
uint32_t    GetControlLowDevice_i(void);

ControlCBFunction GetControlCallbackFuncPtr(uint32_t ControlId);

extern Task_Handle Control_Task_Handle;
extern uint32_t millisecondCounter;

#endif