/* This API is used to calculate the power of given base value. 
This API is used to calculate the power of 2. */
static int32_t power(int16_t base, uint8_t resolution)
/* This API is used to calculate the power of given base value. 
This API is used to calculate the power of 2. */
static int32_t power(int16_t base, uint8_t resolution)
{
    uint8_t i = 1;
    int32_t value = 1;
    for (; i <= resolution; i++)
        value = (int32_t)(value * base);
    return value;
}