bma456.c
/*!
 *	@brief This API is used to get the configuration id of the sensor.
 */
@brief This API is used to get the configuration id of the sensor.
@brief This API is used to get the configuration id of the sensor .
uint16_t bma456_get_config_id(uint16_t *config_id, struct bma4_dev *dev)
{
	uint8_t feature_config[BMA456_FEATURE_SIZE] = {0};
	uint8_t index = BMA456_CONFIG_ID_OFFSET;
	uint16_t rslt = BMA4_OK;
	uint16_t config_id_lsb = 0;
	uint16_t config_id_msb = 0;
	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) {
				config_id_lsb = (uint16_t)feature_config[index];
				config_id_msb = ((uint16_t)feature_config[index + 1]) << 8;
				*config_id = config_id_lsb | config_id_msb;
			}
		} else {
			rslt = BMA4_E_INVALID_SENSOR;
		}
	} else {
		rslt = BMA4_E_NULL_PTR;
	}
	return rslt;
}
uint16_t bma456_get_config_id ( uint16_t * config_id , struct bma4_dev * dev ) { uint8_t feature_config [ BMA456_FEATURE_SIZE ] = { 0 } ; uint8_t index = BMA456_CONFIG_ID_OFFSET ; uint16_t rslt = BMA4_OK ; uint16_t config_id_lsb = 0 ; uint16_t config_id_msb = 0 ; 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 ) { config_id_lsb = ( uint16_t ) feature_config [ index ] ; config_id_msb = ( ( uint16_t ) feature_config [ index + 1 ] ) << 8 ; * config_id = config_id_lsb | config_id_msb ; } } else { rslt = BMA4_E_INVALID_SENSOR ; } } else { rslt = BMA4_E_NULL_PTR ; } return rslt ; }
@brief This API is used to get the configuration id of the sensor.
@brief This API is used to get the configuration id of the sensor .