/* Enable or disable the BMA222 sleep mode. 
This routine enables or disables the BMA222 sleep mode depending upon the value of the \sleep parameter; a \true value enables sleep mode and a \false value disables sleep mode by setting or clearing the 'sleep_en' bit, respectively. */
static void bma222_sleep_en(sensor_hal_t *hal, bool sleep)
/* Enable or disable the BMA222 sleep mode. 
This routine enables or disables the BMA222 sleep mode depending upon the value of the \sleep parameter; a \true value enables sleep mode and a \false value disables sleep mode by setting or clearing the 'sleep_en' bit, respectively. */
static void bma222_sleep_en(sensor_hal_t *hal, bool sleep)
{
	uint8_t const power_mode_val = (sleep == true)
			? (BMA222_LOWPOWER_EN | BMA222_SLEEP_DUR_1ms) : 0;
	sensor_bus_put(hal, BMA222_POWER_MODES, power_mode_val);
}