STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
ISM330DHCX_common

This section groups common useful functions. More...

Collaboration diagram for ISM330DHCX_common:

Functions

int32_t ism330dhcx_device_conf_set (stmdev_ctx_t *ctx, uint8_t val)
 DEVICE_CONF bit configuration[set].
int32_t ism330dhcx_device_conf_get (stmdev_ctx_t *ctx, uint8_t *val)
 DEVICE_CONF bit configuration[get].
int32_t ism330dhcx_odr_cal_reg_set (stmdev_ctx_t *ctx, uint8_t val)
 Difference in percentage of the effective ODR (and timestamp rate) with respect to the typical.
int32_t ism330dhcx_odr_cal_reg_get (stmdev_ctx_t *ctx, uint8_t *val)
 Difference in percentage of the effective ODR (and timestamp rate) with respect to the typical.
int32_t ism330dhcx_mem_bank_set (stmdev_ctx_t *ctx, ism330dhcx_reg_access_t val)
 Enable access to the embedded functions/sensor hub configuration registers.
int32_t ism330dhcx_mem_bank_get (stmdev_ctx_t *ctx, ism330dhcx_reg_access_t *val)
 Enable access to the embedded functions/sensor hub configuration registers.
int32_t ism330dhcx_ln_pg_write_byte (stmdev_ctx_t *ctx, uint16_t add, uint8_t *val)
 Write a line(byte) in a page.
int32_t ism330dhcx_ln_pg_write (stmdev_ctx_t *ctx, uint16_t add, uint8_t *buf, uint8_t len)
 Write buffer in a page.
int32_t ism330dhcx_ln_pg_read_byte (stmdev_ctx_t *ctx, uint16_t add, uint8_t *val)
 Read a line(byte) in a page.
int32_t ism330dhcx_data_ready_mode_set (stmdev_ctx_t *ctx, ism330dhcx_dataready_pulsed_t val)
 Data-ready pulsed / letched mode.
int32_t ism330dhcx_data_ready_mode_get (stmdev_ctx_t *ctx, ism330dhcx_dataready_pulsed_t *val)
 Data-ready pulsed / letched mode.
int32_t ism330dhcx_device_id_get (stmdev_ctx_t *ctx, uint8_t *buff)
 Device Who am I.
int32_t ism330dhcx_reset_set (stmdev_ctx_t *ctx, uint8_t val)
 Software reset.
int32_t ism330dhcx_reset_get (stmdev_ctx_t *ctx, uint8_t *val)
 Software reset.
int32_t ism330dhcx_auto_increment_set (stmdev_ctx_t *ctx, uint8_t val)
 Register address automatically incremented during a multiple byte access with a serial interface.
int32_t ism330dhcx_auto_increment_get (stmdev_ctx_t *ctx, uint8_t *val)
 Register address automatically incremented during a multiple byte access with a serial interface.
int32_t ism330dhcx_boot_set (stmdev_ctx_t *ctx, uint8_t val)
 Reboot memory content.
int32_t ism330dhcx_boot_get (stmdev_ctx_t *ctx, uint8_t *val)
 Reboot memory content.
int32_t ism330dhcx_xl_self_test_set (stmdev_ctx_t *ctx, ism330dhcx_st_xl_t val)
 Linear acceleration sensor self-test enable.
int32_t ism330dhcx_xl_self_test_get (stmdev_ctx_t *ctx, ism330dhcx_st_xl_t *val)
 Linear acceleration sensor self-test enable.
int32_t ism330dhcx_gy_self_test_set (stmdev_ctx_t *ctx, ism330dhcx_st_g_t val)
 Angular rate sensor self-test enable.
int32_t ism330dhcx_gy_self_test_get (stmdev_ctx_t *ctx, ism330dhcx_st_g_t *val)
 Angular rate sensor self-test enable.

Detailed Description

This section groups common useful functions.

Function Documentation

◆ ism330dhcx_auto_increment_get()

int32_t ism330dhcx_auto_increment_get ( stmdev_ctx_t * ctx,
uint8_t * val )

Register address automatically incremented during a multiple byte access with a serial interface.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of if_inc in reg CTRL3_C
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2449 of file ism330dhcx_reg.c.

References ism330dhcx_ctrl3_c_t::if_inc, ISM330DHCX_CTRL3_C, and ism330dhcx_read_reg().

◆ ism330dhcx_auto_increment_set()

int32_t ism330dhcx_auto_increment_set ( stmdev_ctx_t * ctx,
uint8_t val )

Register address automatically incremented during a multiple byte access with a serial interface.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of if_inc in reg CTRL3_C
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2423 of file ism330dhcx_reg.c.

References ism330dhcx_ctrl3_c_t::if_inc, ISM330DHCX_CTRL3_C, ism330dhcx_read_reg(), and ism330dhcx_write_reg().

