ledflash4
2.1.0.0
|
API for configuring and manipulating LED Flash 4 Click driver. More...
Modules | |
LED Flash 4 Registers List | |
List of registers of LED Flash 4 Click driver. | |
LED Flash 4 Registers Settings | |
Settings for registers of LED Flash 4 Click driver. | |
LED Flash 4 MikroBUS Map | |
MikroBUS pin mapping of LED Flash 4 Click driver. | |
Functions | |
void | ledflash4_cfg_setup (ledflash4_cfg_t *cfg) |
LED Flash 4 configuration object setup function. More... | |
err_t | ledflash4_init (ledflash4_t *ctx, ledflash4_cfg_t *cfg) |
LED Flash 4 initialization function. More... | |
err_t | ledflash4_default_cfg (ledflash4_t *ctx) |
LED Flash 4 default configuration function. More... | |
err_t | ledflash4_generic_write (ledflash4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
LED Flash 4 I2C writing function. More... | |
err_t | ledflash4_generic_read (ledflash4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
LED Flash 4 I2C reading function. More... | |
err_t | ledflash4_write_reg (ledflash4_t *ctx, uint8_t reg, uint8_t data_in) |
LED Flash 4 write reg function. More... | |
err_t | ledflash4_read_reg (ledflash4_t *ctx, uint8_t reg, uint8_t *data_out) |
LED Flash 4 read reg function. More... | |
void | ledflash4_set_stb_pin (ledflash4_t *ctx, uint8_t state) |
LED Flash 4 set STB pin function. More... | |
err_t | ledflash4_check_communication (ledflash4_t *ctx) |
LED Flash 4 check communication function. More... | |
err_t | ledflash4_set_led1_current (ledflash4_t *ctx, uint16_t led_current) |
LED Flash 4 set LED1 current function. More... | |
err_t | ledflash4_set_led2_current (ledflash4_t *ctx, uint16_t led_current) |
LED Flash 4 set LED2 current function. More... | |
API for configuring and manipulating LED Flash 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void ledflash4_cfg_setup | ( | ledflash4_cfg_t * | cfg | ) |
LED Flash 4 configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ledflash4_cfg_t object definition for detailed explanation. |
err_t ledflash4_check_communication | ( | ledflash4_t * | ctx | ) |
LED Flash 4 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See ledflash4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ledflash4_default_cfg | ( | ledflash4_t * | ctx | ) |
LED Flash 4 default configuration function.
This function executes a default configuration of LED Flash 4 Click board.
[in] | ctx | : Click context object. See ledflash4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ledflash4_generic_read | ( | ledflash4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
LED Flash 4 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 ledflash4_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ledflash4_generic_write | ( | ledflash4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
LED Flash 4 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 ledflash4_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ledflash4_init | ( | ledflash4_t * | ctx, |
ledflash4_cfg_t * | cfg | ||
) |
LED Flash 4 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See ledflash4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See ledflash4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ledflash4_read_reg | ( | ledflash4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
LED Flash 4 read reg function.
This function reads a data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See ledflash4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ledflash4_set_led1_current | ( | ledflash4_t * | ctx, |
uint16_t | led_current | ||
) |
LED Flash 4 set LED1 current function.
This function sets the LED1 maximum current in mA.
[in] | ctx | : Click context object. See ledflash4_t object definition for detailed explanation. |
[in] | led_current | : LED current in mA [0-900]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ledflash4_set_led2_current | ( | ledflash4_t * | ctx, |
uint16_t | led_current | ||
) |
LED Flash 4 set LED2 current function.
This function sets the LED2 maximum current in mA.
[in] | ctx | : Click context object. See ledflash4_t object definition for detailed explanation. |
[in] | led_current | : LED current in mA [0-900]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void ledflash4_set_stb_pin | ( | ledflash4_t * | ctx, |
uint8_t | state | ||
) |
LED Flash 4 set STB pin function.
This function sets the strobe (STB) pin logic state.
[in] | ctx | : Click context object. See ledflash4_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t ledflash4_write_reg | ( | ledflash4_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
LED Flash 4 write reg function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See ledflash4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.