Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
LedPwmOutCC Class Reference
LedPwmOutCC class. More...
#include <LedPwmOutCC.h>
Public Member Functions | |
| LedPwmOutCC (CompLedDvrCC &ledp, LedPinName pin_name) | |
| Create a LedPwmOutCC instance connected to a pin on the LED driver A pin which performs PWM and constant current sink. | |
| virtual | ~LedPwmOutCC () |
| Destractor. | |
| virtual void | pwm (float v) |
| Set PWM duty-cycle. | |
| virtual void | current (float v) |
| Set output current. | |
| LedPwmOutCC & | operator= (float rhs) |
| A shorthand for pwm() | |
Detailed Description
LedPwmOutCC class.
"LedPwmOutCC" class works like "PwmOut" class of mbed-SDK. This class provides API on device's pin level with abstracting the LED controller.
Example:
#include "mbed.h" #include "PCA9956A.h" PCA9956A led_cntlr( p28, p27, 0xC4 ); // SDA, SCL, Slave_address(option) LedPwmOutCC led( led_cntlr, L0 ); int main() { while( 1 ) { for( float p = 0.0f; p < 1.0f; p += 0.1f ) { led = p; wait( 0.1 ); } } }
Definition at line 42 of file LedPwmOutCC.h.
Constructor & Destructor Documentation
| LedPwmOutCC | ( | CompLedDvrCC & | ledp, |
| LedPinName | pin_name | ||
| ) |
Create a LedPwmOutCC instance connected to a pin on the LED driver A pin which performs PWM and constant current sink.
- Parameters:
-
ledp Instance of a device (LED driver) pin_name Specifying pin by LedPinName like 'L7'.
- Note:
- Pin names of LED driver are defined like L0, L1, L2.. It is not like "LED0". Because we cannot use mbed reserved symbols.
Definition at line 4 of file LedPwmOutCC.cpp.
| ~LedPwmOutCC | ( | ) | [virtual] |
Destractor.
Definition at line 10 of file LedPwmOutCC.cpp.
Member Function Documentation
| void current | ( | float | v ) | [virtual] |
Set output current.
- Parameters:
-
v Ratio of output current. 1.0 for 100 % output of hardware setting
Definition at line 19 of file LedPwmOutCC.cpp.
| LedPwmOutCC & operator= | ( | float | rhs ) |
A shorthand for pwm()
Definition at line 23 of file LedPwmOutCC.cpp.
| void pwm | ( | float | v ) | [virtual] |
Set PWM duty-cycle.
- Parameters:
-
v Ratio of duty-cycle. '0.0' for 0 %. '1.0' for 99.6 % on PCA9956A and 100 % for PCA9955A.
Definition at line 14 of file LedPwmOutCC.cpp.
Generated on Wed Jul 13 2022 09:35:05 by
1.7.2