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

This section groups all the data output functions. More...

Collaboration diagram for "output":

Functions

int32_t lsm6dso32_rounding_mode_set (stmdev_ctx_t *ctx, lsm6dso32_rounding_t val)
 Circular burst-mode (rounding) read of the output registers.[set].
 
int32_t lsm6dso32_rounding_mode_get (stmdev_ctx_t *ctx, lsm6dso32_rounding_t *val)
 Gyroscope UI chain full-scale selection.[get].
 
int32_t lsm6dso32_temperature_raw_get (stmdev_ctx_t *ctx, int16_t *val)
 Temperature data output register (r). L and H registers together express a 16-bit word in two’s complement.[get].
 
int32_t lsm6dso32_angular_rate_raw_get (stmdev_ctx_t *ctx, int16_t *val)
 Angular rate sensor. The value is expressed as a 16-bit word in two’s complement.[get].
 
int32_t lsm6dso32_acceleration_raw_get (stmdev_ctx_t *ctx, int16_t *val)
 Linear acceleration output register. The value is expressed as a 16-bit word in two’s complement.[get].
 
int32_t lsm6dso32_fifo_out_raw_get (stmdev_ctx_t *ctx, uint8_t *buff)
 FIFO data output [get].
 
int32_t lsm6dso32_number_of_steps_get (stmdev_ctx_t *ctx, uint16_t *val)
 Step counter output register.[get].
 
int32_t lsm6dso32_steps_reset (stmdev_ctx_t *ctx)
 Reset step counter register.[get].
 

Detailed Description

This section groups all the data output functions.

Function Documentation

◆ lsm6dso32_acceleration_raw_get()

int32_t lsm6dso32_acceleration_raw_get ( stmdev_ctx_t ctx,
int16_t *  val 
)

Linear acceleration output register. The value is expressed as a 16-bit word in two’s complement.[get].

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

Definition at line 1299 of file lsm6dso32_reg.c.

1301{
1302 uint8_t buff[6];
1303 int32_t ret;
1304
1305 ret = lsm6dso32_read_reg(ctx, LSM6DSO32_OUTX_L_A, buff, 6);
1306 val[0] = (int16_t)buff[1];
1307 val[0] = (val[0] * 256) + (int16_t)buff[0];
1308 val[1] = (int16_t)buff[3];
1309 val[1] = (val[1] * 256) + (int16_t)buff[2];
1310 val[2] = (int16_t)buff[5];
1311 val[2] = (val[2] * 256) + (int16_t)buff[4];
1312
1313 return ret;
1314}
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_OUTX_L_A

References LSM6DSO32_OUTX_L_A, and lsm6dso32_read_reg().

Referenced by calibrateIMU(), and StartSensor_Task().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lsm6dso32_angular_rate_raw_get()

int32_t lsm6dso32_angular_rate_raw_get ( stmdev_ctx_t ctx,
int16_t *  val 
)

Angular rate sensor. The value is expressed as a 16-bit word in two’s complement.[get].

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

Definition at line 1273 of file lsm6dso32_reg.c.

1275{
1276 uint8_t buff[6];
1277 int32_t ret;
1278
1279 ret = lsm6dso32_read_reg(ctx, LSM6DSO32_OUTX_L_G, buff, 6);
1280 val[0] = (int16_t)buff[1];
1281 val[0] = (val[0] * 256) + (int16_t)buff[0];
1282 val[1] = (int16_t)buff[3];
1283 val[1] = (val[1] * 256) + (int16_t)buff[2];
1284 val[2] = (int16_t)buff[5];
1285 val[2] = (val[2] * 256) + (int16_t)buff[4];
1286
1287 return ret;
1288}
#define LSM6DSO32_OUTX_L_G

References LSM6DSO32_OUTX_L_G, and lsm6dso32_read_reg().

Referenced by calibrateIMU(), and StartSensor_Task().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lsm6dso32_fifo_out_raw_get()

int32_t lsm6dso32_fifo_out_raw_get ( stmdev_ctx_t ctx,
uint8_t *  buff 
)

FIFO data output [get].

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

Definition at line 1324 of file lsm6dso32_reg.c.

1325{
1326 int32_t ret;
1327
1329
1330 return ret;
1331}
#define LSM6DSO32_FIFO_DATA_OUT_X_L

References LSM6DSO32_FIFO_DATA_OUT_X_L, and lsm6dso32_read_reg().

Here is the call graph for this function:

◆ lsm6dso32_number_of_steps_get()

int32_t lsm6dso32_number_of_steps_get ( stmdev_ctx_t ctx,
uint16_t *  val 
)

Step counter output register.[get].

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

Definition at line 1341 of file lsm6dso32_reg.c.

1343{
1344 uint8_t buff[2];
1345 int32_t ret;
1346
1348
1349 if (ret == 0)
1350 {
1351 ret = lsm6dso32_read_reg(ctx, LSM6DSO32_STEP_COUNTER_L, buff, 2);
1352 }
1353
1354 if (ret == 0)
1355 {
1356 *val = buff[1];
1357 *val = (*val * 256U) + buff[0];
1359 }
1360
1361 return ret;
1362}
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_STEP_COUNTER_L

