need to start re-thinking structure of uart etc
This commit is contained in:
parent
d03cceb283
commit
44324eb803
5 changed files with 4 additions and 4 deletions
20
bs/Uart/State.bs
Normal file
20
bs/Uart/State.bs
Normal file
|
@ -0,0 +1,20 @@
|
|||
package State(
|
||||
State(..),
|
||||
ftdiState') where
|
||||
|
||||
data State = IDLE
|
||||
| START
|
||||
| DATA (UInt (TLog 8))
|
||||
| PARITY
|
||||
| STOP
|
||||
deriving (Bits, Eq, FShow)
|
||||
|
||||
ftdiState' :: State -> State
|
||||
ftdiState' state =
|
||||
case state of
|
||||
IDLE -> START
|
||||
START -> DATA(0)
|
||||
DATA(7) -> PARITY
|
||||
DATA(n) -> DATA(n+1)
|
||||
PARITY -> STOP
|
||||
STOP -> IDLE
|
Reference in a new issue