uvb 2.0.0.0
UVB Click Driver

API for configuring and manipulating UVB Click driver. More...

Topics

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

Functions

void uvb_cfg_setup (uvb_cfg_t *cfg)
 UVB configuration object setup function.
 
err_t uvb_init (uvb_t *ctx, uvb_cfg_t *cfg)
 UVB initialization function.
 
err_t uvb_default_cfg (uvb_t *ctx)
 UVB default configuration function.
 
err_t uvb_generic_write (uvb_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 UVB I2C writing function.
 
err_t uvb_generic_read (uvb_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 UVB I2C reading function.
 
void uvb_configuration (uvb_t *ctx, uint8_t reg, uint8_t cfg)
 Configuration register.
 
uint8_t uvb_read_byte (uvb_t *ctx, uint8_t reg)
 Read one byte data from register.
 
err_t uvb_check_communication (uvb_t *ctx)
 Check communication.
 
uint16_t uvb_get_uv_data (uvb_t *ctx)
 Get UVB data.
 

Detailed Description

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

◆ uvb_cfg_setup()

void uvb_cfg_setup ( uvb_cfg_t * cfg)

UVB configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ uvb_check_communication()

err_t uvb_check_communication ( uvb_t * ctx)

Check communication.

This function checks communication.

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

◆ uvb_configuration()

void uvb_configuration ( uvb_t * ctx,
uint8_t reg,
uint8_t cfg )

Configuration register.

This function configure register.

Parameters
[in]ctx: Click context object. See uvb_t object definition for detailed explanation.
[in]reg: Register Address.
[in]cfg: Config data.
Returns
Nothing.

◆ uvb_default_cfg()

err_t uvb_default_cfg ( uvb_t * ctx)

UVB default configuration function.

This function executes a default configuration of UVB click board.

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

◆ uvb_generic_read()

err_t uvb_generic_read ( uvb_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

UVB 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 uvb_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ uvb_generic_write()

err_t uvb_generic_write ( uvb_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

UVB 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 uvb_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ uvb_get_uv_data()

uint16_t uvb_get_uv_data ( uvb_t * ctx)

Get UVB data.

This function gets UVB data.

Parameters
[in]ctx: Click context object. See uvb_t object definition for detailed explanation.
Returns
(16 bit) UVB data.

◆ uvb_init()

err_t uvb_init ( uvb_t * ctx,
uvb_cfg_t * cfg )

UVB initialization function.

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

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

◆ uvb_read_byte()

uint8_t uvb_read_byte ( uvb_t * ctx,
uint8_t reg )

Read one byte data from register.

This function reads one byte of data.

Parameters
[in]ctx: Click context object. See uvb_t object definition for detailed explanation.
[in]reg: Register Address.
Returns
One byte data.