LEDDriver_NXP_Arduino 1.0.2
LED driver device operation sample code for Arduino
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
GradationControl Class Reference

#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
 

Detailed Description

GradationControl operation library for Arduino

Author
Tedd OKANO

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.

Member Enumeration Documentation

◆ control

Commands for "control()" method

Definition at line 25 of file GradationControl.h.

Constructor & Destructor Documentation

◆ GradationControl()

GradationControl::GradationControl ( PCA995x * devp,
int num_group,
uint32_t bitmap = 0x0000 )

Create a GradationControl instance for a group

Parameters
devppointer to PCA9955B or PCA9957 device instance
num_groupint value to specify group number
bitmapoption. 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.

◆ ~GradationControl()

GradationControl::~GradationControl ( )
virtual

Destructor

Definition at line 10 of file GradationControl.cpp.

Member Function Documentation

◆ add_channel()

void GradationControl::add_channel ( uint8_t ch)

Adding channel

Parameters
chChannel to be added to the group

Definition at line 125 of file GradationControl.cpp.

◆ control()

void GradationControl::control ( int ctrl)

Start/Stop gradation control

Parameters
ctrlCan be STOP, ONE_SHOT, CONTINUOUS

Definition at line 154 of file GradationControl.cpp.

◆ gradation_channel_enable()

void GradationControl::gradation_channel_enable ( uint32_t bitmap)

Enabling channels for gradation control

Parameters
bitmapSet 1 for the channel assigning to the group (bit 0 = channel 0)

Definition at line 87 of file GradationControl.cpp.

Referenced by GradationControl().

◆ gradation_group_assign()

void GradationControl::gradation_group_assign ( uint32_t bitmap)

Channel assign into group

Parameters
bitmapSet 1 for the channel assigning to the group (bit 0 = channel 0)

Definition at line 101 of file GradationControl.cpp.

Referenced by GradationControl().

◆ set_gradation()

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

Parameters
max_irefPeak current value. 0.0 for 0%, 1.0 for 100%
timeramp-time in second
upoption: ramp-up enable. default: true
downoption: ramp-down enable. default: true
onoption: hold-ON duration in second. default: 0.0
offoption: hold-OFF duration in second. default: 0.0
hold_onoption: hold-on enable. default: true
hold_offoption: hold-off enable. default: true
Returns
Actual cycle period after calculation

Definition at line 14 of file GradationControl.cpp.

◆ start()

void GradationControl::start ( bool continuous = true)

Start gradation control

Parameters
continuousoption. default: true

Definition at line 170 of file GradationControl.cpp.

◆ stop()

void GradationControl::stop ( void )

Stop gradation control

Definition at line 175 of file GradationControl.cpp.

Member Data Documentation

◆ cycle

float GradationControl::cycle

Cycle period for the gradation control

Definition at line 34 of file GradationControl.h.

Referenced by set_gradation().


The documentation for this class was generated from the following files: