bma456.c
/*!
 *	@brief This API is used to upload the config file to enable
 *	the features of the sensor.
 */
@brief This API is used to upload the config file to enable
the features of the sensor.
@brief This API is used to upload the config file to enable the features of the sensor .
uint16_t bma456_write_config_file(struct bma4_dev *dev)
{
	uint16_t rslt = BMA4_OK;
	if (dev != NULL) {
		if (dev->chip_id == BMA456_CHIP_ID) {
			if ((dev->read_write_len >= BMA456_RD_WR_MIN_LEN) &&
				(dev->read_write_len <= BMA456_FEATURE_SIZE)) {
				if ((dev->read_write_len % 2) != 0)
					dev->read_write_len = dev->read_write_len - 1;
				dev->config_file_ptr = bma456_config_file;
				rslt = bma4_write_config_file(dev);
			} else {
				rslt = BMA4_E_RD_WR_LENGTH_INVALID;
			}
		} else {
			rslt = BMA4_E_INVALID_SENSOR;
		}
	} else {
		rslt = BMA4_E_NULL_PTR;
	}
	return rslt;
}
uint16_t bma456_write_config_file ( struct bma4_dev * dev ) { uint16_t rslt = BMA4_OK ; if ( dev != NULL ) { if ( dev -> chip_id == BMA456_CHIP_ID ) { if ( ( dev -> read_write_len >= BMA456_RD_WR_MIN_LEN ) && ( dev -> read_write_len <= BMA456_FEATURE_SIZE ) ) { if ( ( dev -> read_write_len % 2 ) != 0 ) dev -> read_write_len = dev -> read_write_len - 1 ; dev -> config_file_ptr = bma456_config_file ; rslt = bma4_write_config_file ( dev ) ; } else { rslt = BMA4_E_RD_WR_LENGTH_INVALID ; } } else { rslt = BMA4_E_INVALID_SENSOR ; } } else { rslt = BMA4_E_NULL_PTR ; } return rslt ; }
@brief This API is used to upload the config file to enable
      the features of the sensor.
@brief This API is used to upload the config file to enable the features of the sensor .
/* Config. stream read/write length boundary check */ /* Even or odd check */ /*Assign stream data */