bma456.c
/*!
 *  @brief This API select the platform configuration wrist(default) or phone.
 */
@brief This API select the platform configuration wrist(default) or phone.
@brief This API select the platform configuration wrist ( default ) or phone .
uint16_t bma456_select_platform(uint8_t platform, struct bma4_dev *dev)
{
	uint16_t rslt = BMA4_OK;
	struct bma456_stepcounter_settings sc_settings = {0};
	if (dev != NULL) {
		if (dev->chip_id == BMA456_CHIP_ID) {
			switch (platform) {
			case BMA456_PHONE_CONFIG:
				sc_settings.param1  = BMA456_PHONE_SC_PARAM_1;
				sc_settings.param2  = BMA456_PHONE_SC_PARAM_2;
				sc_settings.param3  = BMA456_PHONE_SC_PARAM_3;
				sc_settings.param4  = BMA456_PHONE_SC_PARAM_4;
				sc_settings.param5  = BMA456_PHONE_SC_PARAM_5;
				sc_settings.param6  = BMA456_PHONE_SC_PARAM_6;
				sc_settings.param7  = BMA456_PHONE_SC_PARAM_7;
				sc_settings.param8  = BMA456_PHONE_SC_PARAM_8;
				sc_settings.param9  = BMA456_PHONE_SC_PARAM_9;
				sc_settings.param10 = BMA456_PHONE_SC_PARAM_10;
				sc_settings.param11 = BMA456_PHONE_SC_PARAM_11;
				sc_settings.param12 = BMA456_PHONE_SC_PARAM_12;
				sc_settings.param13 = BMA456_PHONE_SC_PARAM_13;
				sc_settings.param14 = BMA456_PHONE_SC_PARAM_14;
				sc_settings.param15 = BMA456_PHONE_SC_PARAM_15;
				sc_settings.param16 = BMA456_PHONE_SC_PARAM_16;
				sc_settings.param17 = BMA456_PHONE_SC_PARAM_17;
				sc_settings.param18 = BMA456_PHONE_SC_PARAM_18;
				sc_settings.param19 = BMA456_PHONE_SC_PARAM_19;
				sc_settings.param20 = BMA456_PHONE_SC_PARAM_20;
				sc_settings.param21 = BMA456_PHONE_SC_PARAM_21;
				sc_settings.param22 = BMA456_PHONE_SC_PARAM_22;
				sc_settings.param23 = BMA456_PHONE_SC_PARAM_23;
				sc_settings.param24 = BMA456_PHONE_SC_PARAM_24;
				sc_settings.param25 = BMA456_PHONE_SC_PARAM_25;
				break;
			case BMA456_WRIST_CONFIG:
				sc_settings.param1  = BMA456_WRIST_SC_PARAM_1;
				sc_settings.param2  = BMA456_WRIST_SC_PARAM_2;
				sc_settings.param3  = BMA456_WRIST_SC_PARAM_3;
				sc_settings.param4  = BMA456_WRIST_SC_PARAM_4;
				sc_settings.param5  = BMA456_WRIST_SC_PARAM_5;
				sc_settings.param6  = BMA456_WRIST_SC_PARAM_6;
				sc_settings.param7  = BMA456_WRIST_SC_PARAM_7;
				sc_settings.param8  = BMA456_WRIST_SC_PARAM_8;
				sc_settings.param9  = BMA456_WRIST_SC_PARAM_9;
				sc_settings.param10 = BMA456_WRIST_SC_PARAM_10;
				sc_settings.param11 = BMA456_WRIST_SC_PARAM_11;
				sc_settings.param12 = BMA456_WRIST_SC_PARAM_12;
				sc_settings.param13 = BMA456_WRIST_SC_PARAM_13;
				sc_settings.param14 = BMA456_WRIST_SC_PARAM_14;
				sc_settings.param15 = BMA456_WRIST_SC_PARAM_15;
				sc_settings.param16 = BMA456_WRIST_SC_PARAM_16;
				sc_settings.param17 = BMA456_WRIST_SC_PARAM_17;
				sc_settings.param18 = BMA456_WRIST_SC_PARAM_18;
				sc_settings.param19 = BMA456_WRIST_SC_PARAM_19;
				sc_settings.param20 = BMA456_WRIST_SC_PARAM_20;
				sc_settings.param21 = BMA456_WRIST_SC_PARAM_21;
				sc_settings.param22 = BMA456_WRIST_SC_PARAM_22;
				sc_settings.param23 = BMA456_WRIST_SC_PARAM_23;
				sc_settings.param24 = BMA456_WRIST_SC_PARAM_24;
				sc_settings.param25 = BMA456_WRIST_SC_PARAM_25;
				break;
			default:
				rslt = BMA4_E_OUT_OF_RANGE;
				break;
			}
		} else {
			rslt = BMA4_E_INVALID_SENSOR;
		}
	} else {
		rslt = BMA4_E_NULL_PTR;
	}
	if (rslt == BMA4_OK) {
		rslt = bma456_stepcounter_set_parameter(&sc_settings, dev);
	}
	return rslt;
}
uint16_t bma456_select_platform ( uint8_t platform , struct bma4_dev * dev ) { uint16_t rslt = BMA4_OK ; struct bma456_stepcounter_settings sc_settings = { 0 } ; if ( dev != NULL ) { if ( dev -> chip_id == BMA456_CHIP_ID ) { switch ( platform ) { case BMA456_PHONE_CONFIG : sc_settings . param1 = BMA456_PHONE_SC_PARAM_1 ; sc_settings . param2 = BMA456_PHONE_SC_PARAM_2 ; sc_settings . param3 = BMA456_PHONE_SC_PARAM_3 ; sc_settings . param4 = BMA456_PHONE_SC_PARAM_4 ; sc_settings . param5 = BMA456_PHONE_SC_PARAM_5 ; sc_settings . param6 = BMA456_PHONE_SC_PARAM_6 ; sc_settings . param7 = BMA456_PHONE_SC_PARAM_7 ; sc_settings . param8 = BMA456_PHONE_SC_PARAM_8 ; sc_settings . param9 = BMA456_PHONE_SC_PARAM_9 ; sc_settings . param10 = BMA456_PHONE_SC_PARAM_10 ; sc_settings . param11 = BMA456_PHONE_SC_PARAM_11 ; sc_settings . param12 = BMA456_PHONE_SC_PARAM_12 ; sc_settings . param13 = BMA456_PHONE_SC_PARAM_13 ; sc_settings . param14 = BMA456_PHONE_SC_PARAM_14 ; sc_settings . param15 = BMA456_PHONE_SC_PARAM_15 ; sc_settings . param16 = BMA456_PHONE_SC_PARAM_16 ; sc_settings . param17 = BMA456_PHONE_SC_PARAM_17 ; sc_settings . param18 = BMA456_PHONE_SC_PARAM_18 ; sc_settings . param19 = BMA456_PHONE_SC_PARAM_19 ; sc_settings . param20 = BMA456_PHONE_SC_PARAM_20 ; sc_settings . param21 = BMA456_PHONE_SC_PARAM_21 ; sc_settings . param22 = BMA456_PHONE_SC_PARAM_22 ; sc_settings . param23 = BMA456_PHONE_SC_PARAM_23 ; sc_settings . param24 = BMA456_PHONE_SC_PARAM_24 ; sc_settings . param25 = BMA456_PHONE_SC_PARAM_25 ; break ; case BMA456_WRIST_CONFIG : sc_settings . param1 = BMA456_WRIST_SC_PARAM_1 ; sc_settings . param2 = BMA456_WRIST_SC_PARAM_2 ; sc_settings . param3 = BMA456_WRIST_SC_PARAM_3 ; sc_settings . param4 = BMA456_WRIST_SC_PARAM_4 ; sc_settings . param5 = BMA456_WRIST_SC_PARAM_5 ; sc_settings . param6 = BMA456_WRIST_SC_PARAM_6 ; sc_settings . param7 = BMA456_WRIST_SC_PARAM_7 ; sc_settings . param8 = BMA456_WRIST_SC_PARAM_8 ; sc_settings . param9 = BMA456_WRIST_SC_PARAM_9 ; sc_settings . param10 = BMA456_WRIST_SC_PARAM_10 ; sc_settings . param11 = BMA456_WRIST_SC_PARAM_11 ; sc_settings . param12 = BMA456_WRIST_SC_PARAM_12 ; sc_settings . param13 = BMA456_WRIST_SC_PARAM_13 ; sc_settings . param14 = BMA456_WRIST_SC_PARAM_14 ; sc_settings . param15 = BMA456_WRIST_SC_PARAM_15 ; sc_settings . param16 = BMA456_WRIST_SC_PARAM_16 ; sc_settings . param17 = BMA456_WRIST_SC_PARAM_17 ; sc_settings . param18 = BMA456_WRIST_SC_PARAM_18 ; sc_settings . param19 = BMA456_WRIST_SC_PARAM_19 ; sc_settings . param20 = BMA456_WRIST_SC_PARAM_20 ; sc_settings . param21 = BMA456_WRIST_SC_PARAM_21 ; sc_settings . param22 = BMA456_WRIST_SC_PARAM_22 ; sc_settings . param23 = BMA456_WRIST_SC_PARAM_23 ; sc_settings . param24 = BMA456_WRIST_SC_PARAM_24 ; sc_settings . param25 = BMA456_WRIST_SC_PARAM_25 ; break ; default : rslt = BMA4_E_OUT_OF_RANGE ; break ; } } else { rslt = BMA4_E_INVALID_SENSOR ; } } else { rslt = BMA4_E_NULL_PTR ; } if ( rslt == BMA4_OK ) { rslt = bma456_stepcounter_set_parameter ( & sc_settings , dev ) ; } return rslt ; }
@brief This API select the platform configuration wrist(default) or phone.
@brief This API select the platform configuration wrist ( default ) or phone .
/* Set the step counter parameter */