LED.hpp
Go to the documentation of this file.
1 /*
2  * SocialLedge.com - Copyright (C) 2013
3  *
4  * This file is part of free software framework for embedded processors.
5  * You can use it and/or distribute it as long as this copyright header
6  * remains unmodified. The code is free for personal use and requires
7  * permission to use in a commercial product.
8  *
9  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
10  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
12  * I SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
13  * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
14  *
15  * You can reach the author of this software at :
16  * p r e e t . w i k i @ g m a i l . c o m
17  */
18 
24 #ifndef LED_HPP__
25 #define LED_HPP__
26 #include <stdint.h>
27 
28 
29 
35 class LED : public SingletonTemplate<LED>
36 {
37  public:
38  bool init();
39 
40  void on(uint8_t ledNum);
41  void off(uint8_t ledNum);
42  void set(uint8_t ledNum, bool on);
43  void toggle(uint8_t ledNum);
44  void setAll(uint8_t value);
45  uint8_t getValues(void) const;
46 
47  private:
48  uint8_t mLedValue;
49 
50  LED() : mLedValue (0) {}
51  friend class SingletonTemplate<LED>;
52 };
53 
54 #endif /* LED_HPP__ */
Definition: LED.hpp:35
void setAll(uint8_t value)
Sets 8-bit value of 8 LEDs; 1 bit per LED.
Definition: io_source.cpp:300
bool init()
Initializes this device,.
Definition: io_source.cpp:270
uint8_t getValues(void) const
Get the LED bit values currently set.
Definition: io_source.cpp:319
void toggle(uint8_t ledNum)
Toggles the LED.
Definition: io_source.cpp:289
void off(uint8_t ledNum)
Turns OFF LED.
Definition: io_source.cpp:282
Definition: singleton_template.hpp:55
void on(uint8_t ledNum)
Turns ON LED.
Definition: io_source.cpp:275