◆ ism330dhcx_boot_get()

int32_t ism330dhcx_boot_get ( stmdev_ctx_t * ctx,
uint8_t * val )

Reboot memory content.

Reload the calibration parameters.[get]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of boot in reg CTRL3_C
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2493 of file ism330dhcx_reg.c.

References ism330dhcx_ctrl3_c_t::boot, ISM330DHCX_CTRL3_C, and ism330dhcx_read_reg().

◆ ism330dhcx_boot_set()

int32_t ism330dhcx_boot_set ( stmdev_ctx_t * ctx,
uint8_t val )

Reboot memory content.

Reload the calibration parameters.[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of boot in reg CTRL3_C
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2468 of file ism330dhcx_reg.c.

References ism330dhcx_ctrl3_c_t::boot, ISM330DHCX_CTRL3_C, ism330dhcx_read_reg(), and ism330dhcx_write_reg().

◆ ism330dhcx_data_ready_mode_get()

int32_t ism330dhcx_data_ready_mode_get ( stmdev_ctx_t * ctx,
ism330dhcx_dataready_pulsed_t * val )

Data-ready pulsed / letched mode.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valGet the values of dataready_pulsed in reg COUNTER_BDR_REG1
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2328 of file ism330dhcx_reg.c.

References ism330dhcx_counter_bdr_reg1_t::dataready_pulsed, ISM330DHCX_COUNTER_BDR_REG1, ISM330DHCX_DRDY_LATCHED, ISM330DHCX_DRDY_PULSED, and ism330dhcx_read_reg().

◆ ism330dhcx_data_ready_mode_set()

int32_t ism330dhcx_data_ready_mode_set ( stmdev_ctx_t * ctx,
ism330dhcx_dataready_pulsed_t val )

Data-ready pulsed / letched mode.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of dataready_pulsed in reg COUNTER_BDR_REG1
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2301 of file ism330dhcx_reg.c.

References ism330dhcx_counter_bdr_reg1_t::dataready_pulsed, ISM330DHCX_COUNTER_BDR_REG1, ism330dhcx_read_reg(), and ism330dhcx_write_reg().

Referenced by QwDevISM330DHCX::setDataReadyMode().

◆ ism330dhcx_device_conf_get()

int32_t ism330dhcx_device_conf_get ( stmdev_ctx_t * ctx,
uint8_t * val )

DEVICE_CONF bit configuration[get].

Parameters
ctxRead / write interface definitions.(ptr)
valGet the values of device_conf in reg CTRL9_XL
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 1896 of file ism330dhcx_reg.c.

References ism330dhcx_ctrl9_xl_t::device_conf, ISM330DHCX_CTRL9_XL, and ism330dhcx_read_reg().

◆ ism330dhcx_device_conf_set()

int32_t ism330dhcx_device_conf_set ( stmdev_ctx_t * ctx,
uint8_t val )

DEVICE_CONF bit configuration[set].

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of device_conf in reg CTRL9_XL
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 1871 of file ism330dhcx_reg.c.

References ism330dhcx_ctrl9_xl_t::device_conf, ISM330DHCX_CTRL9_XL, ism330dhcx_read_reg(), and ism330dhcx_write_reg().

Referenced by QwDevISM330DHCX::setDeviceConfig().

◆ ism330dhcx_device_id_get()

int32_t ism330dhcx_device_id_get ( stmdev_ctx_t * ctx,
uint8_t * buff )

Device Who am I.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
buffBuffer that stores data read
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2362 of file ism330dhcx_reg.c.

References ism330dhcx_read_reg(), and ISM330DHCX_WHO_AM_I.

Referenced by QwDevISM330DHCX::getUniqueId().

◆ ism330dhcx_gy_self_test_get()

int32_t ism330dhcx_gy_self_test_get ( stmdev_ctx_t * ctx,
ism330dhcx_st_g_t * val )

Angular rate sensor self-test enable.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valGet the values of st_g in reg CTRL5_C
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2604 of file ism330dhcx_reg.c.

References ISM330DHCX_CTRL5_C, ISM330DHCX_GY_ST_DISABLE, ISM330DHCX_GY_ST_NEGATIVE, ISM330DHCX_GY_ST_POSITIVE, ism330dhcx_read_reg(), and ism330dhcx_ctrl5_c_t::st_g.

◆ ism330dhcx_gy_self_test_set()

int32_t ism330dhcx_gy_self_test_set ( stmdev_ctx_t * ctx,
ism330dhcx_st_g_t val )

Angular rate sensor self-test enable.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of st_g in reg CTRL5_C
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2578 of file ism330dhcx_reg.c.

References ISM330DHCX_CTRL5_C, ism330dhcx_read_reg(), ism330dhcx_write_reg(), and ism330dhcx_ctrl5_c_t::st_g.

Referenced by QwDevISM330DHCX::setGyroSelfTest().

◆ ism330dhcx_ln_pg_read_byte()

◆ ism330dhcx_ln_pg_write()

int32_t ism330dhcx_ln_pg_write ( stmdev_ctx_t * ctx,
uint16_t add,
uint8_t * buf,
uint8_t len )

Write buffer in a page.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
bufPage line address.(ptr)
valValue to write.
lenbuffer length.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2109 of file ism330dhcx_reg.c.

References ISM330DHCX_EMBEDDED_FUNC_BANK, ism330dhcx_mem_bank_set(), ISM330DHCX_PAGE_ADDRESS, ISM330DHCX_PAGE_RW, ISM330DHCX_PAGE_SEL, ISM330DHCX_PAGE_VALUE, ism330dhcx_read_reg(), ISM330DHCX_USER_BANK, ism330dhcx_write_reg(), ism330dhcx_page_sel_t::not_used_01, ism330dhcx_page_address_t::page_addr, ism330dhcx_page_rw_t::page_rw, and ism330dhcx_page_sel_t::page_sel.

◆ ism330dhcx_ln_pg_write_byte()

◆ ism330dhcx_mem_bank_get()

int32_t ism330dhcx_mem_bank_get ( stmdev_ctx_t * ctx,
ism330dhcx_reg_access_t * val )

Enable access to the embedded functions/sensor hub configuration registers.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valGet the values of reg_access in reg FUNC_CFG_ACCESS
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 1991 of file ism330dhcx_reg.c.

References ISM330DHCX_EMBEDDED_FUNC_BANK, ISM330DHCX_FUNC_CFG_ACCESS, ism330dhcx_read_reg(), ISM330DHCX_SENSOR_HUB_BANK, ISM330DHCX_USER_BANK, and ism330dhcx_func_cfg_access_t::reg_access.

◆ ism330dhcx_mem_bank_set()

int32_t ism330dhcx_mem_bank_set ( stmdev_ctx_t * ctx,
ism330dhcx_reg_access_t val )

Enable access to the embedded functions/sensor hub configuration registers.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of reg_access in reg FUNC_CFG_ACCESS
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 1964 of file ism330dhcx_reg.c.

References ISM330DHCX_FUNC_CFG_ACCESS, ism330dhcx_read_reg(), ism330dhcx_write_reg(), and ism330dhcx_func_cfg_access_t::reg_access.

Referenced by ism330dhcx_all_sources_get(), ism330dhcx_compression_algo_init_get(), ism330dhcx_compression_algo_init_set(), ism330dhcx_compression_algo_set(), ism330dhcx_emb_fsm_en_get(), ism330dhcx_emb_fsm_en_set(), ism330dhcx_fifo_pedo_batch_get(), ism330dhcx_fifo_pedo_batch_set(), ism330dhcx_fsm_data_rate_get(), ism330dhcx_fsm_data_rate_set(), ism330dhcx_fsm_enable_get(), ism330dhcx_fsm_enable_set(), ism330dhcx_fsm_init_get(), ism330dhcx_fsm_init_set(), ism330dhcx_fsm_out_get(), ism330dhcx_int_notification_get(), ism330dhcx_int_notification_set(), ism330dhcx_ln_pg_read_byte(), ism330dhcx_ln_pg_write(), ism330dhcx_ln_pg_write_byte(), ism330dhcx_long_clr_get(), ism330dhcx_long_clr_set(), ism330dhcx_long_cnt_flag_data_ready_get(), ism330dhcx_long_cnt_get(), ism330dhcx_long_cnt_set(), ism330dhcx_mlc_data_rate_get(), ism330dhcx_mlc_data_rate_set(), ism330dhcx_mlc_get(), ism330dhcx_mlc_out_get(), ism330dhcx_mlc_set(), ism330dhcx_motion_flag_data_ready_get(), ism330dhcx_motion_sens_get(), ism330dhcx_motion_sens_set(), ism330dhcx_number_of_steps_get(), ism330dhcx_pedo_sens_get(), ism330dhcx_pedo_sens_set(), ism330dhcx_pedo_step_detect_get(), ism330dhcx_pin_int1_route_get(), ism330dhcx_pin_int1_route_set(), ism330dhcx_pin_int2_route_get(), ism330dhcx_pin_int2_route_set(), ism330dhcx_sh_batch_slave_0_get(), ism330dhcx_sh_batch_slave_0_set(), ism330dhcx_sh_batch_slave_1_get(), ism330dhcx_sh_batch_slave_1_set(), ism330dhcx_sh_batch_slave_2_get(), ism330dhcx_sh_batch_slave_2_set(), ism330dhcx_sh_batch_slave_3_get(), ism330dhcx_sh_batch_slave_3_set(), ism330dhcx_sh_cfg_write(), ism330dhcx_sh_data_rate_get(), ism330dhcx_sh_data_rate_set(), ism330dhcx_sh_master_get(), ism330dhcx_sh_master_set(), ism330dhcx_sh_pass_through_get(), ism330dhcx_sh_pass_through_set(), ism330dhcx_sh_pin_mode_get(), ism330dhcx_sh_pin_mode_set(), ism330dhcx_sh_read_data_raw_get(), ism330dhcx_sh_reset_get(), ism330dhcx_sh_reset_set(), ism330dhcx_sh_slave_connected_get(), ism330dhcx_sh_slave_connected_set(), ism330dhcx_sh_slv0_cfg_read(), ism330dhcx_sh_slv1_cfg_read(), ism330dhcx_sh_slv2_cfg_read(), ism330dhcx_sh_slv3_cfg_read(), ism330dhcx_sh_status_get(), ism330dhcx_sh_syncro_mode_get(), ism330dhcx_sh_syncro_mode_set(), ism330dhcx_sh_write_mode_get(), ism330dhcx_sh_write_mode_set(), ism330dhcx_steps_reset(), ism330dhcx_tilt_flag_data_ready_get(), ism330dhcx_tilt_sens_get(), and ism330dhcx_tilt_sens_set().

◆ ism330dhcx_odr_cal_reg_get()

int32_t ism330dhcx_odr_cal_reg_get ( stmdev_ctx_t * ctx,
uint8_t * val )

Difference in percentage of the effective ODR (and timestamp rate) with respect to the typical.

[get] Step: 0.15%. 8-bit format, 2's complement.

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of freq_fine in reg INTERNAL_FREQ_FINE
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 1944 of file ism330dhcx_reg.c.

References ism330dhcx_internal_freq_fine_t::freq_fine, ISM330DHCX_INTERNAL_FREQ_FINE, and ism330dhcx_read_reg().

◆ ism330dhcx_odr_cal_reg_set()

int32_t ism330dhcx_odr_cal_reg_set ( stmdev_ctx_t * ctx,
uint8_t val )

Difference in percentage of the effective ODR (and timestamp rate) with respect to the typical.

[set] Step: 0.15%. 8-bit format, 2's complement.

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of freq_fine in reg INTERNAL_FREQ_FINE
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 1917 of file ism330dhcx_reg.c.

References ism330dhcx_internal_freq_fine_t::freq_fine, ISM330DHCX_INTERNAL_FREQ_FINE, ism330dhcx_read_reg(), and ism330dhcx_write_reg().

◆ ism330dhcx_reset_get()

int32_t ism330dhcx_reset_get ( stmdev_ctx_t * ctx,
uint8_t * val )

Software reset.

Restore the default values in user registers.[get]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of sw_reset in reg CTRL3_C
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2403 of file ism330dhcx_reg.c.

References ISM330DHCX_CTRL3_C, ism330dhcx_read_reg(), and ism330dhcx_ctrl3_c_t::sw_reset.

Referenced by QwDevISM330DHCX::getDeviceReset().

◆ ism330dhcx_reset_set()

int32_t ism330dhcx_reset_set ( stmdev_ctx_t * ctx,
uint8_t val )

Software reset.

Restore the default values in user registers.[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of sw_reset in reg CTRL3_C
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2378 of file ism330dhcx_reg.c.

References ISM330DHCX_CTRL3_C, ism330dhcx_read_reg(), ism330dhcx_write_reg(), and ism330dhcx_ctrl3_c_t::sw_reset.

Referenced by QwDevISM330DHCX::deviceReset().

◆ ism330dhcx_xl_self_test_get()

int32_t ism330dhcx_xl_self_test_get ( stmdev_ctx_t * ctx,
ism330dhcx_st_xl_t * val )

Linear acceleration sensor self-test enable.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valGet the values of st_xl in reg CTRL5_C
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2540 of file ism330dhcx_reg.c.

References ISM330DHCX_CTRL5_C, ism330dhcx_read_reg(), ISM330DHCX_XL_ST_DISABLE, ISM330DHCX_XL_ST_NEGATIVE, ISM330DHCX_XL_ST_POSITIVE, and ism330dhcx_ctrl5_c_t::st_xl.

◆ ism330dhcx_xl_self_test_set()

int32_t ism330dhcx_xl_self_test_set ( stmdev_ctx_t * ctx,
ism330dhcx_st_xl_t val )

Linear acceleration sensor self-test enable.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of st_xl in reg CTRL5_C
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 2514 of file ism330dhcx_reg.c.

References ISM330DHCX_CTRL5_C, ism330dhcx_read_reg(), ism330dhcx_write_reg(), and ism330dhcx_ctrl5_c_t::st_xl.

Referenced by QwDevISM330DHCX::setAccelSelfTest().