irdistance 2.0.0.0

Functions

void irdistance_cfg_setup (irdistance_cfg_t *cfg)
 Config Object Initialization function.
 
err_t irdistance_init (irdistance_t *ctx, irdistance_cfg_t *cfg)
 Initialization function.
 
void irdistance_enable_device (irdistance_t *ctx)
 Enable IR sensor function.
 
void irdistance_disable_device (irdistance_t *ctx)
 Disable IR sensor function.
 
err_t irdistance_read_adc (irdistance_t *ctx, uint16_t *data_out)
 Generic read function.
 
err_t irdistance_get_pin_voltage (irdistance_t *ctx, float *data_out)
 Get the voltage output of the sensor function.
 

Detailed Description

Function Documentation

◆ irdistance_cfg_setup()

void irdistance_cfg_setup ( irdistance_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.

◆ irdistance_disable_device()

void irdistance_disable_device ( irdistance_t * ctx)

Disable IR sensor function.

Parameters
ctxClick object.

@description Function disables distance measuring on the sensor by clearing EN pin on the IR distance click board.

◆ irdistance_enable_device()

void irdistance_enable_device ( irdistance_t * ctx)

Enable IR sensor function.

Parameters
ctxClick object.

@description Function enables distance measuring on the sensor by setting EN pin on the IR distance click board.

◆ irdistance_get_pin_voltage()

err_t irdistance_get_pin_voltage ( irdistance_t * ctx,
float * data_out )

Get the voltage output of the sensor function.

Parameters
ctxClick object.
data_outVoltage value on the pin.
Returns
See #err_t definition of data type.

@description This function reads voltage value on the pin.

◆ irdistance_init()

err_t irdistance_init ( irdistance_t * ctx,
irdistance_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.
Returns
See #err_t definition of data type. 0 - Success, (-1) - Error.

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

◆ irdistance_read_adc()

err_t irdistance_read_adc ( irdistance_t * ctx,
uint16_t * data_out )

Generic read function.

Parameters
ctxClick object.
data_outADC value on the pin.
Returns
See #err_t definition of data type.

@description This function reads ADC value on the pin.