repo.or.cz
/
avr-sim.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
avr: Decoding table no longer static
[avr-sim.git]
/
test
/
usart_test.c
blob
3ea21377a96ab1a4fad900fd5762152bcfb56da1
1
#include <avr/io.h>
2
#include <avr/interrupt.h>
3
#include <stdio.h>
4
#include
"midi.h"
5
6
int
main
(
void
) {
7
midi_init
();
8
9
sei
();
// enable interrupts
10
11
sysex_start
(
0xE
);
12
sysex_data
(
0xDE
);
13
sysex_data
(
0xAD
);
14
sysex_data
(
0xBE
);
15
sysex_data
(
0xEF
);
16
sysex_end
();
17
return
0
;
18
}
19
20
void
io_init
() {
21
DDRA
=
0xFF
;
// Data
22
PORTA
=
0x00
;
23
24
DDRB
=
0xB9
;
// spi_clk, spi_in, spi_out, NC, TX, RX, clock in, clock
25
PORTB
=
0x02
;
26
27
DDRC
=
0xFF
;
// Address
28
PORTC
=
0x00
;
29
30
DDRD
=
0xFA
;
// NC, NC, NC, NC, NC, CAN_INT, MIDI TX & RX
31
PORTD
=
0x00
;
32
33
DDRE
=
0xFF
;
34
PORTE
=
0x00
;
35
}
36