Is there a library that can be used to calculate the number of stairs in STM32F429 and LSM6DS3?

Hi, there.
I am using the STM32F429 Discovery evaluation board. I connected the LSM6DS3 to the evaluation board via I2C. LSM6DS3 provides a good function of directly reading the number of steps without having to pay more effort to the microcontroller. Currently I am trying to use LSM6DS3 to measure the number of stairs. I have few doubts about the following:

  1. Is there a library that can be used to calculate the number of stairs in STM32F429 and LSM6DS3?

  2. If there is no library, please provide some reference materials on how to calculate the number of stairs in LSM6DS3.

Looking for someone’s suggestions.

Yours sincerely,
Ts