struct
Crybus::Connector::Segment
- Crybus::Connector::Segment
- Struct
- Value
- Object
Overview
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.
Defined in:
cry-bus/connector.crConstructors
-
.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.
-
.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
Instance Method Summary
-
#end_adr : UInt32
The address in which the bus will no longer see this segment
-
#seg_in : Proc(UInt32, UInt8, Nil)
The function for when the segment is called to input.
Takes an address and the 8 bit data -
#seg_out : Proc(UInt32, UInt8)
The function for when the segment is called to output.
Takes an address. -
#start_adr : UInt32
The address in which the bus will begin to see this segment
-
#would_hit?(address : UInt32) : Bool
Returns whether or not an address is within this segments address space
Constructor Detail
Creates a new segment given its start address, size, and IO procs.
Creates a new segment given its start address and IO procs.
end_adr is set to start_adr + 1
Instance Method Detail
The function for when the segment is called to input.
Takes an address and the 8 bit data
The function for when the segment is called to output.
Takes an address. Returns the 8 bit data
Returns whether or not an address is within this segments address space