how to use ST library for accelerometer interrupt on LSM6DSO32?
Hi all,
I'm trying to understand how can I use this ST lib to activated interrupt if accelerometer data ready. I already use this lib but I don't use interrupt mode, right now I'd like to try it.
So if I understand well I have to use
int32_t lsm6dso32_pin_int1_route_set(const stmdev_ctx_t *ctx,
lsm6dso32_pin_int1_route_t *val)
I've find it in the datasheet :
. Write INT1_CTRL = 01h // Accelerometer data-ready interrupt on INT1 in Startup sequence part 4.1, so if I want to activate the interrupt I have to write 0x01 in INT1_CTRL register, but I'm little lost to how to use
typedef struct
{
lsm6dso32_int1_ctrl_t int1_ctrl;
lsm6dso32_md1_cfg_t md1_cfg;
lsm6dso32_emb_func_int1_t emb_func_int1;
lsm6dso32_fsm_int1_a_t fsm_int1_a;
lsm6dso32_fsm_int1_b_t fsm_int1_b;
} lsm6dso32_pin_int1_route_t;
and
typedef struct
{
#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
uint8_t int1_drdy_xl : 1;
uint8_t int1_drdy_g : 1;
uint8_t int1_boot : 1;
uint8_t int1_fifo_th : 1;
uint8_t int1_fifo_ovr : 1;
uint8_t int1_fifo_full : 1;
uint8_t int1_cnt_bdr : 1;
uint8_t den_drdy_flag : 1;
#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
uint8_t den_drdy_flag : 1;
uint8_t int1_cnt_bdr : 1;
uint8_t int1_fifo_full : 1;
uint8_t int1_fifo_ovr : 1;
uint8_t int1_fifo_th : 1;
uint8_t int1_boot : 1;
uint8_t int1_drdy_g : 1;
uint8_t int1_drdy_xl : 1;
#endif /* DRV_BYTE_ORDER */
} lsm6dso32_int1_ctrl_t;
or maybe I can simply use
ret = lsm6dso32_write_reg(ctx, LSM6DSO32_INT1_CTRL,
(uint8_t *)&val->int1_ctrl, 1);
to write 0x01H ?
