Exemplo n.º 1
0
void io_matrix_strobe (struct io_matrix *mx, U8 val, mux_ui ui_update, unsigned int signo)
{
	if (val == 0)
		mx->rowptr = NULL;
	else
	{
		mx->rowptr = mx->rowdata + scanbit (val);
		mux_write (ui_update, 8 * (mx->rowptr - mx->rowdata), mx->rowptr, mx->rowlatch, SIGNO_LAMP);
	}
}
Exemplo n.º 2
0
/** Simulate writing to a set of 8 solenoids. */
static void sim_sol_write (int index, U8 *memp, U8 val)
{
	int n;

	/* Update the state of each solenoid from the signal coming
	into it. */
	for (n = 0; n < 8; n++)
	{
		unsigned int solno = index+n;

		if (solno < PINIO_NUM_SOLS)
			sim_coil_change (solno, val & (1 << n));
	}

	/* Commit the new state */
	mux_write (ui_write_solenoid, index, memp, val, SIGNO_SOL);
}
Exemplo n.º 3
0
/** Update the output side of the triac/flipper relay register.
 * This becomes zero when a zerocrossing occurs.  When the input side of the latch
 * is written, GI strings can be turned on but not turned off.
 */
void sim_triac_update (U8 val)
{
	mux_write (ui_write_triac, 0, &linux_triac_outputs, val, SIGNO_TRIAC);
}