02-14-2023 01:39 PM
I have a BHI260AP+BMM150 board (similar to shuttle board). BHI260AP is connected to a host via i2c. The whole system can be put into sleep mode. Before sleep the host, I want to make sure BHI260AP+BMM150 is in sleep in order to minimise power consumption during sleep. However, I cannot find anything to control the power mode of BHI260AP and/or BMM150 via the host interface.
Is there a way to achieve this? Or am I in a wrong path?
Solved! Go to Solution.
02-16-2023 04:37 AM
Hi zkz,
After the firmware is loaded, no sensors are enabled by default. Refer to chapter 19.3 of the data sheet for power consumption at this time.
If the sensor is enabled in your application, you should turn it off before entering low power consumption.
Example:
float sample_rate = 50.0f; /* Read out data measured at 10Hz */
uint32_t report_latency_ms = 0; /* Report immediately */
/*load firmware*/
...
rslt = bhy2_register_fifo_parse_callback(BHY2_SENSOR_ID_ORI_WU, parse_euler, (void*)&euler_accuracy, &bhy2);
print_api_error(rslt, &bhy2);
rslt = bhy2_set_virt_sensor_cfg(BHY2_SENSOR_ID_ORI_WU, sample_rate, report_latency_ms, &bhy2);
print_api_error(rslt, &bhy2);
PDEBUG("Enable %s at %.2fHz.\r\n", get_sensor_name(BHY2_SENSOR_ID_ORI_WU), sample_rate);
/*run user code*/
...
/*enter to low power*/
sample_rate = 0.0f;
rslt = bhy2_set_virt_sensor_cfg(BHY2_SENSOR_ID_ORI_WU, 0, report_latency_ms, &bhy2);
print_api_error(rslt, &bhy2);
PDEBUG("Disable %s at %.2fHz.\r\n", get_sensor_name(BHY2_SENSOR_ID_ORI_WU), sample_rate);
02-16-2023 06:12 AM
Thanks, BSTRobin.
I know what to do now.
Your help is highly appreciated.
02-16-2023 07:17 AM
Welcome, zkz.