Commit graph

55 commits

Author SHA1 Message Date
Michael Mogenson
00897a0657
SioSerial improvements (#100)
Make a few improvements to the SioSerial struct:
- Have init() return Self. It's more ergonomic to create and initialize
the empty struct in one call.
- Enable FIFO. The GBA has a 4-byte UART FIFO. This makes it less
likely to lose received bytes.
- Derive Clone on SioSerial so it can be split and shared with an
interrupt.
- Derive Debug on SioError so results can be unwrapped.
2021-01-12 14:42:56 -07:00
Michael Mogenson
51c870281c
Add Serial and GPIO registers and implement embedded_hal traits (#96)
* Add Serial and GPIO registers and implement embedded_hal traits

Use VolAddress and phantom_fields to populate the SIOCNT, RCNT, and
SIODATA8 registers. Implement embedded_hal serial traits around an empty
SioSerial struct.

Hide serial read and write traits behind a "serial" feature flag
to make embedded-hal and nb dependencies optional.

* UART echo example

Enable the serial feature for this example. Provide a pinout
diagram to assist people with wiring up a USB to UART adapter.
2020-12-26 11:28:07 -07:00
Lokathor
ac031627c8 Update IME to be u16 sized, avoid newtype_enum
newtype_enum makes an enum, but an enum can be UB if it's no a valid bit pattern. We should avoid having registers mapped to enum types.
2019-02-14 22:11:23 -07:00
Lokathor
0f031e6435 bitmap video explanation 2019-02-14 21:18:21 -07:00
Lokathor
3b688b907c Get all the code lined up 2019-02-14 19:39:34 -07:00
Lokathor
89b7cc0eaa Merge branch 'dev' into lokathor 2019-02-14 19:17:02 -07:00
Lokathor
273a8bd676 commit the changes 2019-02-14 19:16:09 -07:00
Ian Pickering
d15168068b Add __IRQ_HANDLER symbol to hello_magic example
The hello_magic example does not depend on the gba crate, but the crt0
now assumes that the symbol for the interrupt handler which is defined
in it will be present, as interrupts ought to be handled in some
manner. If neither the symbol or the crate are added then the linker
will give an error, but if anything in the gba crate is used also then
the symbol will be brought in, so defining it manually also would
cause a duplicate definition error. In the future something like
cortex-m-rt's `exception!` macro could be used to better document how
to define this symbol (all their examples depend on at least one
symbol from their runtime library, so they don't have this problem).
2019-02-13 18:27:27 -08:00
Ian Pickering
0d654032bb Add module for interrupt request (IRQ) handling 2019-02-13 17:08:57 -08:00
Lokathor
c360c2dce4 example updates 2019-02-13 01:47:12 -07:00
Lokathor
2929076e55 jump to 120
Picking this because it makes the `hello_magic.rs` lines all stay on one line.
2019-02-12 09:42:17 -07:00
Lokathor
b67bdc80a1 io registers lesson, +cargo fmt with lin length down to 100 2019-02-11 21:59:17 -07:00
Lokathor
6466a53475 Move to the phantom_fields! proc-macro 2018-12-29 00:06:08 -07:00
Lokathor
f99da154e8 minor fixes 2018-12-27 23:22:48 -07:00
Lokathor
e475253dcf small cleanups 2018-12-27 11:51:53 -07:00
Lokathor
72bbe412b6 clearer module organization 2018-12-26 23:13:10 -07:00
Lokathor
6271614335 backgrounds and OAM start 2018-12-26 20:19:53 -07:00
Lokathor
d6a6301815 CLOSE to another release 2018-12-25 23:19:16 -07:00
Lokathor
298d45ccfb The BG checker demo runs now! 2018-12-25 16:46:11 -07:00
Lokathor
d2260fc117 Move Mode3/4/5 into gba::video::bitmap 2018-12-25 14:44:05 -07:00
Lokathor
51dbb749ef DMA first draft 2018-12-24 15:43:36 -07:00
Lokathor
7d8c82ddbc mgba panic handler 100% safe, justrelease only tho 2018-12-23 15:52:42 -07:00
Lokathor
7ab96c35f2 light cycle is also 100% safe now 2018-12-23 15:10:14 -07:00
Lokathor
35ed03cb44 cleanup, hello world runs 100% safe now 2018-12-23 14:45:38 -07:00
Lokathor
b927a348bd sensible goals 2018-12-22 00:26:52 -07:00
Lokathor
4586d2d95f module organization 2018-12-20 18:08:54 -07:00
Lokathor
58d739dd9e fixed point and stuff 2018-12-17 17:00:22 -07:00
Lokathor
779770a187 cleanup and cleanup designations 2018-12-16 20:55:53 -07:00
Lokathor
51d3915dea static asserts 2018-12-15 20:35:57 -07:00
Lokathor
ac5353b773 Introduction and Limits chapters updated 2018-12-14 22:57:14 -07:00
Lokathor
00e14960c6 ch 00: rewrite done 2018-12-10 01:48:06 -07:00
Lokathor
ad7cac6628 begin re-oganization 2018-12-07 17:06:11 -07:00
Lokathor
9689394d75 checkers! 2018-12-05 21:56:39 -07:00
Lokathor
e9b62f1832 more writing, but the demo just shows white 2018-12-04 23:27:35 -07:00
Lokathor
b40ee565d0 ready to begin PR 2018-11-29 00:15:41 -07:00
Lokathor
6ae1374412 closer 2018-11-28 18:18:23 -07:00
Lokathor
caec27da7b more stuff 2018-11-27 16:58:13 -07:00
Lokathor
e6cc23ef30 progress towards an RNG section 2018-11-26 01:35:30 -07:00
Lokathor
ca4118b482 final case 2018-11-23 14:55:14 -07:00
Lokathor
f225c67d9f commit 2018-11-23 14:48:37 -07:00
Lokathor
423a2f584b better make those examples build 2018-11-21 22:47:43 -07:00
Lokathor
fa6bd606d5 reg-backgrounds 2018-11-21 16:49:17 -07:00
Lokathor
445c3b489b describing how tiles work 2018-11-20 02:57:43 -07:00
Lokathor
39176c19ee part of ch3 2018-11-18 22:19:13 -07:00
Lokathor
241fb1746c edits, cleanups, and a goal for ch3 2018-11-17 17:14:42 -07:00
Lokathor
3a355db578 cargo-make Makefile.toml 2018-11-16 00:39:47 -07:00
Lokathor
8aa1bb0065 partial intrinsic work 2018-11-15 01:23:04 -07:00
Lokathor
5b0e2e30a4 more correct example 2018-11-14 19:54:32 -07:00
Lokathor
4060b5d6f1 test your keys! 2018-11-14 19:54:04 -07:00
Lokathor
a4b6a4e8b2 Revert "Deploy rust-console/gba to github.com/rust-console/gba.git:master"
This reverts commit 2f1c243742.
2018-11-13 12:47:52 -07:00