/* This API converts the range value into corresponding integer value.  */
static void map_range(uint8_t range_in, uint8_t *range_out)
/* This API converts the range value into corresponding integer value.  */
static void map_range(uint8_t range_in, uint8_t *range_out)
{
    switch (range_in) {
    case  BMA4_ACCEL_RANGE_2G:
        *range_out = 2;
        break;
    case  BMA4_ACCEL_RANGE_4G:
        *range_out = 4;
        break;
    case  BMA4_ACCEL_RANGE_8G:
        *range_out = 8;
        break;
    case  BMA4_ACCEL_RANGE_16G:
        *range_out = 16;
        break;
    default:
        break;
    }
}