Da Vinci Firmware 1
Firmware for the DaVinci-M rocket avionics board.
Loading...
Searching...
No Matches

This section groups all the functions that manage the tilt event detection. More...

Collaboration diagram for LSM6DSO32_tilt_detection:

Functions

int32_t lsm6dso32_tilt_sens_set (stmdev_ctx_t *ctx, uint8_t val)
 Enable tilt calculation.[set].
 
int32_t lsm6dso32_tilt_sens_get (stmdev_ctx_t *ctx, uint8_t *val)
 Enable tilt calculation.[get].
 
int32_t lsm6dso32_tilt_flag_data_ready_get (stmdev_ctx_t *ctx, uint8_t *val)
 Interrupt status bit for tilt detection.[get].
 

Detailed Description

This section groups all the functions that manage the tilt event detection.

Function Documentation

◆ lsm6dso32_tilt_flag_data_ready_get()

int32_t lsm6dso32_tilt_flag_data_ready_get ( stmdev_ctx_t ctx,
uint8_t *  val 
)

Interrupt status bit for tilt detection.[get].

Parameters
ctxread / write interface definitions
valchange the values of is_tilt in reg EMB_FUNC_STATUS
Return values
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 7461 of file lsm6dso32_reg.c.

7463{
7465 int32_t ret;
7466
7468
7469 if (ret == 0)
7470 {
7472 (uint8_t *)&reg, 1);
7473 }
7474
7475 if (ret == 0)
7476 {
7477 *val = reg.is_tilt;
7479 }
7480
7481 return ret;
7482}
int32_t __weak lsm6dso32_read_reg(stmdev_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len)
Read generic device register.
int32_t lsm6dso32_mem_bank_set(stmdev_ctx_t *ctx, lsm6dso32_reg_access_t val)
Enable access to the embedded functions/sensor hub configuration registers.[set].
@ LSM6DSO32_USER_BANK
@ LSM6DSO32_EMBEDDED_FUNC_BANK
#define LSM6DSO32_EMB_FUNC_STATUS

References lsm6dso32_emb_func_status_t::is_tilt, LSM6DSO32_EMB_FUNC_STATUS, LSM6DSO32_EMBEDDED_FUNC_BANK, lsm6dso32_mem_bank_set(), lsm6dso32_read_reg(), and LSM6DSO32_USER_BANK.

Here is the call graph for this function:

◆ lsm6dso32_tilt_sens_get()

int32_t lsm6dso32_tilt_sens_get ( stmdev_ctx_t ctx,
uint8_t *  val 
)

Enable tilt calculation.[get].

Parameters
ctxread / write interface definitions
valchange the values of tilt_en in reg EMB_FUNC_EN_A
Return values
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 7431 of file lsm6dso32_reg.c.

7432{
7434 int32_t ret;
7435
7437
7438 if (ret == 0)
7439 {
7441 (uint8_t *)&reg, 1);
7442 }
7443
7444 if (ret == 0)
7445 {
7446 *val = reg.tilt_en;
7448 }
7449
7450 return ret;
7451}
#define LSM6DSO32_EMB_FUNC_EN_A

References LSM6DSO32_EMB_FUNC_EN_A, LSM6DSO32_EMBEDDED_FUNC_BANK, lsm6dso32_mem_bank_set(), lsm6dso32_read_reg(), LSM6DSO32_USER_BANK, and lsm6dso32_emb_func_en_a_t::tilt_en.

Here is the call graph for this function:

◆ lsm6dso32_tilt_sens_set()

int32_t lsm6dso32_tilt_sens_set ( stmdev_ctx_t ctx,
uint8_t  val 
)

Enable tilt calculation.[set].

Parameters
ctxread / write interface definitions
valchange the values of tilt_en in reg EMB_FUNC_EN_A
Return values
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 7395 of file lsm6dso32_reg.c.

7396{
7398 int32_t ret;
7399
7401
7402 if (ret == 0)
7403 {
7405 (uint8_t *)&reg, 1);
7406 }
7407
7408 if (ret == 0)
7409 {
7410 reg.tilt_en = val;
7412 (uint8_t *)&reg, 1);
7413 }
7414
7415 if (ret == 0)
7416 {
7418 }
7419
7420 return ret;
7421}
int32_t __weak lsm6dso32_write_reg(stmdev_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len)
Write generic device register.

References LSM6DSO32_EMB_FUNC_EN_A, LSM6DSO32_EMBEDDED_FUNC_BANK, lsm6dso32_mem_bank_set(), lsm6dso32_read_reg(), LSM6DSO32_USER_BANK, lsm6dso32_write_reg(), and lsm6dso32_emb_func_en_a_t::tilt_en.

Here is the call graph for this function: