TLC59116

Class to control TLC59116 16-channel 8-bit I2C PWM driver.

Public Functions

Type

Name

uint8_t

uint8_t

uint8_t

uint8_t

uint8_t

uint8_t

Public Functions Documentation

function TLC59116

TLC59116::TLC59116 ()

TLC59116 driver constructor.

function initialize

uint8_t TLC59116::initialize (
    PinName sda,
    PinName scl
)

Initialization of the TLC59116 driver and configuration to default state, i.e. all outputs anabled, individual and global PWM active.

Returns:

Return 0 if success. Non zero value means some error.

function reset_sw

uint8_t TLC59116::reset_sw (
    void 
)

Reset the TLC59116 chip to power on state (good to call "initialize" function to get it work).

function set_channel

uint8_t TLC59116::set_channel (
    uint8_t channel,
    uint8_t pwm
)

Set single channel output number "channel" with given PWM value.

Parameters:

  • channel Numbers 0 to 15 (16 channels).

  • pwm Value from 0 (off) to 255 (fully on).

Returns:

Return 0 if success. Non zero value means some error.

uint8_t TLC59116::set_all_channels (
    uint8_t * data
)

Set all 16 channels with one command with given PWM values.

Parameters:

  • data Array with 16 uint8_t items with PWM value (array element 0 = channel 0, etc).

Returns:

Return 0 if success. Non zero value means some error.

function set_register

uint8_t TLC59116::set_register (
    uint8_t reg,
    uint8_t value
)

Direct write to single register in the TLC59116. Can be used to get the device to alternative configuration.

Parameters:

  • reg See this header file with register definitions.

Returns:

Return 0 if success. Non zero value means some error.

uint8_t TLC59116::set_global_pwm (
    uint8_t pwm
)

Default configuration also use global outputs dimming. Each output has individual (256 steps) and global dimming (256 steps) ability.

Parameters:

  • pwm Value from 0 (off) to 255 (fully on).

Returns:

Return 0 if success. Non zero value means some error.

The documentation for this class was generated from the following file: D:/w/hw-libs/\_libs\_/libraries/TLC59116.h

Last updated