Esempio n. 1
0
int dsi_enable(void)
{
	if (dsi_par.enable_state == 1)
		return 0;
	
	power_enable();
	
	dsihw_set_dsi_clk();
	dsihw_phy_config();
	send_cmd();
	dsihw_video_config();


#ifdef CONFIG_OF_CONTROL
	fdtdec_enable_dsi();
#else
	platform_enable_dsi();
#endif

	dsi_par.enable_state = 1;

	debug("%s 2\n", __func__);

	return 0;
}
Esempio n. 2
0
/*
 * Reset the current protection.
 *
 * If the protection is active, this command will reset it and will turn back
 * on the power supply to the auxiliary devices.
 * If the protection is currently manually overrided, this command resets the
 * process to automatic protection check.
 */
static bool cmd_curr_reset(long l)
{
	(void)l;
	curr_reset();
	/* (Re)enable powerswitch for aux devices */
	power_enable(true);
	return true;
}
Esempio n. 3
0
static void measures_reload(void)
{
	LOG_INFO("Setting measures configuration\n");
	LOG_INFO(" current limit: %d mA\n", curr_limit);
	curr_reset();
	if (logging_checkPreviousPowerStatus() == true)
	{
		LOG_INFO("Powering auxiliary devices...\n");
		power_enable(true);
		LOG_INFO("Powering auxiliary devices: OK!\n");
	}
	else
	{
		LOG_ERR("Previuos power status was not clean! Going to override mode and disabling aux power\n");
		cmd_curr_override(0);
	}
}
Esempio n. 4
0
static void NORETURN curr_process(void)
{
	while (1)
	{
		if (!curr_override && sensor_read(ADC_CURR) > curr_limit)
		{
			power_enable(false);
			if (!curr_logged)
			{
				radio_printf("Current overrange!\n");
				radio_printf("Switching OFF aux power\n");
				curr_logged = true;
			}
		}

		timer_delay(1000);
	}
}
Esempio n. 5
0
/*
 * Override current protection.
 *
 * With this command you can manually switch on and off the power supply
 * to the aux devices. If the argument is 0, the power will be switched OFF,
 * while if it's different from 0 the power will be switched ON.
 * This command ovverride and disable the current protection state.
 *
 * To switch back to automatic protection state, you can call the curr_reset
 * command.
 */
static bool cmd_curr_override(long cmd)
{
	curr_override = true;
	power_enable(cmd);
	return true;
}