Abstract class for 'constant current (CC)' LED driver component. Including "LedPwmOutCC API" class.
LedPwmOutCC.cpp@0:6d2f6c0fcc40, 2015-03-04 (annotated)
- Committer:
- nxp_ip
- Date:
- Wed Mar 04 10:14:02 2015 +0000
- Revision:
- 0:6d2f6c0fcc40
- Child:
- 2:cc08ac7ed407
Initial version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nxp_ip | 0:6d2f6c0fcc40 | 1 | #include "mbed.h" |
nxp_ip | 0:6d2f6c0fcc40 | 2 | #include "LedPwmOutCC.h" |
nxp_ip | 0:6d2f6c0fcc40 | 3 | |
nxp_ip | 0:6d2f6c0fcc40 | 4 | LedPwmOutCC::LedPwmOutCC( CompLedDvrCC &ledp, LedPinName pin_name ) |
nxp_ip | 0:6d2f6c0fcc40 | 5 | : leddvrp( &ledp ), pin( pin_name ) |
nxp_ip | 0:6d2f6c0fcc40 | 6 | { |
nxp_ip | 0:6d2f6c0fcc40 | 7 | pwm( 0.0 ); |
nxp_ip | 0:6d2f6c0fcc40 | 8 | } |
nxp_ip | 0:6d2f6c0fcc40 | 9 | |
nxp_ip | 0:6d2f6c0fcc40 | 10 | LedPwmOutCC::~LedPwmOutCC() |
nxp_ip | 0:6d2f6c0fcc40 | 11 | { |
nxp_ip | 0:6d2f6c0fcc40 | 12 | } |
nxp_ip | 0:6d2f6c0fcc40 | 13 | |
nxp_ip | 0:6d2f6c0fcc40 | 14 | void LedPwmOutCC::pwm( float v ) |
nxp_ip | 0:6d2f6c0fcc40 | 15 | { |
nxp_ip | 0:6d2f6c0fcc40 | 16 | leddvrp->pwm( pin, v ); |
nxp_ip | 0:6d2f6c0fcc40 | 17 | } |
nxp_ip | 0:6d2f6c0fcc40 | 18 | |
nxp_ip | 0:6d2f6c0fcc40 | 19 | void LedPwmOutCC::current( float v ) |
nxp_ip | 0:6d2f6c0fcc40 | 20 | { |
nxp_ip | 0:6d2f6c0fcc40 | 21 | leddvrp->current( pin, v ); |
nxp_ip | 0:6d2f6c0fcc40 | 22 | } |
nxp_ip | 0:6d2f6c0fcc40 | 23 | LedPwmOutCC& LedPwmOutCC::operator=( float rhs ) |
nxp_ip | 0:6d2f6c0fcc40 | 24 | { |
nxp_ip | 0:6d2f6c0fcc40 | 25 | pwm( rhs ); |
nxp_ip | 0:6d2f6c0fcc40 | 26 | return ( *this ); |
nxp_ip | 0:6d2f6c0fcc40 | 27 | } |