Hi Tomas,
I found another bug, a small one this time.
file fxls896xaf_driver.h, desctription of fxls896xaf_deinit() function (end of file)
/*! @brief The interface function to de-initialize the fxls896xaf sensor.
* @details This function de-initialize the fxls896xaf sensor.
* [in] pDriver - Pointer to the driver
* [out] selftest - Pointer to the self-test metadata.
* @return returns the status of the operation.
*/
uint8_t fxls896xaf_deinit(fxls896xaf_driver_t *pDriver);
In description is information about param[out], but this argument does not exist in the function.
it was probably created in the process of copying.
And next one, fxls896xaf_config_interrupt() function, line 368:
...
//Read the CRTL3 and preserve the existing configuration bits of the control registers other than interrupt configuration bits
status = sensor_comm_read(&pDriver->comHandle, FXLS896xAF_SENS_CONFIG4, 1, &ctrlReg);
// Update the Ctrl reg with polarity and open drain/push pull
ctrlReg |= ((uint8_t)(pConfig->control.ipol | (pConfig->control.pp_od << FXLS896xAF_SENS_CONFIG4_INT_PP_OD_SHIFT)) & (FXLS896xAF_SENS_CONFIG4_INT_POL_MASK | FXLS896xAF_SENS_CONFIG4_INT_PP_OD_MASK));
// configure the interrupts sources with desired pin configuration setting for fxls896xaf
...
incorrect implementation of the register bit change, thus the bits cannot be reset.
My proposition of implementation:
...
// Update the Ctrl reg with polarity and open drain/push pull
ctrlReg = (ctrlReg & ~(FXLS896xAF_SENS_CONFIG4_INT_POL_MASK | FXLS896xAF_SENS_CONFIG4_INT_PP_OD_MASK)) | ((uint8_t)(pConfig->control.ipol | (pConfig->control.pp_od << FXLS896xAF_SENS_CONFIG4_INT_PP_OD_SHIFT)));
...
One more question, I'm introducing modifications to the library, which in my opinion will become more universal, is there a place for sending changes or proposition of changes?
Best regards,
Adrian Chmiel