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