Luka Brajovic
/
ws2801B
Testing WS2801
Fork of ws2801 by
ws2801.h@2:a147efe1f3a8, 2011-06-14 (annotated)
- Committer:
- wertyfrog
- Date:
- Tue Jun 14 19:39:18 2011 +0000
- Revision:
- 2:a147efe1f3a8
- Parent:
- 1:363dd100d793
- Child:
- 3:2b362d164405
documentation test 3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wertyfrog | 0:b964d673c7db | 1 | #ifndef WS2801_H |
wertyfrog | 0:b964d673c7db | 2 | #define WS2801_H |
wertyfrog | 0:b964d673c7db | 3 | |
wertyfrog | 0:b964d673c7db | 4 | #include "mbed.h" |
wertyfrog | 0:b964d673c7db | 5 | #include "HTML_color.h" |
wertyfrog | 0:b964d673c7db | 6 | |
wertyfrog | 2:a147efe1f3a8 | 7 | |
wertyfrog | 2:a147efe1f3a8 | 8 | /** WS2801 class, controlling LED strips or arrays |
wertyfrog | 2:a147efe1f3a8 | 9 | * |
wertyfrog | 2:a147efe1f3a8 | 10 | * Example: |
wertyfrog | 2:a147efe1f3a8 | 11 | * @code |
wertyfrog | 2:a147efe1f3a8 | 12 | * |
wertyfrog | 2:a147efe1f3a8 | 13 | * code exalple goes here |
wertyfrog | 2:a147efe1f3a8 | 14 | * |
wertyfrog | 2:a147efe1f3a8 | 15 | * @endcode |
wertyfrog | 2:a147efe1f3a8 | 16 | */ |
wertyfrog | 0:b964d673c7db | 17 | class ws2801 |
wertyfrog | 0:b964d673c7db | 18 | { |
wertyfrog | 0:b964d673c7db | 19 | public: |
wertyfrog | 0:b964d673c7db | 20 | /** Create a new ws2801 object |
wertyfrog | 0:b964d673c7db | 21 | * |
wertyfrog | 0:b964d673c7db | 22 | * More details about the function goes here |
wertyfrog | 0:b964d673c7db | 23 | * and here |
wertyfrog | 0:b964d673c7db | 24 | * |
wertyfrog | 0:b964d673c7db | 25 | * @param CKI clock pin |
wertyfrog | 0:b964d673c7db | 26 | * @param SDI data pin |
wertyfrog | 0:b964d673c7db | 27 | * @param STRIP_LENGTH number of ws2801 IC's i strip or array |
wertyfrog | 0:b964d673c7db | 28 | * @param reset_delay delay in us to allow latching data |
wertyfrog | 0:b964d673c7db | 29 | * @returns nothing |
wertyfrog | 0:b964d673c7db | 30 | */ |
wertyfrog | 0:b964d673c7db | 31 | ws2801(PinName CKI, PinName SDI, int STRIP_LENGTH = 32, int reset_delay = 800); |
wertyfrog | 0:b964d673c7db | 32 | /** write RGB color data to strip or array |
wertyfrog | 0:b964d673c7db | 33 | * |
wertyfrog | 0:b964d673c7db | 34 | * More details about the function goes here |
wertyfrog | 0:b964d673c7db | 35 | * and here |
wertyfrog | 0:b964d673c7db | 36 | * |
wertyfrog | 0:b964d673c7db | 37 | * @param strip_colors array of color data, size must be 24xSTRIP_LENGHT bits |
wertyfrog | 0:b964d673c7db | 38 | */ |
wertyfrog | 0:b964d673c7db | 39 | void post(int *strip_colors); |
wertyfrog | 0:b964d673c7db | 40 | /** clears the array or strip (all off) |
wertyfrog | 0:b964d673c7db | 41 | * |
wertyfrog | 0:b964d673c7db | 42 | * More details about the function goes here |
wertyfrog | 0:b964d673c7db | 43 | * and here |
wertyfrog | 0:b964d673c7db | 44 | * |
wertyfrog | 0:b964d673c7db | 45 | */ |
wertyfrog | 0:b964d673c7db | 46 | void clear(void); |
wertyfrog | 0:b964d673c7db | 47 | /** dimms the entire array |
wertyfrog | 0:b964d673c7db | 48 | * |
wertyfrog | 0:b964d673c7db | 49 | * More details about the function goes here |
wertyfrog | 0:b964d673c7db | 50 | * and here |
wertyfrog | 0:b964d673c7db | 51 | * |
wertyfrog | 0:b964d673c7db | 52 | * @param level level in percent |
wertyfrog | 0:b964d673c7db | 53 | * @returns current level |
wertyfrog | 0:b964d673c7db | 54 | */ |
wertyfrog | 0:b964d673c7db | 55 | int setlevel(int level=100); |
wertyfrog | 0:b964d673c7db | 56 | /** set reset/write delay |
wertyfrog | 0:b964d673c7db | 57 | * |
wertyfrog | 0:b964d673c7db | 58 | * More details about the function goes here |
wertyfrog | 0:b964d673c7db | 59 | * and here |
wertyfrog | 0:b964d673c7db | 60 | * |
wertyfrog | 0:b964d673c7db | 61 | * @param delay delay in us |
wertyfrog | 0:b964d673c7db | 62 | * @returns delay in us |
wertyfrog | 0:b964d673c7db | 63 | */ |
wertyfrog | 0:b964d673c7db | 64 | int setdelay(int reset_delay=800); |
wertyfrog | 0:b964d673c7db | 65 | |
wertyfrog | 0:b964d673c7db | 66 | private: |
wertyfrog | 0:b964d673c7db | 67 | DigitalOut _CKI; |
wertyfrog | 0:b964d673c7db | 68 | DigitalOut _SDI; |
wertyfrog | 0:b964d673c7db | 69 | int _STRIP_LENGTH; |
wertyfrog | 0:b964d673c7db | 70 | int _level; |
wertyfrog | 0:b964d673c7db | 71 | int _reset_delay; |
wertyfrog | 0:b964d673c7db | 72 | }; |
wertyfrog | 0:b964d673c7db | 73 | |
wertyfrog | 0:b964d673c7db | 74 | #endif |