inclinometer 2.0.0.0
Inclinometer Click Driver

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

Topics

 Inclinometer Registers List
 List of registers of Inclinometer Click driver.
 
 Inclinometer Commands
 Commands of Inclinometer Click driver.
 
 Inclinometer MikroBUS Map
 MikroBUS pin mapping of Inclinometer Click driver.
 

Functions

void inclinometer_cfg_setup (inclinometer_cfg_t *cfg)
 Inclinometer configuration object setup function.
 
err_t inclinometer_init (inclinometer_t *ctx, inclinometer_cfg_t *cfg)
 Inclinometer initialization function.
 
err_t inclinometer_default_cfg (inclinometer_t *ctx)
 Inclinometer default configuration function.
 
err_t inclinometer_generic_write (inclinometer_t *ctx, uint8_t reg, uint16_t data_in)
 Data writing function.
 
err_t inclinometer_generic_read (inclinometer_t *ctx, uint8_t reg, uint16_t *data_out)
 Data reading function.
 
err_t inclinometer_cmd_write (inclinometer_t *ctx, uint32_t cmd)
 CMD writing function.
 
err_t inclinometer_cmd_read (inclinometer_t *ctx, uint32_t cmd, uint16_t *cmd_data)
 CMD reading function.
 
err_t inclinometer_get_temperature (inclinometer_t *ctx, float *temperature)
 Temperature reading.
 
err_t inclinometer_get_axes (inclinometer_t *ctx, inclinometer_accel_t *axes_data)
 Axes reading.
 
err_t inclinometer_get_angle (inclinometer_t *ctx, inclinometer_accel_t *angle_data)
 Angle reading.
 

Detailed Description

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

◆ inclinometer_cfg_setup()

void inclinometer_cfg_setup ( inclinometer_cfg_t * cfg)

Inclinometer configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ inclinometer_cmd_read()

err_t inclinometer_cmd_read ( inclinometer_t * ctx,
uint32_t cmd,
uint16_t * cmd_data )

CMD reading function.

This function reads a data from predefined command.

Parameters
[in]ctx: Click context object. See inclinometer_t object definition for detailed explanation.
[in]cmd: Predefined command. See #inclinometer_cmd def group for detailed explanation.
[out]cmd_data: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ inclinometer_cmd_write()

err_t inclinometer_cmd_write ( inclinometer_t * ctx,
uint32_t cmd )

CMD writing function.

This function writes predefined command.

Parameters
[in]ctx: Click context object. See inclinometer_t object definition for detailed explanation.
[in]cmd: Predefined command. See #inclinometer_cmd def group for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ inclinometer_default_cfg()

err_t inclinometer_default_cfg ( inclinometer_t * ctx)

Inclinometer default configuration function.

This function executes a default configuration of Inclinometer click board.

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

◆ inclinometer_generic_read()

err_t inclinometer_generic_read ( inclinometer_t * ctx,
uint8_t reg,
uint16_t * data_out )

Data reading function.

This function reads a data from register.

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

◆ inclinometer_generic_write()

err_t inclinometer_generic_write ( inclinometer_t * ctx,
uint8_t reg,
uint16_t data_in )

Data writing function.

This function writes a data to register.

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

◆ inclinometer_get_angle()

err_t inclinometer_get_angle ( inclinometer_t * ctx,
inclinometer_accel_t * angle_data )

Angle reading.

This function reads a angle data from device.

Parameters
[in]ctx: Click context object. See inclinometer_t object definition for detailed explanation.
[out]angle_data: Output read data. See inclinometer_accel_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ inclinometer_get_axes()

err_t inclinometer_get_axes ( inclinometer_t * ctx,
inclinometer_accel_t * axes_data )

Axes reading.

This function reads a axes data from device.

Parameters
[in]ctx: Click context object. See inclinometer_t object definition for detailed explanation.
[out]axes_data: Output read data. See inclinometer_accel_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ inclinometer_get_temperature()

err_t inclinometer_get_temperature ( inclinometer_t * ctx,
float * temperature )

Temperature reading.

This function reads a temperature data from device.

Parameters
[in]ctx: Click context object. See inclinometer_t object definition for detailed explanation.
[out]temperature: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ inclinometer_init()

err_t inclinometer_init ( inclinometer_t * ctx,
inclinometer_cfg_t * cfg )

Inclinometer initialization function.

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

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