struct

Crybus::Connector::Segment

Inherits Struct < Value < Object

An address chunk assigned to this connector.
Each segment takes up a portion of address space
and has an individual output and input proc (function pointer).

Segments can act as either one connection to the bus or a chain of connections which would function similarly to IO registers, with each segment having a seperate output and input proc based of what that register should do when being read/written.

Constructors

new(start_adr : UInt32, length : UInt32, seg_out : Proc(UInt32, UInt8), seg_in : Proc(UInt32, UInt8, Nil))

Creates a new segment given its start address, size, and IO procs.

Source
new(start_adr : UInt32, seg_out : Proc(UInt32, UInt8), seg_in : Proc(UInt32, UInt8, Nil))

Creates a new segment given its start address and IO procs.
end_adr is set to start_adr + 1

Source

Instance methods

end_adr

The address in which the bus will no longer see this segment

Source
seg_in

The function for when the segment is called to input.
Takes an address and the 8 bit data

Source
seg_out

The function for when the segment is called to output.
Takes an address. Returns the 8 bit data

Source
start_adr

The address in which the bus will begin to see this segment

Source
would_hit?(address : UInt32) : Bool

Returns whether or not an address is within this segments address space

Source

Nested types