ledflash2 2.0.0.0

Functions

void ledflash2_cfg_setup (ledflash2_cfg_t *cfg)
 Config Object Initialization function.
 
LEDFLASH2_RETVAL ledflash2_init (ledflash2_t *ctx, ledflash2_cfg_t *cfg)
 Initialization function.
 
void ledflash2_generic_write (ledflash2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void ledflash2_generic_read (ledflash2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t ledflash2_read_register (ledflash2_t *ctx, uint8_t reg_address)
 Read register function.
 
void ledflash2_write_register (ledflash2_t *ctx, uint8_t reg_address, uint8_t reg_data)
 Write register function.
 
void ledflash2_set_mode (ledflash2_t *ctx, uint8_t mode, uint8_t intensity, uint8_t flash_duration)
 Set mode function.
 
void ledflash2_toggle_flash_inhibit (ledflash2_t *ctx, uint8_t pin_state)
 Toggle flash inhibit function.
 

Detailed Description

Function Documentation

◆ ledflash2_cfg_setup()

void ledflash2_cfg_setup ( ledflash2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ ledflash2_generic_read()

void ledflash2_generic_read ( ledflash2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ ledflash2_generic_write()

void ledflash2_generic_write ( ledflash2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ ledflash2_init()

LEDFLASH2_RETVAL ledflash2_init ( ledflash2_t * ctx,
ledflash2_cfg_t * cfg )

Initialization function.

Parameters
ledflash2Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ ledflash2_read_register()

uint8_t ledflash2_read_register ( ledflash2_t * ctx,
uint8_t reg_address )

Read register function.

Parameters
ctxClick object.
reg_addressRegister address.

@description This function reads raw data from any register.

◆ ledflash2_set_mode()

void ledflash2_set_mode ( ledflash2_t * ctx,
uint8_t mode,
uint8_t intensity,
uint8_t flash_duration )

Set mode function.

Parameters
ctxClick object.
modeMode to select.
intensityLed intensity.
flash_durationFlash duration.

@description This control function that sets the click into one of the three available modes. OFF mode requires no additional parameters, and will ignore intensity and duration. Flash mode will set both the intensity and duration, and will set them to default value (100% intensity, 156 duration) if 0 values are passed instead. Torch mode only requires intensity parameter. It will ignore duration parameter, and will set the intensity to default (100 %) if intensity parameter is 0.

◆ ledflash2_toggle_flash_inhibit()

void ledflash2_toggle_flash_inhibit ( ledflash2_t * ctx,
uint8_t pin_state )

Toggle flash inhibit function.

Parameters
ctxClick object.
pin_stateFlash inhibit on or off.

@description This function will set the flash inhibit pin to either 1 or 0. It should be used when click is in flash mode, to reduce the flash intensity.

◆ ledflash2_write_register()

void ledflash2_write_register ( ledflash2_t * ctx,
uint8_t reg_address,
uint8_t reg_data )

Write register function.

Parameters
ctxClick object.
reg_addressRegister address.
reg_dataData to write.

@description This function writes data into any register.