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. | |
void ledflash2_cfg_setup | ( | ledflash2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void ledflash2_generic_read | ( | ledflash2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void ledflash2_generic_write | ( | ledflash2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
LEDFLASH2_RETVAL ledflash2_init | ( | ledflash2_t * | ctx, |
ledflash2_cfg_t * | cfg ) |
Initialization function.
ledflash2 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t ledflash2_read_register | ( | ledflash2_t * | ctx, |
uint8_t | reg_address ) |
Read register function.
ctx | Click object. |
reg_address | Register address. |
@description This function reads raw data from any register.
void ledflash2_set_mode | ( | ledflash2_t * | ctx, |
uint8_t | mode, | ||
uint8_t | intensity, | ||
uint8_t | flash_duration ) |
Set mode function.
ctx | Click object. |
mode | Mode to select. |
intensity | Led intensity. |
flash_duration | Flash 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.
void ledflash2_toggle_flash_inhibit | ( | ledflash2_t * | ctx, |
uint8_t | pin_state ) |
Toggle flash inhibit function.
ctx | Click object. |
pin_state | Flash 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.
void ledflash2_write_register | ( | ledflash2_t * | ctx, |
uint8_t | reg_address, | ||
uint8_t | reg_data ) |
Write register function.
ctx | Click object. |
reg_address | Register address. |
reg_data | Data to write. |
@description This function writes data into any register.