TEMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Power.h
Go to the documentation of this file.
1 //===------------------------------------------------------------*- C++ -*-===//
2 //
3 // T-EMU: The Terma Emulator
4 // (c) Terma 2017
5 // Authors: Mattias Holm <maho (at) terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 
9 /*
10  * EXPERIMENTAL INTERFACE: This interface is undergoing public review
11  */
12 #ifndef TEMU_MODELS_POWER_H
13 #define TEMU_MODELS_POWER_H
14 
15 #include "temu-c/Support/Objsys.h"
16 
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
23 typedef enum {
27 
28 typedef struct {
29  void (*powerOn)(void *Obj);
30  void (*powerOff)(void *Obj);
31  temu_PowerState (*getPowerState)(void *Obj);
33 
34 #define TEMU_POWER_IFACE_TYPE "PowerIface"
35 TEMU_IFACE_REFERENCE_TYPE(temu_Power);
36 
37 
38 // Power line interface is experimental
39 typedef struct {
40  void (*setCurrent)(void *Obj, double Current);
41  double (*getCurrent)(void *Obj);
42  void (*setVoltage)(void *Obj, double Voltage);
43  double (*getVoltage)(void *Obj);
45 
46 #define TEMU_POWER_LINE_IFACE_TYPE "PowerLineIface"
47 TEMU_IFACE_REFERENCE_TYPE(temu_PowerLine);
48 
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
54 #endif /* !TEMU_MODELS_POWER_H */
System is powered off.
Definition: Power.h:24
temu_PowerState
Used to indicate whether a model is powered on.
Definition: Power.h:23
#define TEMU_IFACE_REFERENCE_TYPE(N)
Definition: Objsys.h:129
System is powered on.
Definition: Power.h:25