sqefqsdf
Dependencies: C12832 EthernetInterface LM75B mbed-rtos mbed
Fork of app-board-LM75B by
IOController.h@6:77a4c45f6416, 2017-03-23 (annotated)
- Committer:
- gimohd
- Date:
- Thu Mar 23 12:51:27 2017 +0000
- Revision:
- 6:77a4c45f6416
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gimohd | 6:77a4c45f6416 | 1 | #ifndef IOController_H |
gimohd | 6:77a4c45f6416 | 2 | #define IOController_H |
gimohd | 6:77a4c45f6416 | 3 | #include <mbed.h> |
gimohd | 6:77a4c45f6416 | 4 | #include "TemperatureSensor.h" |
gimohd | 6:77a4c45f6416 | 5 | #include "Potentiometer.h" |
gimohd | 6:77a4c45f6416 | 6 | #include "Joystick.h" |
gimohd | 6:77a4c45f6416 | 7 | #include "Speaker.h" |
gimohd | 6:77a4c45f6416 | 8 | #include "RGB.h" |
gimohd | 6:77a4c45f6416 | 9 | #include "LCD.h" |
gimohd | 6:77a4c45f6416 | 10 | #include "Communication.h" |
gimohd | 6:77a4c45f6416 | 11 | #include "Packet.h" |
gimohd | 6:77a4c45f6416 | 12 | |
gimohd | 6:77a4c45f6416 | 13 | /** IOController class |
gimohd | 6:77a4c45f6416 | 14 | * Controls both the input(TemperatureSensor, Potentiometer, Joystick) and |
gimohd | 6:77a4c45f6416 | 15 | * output(Speaker, RGB, LCD) devices. And uses the Communication class to send |
gimohd | 6:77a4c45f6416 | 16 | * the read input data to an other client. |
gimohd | 6:77a4c45f6416 | 17 | * @ref Joystick |
gimohd | 6:77a4c45f6416 | 18 | * @ref TemperatureSensor |
gimohd | 6:77a4c45f6416 | 19 | * @ref Potentiometer |
gimohd | 6:77a4c45f6416 | 20 | * @ref Speaker |
gimohd | 6:77a4c45f6416 | 21 | * @ref RGB |
gimohd | 6:77a4c45f6416 | 22 | * @ref Potentiometer |
gimohd | 6:77a4c45f6416 | 23 | */ |
gimohd | 6:77a4c45f6416 | 24 | |
gimohd | 6:77a4c45f6416 | 25 | class IOController |
gimohd | 6:77a4c45f6416 | 26 | { |
gimohd | 6:77a4c45f6416 | 27 | public: |
gimohd | 6:77a4c45f6416 | 28 | |
gimohd | 6:77a4c45f6416 | 29 | /** |
gimohd | 6:77a4c45f6416 | 30 | * Makes an instance of the IOController class, this will initialize |
gimohd | 6:77a4c45f6416 | 31 | * all the IO devices |
gimohd | 6:77a4c45f6416 | 32 | */ |
gimohd | 6:77a4c45f6416 | 33 | IOController(); |
gimohd | 6:77a4c45f6416 | 34 | |
gimohd | 6:77a4c45f6416 | 35 | /** |
gimohd | 6:77a4c45f6416 | 36 | * Deletes the IOController and calls the destructor from |
gimohd | 6:77a4c45f6416 | 37 | * all the IO devices |
gimohd | 6:77a4c45f6416 | 38 | */ |
gimohd | 6:77a4c45f6416 | 39 | ~IOController(); |
gimohd | 6:77a4c45f6416 | 40 | |
gimohd | 6:77a4c45f6416 | 41 | /** |
gimohd | 6:77a4c45f6416 | 42 | * The main run method used in a loop for controlling the IO Devices |
gimohd | 6:77a4c45f6416 | 43 | */ |
gimohd | 6:77a4c45f6416 | 44 | int run(); |
gimohd | 6:77a4c45f6416 | 45 | |
gimohd | 6:77a4c45f6416 | 46 | private: |
gimohd | 6:77a4c45f6416 | 47 | |
gimohd | 6:77a4c45f6416 | 48 | /** |
gimohd | 6:77a4c45f6416 | 49 | * Pointer to an object of the class TemperatureSensor |
gimohd | 6:77a4c45f6416 | 50 | * |
gimohd | 6:77a4c45f6416 | 51 | * @ref TemperatureSensor |
gimohd | 6:77a4c45f6416 | 52 | */ |
gimohd | 6:77a4c45f6416 | 53 | TemperatureSensor * temperatureSensor; |
gimohd | 6:77a4c45f6416 | 54 | |
gimohd | 6:77a4c45f6416 | 55 | /** |
gimohd | 6:77a4c45f6416 | 56 | * Pointer to an object of the class Potentiometer |
gimohd | 6:77a4c45f6416 | 57 | * |
gimohd | 6:77a4c45f6416 | 58 | * @ref Potentiometer |
gimohd | 6:77a4c45f6416 | 59 | */ |
gimohd | 6:77a4c45f6416 | 60 | Potentiometer * potentiometer; |
gimohd | 6:77a4c45f6416 | 61 | |
gimohd | 6:77a4c45f6416 | 62 | /** |
gimohd | 6:77a4c45f6416 | 63 | * Pointer to an object of the class Joystick |
gimohd | 6:77a4c45f6416 | 64 | * |
gimohd | 6:77a4c45f6416 | 65 | * @ref Joystick |
gimohd | 6:77a4c45f6416 | 66 | */ |
gimohd | 6:77a4c45f6416 | 67 | Joystick * joystick; |
gimohd | 6:77a4c45f6416 | 68 | |
gimohd | 6:77a4c45f6416 | 69 | /** |
gimohd | 6:77a4c45f6416 | 70 | * Pointer to an object of the class Speaker |
gimohd | 6:77a4c45f6416 | 71 | * |
gimohd | 6:77a4c45f6416 | 72 | * @ref Speaker |
gimohd | 6:77a4c45f6416 | 73 | */ |
gimohd | 6:77a4c45f6416 | 74 | Speaker * speaker; |
gimohd | 6:77a4c45f6416 | 75 | |
gimohd | 6:77a4c45f6416 | 76 | /** |
gimohd | 6:77a4c45f6416 | 77 | * Pointer to an object of the class RGB |
gimohd | 6:77a4c45f6416 | 78 | * |
gimohd | 6:77a4c45f6416 | 79 | * @ref RGB |
gimohd | 6:77a4c45f6416 | 80 | */ |
gimohd | 6:77a4c45f6416 | 81 | RGB * rgbLed; |
gimohd | 6:77a4c45f6416 | 82 | |
gimohd | 6:77a4c45f6416 | 83 | /** |
gimohd | 6:77a4c45f6416 | 84 | * Pointer to an object of the class LCD |
gimohd | 6:77a4c45f6416 | 85 | * |
gimohd | 6:77a4c45f6416 | 86 | * @ref LDC |
gimohd | 6:77a4c45f6416 | 87 | */ |
gimohd | 6:77a4c45f6416 | 88 | LCD * lcd; |
gimohd | 6:77a4c45f6416 | 89 | |
gimohd | 6:77a4c45f6416 | 90 | /** |
gimohd | 6:77a4c45f6416 | 91 | * Pointer to an object of the class Communication |
gimohd | 6:77a4c45f6416 | 92 | * @ref Communication |
gimohd | 6:77a4c45f6416 | 93 | */ |
gimohd | 6:77a4c45f6416 | 94 | Communication * communication; |
gimohd | 6:77a4c45f6416 | 95 | |
gimohd | 6:77a4c45f6416 | 96 | /** |
gimohd | 6:77a4c45f6416 | 97 | * Pointer to an object of the class Packet |
gimohd | 6:77a4c45f6416 | 98 | * |
gimohd | 6:77a4c45f6416 | 99 | * @ref Packet |
gimohd | 6:77a4c45f6416 | 100 | */ |
gimohd | 6:77a4c45f6416 | 101 | Packet * receivePacket; |
gimohd | 6:77a4c45f6416 | 102 | |
gimohd | 6:77a4c45f6416 | 103 | /** |
gimohd | 6:77a4c45f6416 | 104 | * An integer resembling the ID of the destination |
gimohd | 6:77a4c45f6416 | 105 | */ |
gimohd | 6:77a4c45f6416 | 106 | int destinationID; |
gimohd | 6:77a4c45f6416 | 107 | |
gimohd | 6:77a4c45f6416 | 108 | /** |
gimohd | 6:77a4c45f6416 | 109 | * A boolean which is toggled on when the receiving is started. |
gimohd | 6:77a4c45f6416 | 110 | */ |
gimohd | 6:77a4c45f6416 | 111 | bool startReceiving; |
gimohd | 6:77a4c45f6416 | 112 | }; |
gimohd | 6:77a4c45f6416 | 113 | |
gimohd | 6:77a4c45f6416 | 114 | #endif |