References LSM6DSO32_EMBEDDED_FUNC_BANK, lsm6dso32_mem_bank_set(), lsm6dso32_read_reg(), LSM6DSO32_STEP_COUNTER_L, and LSM6DSO32_USER_BANK.

Here is the call graph for this function:

◆ lsm6dso32_rounding_mode_get()

int32_t lsm6dso32_rounding_mode_get ( stmdev_ctx_t ctx,
lsm6dso32_rounding_t val 
)

Gyroscope UI chain full-scale selection.[get].

Parameters
ctxread / write interface definitions
valGet the values of rounding in reg CTRL5_C
Return values
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 1208 of file lsm6dso32_reg.c.

1210{
1212 int32_t ret;
1213
1214 ret = lsm6dso32_read_reg(ctx, LSM6DSO32_CTRL5_C, (uint8_t *)&reg, 1);
1215
1216 switch (reg.rounding)
1217 {
1218 case LSM6DSO32_NO_ROUND:
1219 *val = LSM6DSO32_NO_ROUND;
1220 break;
1221
1222 case LSM6DSO32_ROUND_XL:
1223 *val = LSM6DSO32_ROUND_XL;
1224 break;
1225
1226 case LSM6DSO32_ROUND_GY:
1227 *val = LSM6DSO32_ROUND_GY;
1228 break;
1229
1231 *val = LSM6DSO32_ROUND_GY_XL;
1232 break;
1233
1234 default:
1235 *val = LSM6DSO32_NO_ROUND;
1236 break;
1237 }
1238
1239 return ret;
1240}
@ LSM6DSO32_ROUND_GY
@ LSM6DSO32_NO_ROUND
@ LSM6DSO32_ROUND_GY_XL
@ LSM6DSO32_ROUND_XL
#define LSM6DSO32_CTRL5_C

References LSM6DSO32_CTRL5_C, LSM6DSO32_NO_ROUND, lsm6dso32_read_reg(), LSM6DSO32_ROUND_GY, LSM6DSO32_ROUND_GY_XL, LSM6DSO32_ROUND_XL, and lsm6dso32_ctrl5_c_t::rounding.

Here is the call graph for this function:

◆ lsm6dso32_rounding_mode_set()

int32_t lsm6dso32_rounding_mode_set ( stmdev_ctx_t ctx,
lsm6dso32_rounding_t  val 
)

Circular burst-mode (rounding) read of the output registers.[set].

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

Definition at line 1183 of file lsm6dso32_reg.c.

1185{
1187 int32_t ret;
1188
1189 ret = lsm6dso32_read_reg(ctx, LSM6DSO32_CTRL5_C, (uint8_t *)&reg, 1);
1190
1191 if (ret == 0)
1192 {
1193 reg.rounding = (uint8_t)val;
1194 ret = lsm6dso32_write_reg(ctx, LSM6DSO32_CTRL5_C, (uint8_t *)&reg, 1);
1195 }
1196
1197 return ret;
1198}
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_CTRL5_C, lsm6dso32_read_reg(), lsm6dso32_write_reg(), and lsm6dso32_ctrl5_c_t::rounding.

Here is the call graph for this function:

◆ lsm6dso32_steps_reset()

int32_t lsm6dso32_steps_reset ( stmdev_ctx_t ctx)

Reset step counter register.[get].

Parameters
ctxread / write interface definitions
Return values
interfacestatus (MANDATORY: return 0 -> no Error)

Definition at line 1371 of file lsm6dso32_reg.c.

1372{
1374 int32_t ret;
1375
1377
1378 if (ret == 0)
1379 {
1380 ret = lsm6dso32_read_reg(ctx, LSM6DSO32_EMB_FUNC_SRC, (uint8_t *)&reg, 1);
1381 }
1382
1383 if (ret == 0)
1384 {
1387 (uint8_t *)&reg, 1);
1388 }
1389
1390 if (ret == 0)
1391 {
1393 }
1394
1395 return ret;
1396}
#define PROPERTY_ENABLE
#define LSM6DSO32_EMB_FUNC_SRC

References LSM6DSO32_EMB_FUNC_SRC, LSM6DSO32_EMBEDDED_FUNC_BANK, lsm6dso32_mem_bank_set(), lsm6dso32_read_reg(), LSM6DSO32_USER_BANK, lsm6dso32_write_reg(), lsm6dso32_emb_func_src_t::pedo_rst_step, and PROPERTY_ENABLE.

Here is the call graph for this function:

◆ lsm6dso32_temperature_raw_get()

int32_t lsm6dso32_temperature_raw_get ( stmdev_ctx_t ctx,
int16_t *  val 
)

Temperature data output register (r). L and H registers together express a 16-bit word in two’s complement.[get].

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

Definition at line 1252 of file lsm6dso32_reg.c.

1253{
1254 uint8_t buff[2];
1255 int32_t ret;
1256
1257 ret = lsm6dso32_read_reg(ctx, LSM6DSO32_OUT_TEMP_L, buff, 2);
1258 val[0] = (int16_t)buff[1];
1259 val[0] = (val[0] * 256) + (int16_t)buff[0];
1260
1261 return ret;
1262}
#define LSM6DSO32_OUT_TEMP_L

References LSM6DSO32_OUT_TEMP_L, and lsm6dso32_read_reg().

Referenced by calibrateIMU().

Here is the call graph for this function:
Here is the caller graph for this function: