FW Profile - C1 Implementation
|
Definition of the interface to access the Hardware Device. More...
Go to the source code of this file.
Macros | |
#define | HW_DEV_ON 1 |
Name of the ON state in the HW Device State Machine. | |
#define | HW_DEV_OFF 2 |
Name of the OFF state in the HW Device State Machine. | |
#define | HW_DEV_SBY 1 |
Name of the STANDBY state in the HW Device State Machine. | |
#define | HW_DEV_OPER 2 |
Name of the OPERATIONAL state in the HW Device State Machine. | |
#define | TR_HW_DEV_ON 1 |
Name of the transition from OFF to ON in the HW Device State Machine. | |
#define | TR_HW_DEV_OFF 2 |
Name of the transition from ON to OFF in the HW Device State Machine. | |
#define | TR_HW_DEV_OPER 3 |
Name of the transition from STANDBY to OPERATIONAL in the HW Device State Machine. | |
#define | TR_HW_DEV_SBY 4 |
Name of the transition from OPERATIONAL to STANDBY in the HW Device State Machine. | |
#define | HW_DEV_TEMP_MAX 100 |
The maximum value of the temperature of the Hardware Device. | |
#define | HW_DEV_CUR_MAX 1 |
The maximum value of the current absorbed by the Hardware Device. | |
Functions | |
FwSmDesc_t | GetHwDevSm () |
Retrieve the descriptor of the Hardware Device State Machine. More... | |
float | GetHwDevTemp () |
This function returns the temperature of the Hardware Device. More... | |
float | GetHwDevCur () |
This function returns the current absorbed by the Hardware Device. More... | |
Definition of the interface to access the Hardware Device.
The behaviour of the Hardware Device is modelled by one state machine and two attributes.
The state machine is called the Hardware Device State Machine and is shown in the figure below. The HW Device State Machine is a singleton and this file defines a getter function to access the single instance of its descriptor.
The attributes of the Hardware Device are: temperature and current. This file defines getter functions through which the value of the two attributes can be retrieved.
Definition in file FwDaHwDev.h.
float GetHwDevCur | ( | ) |
This function returns the current absorbed by the Hardware Device.
In this demo application, the current is modelled as a stochastic variable which is uniformly distributed in the interval: [0, HW_DEV_CUR_MAX].
Definition at line 129 of file FwDaHwDev.c.
FwSmDesc_t GetHwDevSm | ( | ) |
Retrieve the descriptor of the Hardware Device State Machine.
The Hardware Device State Machine is a singleton. The first time this function is called, it creates and configures the state machine descriptor. Subsequently, it always returns the same descriptor.
Definition at line 92 of file FwDaHwDev.c.
float GetHwDevTemp | ( | ) |
This function returns the temperature of the Hardware Device.
In this demo application, the temperature is modelled as a stochastic variable which is uniformly distributed in the interval: [0, HW_DEV_TEMP_MAX].
Definition at line 124 of file FwDaHwDev.c.