BHI260AP: How to drive a GPIO via host interface?

In one of our applications, our host MCU runs short of GPIOs. So we plan to use MCSB2-4 of BHP260AP as GPIO expansion.

It looks like we can change the gpio line in xxx.cfg to configure the initial state of the GPIOs. However, I could not find a way to control those GPIOs from my host MCU.

Any suggestions or pointers?

Thanks

ZKZ

Best reply by BSTRobin

Hi zkz,

The simplest method is to use the example of LED. The host side enable the LED virtual sensor ID, and controls GPIO through bhy2_set_virt_sensor_cfg() interface, setting sample_rate to change the control GPIO high or low.

View original
4 replies
Resolved