uva 2.0.0.0
UVA Click Driver

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

Topics

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

Functions

void uva_cfg_setup (uva_cfg_t *cfg)
 UVA configuration object setup function.
 
err_t uva_init (uva_t *ctx, uva_cfg_t *cfg)
 UVA initialization function.
 
err_t uva_default_cfg (uva_t *ctx)
 UVA default configuration function.
 
err_t uva_generic_write (uva_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 UVA I2C writing function.
 
err_t uva_generic_read (uva_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 UVA I2C reading function.
 
err_t uva_write_register (uva_t *ctx, uint8_t reg, uint8_t data_in)
 UVA write register function.
 
err_t uva_read_register (uva_t *ctx, uint8_t reg, uint8_t *data_out)
 UVA read register function.
 
err_t uva_check_communication (uva_t *ctx)
 UVA check communication function.
 
err_t uva_read_data (uva_t *ctx, uint16_t *uva_data)
 UVA read data function.
 
err_t uva_soft_reset (uva_t *ctx)
 UVA soft reset function.
 

Detailed Description

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

◆ uva_cfg_setup()

void uva_cfg_setup ( uva_cfg_t * cfg)

UVA configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ uva_check_communication()

err_t uva_check_communication ( uva_t * ctx)

UVA check communication function.

This function checks the communication by reading and verifying the chip ID.

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

◆ uva_default_cfg()

err_t uva_default_cfg ( uva_t * ctx)

UVA default configuration function.

This function executes a default configuration of UVA click board.

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

◆ uva_generic_read()

err_t uva_generic_read ( uva_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

UVA 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 uva_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.
Note
None.

◆ uva_generic_write()

err_t uva_generic_write ( uva_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

UVA 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 uva_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.
Note
None.

◆ uva_init()

err_t uva_init ( uva_t * ctx,
uva_cfg_t * cfg )

UVA initialization function.

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

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

◆ uva_read_data()

err_t uva_read_data ( uva_t * ctx,
uint16_t * uva_data )

UVA read data function.

This function reads the raw UVA data from registers.

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

◆ uva_read_register()

err_t uva_read_register ( uva_t * ctx,
uint8_t reg,
uint8_t * data_out )

UVA read register function.

This function reads a data byte from the selected register by using I2C serial interface.

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

◆ uva_soft_reset()

err_t uva_soft_reset ( uva_t * ctx)

UVA soft reset function.

This function executes the soft reset command.

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

◆ uva_write_register()

err_t uva_write_register ( uva_t * ctx,
uint8_t reg,
uint8_t data_in )

UVA write register function.

This function writes a data byte to the selected register by using I2C serial interface.

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