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 timestamp generation. More...

Collaboration diagram for LSM6DSO32_Timestamp:

Functions

int32_t lsm6dso32_timestamp_set (stmdev_ctx_t *ctx, uint8_t val)
 Enables timestamp counter.[set].
 
int32_t lsm6dso32_timestamp_get (stmdev_ctx_t *ctx, uint8_t *val)
 Enables timestamp counter.[get].
 
int32_t lsm6dso32_timestamp_raw_get (stmdev_ctx_t *ctx, uint32_t *val)
 Timestamp first data output register (r). The value is expressed as a 32-bit word and the bit resolution is 25 μs.[get].
 

Detailed Description

This section groups all the functions that manage the timestamp generation.

Function Documentation

◆ lsm6dso32_timestamp_get()

int32_t lsm6dso32_timestamp_get ( stmdev_ctx_t ctx,
uint8_t *  val 
)

Enables timestamp counter.[get].

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

Definition at line 1127 of file lsm6dso32_reg.c.

1128{
1130 int32_t ret;
1131
1132 ret = lsm6dso32_read_reg(ctx, LSM6DSO32_CTRL10_C, (uint8_t *)&reg, 1);
1133 *val = reg.timestamp_en;
1134
1135 return ret;
1136}
int32_t __weak lsm6dso32_read_reg(stmdev_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len)
Read generic device register.
#define LSM6DSO32_CTRL10_C

References LSM6DSO32_CTRL10_C, lsm6dso32_read_reg(), and lsm6dso32_ctrl10_c_t::timestamp_en.

Here is the call graph for this function:

◆ lsm6dso32_timestamp_raw_get()

int32_t lsm6dso32_timestamp_raw_get ( stmdev_ctx_t ctx,
uint32_t *  val 
)

Timestamp first data output register (r). The value is expressed as a 32-bit word and the bit resolution is 25 μs.[get].

Parameters
ctxread / write interface definitions
buffbuffer that stores data read
Return values
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 1148 of file lsm6dso32_reg.c.

1149{
1150 uint8_t buff[4];
1151 int32_t ret;
1152
1153 ret = lsm6dso32_read_reg(ctx, LSM6DSO32_TIMESTAMP0, buff, 4);
1154 *val = buff[3];
1155 *val = (*val * 256U) + buff[2];
1156 *val = (*val * 256U) + buff[1];
1157 *val = (*val * 256U) + buff[0];
1158
1159 return ret;
1160}
#define LSM6DSO32_TIMESTAMP0

References lsm6dso32_read_reg(), and LSM6DSO32_TIMESTAMP0.

Here is the call graph for this function:

◆ lsm6dso32_timestamp_set()

int32_t lsm6dso32_timestamp_set ( stmdev_ctx_t ctx,
uint8_t  val 
)

Enables timestamp counter.[set].

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

Definition at line 1103 of file lsm6dso32_reg.c.

1104{
1106 int32_t ret;
1107
1108 ret = lsm6dso32_read_reg(ctx, LSM6DSO32_CTRL10_C, (uint8_t *)&reg, 1);
1109
1110 if (ret == 0)
1111 {
1112 reg.timestamp_en = val;
1113 ret = lsm6dso32_write_reg(ctx, LSM6DSO32_CTRL10_C, (uint8_t *)&reg, 1);
1114 }
1115
1116 return ret;
1117}
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_CTRL10_C, lsm6dso32_read_reg(), lsm6dso32_write_reg(), and lsm6dso32_ctrl10_c_t::timestamp_en.

Here is the call graph for this function: