TEMU  3.0
The Terma Emulator
Power.h
Go to the documentation of this file.
1 //===------------------------------------------------------------*- C++ -*-===//
2 //
3 // TEMU: 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 
29 typedef struct {
31  void (*powerOn)(void *Obj);
33  void (*powerOff)(void *Obj);
35  temu_PowerState (*getPowerState)(void *Obj);
37 
38 #define TEMU_POWER_IFACE_TYPE "PowerIface"
39 TEMU_IFACE_REFERENCE_TYPE(temu_Power);
40 
41 
42 // Power line interface is experimental
43 typedef struct {
44  void (*setCurrent)(void *Obj, double Current);
45  double (*getCurrent)(void *Obj);
46  void (*setVoltage)(void *Obj, double Voltage);
47  double (*getVoltage)(void *Obj);
49 
50 #define TEMU_POWER_LINE_IFACE_TYPE "PowerLineIface"
51 TEMU_IFACE_REFERENCE_TYPE(temu_PowerLine);
52 
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif /* !TEMU_MODELS_POWER_H */
System is powered on.
Definition: Power.h:25
temu_PowerState
Used to indicate whether a model is powered on.
Definition: Power.h:23
Definition: Power.h:43
TEMU_IFACE_REFERENCE_TYPE(temu_Power)
Power interface.
Definition: Power.h:29
System is powered off.
Definition: Power.h:24