bma456.c
/*!
 *	@brief This API gets the parameter1 to parameter7 settings of the
 *	step counter feature.
 */
@brief This API gets the parameter1 to parameter7 settings of the
step counter feature.
@brief This API gets the parameter1 to parameter7 settings of the step counter feature .
uint16_t bma456_stepcounter_get_parameter(struct bma456_stepcounter_settings *setting, struct bma4_dev *dev)
{
	uint8_t feature_config[BMA456_FEATURE_SIZE] = {0};
	uint16_t *data_p = (uint16_t *)feature_config;
	uint16_t rslt = BMA4_OK;
	if (dev != NULL) {
		if (dev->chip_id == BMA456_CHIP_ID) {
			rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456_FEATURE_SIZE, dev);
			if (rslt == BMA4_OK) {
				data_p = data_p + BMA456_STEP_CNTR_PARAM_OFFSET/2;
				extract_stepcounter_parameter(setting, data_p);
			}
		} else {
			rslt = BMA4_E_INVALID_SENSOR;
		}
	} else {
		rslt = BMA4_E_NULL_PTR;
	}
	return rslt;
}
uint16_t bma456_stepcounter_get_parameter ( struct bma456_stepcounter_settings * setting , struct bma4_dev * dev ) { uint8_t feature_config [ BMA456_FEATURE_SIZE ] = { 0 } ; uint16_t * data_p = ( uint16_t * ) feature_config ; uint16_t rslt = BMA4_OK ; if ( dev != NULL ) { if ( dev -> chip_id == BMA456_CHIP_ID ) { rslt = bma4_read_regs ( BMA4_FEATURE_CONFIG_ADDR , feature_config , BMA456_FEATURE_SIZE , dev ) ; if ( rslt == BMA4_OK ) { data_p = data_p + BMA456_STEP_CNTR_PARAM_OFFSET / 2 ; extract_stepcounter_parameter ( setting , data_p ) ; } } else { rslt = BMA4_E_INVALID_SENSOR ; } } else { rslt = BMA4_E_NULL_PTR ; } return rslt ; }
@brief This API gets the parameter1 to parameter7 settings of the
      step counter feature.
@brief This API gets the parameter1 to parameter7 settings of the step counter feature .
/* To convert 8bit to 16 bit address */