//! Defines the data types used to describe the Chip8 and associated peripherals.

/// One byte in RAM.
pub type MemoryCell = u8;
/// An 8-bit register.
pub type Register8 = u8;
/// A 16-bit register.
pub type Register16 = u16;
/// An 8-bit timer.
pub type Timer = u8;
/// An address pointing to a location in CHIP-8 memory.
pub type Address = u16;
/// A 16-bit CHIP-8 codeword.
pub type Codeword = u16;
/// A single pixel.
pub type Pixel = u8;
/// The state of the keyboard.
pub type Keyboard = [bool; 16];
/// The state of the buzzer.
pub type Buzzer = bool;
/// The audio buffer used for XOCHIP.
pub type Audio = [u8; 16];
/// Vram
pub type Vram = Vec<Pixel>;

/// A set of errors that could be returned.
#[derive(Debug)]
pub enum Chip8Error {
    OutOfBoundsAt(usize),
    OutOfBounds,
    PopEmptyStack,
    InvalidOperand,
}
/// The result type used throughout the library.
pub type Chip8Result<T> = Result<T, Chip8Error>;

//! Data types used to describe the data that makes up the Chip8.

/// One byte in RAM.
pub type MemoryCell = u8;
/// A value in an 8-bit register.
pub type Register8 = u8;
/// A value in a 16-bit register.
pub type Register16 = u16;
/// An 8-bit timer.
pub type Timer = u8;
/// An Address.
pub type Address = u16;
/// A 16-bit chip8 codeword.
pub type Codeword = u16;
/// A single pixel.
pub type Pixel = u8;
/// The state of the keyboard.
pub type Keyboard = [bool; 16];
/// The state of the buzzer.
pub type Buzzer = bool;
/// The audio buffer.
pub type Audio = [u8; 16];
/// Vram
pub type Vram = Vec<Pixel>;

#[derive(Debug)]
pub enum Chip8Error {
    OutOfBoundsAt(usize),
    OutOfBounds,
    PopEmptyStack,
    InvalidOperand,
}
pub type Chip8Result<T> = Result<T, Chip8Error>;

--- 
+++ 
@@ -1,16 +1,16 @@
-//! Data types used to describe the data that makes up the Chip8.
+//! Defines the data types used to describe the Chip8 and associated peripherals.
 
 /// One byte in RAM.
 pub type MemoryCell = u8;
-/// A value in an 8-bit register.
+/// An 8-bit register.
 pub type Register8 = u8;
-/// A value in a 16-bit register.
+/// A 16-bit register.
 pub type Register16 = u16;
 /// An 8-bit timer.
 pub type Timer = u8;
-/// An Address.
+/// An address pointing to a location in CHIP-8 memory.
 pub type Address = u16;
-/// A 16-bit chip8 codeword.
+/// A 16-bit CHIP-8 codeword.
 pub type Codeword = u16;
 /// A single pixel.
 pub type Pixel = u8;
@@ -18,11 +18,12 @@
 pub type Keyboard = [bool; 16];
 /// The state of the buzzer.
 pub type Buzzer = bool;
-/// The audio buffer.
+/// The audio buffer used for XOCHIP.
 pub type Audio = [u8; 16];
 /// Vram
 pub type Vram = Vec<Pixel>;
 
+/// A set of errors that could be returned.
 #[derive(Debug)]
 pub enum Chip8Error {
     OutOfBoundsAt(usize),
@@ -30,4 +31,5 @@
     PopEmptyStack,
     InvalidOperand,
 }
+/// The result type used throughout the library.
 pub type Chip8Result<T> = Result<T, Chip8Error>;
Improve documentation of type definitions.
