Documentation ¶
Index ¶
- type A2Gpio
- func (a2 A2Gpio) Init()
- func (a2 A2Gpio) ReadBlock(buffer []byte) error
- func (a2 A2Gpio) ReadByte(noDelay ...bool) (byte, error)
- func (a2 A2Gpio) ReadCharacter() (string, error)
- func (a2 A2Gpio) ReadString() (string, error)
- func (a2 A2Gpio) SendCharacter(character byte)
- func (a2 A2Gpio) WriteBlock(buffer []byte) error
- func (a2 A2Gpio) WriteBuffer(buffer []byte) error
- func (a2 A2Gpio) WriteByte(data byte) error
- func (a2 A2Gpio) WriteString(outString string) error
- type A2Io
- type CDCio
- func (a2 CDCio) Init()
- func (a2 CDCio) ReadBlock(buffer []byte) error
- func (a2 CDCio) ReadByte(noDelay ...bool) (byte, error)
- func (a2 CDCio) ReadCharacter() (string, error)
- func (a2 CDCio) ReadString() (string, error)
- func (a2 CDCio) SendCharacter(character byte)
- func (a2 CDCio) WriteBlock(buffer []byte) error
- func (a2 CDCio) WriteBuffer(buffer []byte) error
- func (a2 CDCio) WriteByte(data byte) error
- func (a2 CDCio) WriteString(outString string) error
- type MockIo
- func (mockIo MockIo) Init()
- func (mockIo MockIo) ReadBlock(buffer []byte) error
- func (mockIo MockIo) ReadByte(noDelay ...bool) (byte, error)
- func (mockIo MockIo) ReadCharacter() (string, error)
- func (mockIo MockIo) ReadString() (string, error)
- func (mockIo MockIo) SendCharacter(character byte)
- func (mockIo MockIo) WriteBlock(buffer []byte) error
- func (mockIo MockIo) WriteBuffer(buffer []byte) error
- func (mockIo MockIo) WriteByte(data byte) error
- func (mockIo MockIo) WriteString(outString string) error
- type MockIoData
- type UserIo
- func (userIo UserIo) Init()
- func (userIo UserIo) ReadBlock(buffer []byte) error
- func (userIo UserIo) ReadByte(noDelay ...bool) (byte, error)
- func (userIo UserIo) ReadCharacter() (string, error)
- func (userIo UserIo) ReadString() (string, error)
- func (userIo UserIo) SendCharacter(character byte)
- func (userIo UserIo) WriteBlock(buffer []byte) error
- func (userIo UserIo) WriteBuffer(buffer []byte) error
- func (userIo UserIo) WriteByte(data byte) error
- func (userIo UserIo) WriteString(outString string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type A2Gpio ¶
type A2Gpio struct { }
A2Gpio is the live implementation of A2Io interface
func (A2Gpio) ReadCharacter ¶
ReadCharacter is a pass-through to vt100 implementation
func (A2Gpio) ReadString ¶
ReadString reads a string from the Apple II via Raspberry Pi's GPIO ports
func (A2Gpio) SendCharacter ¶
SendCharacter is a pass-through to vt100 implementation
func (A2Gpio) WriteBlock ¶
WriteBlock writes 512 bytes to the Apple II via Raspberry Pi's GPIO ports
func (A2Gpio) WriteBuffer ¶
WriteBuffer writes a buffer of bytes to the Apple II via Raspberry Pi's GPIO ports
func (A2Gpio) WriteString ¶
WriteString writes a string to the Apple II via Raspberry Pi's GPIO ports
type A2Io ¶
type A2Io interface { Init() WriteByte(data byte) error WriteString(outString string) error WriteBlock(buffer []byte) error WriteBuffer(buffer []byte) error ReadByte(noDelay ...bool) (byte, error) ReadString() (string, error) ReadBlock(buffer []byte) error SendCharacter(character byte) ReadCharacter() (string, error) }
A2Io provides an interface to send and receive data to the Apple II
type CDCio ¶
type CDCio struct { }
CDCio is a live implementation of A2Io interface
func (CDCio) ReadCharacter ¶
ReadCharacter is a pass-through to vt100 implementation
func (CDCio) ReadString ¶
ReadString reads a string from the Apple II via Raspberry Pi's CDC driver
func (CDCio) SendCharacter ¶
SendCharacter is a pass-through to vt100 implementation
func (CDCio) WriteBlock ¶
WriteBlock writes 512 bytes to the Apple II via Raspberry Pi's CDC driver
func (CDCio) WriteBuffer ¶
WriteBuffer writes a buffer of bytes to the Apple II via Raspberry Pi's CDC driver
func (CDCio) WriteString ¶
WriteString writes a string to the Apple II via Raspberry Pi's CDC driver
type MockIo ¶
type MockIo struct {
Data *MockIoData
}
MockIo implements A2Io to allow unit tests to run without needing GPIO functioning
func (MockIo) ReadCharacter ¶
ReadCharacter is a pass-through to vt100 implementation
func (MockIo) ReadString ¶
ReadString mocks reading a null terminated string from the Apple II
func (MockIo) SendCharacter ¶
SendCharacter is a pass-through to vt100 implementation
func (MockIo) WriteBlock ¶
WriteBlock mocks writing a block to the Apple II
func (MockIo) WriteBuffer ¶
WriteBuffer mocks writing a buffer to the Apple II
func (MockIo) WriteString ¶
WriteString mocks writing a string to the Apple II
type MockIoData ¶
type MockIoData struct { BytesToRead []byte BytesWritten []byte NumberBytesRead int NumberBytesWritten int ErrorToThrow error }
MockIoData is used to verify tests were successful
type UserIo ¶
type UserIo struct { }
UserIo implements A2Io for the purpose of debugging locally
func (UserIo) ReadBlock ¶
ReadBlock should simulate reading to the Apple II but is not yet supported
func (UserIo) ReadCharacter ¶
ReadCharacter is a pass-through to vt100 implementation
func (UserIo) ReadString ¶
ReadString simulates reading to the Apple II but uses stdin instead
func (UserIo) SendCharacter ¶
SendCharacter is a pass-through to vt100 implementation
func (UserIo) WriteBlock ¶
WriteBlock simulates writing to the Apple II but uses stdout instead
func (UserIo) WriteBuffer ¶
WriteBuffer simulates writing to the Apple II but uses stdout instead
func (UserIo) WriteString ¶
WriteString simulates writing to the Apple II but uses stdout instead