Abstract class for 'constant current (CC)' LED driver component. Including "LedPwmOutCC API" class.
Diff: LedPwmOutCC.cpp
- Revision:
- 0:6d2f6c0fcc40
- Child:
- 2:cc08ac7ed407
diff -r 000000000000 -r 6d2f6c0fcc40 LedPwmOutCC.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LedPwmOutCC.cpp Wed Mar 04 10:14:02 2015 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" +#include "LedPwmOutCC.h" + +LedPwmOutCC::LedPwmOutCC( CompLedDvrCC &ledp, LedPinName pin_name ) + : leddvrp( &ledp ), pin( pin_name ) +{ + pwm( 0.0 ); +} + +LedPwmOutCC::~LedPwmOutCC() +{ +} + +void LedPwmOutCC::pwm( float v ) +{ + leddvrp->pwm( pin, v ); +} + +void LedPwmOutCC::current( float v ) +{ + leddvrp->current( pin, v ); +} +LedPwmOutCC& LedPwmOutCC::operator=( float rhs ) +{ + pwm( rhs ); + return ( *this ); +} \ No newline at end of file