Exemple #1
0
void tms9902_device::set_data_bits()
{
	int value = m_RCL;
	if (VERBOSE>3) LOG("TMS9902: set data bits = %02x\n", value);
	m_last_config_value = value;
	ctrl_callback(CONFIG, DATABITS);
}
Exemple #2
0
void tms9902_device::set_parity()
{
	int value = (m_PENB? 2:0) | (m_ODDP? 1:0);
	if (VERBOSE>3) LOG("TMS9902: set parity = %02x\n", value);
	m_last_config_value = value;
	ctrl_callback(CONFIG, PARITY);
}
Exemple #3
0
void tms9902_device::set_stop_bits()
{
	int value = m_STOPB;
	if (VERBOSE>3) LOG("TMS9902: set stop bits = %02x\n", value);
	m_last_config_value = value;
	ctrl_callback(CONFIG, STOPBITS);
}
Exemple #4
0
/*
    Sets the data rate for the sender part. If a remote UART is attached,
    propagate this setting.
*/
void tms9902_device::set_transmit_data_rate()
{
	int value = (m_CLK4M? 0x800 : 0) | (m_XDV8? 0x400 : 0) | m_XDR;
	if (VERBOSE>3) LOG("TMS9902: set transmit rate = %04x\n", value);
	m_last_config_value = value;
	ctrl_callback(CONFIG, RATEXMIT);
}
Exemple #5
0
void tms9902_device::transmit_line_state()
{
	// 00ab cdef = setting line RTS=a, CTS=b, DSR=c, DCD=d, DTR=e, RI=f
	// The 9902 only outputs RTS and BRK
	if (VERBOSE>3) LOG("TMS9902: transmitting line state (only RTS) = %02x\n", (m_RTSout)? 1:0);
	m_last_config_value = (m_RTSout)? RTS : 0;
	ctrl_callback(LINES, RTS);
}
Exemple #6
0
void tms9902_device::send_break(bool state)
{
	if (state != m_BRKout)
	{
		m_BRKout = state;
		if (VERBOSE>2) LOG("TMS9902: Sending BREAK=%d\n", state? 1:0);

		// Signal BRK (on/off) to the remote site
		ctrl_callback((EXCEPT | BRK), state? 1:0);
	}
}
Exemple #7
0
/*
    Sets the data rate for the receiver part. If a remote UART is attached,
    propagate this setting.
    The TMS9902 calculates the baud rate from the external clock, and the result
    does not match the known baud rates precisely (e.g. for 9600 baud the
    closest value is 9615). Other UARTs may have a different way to set baud
    rates. Thus we transmit the bit pattern and leave it up to the remote UART
    to calculate its own baud rate from it. Apart from that, the callback
    function should add information about the UART.

    CLK4M RDV8 RDR9 RDR8 | RDR7 RDR6 RDR5 RDR4 | RDR3 RDR2 RDR1 RDR0
*/
void tms9902_device::set_receive_data_rate()
{
	int value = (m_CLK4M? 0x800 : 0) | (m_RDV8? 0x400 : 0) | m_RDR;
	if (VERBOSE>3) LOG("TMS9902: receive rate = %04x\n", value);

	// Calculate the ratio between receive baud rate and polling frequency
	double fint = m_clock_rate / ((m_CLK4M) ? 4.0 : 3.0);
	double baud = fint / (2.0 * ((m_RDV8)? 8:1) * m_RDR);

	// We assume 10 bit per character (7 data usually add 1 parity; 1 start, 1 stop)
	// This value represents the ratio of data inputs of one poll.
	// Thus the callback function should add up this value on each poll
	// and deliver a data input not before it sums up to 1.
	m_baudpoll = (double)(baud / (10*POLLING_FREQ));
	if (VERBOSE>3) LOG ("TMS9902: baudpoll = %lf\n", m_baudpoll);

	m_last_config_value = value;
	ctrl_callback(CONFIG, RATERECV);
}
Exemple #8
0
static void pegasus_set_multicast(struct net_device *net)
{
	pegasus_t *pegasus = netdev_priv(net);

	if (net->flags & IFF_PROMISC) {
		pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS;
		info("%s: Promiscuous mode enabled", net->name);
	} else if ((net->mc_count > multicast_filter_limit) ||
		   (net->flags & IFF_ALLMULTI)) {
		pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST;
		pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS;
		info("%s set allmulti", net->name);
	} else {
		pegasus->eth_regs[EthCtrl0] &= ~RX_MULTICAST;
		pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS;
	}

	pegasus->flags |= ETH_REGS_CHANGE;
	ctrl_callback(pegasus->ctrl_urb, NULL);
}