uv5 2.1.0.0
UV 5 Click Driver

API for configuring and manipulating UV 5 Click driver. More...

Topics

 UV 5 Registers List
 List of registers of UV 5 Click driver.
 
 UV 5 Registers Settings
 Settings for registers of UV 5 Click driver.
 
 UV 5 MikroBUS Map
 MikroBUS pin mapping of UV 5 Click driver.
 

Functions

void uv5_cfg_setup (uv5_cfg_t *cfg)
 UV 5 configuration object setup function.
 
err_t uv5_init (uv5_t *ctx, uv5_cfg_t *cfg)
 UV 5 initialization function.
 
err_t uv5_default_cfg (uv5_t *ctx)
 UV 5 default configuration function.
 
err_t uv5_generic_write (uv5_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 UV 5 I2C writing function.
 
err_t uv5_generic_read (uv5_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 UV 5 I2C reading function.
 
err_t uv5_write_cfg_reg (uv5_t *ctx, uint8_t reg, uint8_t data_in)
 UV 5 configuration mode register write function.
 
err_t uv5_write_measu_reg (uv5_t *ctx, uint8_t reg, uint8_t *data_in)
 UV 5 measurement mode register write function.
 
err_t uv5_read_cfg_reg (uv5_t *ctx, uint8_t reg, uint8_t *data_out)
 UV 5 configuration mode register reading function.
 
err_t uv5_read_measu_reg (uv5_t *ctx, uint8_t reg, uint8_t *data_out)
 UV 5 measurement mode register reading function.
 
void uv5_set_syn_pin (uv5_t *ctx, uint8_t pin_state)
 UV 5 set SYN pin state function.
 
uint8_t uv5_get_rdy_pin (uv5_t *ctx)
 UV 5 get READY pin state function.
 
err_t uv5_sw_reset (uv5_t *ctx)
 UV 5 software reset function.
 
err_t uv5_temperature_read (uv5_t *ctx, float *temp_data)
 UV 5 read temperature function.
 
err_t uv5_channel_uva_read (uv5_t *ctx, uint16_t *uva_data)
 UV 5 read raw UVA data function.
 
err_t uv5_channel_uvb_read (uv5_t *ctx, uint16_t *uvb_data)
 UV 5 read raw UVB data function.
 
err_t uv5_channel_uvc_read (uv5_t *ctx, uint16_t *uvc_data)
 UV 5 read raw UVC data function.
 

Detailed Description

API for configuring and manipulating UV 5 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

◆ uv5_cfg_setup()

void uv5_cfg_setup ( uv5_cfg_t * cfg)

UV 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ uv5_channel_uva_read()

err_t uv5_channel_uva_read ( uv5_t * ctx,
uint16_t * uva_data )

UV 5 read raw UVA data function.

This function is used to read raw UVA data.

Parameters
[in]ctx: Click context object. See uv5_t object definition for detailed explanation.
[out]uva_data: Read raw UVA data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uv5_channel_uvb_read()

err_t uv5_channel_uvb_read ( uv5_t * ctx,
uint16_t * uvb_data )

UV 5 read raw UVB data function.

This function is used to read raw UVB data.

Parameters
[in]ctx: Click context object. See uv5_t object definition for detailed explanation.
[out]uva_data: Read raw UVB data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uv5_channel_uvc_read()

err_t uv5_channel_uvc_read ( uv5_t * ctx,
uint16_t * uvc_data )

UV 5 read raw UVC data function.

This function is used to read raw UVC data.

Parameters
[in]ctx: Click context object. See uv5_t object definition for detailed explanation.
[out]uva_data: Read raw UVC data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uv5_default_cfg()

err_t uv5_default_cfg ( uv5_t * ctx)

UV 5 default configuration function.

This function executes a default configuration of UV 5 click board.

Parameters
[in]ctx: Click context object. See uv5_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.

◆ uv5_generic_read()

err_t uv5_generic_read ( uv5_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

UV 5 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 uv5_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.

◆ uv5_generic_write()

err_t uv5_generic_write ( uv5_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

UV 5 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 uv5_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.

◆ uv5_get_rdy_pin()

uint8_t uv5_get_rdy_pin ( uv5_t * ctx)

UV 5 get READY pin state function.

This function is used to get state of the READY pin.

Parameters
[in]ctx: Click context object. See uv5_t object definition for detailed explanation.
Returns
  • 0 - Pin state low,
  • 1 - Pin state high.
Note
None.

◆ uv5_init()

err_t uv5_init ( uv5_t * ctx,
uv5_cfg_t * cfg )

UV 5 initialization function.

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

Parameters
[out]ctx: Click context object. See uv5_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See uv5_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uv5_read_cfg_reg()

err_t uv5_read_cfg_reg ( uv5_t * ctx,
uint8_t reg,
uint8_t * data_out )

UV 5 configuration mode register reading function.

This function reads bytes of data starting from the selected register in configuration mode by using I2C serial interface.

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

◆ uv5_read_measu_reg()

err_t uv5_read_measu_reg ( uv5_t * ctx,
uint8_t reg,
uint8_t * data_out )

UV 5 measurement mode register reading function.

This function reads bytes of data starting from the selected register in measurement mode by using I2C serial interface.

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

◆ uv5_set_syn_pin()

void uv5_set_syn_pin ( uv5_t * ctx,
uint8_t pin_state )

UV 5 set SYN pin state function.

This function is used to set state of the SYN pin.

Parameters
[in]ctx: Click context object. See uv5_t object definition for detailed explanation.
[in]pin_state: SYN pin state.
Returns
Nothing.
Note
None.

◆ uv5_sw_reset()

err_t uv5_sw_reset ( uv5_t * ctx)

UV 5 software reset function.

This function is used to perform software reset.

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

◆ uv5_temperature_read()

err_t uv5_temperature_read ( uv5_t * ctx,
float * temp_data )

UV 5 read temperature function.

This function is used to read temperature.

Parameters
[in]ctx: Click context object. See uv5_t object definition for detailed explanation.
[out]temp_data: Read temperature in degrees celsius.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uv5_write_cfg_reg()

err_t uv5_write_cfg_reg ( uv5_t * ctx,
uint8_t reg,
uint8_t data_in )

UV 5 configuration mode register write function.

This function writes a bytes of data starting from the selected register, when device is in configuration mode.

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

◆ uv5_write_measu_reg()

err_t uv5_write_measu_reg ( uv5_t * ctx,
uint8_t reg,
uint8_t * data_in )

UV 5 measurement mode register write function.

This function writes a bytes of data starting from the selected register, when device is in measurement mode.

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