LEDDriver_NXP_Arduino 1.0.2
LED driver device operation sample code for Arduino
|
#include <GradationControl.h>
Public Types | |
enum | control : int { STOP , DUMMY , ONE_SHOT , CONTINUOUS } |
Public Member Functions | |
GradationControl (PCA995x *devp, int num_group, uint32_t bitmap=0x0000) | |
virtual | ~GradationControl () |
float | set_gradation (float max_iref, float time, bool up=true, bool down=true, float on=0.0, float off=0.0, bool hold_on=true, bool hold_off=true) |
void | gradation_group_assign (uint32_t bitmap) |
void | add_channel (uint8_t ch) |
void | gradation_channel_enable (uint32_t bitmap) |
void | control (int ctrl) |
void | start (bool continuous=true) |
void | stop (void) |
Public Attributes | |
float | cycle |
GradationControl operation library for Arduino
Released under the MIT license License GradationControl class
GradationControl class is an API to use PCA9955B and PCA9957 gradation control feature. Instances are made for each gradation control groups
Definition at line 20 of file GradationControl.h.
enum GradationControl::control : int |
Commands for "control()" method
Definition at line 25 of file GradationControl.h.
GradationControl::GradationControl | ( | PCA995x * | devp, |
int | num_group, | ||
uint32_t | bitmap = 0x0000 ) |
Create a GradationControl instance for a group
devp | pointer to PCA9955B or PCA9957 device instance |
num_group | int value to specify group number |
bitmap | option. specifying channels assign into this group (bit 0 = channel 0). Assigning can be done later by "add_channel()" method |
Definition at line 3 of file GradationControl.cpp.
|
virtual |
Destructor
Definition at line 10 of file GradationControl.cpp.
void GradationControl::add_channel | ( | uint8_t | ch | ) |
Adding channel
ch | Channel to be added to the group |
Definition at line 125 of file GradationControl.cpp.
void GradationControl::control | ( | int | ctrl | ) |
Start/Stop gradation control
ctrl | Can be STOP, ONE_SHOT, CONTINUOUS |
Definition at line 154 of file GradationControl.cpp.
void GradationControl::gradation_channel_enable | ( | uint32_t | bitmap | ) |
Enabling channels for gradation control
bitmap | Set 1 for the channel assigning to the group (bit 0 = channel 0) |
Definition at line 87 of file GradationControl.cpp.
Referenced by GradationControl().
void GradationControl::gradation_group_assign | ( | uint32_t | bitmap | ) |
Channel assign into group
bitmap | Set 1 for the channel assigning to the group (bit 0 = channel 0) |
Definition at line 101 of file GradationControl.cpp.
Referenced by GradationControl().
float GradationControl::set_gradation | ( | float | max_iref, |
float | time, | ||
bool | up = true, | ||
bool | down = true, | ||
float | on = 0.0, | ||
float | off = 0.0, | ||
bool | hold_on = true, | ||
bool | hold_off = true ) |
Gradation parameter settings
max_iref | Peak current value. 0.0 for 0%, 1.0 for 100% |
time | ramp-time in second |
up | option: ramp-up enable. default: true |
down | option: ramp-down enable. default: true |
on | option: hold-ON duration in second. default: 0.0 |
off | option: hold-OFF duration in second. default: 0.0 |
hold_on | option: hold-on enable. default: true |
hold_off | option: hold-off enable. default: true |
Definition at line 14 of file GradationControl.cpp.
void GradationControl::start | ( | bool | continuous = true | ) |
Start gradation control
continuous | option. default: true |
Definition at line 170 of file GradationControl.cpp.
void GradationControl::stop | ( | void | ) |
Stop gradation control
Definition at line 175 of file GradationControl.cpp.
float GradationControl::cycle |
Cycle period for the gradation control
Definition at line 34 of file GradationControl.h.
Referenced by set_gradation().