![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
First version
Dependencies: mbed EthernetInterface mbed-rto
LEDDriver.h@27:29948b116e82, 2018-04-25 (annotated)
- Committer:
- albireo987
- Date:
- Wed Apr 25 14:13:22 2018 +0000
- Revision:
- 27:29948b116e82
- Parent:
- 26:4c673da1a3ae
- Child:
- 32:537005b4a065
thread+queue driver;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
albireo987 | 6:36158325f7b0 | 1 | #ifndef LEDDRIVER_H |
albireo987 | 6:36158325f7b0 | 2 | #define LEDDRIVER_H |
albireo987 | 6:36158325f7b0 | 3 | |
albireo987 | 6:36158325f7b0 | 4 | #include "copy.h" |
albireo987 | 6:36158325f7b0 | 5 | #include "mbed.h" |
albireo987 | 26:4c673da1a3ae | 6 | #include "rtos.h" |
albireo987 | 6:36158325f7b0 | 7 | |
albireo987 | 6:36158325f7b0 | 8 | class LEDDriver |
albireo987 | 6:36158325f7b0 | 9 | { |
albireo987 | 6:36158325f7b0 | 10 | private: |
albireo987 | 8:a987e04734dd | 11 | |
albireo987 | 9:c800045806f0 | 12 | int* messageList; |
albireo987 | 9:c800045806f0 | 13 | int* codedMessage0; |
albireo987 | 9:c800045806f0 | 14 | int* codedMessage1; |
albireo987 | 9:c800045806f0 | 15 | int* codedMessage2; |
albireo987 | 9:c800045806f0 | 16 | int* codedMessage3; |
albireo987 | 9:c800045806f0 | 17 | int directions[8]; |
albireo987 | 26:4c673da1a3ae | 18 | Queue<int,8>* queue; |
albireo987 | 6:36158325f7b0 | 19 | DigitalOut* leds; |
albireo987 | 6:36158325f7b0 | 20 | |
albireo987 | 26:4c673da1a3ae | 21 | /**prep for eventual multithreading |
albireo987 | 26:4c673da1a3ae | 22 | *methode om nieuwe richtingen van de receiver klasse te ontvangen |
albireo987 | 26:4c673da1a3ae | 23 | *@params aantal leds die een nieuw bericht moeten krijgen |
albireo987 | 26:4c673da1a3ae | 24 | */ |
albireo987 | 27:29948b116e82 | 25 | void poll(int numberOfLeds, int first); |
albireo987 | 26:4c673da1a3ae | 26 | |
albireo987 | 6:36158325f7b0 | 27 | |
albireo987 | 10:7871aeacea08 | 28 | public: |
albireo987 | 10:7871aeacea08 | 29 | |
albireo987 | 10:7871aeacea08 | 30 | /** |
albireo987 | 10:7871aeacea08 | 31 | *methode om de mbed te doen wachten,nop |
albireo987 | 10:7871aeacea08 | 32 | *@params aantal microseconden te wachten |
albireo987 | 10:7871aeacea08 | 33 | */ |
albireo987 | 10:7871aeacea08 | 34 | void ownWait(uint32_t us); |
albireo987 | 10:7871aeacea08 | 35 | |
albireo987 | 10:7871aeacea08 | 36 | |
albireo987 | 6:36158325f7b0 | 37 | |
albireo987 | 10:7871aeacea08 | 38 | /** |
albireo987 | 10:7871aeacea08 | 39 | *methode dat alle leds aanstuurt |
albireo987 | 10:7871aeacea08 | 40 | *@params aantal leds aan te sturen |
albireo987 | 10:7871aeacea08 | 41 | */ |
albireo987 | 6:36158325f7b0 | 42 | void drive(int numberOfLeds); |
albireo987 | 10:7871aeacea08 | 43 | |
albireo987 | 10:7871aeacea08 | 44 | /** |
albireo987 | 10:7871aeacea08 | 45 | *constructor voor een driver object |
albireo987 | 10:7871aeacea08 | 46 | *@params de int waarden die een richting aanduiden |
albireo987 | 10:7871aeacea08 | 47 | *@params het aantal waarden in de sharedDirection array |
albireo987 | 10:7871aeacea08 | 48 | */ |
albireo987 | 26:4c673da1a3ae | 49 | LEDDriver(Queue<int,8>* queue); |
albireo987 | 10:7871aeacea08 | 50 | /** |
albireo987 | 10:7871aeacea08 | 51 | *methode om de driver te gebruiken |
albireo987 | 10:7871aeacea08 | 52 | *@params aantal leds om te drive |
albireo987 | 10:7871aeacea08 | 53 | */ |
albireo987 | 6:36158325f7b0 | 54 | void run(int numberOfLeds); |
albireo987 | 6:36158325f7b0 | 55 | |
albireo987 | 6:36158325f7b0 | 56 | }; |
albireo987 | 6:36158325f7b0 | 57 | |
albireo987 | 6:36158325f7b0 | 58 | #endif |