Skip to content

Commit ab31b86

Browse files
committed
Formatting changes.
Adds blocks to break up the structure.
1 parent 7c6d050 commit ab31b86

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

src/lib.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ pub const API_VERSION: Version = Version::new(0, 6, 1);
5555
/// function.
5656
#[repr(C)]
5757
pub struct Api {
58+
// ========================================================================
59+
// Version and Metadata
60+
// ========================================================================
5861
/// Gets the version number of the BIOS API.
5962
///
6063
/// You need this value to determine which of the following API calls are
@@ -69,6 +72,10 @@ pub struct Api {
6972
/// a Rust string. It is unspecified as to whether the string is located
7073
/// in Flash ROM or RAM (but it's likely to be Flash ROM).
7174
pub bios_version_get: extern "C" fn() -> ApiString<'static>,
75+
76+
// ========================================================================
77+
// Serial Port Support
78+
// ========================================================================
7279
/// Get information about the Serial ports in the system.
7380
///
7481
/// Serial ports are ordered octet-oriented pipes. You can push octets
@@ -106,6 +113,10 @@ pub struct Api {
106113
data: ApiBuffer,
107114
timeout: crate::Option<Timeout>,
108115
) -> crate::Result<usize>,
116+
117+
// ========================================================================
118+
// Time Support
119+
// ========================================================================
109120
/// Get the current wall time.
110121
///
111122
/// The Neotron BIOS does not understand time zones, leap-seconds or the
@@ -137,6 +148,9 @@ pub struct Api {
137148
/// Report the system tick rate, in ticks-per-second.
138149
pub time_ticks_per_second: extern "C" fn() -> Ticks,
139150

151+
// ========================================================================
152+
// Persistent Configuration Support
153+
// ========================================================================
140154
/// Get the configuration data block.
141155
///
142156
/// Configuration data is, to the BIOS, just a block of bytes of a given
@@ -147,6 +161,10 @@ pub struct Api {
147161
///
148162
/// See `configuration_get`.
149163
pub configuration_set: extern "C" fn(buffer: ApiByteSlice) -> crate::Result<()>,
164+
165+
// ========================================================================
166+
// Video Output Support
167+
// ========================================================================
150168
/// Does this Neotron BIOS support this video mode?
151169
pub video_is_valid_mode: extern "C" fn(mode: video::Mode) -> bool,
152170
/// Does this Neotron BIOS require extra VRAM (passed with
@@ -263,6 +281,9 @@ pub struct Api {
263281
pub video_set_whole_palette:
264282
unsafe extern "C" fn(start: *const video::RGBColour, length: usize),
265283

284+
// ========================================================================
285+
// Memory Region Support
286+
// ========================================================================
266287
/// Find out about regions of memory in the system.
267288
///
268289
/// The first region (index `0`) must be the 'application region' which is
@@ -280,12 +301,20 @@ pub struct Api {
280301
/// application space available). The OS will prefer lower numbered regions
281302
/// (other than Region 0), so faster memory should be listed first.
282303
pub memory_get_region: extern "C" fn(region_index: u8) -> crate::Result<types::MemoryRegion>,
304+
305+
// ========================================================================
306+
// Human Interface Device Support
307+
// ========================================================================
283308
/// Get the next available HID event, if any.
284309
///
285310
/// This function doesn't block. It will return `Ok(None)` if there is no event ready.
286311
pub hid_get_event: extern "C" fn() -> crate::Result<crate::Option<hid::HidEvent>>,
287312
/// Control the keyboard LEDs.
288313
pub hid_set_leds: extern "C" fn(leds: hid::KeyboardLeds) -> crate::Result<()>,
314+
315+
// ========================================================================
316+
// I²C Bus Support
317+
// ========================================================================
289318
/// Get information about the I²C Buses in the system.
290319
///
291320
/// I²C Bus 0 should be the one connected to the Neotron Bus.
@@ -317,6 +346,10 @@ pub struct Api {
317346
tx2: ApiByteSlice,
318347
rx: ApiBuffer,
319348
) -> crate::Result<()>,
349+
350+
// ========================================================================
351+
// Audio Support
352+
// ========================================================================
320353
/// Get information about the Audio Mixer channels
321354
pub audio_mixer_channel_get_info:
322355
extern "C" fn(audio_mixer_id: u8) -> crate::Result<audio::MixerChannelInfo>,
@@ -406,6 +439,10 @@ pub struct Api {
406439
/// How many samples in the current format can be read right now using
407440
/// `audio_input_data`?
408441
pub audio_input_get_count: extern "C" fn() -> crate::Result<usize>,
442+
443+
// ========================================================================
444+
// Neotron (SPI) Bus Support
445+
// ========================================================================
409446
/// Select a Neotron Bus Peripheral. This drives the SPI chip-select line
410447
/// low for that peripheral. Selecting a peripheral de-selects any other
411448
/// peripherals. Select peripheral 'None' to select no peripherals. If

src/video.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub struct TextBackgroundColour(u8);
152152
pub struct Attr(pub u8);
153153

154154
/// Represents a glyph/attribute pair.
155-
///
155+
///
156156
/// This is what out text console is made out of. They work in exactly the same
157157
/// way as IBM PC VGA.
158158
#[repr(transparent)]

0 commit comments

Comments
 (0)