gba_clock
A real-time clock library for the GBA.
Provides access to the RTC for programs running on a Game Boy Advance, returning dates and times that are interoperable with the time library.
Features
- Storing and reading of any valid time representable by the time crate (i.e. any year within the range ±9999, or ±999,999 if
time'slarge-datesfeature is enabled). - Works out of the box on real hardware and popular emulators (including mGBA).
- Serializable with the
serdelibrary (by enabling theserdefeature).
Usage
Access to the RTC is done through the Clock type. Create a Clock using the current time and use the returned instance to access the current time.
use Clock;
use ;
let current_time = new;
let clock = new.expect;
// Read the current time whenever you need.
let time = clock
.read_datetime
.expect;
License
This project is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.