weather  2.0.0.0
Functions
Public function

Functions

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

Detailed Description

Function Documentation

◆ weather_cfg_setup()

void weather_cfg_setup ( weather_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ weather_default_cfg()

void weather_default_cfg ( weather_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description 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()

void 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

@description This function reads data from the desired register.

◆ weather_generic_write()

void 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.

@description This function writes data to the desired register.

◆ weather_get_ambient_data()

void 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

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

◆ weather_get_device_id()

uint8_t weather_get_device_id ( weather_t ctx)

Device ID.

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

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

◆ weather_init()

WEATHER_RETVAL weather_init ( weather_t ctx,
weather_cfg_t cfg 
)

Initialization function.

Parameters
weatherClick object.
cfgClick configuration structure.

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

◆ weather_measurement_cfg()

void 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

@description Use this function to set up new settings

◆ weather_software_reset()

void weather_software_reset ( weather_t ctx)

Software reset function.

Parameters
ctxClick object.