aboutsummaryrefslogtreecommitdiff
path: root/sim/m68hc11/dv-m68hc11spi.c
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2002-03-07 19:12:44 +0000
committerStephane Carrez <stcarrez@nerim.fr>2002-03-07 19:12:44 +0000
commit827ec39a5a8af8821006d93978623dc1ababdac1 (patch)
tree7f3e2c7e8cad430e5fa9bccc996f55a8d1f5d942 /sim/m68hc11/dv-m68hc11spi.c
parent5abb9efa086f5bd9eeacf3911d0b528cc522b870 (diff)
downloadgdb-827ec39a5a8af8821006d93978623dc1ababdac1.zip
gdb-827ec39a5a8af8821006d93978623dc1ababdac1.tar.gz
gdb-827ec39a5a8af8821006d93978623dc1ababdac1.tar.bz2
* interp.c (sim_hw_configure): Save the HW cpu pointer in the
cpu struct. (sim_hw_configure): Connect the capture input/output events. * sim-main.h (_sim_cpu): New member hw_cpu. (m68hc11cpu_set_oscillator): Declare. (m68hc11cpu_clear_oscillator): Declare. (m68hc11cpu_set_port): Declare. * dv-m68hc11.c (m68hc11_options): New for oscillator commands. (m68hc11cpu_ports): New input ports and output ports to reflect the HC11 IOs. (m68hc11_delete): Cleanup any running oscillator. (attach_m68hc11_regs): Create the input oscillators. (make_oscillator): New function. (find_oscillator): New function. (oscillator_handler): New function. (reset_oscillators): New function. (m68hc11cpu_port_event): Handle the new input ports. (m68hc11cpu_set_oscillator): New function. (m68hc11cpu_clear_oscillator): New function. (get_frequency): New function. (m68hc11_option_handler): New function. (m68hc11cpu_set_port): New function. (m68hc11cpu_io_write): Post the port output events. * dv-m68hc11spi.c (set_bit_port): Use m68hc11cpu_set_port to set the output port value. * dv-m68hc11tim.c (m68hc11tim_port_event): Handle CAPTURE event by latching the TCNT value in the register.
Diffstat (limited to 'sim/m68hc11/dv-m68hc11spi.c')
-rw-r--r--sim/m68hc11/dv-m68hc11spi.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sim/m68hc11/dv-m68hc11spi.c b/sim/m68hc11/dv-m68hc11spi.c
index d0bdfda..5f5e0bb 100644
--- a/sim/m68hc11/dv-m68hc11spi.c
+++ b/sim/m68hc11/dv-m68hc11spi.c
@@ -1,5 +1,5 @@
/* dv-m68hc11spi.c -- Simulation of the 68HC11 SPI
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@worldnet.fr)
(From a driver model Contributed by Cygnus Solutions.)
@@ -192,14 +192,16 @@ m68hc11spi_port_event (struct hw *me,
static void
set_bit_port (struct hw *me, sim_cpu *cpu, int port, int mask, int value)
{
- /* TODO: Post an event to inform other devices that pin 'port' changes.
- This has only a sense if we provide some device that is logically
- connected to these pin ports (SCLK and MOSI) and that handles
- the SPI protocol. */
+ uint8 val;
+
if (value)
- cpu->ios[port] |= mask;
+ val = cpu->ios[port] | mask;
else
- cpu->ios[port] &= ~mask;
+ val = cpu->ios[port] & ~mask;
+
+ /* Set the new value and post an event to inform other devices
+ that pin 'port' changed. */
+ m68hc11cpu_set_port (me, cpu, port, val);
}