new global_logger, used in AVR_LOG(), default is stdout/stderr
[simavr] / simavr / cores / sim_megax8.c
1 /*
2         sim_megax8.c
3
4         Copyright 2008, 2009 Michel Pollet <buserror@gmail.com>
5
6         This file is part of simavr.
7
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.
12
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.
17
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/>.
20  */
21
22 #include "sim_avr.h"
23
24 #include "sim_megax8.h"
25
26 void mx8_init(struct avr_t * avr)
27 {
28         struct mcu_t * mcu = (struct mcu_t*)avr;
29
30         avr_eeprom_init(avr, &mcu->eeprom);
31         avr_flash_init(avr, &mcu->selfprog);
32         avr_watchdog_init(avr, &mcu->watchdog);
33         avr_extint_init(avr, &mcu->extint);
34         avr_ioport_init(avr, &mcu->portb);
35         avr_ioport_init(avr, &mcu->portc);
36         avr_ioport_init(avr, &mcu->portd);
37         avr_uart_init(avr, &mcu->uart);
38         avr_adc_init(avr, &mcu->adc);
39         avr_timer_init(avr, &mcu->timer0);
40         avr_timer_init(avr, &mcu->timer1);
41         avr_timer_init(avr, &mcu->timer2);
42         avr_spi_init(avr, &mcu->spi);
43         avr_twi_init(avr, &mcu->twi);
44 }
45
46 void mx8_reset(struct avr_t * avr)
47 {
48 //      struct mcu_t * mcu = (struct mcu_t*)avr;
49 }