light  2.0.0.0
Functions
Public function

Functions

void light_cfg_setup (light_cfg_t *cfg)
 Config Object Initialization function. More...
 
LIGHT_RETVAL light_init (light_t *ctx, light_cfg_t *cfg)
 Initialization function. More...
 
uint16_t light_read_data (light_t *ctx)
 Generic read data function. More...
 
uint8_t light_calculate_percent (light_t *ctx, uint16_t light_value)
 Function calculate percent. More...
 

Detailed Description

Function Documentation

◆ light_calculate_percent()

uint8_t light_calculate_percent ( light_t ctx,
uint16_t  light_value 
)

Function calculate percent.

Parameters
ctxClick object.
light_value14-bit data ADC value

@description Function calculate light intensity percent.

◆ light_cfg_setup()

void light_cfg_setup ( light_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.

◆ light_init()

LIGHT_RETVAL light_init ( light_t ctx,
light_cfg_t cfg 
)

Initialization function.

Parameters
lightClick object.
cfgClick configuration structure.

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

◆ light_read_data()

uint16_t light_read_data ( light_t ctx)

Generic read data function.

Parameters
ctxClick object.

@description Function read 14-bit data from MCP3201.