Polytech Tours - Projet C++ embarqué sur cible mbed
HL1606Stripe.h@0:21e183c9ef81, 2016-04-24 (annotated)
- Committer:
- LecomteDelys
- Date:
- Sun Apr 24 15:43:51 2016 +0000
- Revision:
- 0:21e183c9ef81
Programme final
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
LecomteDelys | 0:21e183c9ef81 | 1 | #ifndef HL1606_STRIPE_H |
LecomteDelys | 0:21e183c9ef81 | 2 | #define HL1606_STRIPE_H |
LecomteDelys | 0:21e183c9ef81 | 3 | |
LecomteDelys | 0:21e183c9ef81 | 4 | #ifndef COLOR_H |
LecomteDelys | 0:21e183c9ef81 | 5 | #define COLOR_H |
LecomteDelys | 0:21e183c9ef81 | 6 | #include "Color.h" |
LecomteDelys | 0:21e183c9ef81 | 7 | #endif |
LecomteDelys | 0:21e183c9ef81 | 8 | |
LecomteDelys | 0:21e183c9ef81 | 9 | #include "mbed.h" |
LecomteDelys | 0:21e183c9ef81 | 10 | #include "Intensity.h" |
LecomteDelys | 0:21e183c9ef81 | 11 | |
LecomteDelys | 0:21e183c9ef81 | 12 | class HL1606Stripe |
LecomteDelys | 0:21e183c9ef81 | 13 | { |
LecomteDelys | 0:21e183c9ef81 | 14 | |
LecomteDelys | 0:21e183c9ef81 | 15 | public: |
LecomteDelys | 0:21e183c9ef81 | 16 | /* Constructeur */ |
LecomteDelys | 0:21e183c9ef81 | 17 | HL1606Stripe(PinName mosi, PinName miso, PinName sclk, PinName latch, uint8_t numLEDs, uint8_t m_numColors); |
LecomteDelys | 0:21e183c9ef81 | 18 | |
LecomteDelys | 0:21e183c9ef81 | 19 | /* Destructeur */ |
LecomteDelys | 0:21e183c9ef81 | 20 | ~HL1606Stripe(); |
LecomteDelys | 0:21e183c9ef81 | 21 | |
LecomteDelys | 0:21e183c9ef81 | 22 | /* Méthodes */ |
LecomteDelys | 0:21e183c9ef81 | 23 | void Update(void); |
LecomteDelys | 0:21e183c9ef81 | 24 | void SwitchOffRGB(void); |
LecomteDelys | 0:21e183c9ef81 | 25 | void FillRGB(uint8_t color); |
LecomteDelys | 0:21e183c9ef81 | 26 | void FillRGB(uint8_t* colors); |
LecomteDelys | 0:21e183c9ef81 | 27 | void FillRGB(uint8_t red, uint8_t green, uint8_t blue); |
LecomteDelys | 0:21e183c9ef81 | 28 | void FillRandomlyRGB(uint8_t* randomColors); |
LecomteDelys | 0:21e183c9ef81 | 29 | |
LecomteDelys | 0:21e183c9ef81 | 30 | void setLED(uint8_t Color, uint8_t LEDx); |
LecomteDelys | 0:21e183c9ef81 | 31 | |
LecomteDelys | 0:21e183c9ef81 | 32 | private: |
LecomteDelys | 0:21e183c9ef81 | 33 | /*Attributs*/ |
LecomteDelys | 0:21e183c9ef81 | 34 | uint8_t* m_redPWM; |
LecomteDelys | 0:21e183c9ef81 | 35 | uint8_t* m_greenPWM; |
LecomteDelys | 0:21e183c9ef81 | 36 | uint8_t* m_bluePWM; |
LecomteDelys | 0:21e183c9ef81 | 37 | |
LecomteDelys | 0:21e183c9ef81 | 38 | uint8_t m_numLEDs; |
LecomteDelys | 0:21e183c9ef81 | 39 | uint8_t m_numColors; |
LecomteDelys | 0:21e183c9ef81 | 40 | |
LecomteDelys | 0:21e183c9ef81 | 41 | SPI m_SPI; |
LecomteDelys | 0:21e183c9ef81 | 42 | DigitalOut m_latchPin; |
LecomteDelys | 0:21e183c9ef81 | 43 | Ticker m_tickerUpdate; |
LecomteDelys | 0:21e183c9ef81 | 44 | |
LecomteDelys | 0:21e183c9ef81 | 45 | }; |
LecomteDelys | 0:21e183c9ef81 | 46 | |
LecomteDelys | 0:21e183c9ef81 | 47 | #endif |