4 Copyright 2008, 2009 Michel Pollet <buserror@gmail.com>
6 This file is part of simavr.
8 simavr is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 simavr is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with simavr. If not, see <http://www.gnu.org/licenses/>.
24 #include "sim_megax8.h"
26 void mx8_init(struct avr_t * avr)
28 struct mcu_t * mcu = (struct mcu_t*)avr;
30 printf("%s init\n", avr->mmcu);
32 avr_eeprom_init(avr, &mcu->eeprom);
33 avr_flash_init(avr, &mcu->selfprog);
34 avr_watchdog_init(avr, &mcu->watchdog);
35 avr_extint_init(avr, &mcu->extint);
36 avr_ioport_init(avr, &mcu->portb);
37 avr_ioport_init(avr, &mcu->portc);
38 avr_ioport_init(avr, &mcu->portd);
39 avr_uart_init(avr, &mcu->uart);
40 avr_adc_init(avr, &mcu->adc);
41 avr_timer_init(avr, &mcu->timer0);
42 avr_timer_init(avr, &mcu->timer1);
43 avr_timer_init(avr, &mcu->timer2);
44 avr_spi_init(avr, &mcu->spi);
45 avr_twi_init(avr, &mcu->twi);
48 void mx8_reset(struct avr_t * avr)
50 // struct mcu_t * mcu = (struct mcu_t*)avr;