lightranger3 2.0.0.0

Functions

void lightranger3_cfg_setup (lightranger3_cfg_t *cfg)
 Config Object Initialization function.
 
LIGHTRANGER3_RETVAL lightranger3_init (lightranger3_t *ctx, lightranger3_cfg_t *cfg)
 Initialization function.
 
void lightranger3_generic_write (lightranger3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void lightranger3_generic_read (lightranger3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void lightranger3_write_byte (lightranger3_t *ctx, uint8_t reg, uint8_t w_data)
 Functions for write one byte in register.
 
void lightranger3_write_data (lightranger3_t *ctx, uint8_t reg, uint16_t w_data)
 Functions for write data in register.
 
uint8_t lightranger3_read_byte (lightranger3_t *ctx, uint8_t reg)
 Functions for read one byte from register.
 
uint16_t lightranger3_read_data (lightranger3_t *ctx, uint8_t reg)
 Functions for read data from register.
 
uint8_t lightranger3_set_standby_mode (lightranger3_t *ctx)
 Functions for go to standby mode.
 
uint8_t lightranger3_set_off_mode (lightranger3_t *ctx)
 Functions for go to OFF mode.
 
uint8_t lightranger3_set_on_mode (lightranger3_t *ctx)
 Functions for go to ON mode.
 
uint8_t lightranger3_set_measurement_mode (lightranger3_t *ctx)
 Functions for go to measurement mode.
 
uint8_t lightranger3_take_single_measurement (lightranger3_t *ctx)
 Functions for measurement.
 
uint16_t lightranger3_get_distance (lightranger3_t *ctx)
 Functions for reads distance.
 
uint16_t lightranger3_get_confidence_value (lightranger3_t *ctx)
 Functions for reads confidence value.
 
uint16_t lightranger3_get_device_id (lightranger3_t *ctx)
 Functions for reads device ID.
 
void lightranger3_soft_reset (lightranger3_t *ctx)
 Functions for soft reset.
 
uint8_t lightranger3_get_interrupt (lightranger3_t *ctx)
 Functions for reads interrupt pin.
 
uint8_t lightranger3_device_init (lightranger3_t *ctx)
 Functions for initializes chip.
 

Detailed Description

Function Documentation

◆ lightranger3_cfg_setup()

void lightranger3_cfg_setup ( lightranger3_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.

◆ lightranger3_device_init()

uint8_t lightranger3_device_init ( lightranger3_t * ctx)

Functions for initializes chip.

Parameters
ctxClick object.

@description This function initializes chip.

Note
Procedure has been written following instructions from the datasheet.

◆ lightranger3_generic_read()

void lightranger3_generic_read ( lightranger3_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.

◆ lightranger3_generic_write()

void lightranger3_generic_write ( lightranger3_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.

◆ lightranger3_get_confidence_value()

uint16_t lightranger3_get_confidence_value ( lightranger3_t * ctx)

Functions for reads confidence value.

Parameters
ctxClick object.

@description This function reads confidence value.

◆ lightranger3_get_device_id()

uint16_t lightranger3_get_device_id ( lightranger3_t * ctx)

Functions for reads device ID.

Parameters
ctxClick object.

@description This function reads device ID.

◆ lightranger3_get_distance()

uint16_t lightranger3_get_distance ( lightranger3_t * ctx)

Functions for reads distance.

Parameters
ctxClick object.

@description This function reads distance.

◆ lightranger3_get_interrupt()

uint8_t lightranger3_get_interrupt ( lightranger3_t * ctx)

Functions for reads interrupt pin.

Parameters
ctxClick object.

@description This function reads interrupt pin.

◆ lightranger3_init()

LIGHTRANGER3_RETVAL lightranger3_init ( lightranger3_t * ctx,
lightranger3_cfg_t * cfg )

Initialization function.

Parameters
lightranger3Click object.
cfgClick configuration structure.

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

◆ lightranger3_read_byte()

uint8_t lightranger3_read_byte ( lightranger3_t * ctx,
uint8_t reg )

Functions for read one byte from register.

Parameters
ctxClick object.
regRegister address.

@description This function use when you need to reads one byte from the register.

◆ lightranger3_read_data()

uint16_t lightranger3_read_data ( lightranger3_t * ctx,
uint8_t reg )

Functions for read data from register.

Parameters
ctxClick object.
regRegister address.

@description This function use when you need to reads data from the register.

◆ lightranger3_set_measurement_mode()

uint8_t lightranger3_set_measurement_mode ( lightranger3_t * ctx)

Functions for go to measurement mode.

Parameters
ctxClick object.

@description This function go to measurement mode.

◆ lightranger3_set_off_mode()

uint8_t lightranger3_set_off_mode ( lightranger3_t * ctx)

Functions for go to OFF mode.

Parameters
ctxClick object.

@description This function sets OFF mode.

◆ lightranger3_set_on_mode()

uint8_t lightranger3_set_on_mode ( lightranger3_t * ctx)

Functions for go to ON mode.

Parameters
ctxClick object.

@description This function sets ON mode.

◆ lightranger3_set_standby_mode()

uint8_t lightranger3_set_standby_mode ( lightranger3_t * ctx)

Functions for go to standby mode.

Parameters
ctxClick object.

@description This function sets standby mode.

◆ lightranger3_soft_reset()

void lightranger3_soft_reset ( lightranger3_t * ctx)

Functions for soft reset.

Parameters
ctxClick object.

@description This function for soft reset.

◆ lightranger3_take_single_measurement()

uint8_t lightranger3_take_single_measurement ( lightranger3_t * ctx)

Functions for measurement.

Parameters
ctxClick object.

@description This function must be called in to start measuring.

◆ lightranger3_write_byte()

void lightranger3_write_byte ( lightranger3_t * ctx,
uint8_t reg,
uint8_t w_data )

Functions for write one byte in register.

Parameters
ctxClick object.
regRegister in which the data will be written.
w_dataData which be written in the register.

@description This function use when you need to written one byte into the register.

◆ lightranger3_write_data()

void lightranger3_write_data ( lightranger3_t * ctx,
uint8_t reg,
uint16_t w_data )

Functions for write data in register.

Parameters
ctxClick object.
regRegister in which the data will be written.
w_dataData which be written in the register.

@description This function use when you need to written data into the register.