bma456.c
/*!
 *	@brief This API reads the x, y and z axis remap data from the sensor.
 */
@brief This API reads the x, y and z axis remap data from the sensor.
@brief This API reads the x y and z axis remap data from the sensor .
uint16_t bma456_get_remap_axes(struct bma456_axes_remap *remap_data, struct bma4_dev *dev)
{
	uint8_t feature_config[BMA456_FEATURE_SIZE] = {0};
	uint8_t index = BMA456_AXES_REMAP_OFFSET;
	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) {
				remap_data->x_axis = feature_config[index] & BMA456_X_AXIS_MASK;
				remap_data->x_axis_sign = (feature_config[index] & BMA456_X_AXIS_SIGN_MASK) >> 2;
				remap_data->y_axis = (feature_config[index] & BMA456_Y_AXIS_MASK) >> 3;
				remap_data->y_axis_sign = (feature_config[index] & BMA456_Y_AXIS_SIGN_MASK) >> 5;
				remap_data->z_axis = (feature_config[index] & BMA456_Z_AXIS_MASK) >> 6;
				remap_data->z_axis_sign = (feature_config[index + 1] & BMA456_Z_AXIS_SIGN_MASK);
			}
		} else {
			rslt = BMA4_E_INVALID_SENSOR;
		}
	} else {
		rslt = BMA4_E_NULL_PTR;
	}
	return rslt;
}
uint16_t bma456_get_remap_axes ( struct bma456_axes_remap * remap_data , struct bma4_dev * dev ) { uint8_t feature_config [ BMA456_FEATURE_SIZE ] = { 0 } ; uint8_t index = BMA456_AXES_REMAP_OFFSET ; 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 ) { remap_data -> x_axis = feature_config [ index ] & BMA456_X_AXIS_MASK ; remap_data -> x_axis_sign = ( feature_config [ index ] & BMA456_X_AXIS_SIGN_MASK ) >> 2 ; remap_data -> y_axis = ( feature_config [ index ] & BMA456_Y_AXIS_MASK ) >> 3 ; remap_data -> y_axis_sign = ( feature_config [ index ] & BMA456_Y_AXIS_SIGN_MASK ) >> 5 ; remap_data -> z_axis = ( feature_config [ index ] & BMA456_Z_AXIS_MASK ) >> 6 ; remap_data -> z_axis_sign = ( feature_config [ index + 1 ] & BMA456_Z_AXIS_SIGN_MASK ) ; } } else { rslt = BMA4_E_INVALID_SENSOR ; } } else { rslt = BMA4_E_NULL_PTR ; } return rslt ; }
@brief This API reads the x, y and z axis remap data from the sensor.
@brief This API reads the x y and z axis remap data from the sensor .