weather 2.0.0.0
Public function

Functions

void weather_cfg_setup (weather_cfg_t *cfg)
 Config Object Initialization function.
 
err_t weather_init (weather_t *ctx, weather_cfg_t *cfg)
 Initialization function.
 
err_t weather_default_cfg (weather_t *ctx)
 Click Default Configuration function.
 
err_t weather_generic_write (weather_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
err_t weather_generic_read (weather_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
err_t weather_get_device_id (weather_t *ctx, uint8_t *device_id)
 Device ID.
 
err_t weather_software_reset (weather_t *ctx)
 Software reset function.
 
err_t weather_get_ambient_data (weather_t *ctx, weather_data_t *weather_data)
 Weather data.
 
err_t weather_measurement_cfg (weather_t *ctx, weather_measurement_cfg_t *cfg)
 Measurement config.
 

Detailed Description

Function Documentation

◆ weather_cfg_setup()

void weather_cfg_setup ( weather_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ weather_default_cfg()

err_t weather_default_cfg ( weather_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

This function executes default configuration for Weather click.

Note
Default configuration of the chip contains the settings :
  • oversampling huidity - WEATHER_HUM_OS_1X;
  • oversampling temperature - WEATHER_MCTRL_TEMP_OS_2X
  • oversampling pressure - WEATHER_MCTRL_PRESS_OS_16X
  • mode - WEATHER_MCTRL_MODE_NORMAL
  • filter - WEATHER_CFG_FILTER_16
  • standby_time - WEATHER_CFG_STANDBY_TIME_10ms

◆ weather_generic_read()

err_t weather_generic_read ( weather_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

This function reads data from the desired register.

◆ weather_generic_write()

err_t weather_generic_write ( weather_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

This function writes data to the desired register.

◆ weather_get_ambient_data()

err_t weather_get_ambient_data ( weather_t * ctx,
weather_data_t * weather_data )

Weather data.

Parameters
ctxClick object.
weather_dataStructure that contains info about weather data

Use this function to read the temperature, pressure and humidity data

◆ weather_get_device_id()

err_t weather_get_device_id ( weather_t * ctx,
uint8_t * device_id )

Device ID.

Parameters
ctxClick object.
device_id(8 bit) Device ID - 0x60 - default

You can use this function as a check on click communication with your MCU.

◆ weather_init()

err_t weather_init ( weather_t * ctx,
weather_cfg_t * cfg )

Initialization function.

Parameters
weatherClick object.
cfgClick configuration structure.

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

◆ weather_measurement_cfg()

err_t weather_measurement_cfg ( weather_t * ctx,
weather_measurement_cfg_t * cfg )

Measurement config.

Parameters
ctxClick object.
cfgStructure that contains info about new measurement data for settings

Use this function to set up new settings

◆ weather_software_reset()

err_t weather_software_reset ( weather_t * ctx)

Software reset function.

Parameters
ctxClick object.