/* This API validates the bandwidth and perfmode value set by the user. 
param bandwidth : bandwidth value set by the user. param perf_mode : perf_mode value set by the user.  */
static uint16_t validate_bandwidth_perfmode(uint8_t bandwidth, uint8_t perf_mode)
/* This API validates the bandwidth and perfmode value set by the user. 
param bandwidth : bandwidth value set by the user. param perf_mode : perf_mode value set by the user.  */
static uint16_t validate_bandwidth_perfmode(uint8_t bandwidth, uint8_t perf_mode)
{
    uint16_t rslt = BMA4_OK;
    if (perf_mode == BMA4_CONTINUOUS_MODE) {
        if (bandwidth > BMA4_ACCEL_NORMAL_AVG4) {
            rslt = BMA4_E_OUT_OF_RANGE;
        }
    } else if (perf_mode == BMA4_CIC_AVG_MODE) {
        if (bandwidth > BMA4_ACCEL_RES_AVG128) {
            rslt = BMA4_E_OUT_OF_RANGE;
        }
    } else {
        rslt = BMA4_E_OUT_OF_RANGE;
    }
    return rslt;
}