ledflash4  2.1.0.0
Modules | Functions
LED Flash 4 Click Driver

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...
 

Detailed Description

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.

Function Documentation

◆ ledflash4_cfg_setup()

void ledflash4_cfg_setup ( ledflash4_cfg_t cfg)

LED Flash 4 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ledflash4_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ ledflash4_check_communication()

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.

Parameters
[in]ctx: Click context object. See ledflash4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledflash4_default_cfg()

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.

Parameters
[in]ctx: Click context object. See ledflash4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ ledflash4_generic_read()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledflash4_generic_write()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledflash4_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledflash4_read_reg()

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.

Parameters
[in]ctx: Click context object. See ledflash4_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledflash4_set_led1_current()

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.

Parameters
[in]ctx: Click context object. See ledflash4_t object definition for detailed explanation.
[in]led_current: LED current in mA [0-900].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledflash4_set_led2_current()

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.

Parameters
[in]ctx: Click context object. See ledflash4_t object definition for detailed explanation.
[in]led_current: LED current in mA [0-900].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledflash4_set_stb_pin()

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.

Parameters
[in]ctx: Click context object. See ledflash4_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ ledflash4_write_reg()

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.

Parameters
[in]ctx: Click context object. See ledflash4_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.