leddriver12 2.0.0.0
|
API for configuring and manipulating LED Driver 12 Click driver. More...
Topics | |
LED Driver 12 Registers List | |
List of registers of LED Driver 12 Click driver. | |
LED Driver 12 Registers Settings | |
Settings for registers of LED Driver 12 Click driver. | |
LED Driver 12 MikroBUS Map | |
MikroBUS pin mapping of LED Driver 12 Click driver. | |
Functions | |
void | leddriver12_cfg_setup (leddriver12_cfg_t *cfg) |
LED Driver 12 configuration object setup function. | |
err_t | leddriver12_init (leddriver12_t *ctx, leddriver12_cfg_t *cfg) |
LED Driver 12 initialization function. | |
err_t | leddriver12_default_cfg (leddriver12_t *ctx) |
LED Driver 12 default configuration function. | |
err_t | leddriver12_generic_write (leddriver12_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
LED Driver 12 I2C writing function. | |
err_t | leddriver12_generic_read (leddriver12_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
LED Driver 12 I2C reading function. | |
err_t | leddriver12_write_register (leddriver12_t *ctx, uint8_t reg, uint8_t data_in) |
LED Driver 12 write register function. | |
err_t | leddriver12_read_register (leddriver12_t *ctx, uint8_t reg, uint8_t *data_out) |
LED Driver 12 read register function. | |
void | leddriver12_set_rst_pin (leddriver12_t *ctx, uint8_t state) |
LED Driver 12 set rst pin function. | |
err_t | leddriver12_set_led_config (leddriver12_t *ctx, uint8_t led_number, uint8_t led_cfg) |
LED Driver 12 set led config function. | |
err_t | leddriver12_set_led_port_config (leddriver12_t *ctx, uint8_t led_port_number, uint8_t led_cfg) |
LED Driver 12 set led port config function. | |
err_t | leddriver12_read_input_0 (leddriver12_t *ctx, uint8_t *data_out) |
LED Driver 12 read input 0 function. | |
err_t | leddriver12_read_input_1 (leddriver12_t *ctx, uint8_t *data_out) |
LED Driver 12 read input 1 function. | |
err_t | leddriver12_set_blink_period_pwm_0 (leddriver12_t *ctx, float blink_period) |
LED Driver 12 set blink period pwm 0 function. | |
err_t | leddriver12_set_blink_period_pwm_1 (leddriver12_t *ctx, float blink_period) |
LED Driver 12 set blink period pwm 1 function. | |
err_t | leddriver12_set_duty_cycle_pwm_0 (leddriver12_t *ctx, uint8_t duty_cycle) |
LED Driver 12 set duty cycle pwm 0 function. | |
err_t | leddriver12_set_duty_cycle_pwm_1 (leddriver12_t *ctx, uint8_t duty_cycle) |
LED Driver 12 set duty cycle pwm 1 function. | |
API for configuring and manipulating LED Driver 12 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void leddriver12_cfg_setup | ( | leddriver12_cfg_t * | cfg | ) |
LED Driver 12 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See leddriver12_cfg_t object definition for detailed explanation. |
err_t leddriver12_default_cfg | ( | leddriver12_t * | ctx | ) |
LED Driver 12 default configuration function.
This function executes a default configuration of LED Driver 12 click board.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t leddriver12_generic_read | ( | leddriver12_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
LED Driver 12 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t leddriver12_generic_write | ( | leddriver12_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
LED Driver 12 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t leddriver12_init | ( | leddriver12_t * | ctx, |
leddriver12_cfg_t * | cfg ) |
LED Driver 12 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See leddriver12_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t leddriver12_read_input_0 | ( | leddriver12_t * | ctx, |
uint8_t * | data_out ) |
LED Driver 12 read input 0 function.
This function reads the input 0 register which contains the status of LEDs 0 to 7.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[out] | data_out | : Input 0 register status. |
0
- Success, -1
- Error.err_t leddriver12_read_input_1 | ( | leddriver12_t * | ctx, |
uint8_t * | data_out ) |
LED Driver 12 read input 1 function.
This function reads the input 1 register which contains the status of LEDs 8 to 15.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[out] | data_out | : Input 1 register status. |
0
- Success, -1
- Error.err_t leddriver12_read_register | ( | leddriver12_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
LED Driver 12 read register function.
This function reads a data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t leddriver12_set_blink_period_pwm_0 | ( | leddriver12_t * | ctx, |
float | blink_period ) |
LED Driver 12 set blink period pwm 0 function.
This function sets the blink period of PWM 0 function.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | blink_period | : Blink period in seconds (MAX: 1.68421, MIN: 0.00657). |
0
- Success, -1
- Error.err_t leddriver12_set_blink_period_pwm_1 | ( | leddriver12_t * | ctx, |
float | blink_period ) |
LED Driver 12 set blink period pwm 1 function.
This function sets the blink period of PWM 1 function.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | blink_period | : Blink period in seconds (MAX: 1.68421, MIN: 0.00657). |
0
- Success, -1
- Error.err_t leddriver12_set_duty_cycle_pwm_0 | ( | leddriver12_t * | ctx, |
uint8_t | duty_cycle ) |
LED Driver 12 set duty cycle pwm 0 function.
This function sets the duty cycle of PWM 0.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | duty_cycle | : Duty cycle value [0x00-0xFF]. |
0
- Success, -1
- Error.err_t leddriver12_set_duty_cycle_pwm_1 | ( | leddriver12_t * | ctx, |
uint8_t | duty_cycle ) |
LED Driver 12 set duty cycle pwm 1 function.
This function sets the duty cycle of PWM 1.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | duty_cycle | : Duty cycle value [0x00-0xFF]. |
0
- Success, -1
- Error.err_t leddriver12_set_led_config | ( | leddriver12_t * | ctx, |
uint8_t | led_number, | ||
uint8_t | led_cfg ) |
LED Driver 12 set led config function.
This function sets the specified LED config.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | led_number | : LED number [0-15 or 0xFF for all LEDs]. |
[in] | led_cfg | : LED config:
|
0
- Success, -1
- Error.err_t leddriver12_set_led_port_config | ( | leddriver12_t * | ctx, |
uint8_t | led_port_number, | ||
uint8_t | led_cfg ) |
LED Driver 12 set led port config function.
This function sets the specified LED port config.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | led_port_number | : LED port number:
|
[in] | led_cfg | : LED config:
|
0
- Success, -1
- Error.void leddriver12_set_rst_pin | ( | leddriver12_t * | ctx, |
uint8_t | state ) |
LED Driver 12 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t leddriver12_write_register | ( | leddriver12_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
LED Driver 12 write register function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See leddriver12_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.