Documentation ¶
Overview ¶
Package i2c facilitates the reading of i2c data for the SaveKey (and AtariVox) peripherals.
information about i2c taken from:
https://learn.sparkfun.com/tutorials/i2c/all (13/09/2020)
Index ¶
Constants ¶
const ( TraceHi = 1.0 TraceLo = -1.0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Trace ¶
type Trace struct {
// contains filtered or unexported fields
}
Trace records the state of electrical line, whether it is high or low, and also whether the immediately previous state is also high or low.
moving from one state to the other is done with tick(bool) where a boolean value of true indicates a high voltage state.
the function hi2lo() returns true if the line voltage has moved from a high state to low state; and low2hi() returns true if the opposite is true.
deriving conditions from two traces is convenient. for example, give two traces A and B, a condition for event E might be:
if A.hi() && B.lo2hi() { E() }