uv 2.0.0.0
Public function

Functions

void uv_cfg_setup (uv_cfg_t *cfg)
 Config Object Initialization function.
 
err_t uv_init (uv_t *ctx, uv_cfg_t *cfg)
 Initialization function.
 
void uv_set_callback_handler (uv_t *ctx, uv_callback_t handler)
 Callback Handler Setting function.
 
err_t uv_read_adc_value (uv_t *ctx, uint16_t *data_out)
 ADC Reading function.
 
err_t uv_read_adc_voltage (uv_t *ctx, float *data_out)
 ADC Voltage Reading function.
 
err_t uv_read_an_pin_value (uv_t *ctx, uint16_t *data_out)
 AN Pin Reading function.
 
err_t uv_read_an_pin_voltage (uv_t *ctx, float *data_out)
 AN Pin Voltage Reading function.
 
void uv_calc_index (uv_t *ctx, float data_in, uint8_t *data_out)
 UV Index Calculation function.
 
void uv_device_enable (uv_t *ctx)
 Device Power ON function.
 
void uv_device_disable (uv_t *ctx)
 Device Power OFF function.
 

Detailed Description

Function Documentation

◆ uv_calc_index()

void uv_calc_index ( uv_t * ctx,
float data_in,
uint8_t * data_out )

UV Index Calculation function.

Parameters
[in]ctxClick object.
[in]data_inADC voltage value for conversion from ADC voltage to UV index level.
[out]data_outUV index level.

This function calculates UV index level depending on the converted ADC voltage value.

Note
If callback handler is properly set, this function will send a message about risk of harm.

◆ uv_cfg_setup()

void uv_cfg_setup ( uv_cfg_t * cfg)

Config Object Initialization function.

Parameters
[out]cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ uv_device_disable()

void uv_device_disable ( uv_t * ctx)

Device Power OFF function.

Parameters
[in]ctxClick object.

This function allows device to be powered OFF / disabled.

◆ uv_device_enable()

void uv_device_enable ( uv_t * ctx)

Device Power ON function.

Parameters
[in]ctxClick object.

This function allows device to be powered ON / enabled.

◆ uv_init()

err_t uv_init ( uv_t * ctx,
uv_cfg_t * cfg )

Initialization function.

Parameters
[out]ctxClick object.
[in]cfgClick configuration structure.
Returns
See #err_t definition of data type. 0 - Ok, (-1) - Error.

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

◆ uv_read_adc_value()

err_t uv_read_adc_value ( uv_t * ctx,
uint16_t * data_out )

ADC Reading function.

Parameters
[in]ctxClick object.
[out]data_outAD conversion result [12-bit].
Returns
See #err_t definition of data type. 0 - Ok, (-1) - Error.

This function reads AD conversion results.

◆ uv_read_adc_voltage()

err_t uv_read_adc_voltage ( uv_t * ctx,
float * data_out )

ADC Voltage Reading function.

Parameters
[in]ctxClick object.
[out]data_outAD voltage value [V].
Returns
See #err_t definition of data type. 0 - Ok, (-1) - Error.

This function reads AD voltage value.

◆ uv_read_an_pin_value()

err_t uv_read_an_pin_value ( uv_t * ctx,
uint16_t * data_out )

AN Pin Reading function.

Parameters
[in]ctxClick object.
[out]data_outAD conversion result [10-bit].
Returns
See #err_t definition of data type. 0 - Ok, (-1) - Error.

This function reads Analog pin by using AD converter from MCU.

Note
The resolution of AD conversion depends on the target MCU and must be previously set on the right value.

◆ uv_read_an_pin_voltage()

err_t uv_read_an_pin_voltage ( uv_t * ctx,
float * data_out )

AN Pin Voltage Reading function.

Parameters
[in]ctxClick object.
[out]data_outAN pin voltage value [V].
Returns
See #err_t definition of data type. 0 - Ok, (-1) - Error.

This function reads voltage on the Analog pin by using AD converter from MCU.

Note
The resolution and reference voltage of the AD converter must be previously set on the right values.

◆ uv_set_callback_handler()

void uv_set_callback_handler ( uv_t * ctx,
uv_callback_t handler )

Callback Handler Setting function.

Parameters
[out]ctxClick object.
[in]handlerCallback handler function.

This function sets a callback handler for the selected ctx object.