retroclash-lib-0.1.2.1: Code shared across the code samples in the book "Retrocomputing with Clash"
Safe HaskellNone
LanguageHaskell2010

RetroClash.SerialTx

Documentation

serialTx :: forall n rate dom. (KnownNat n, KnownNat (ClockDivider dom (HzToPeriod rate)), HiddenClockResetEnable dom) => SNat rate -> Signal dom (Maybe (BitVector n)) -> (Signal dom Bit, Signal dom Bool) Source #

fifo :: forall a dom. (NFDataX a, HiddenClockResetEnable dom) => Signal dom (Maybe a) -> Signal dom Bool -> Signal dom (Maybe a) Source #

data TxState n Source #

Constructors

TxIdle 
TxBit Word32 (TxBit n) 

Instances

Instances details
KnownNat n => Eq (TxState n) Source # 
Instance details

Defined in RetroClash.SerialTx

Methods

(==) :: TxState n -> TxState n -> Bool #

(/=) :: TxState n -> TxState n -> Bool #

KnownNat n => Show (TxState n) Source # 
Instance details

Defined in RetroClash.SerialTx

Methods

showsPrec :: Int -> TxState n -> ShowS #

show :: TxState n -> String #

showList :: [TxState n] -> ShowS #

Generic (TxState n) Source # 
Instance details

Defined in RetroClash.SerialTx

Associated Types

type Rep (TxState n) :: Type -> Type #

Methods

from :: TxState n -> Rep (TxState n) x #

to :: Rep (TxState n) x -> TxState n #

KnownNat n => NFDataX (TxState n) Source # 
Instance details

Defined in RetroClash.SerialTx

type Rep (TxState n) Source # 
Instance details

Defined in RetroClash.SerialTx

type Rep (TxState n) = D1 ('MetaData "TxState" "RetroClash.SerialTx" "retroclash-lib-0.1.2.1-3QYYIIVHJO83EmrUE6AW6v" 'False) (C1 ('MetaCons "TxIdle" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TxBit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxBit n))))

data TxBit n Source #

Constructors

StartBit (BitVector n) 
DataBit (BitVector n) (Index n) 
StopBit 

Instances

Instances details
KnownNat n => Eq (TxBit n) Source # 
Instance details

Defined in RetroClash.SerialTx

Methods

(==) :: TxBit n -> TxBit n -> Bool #

(/=) :: TxBit n -> TxBit n -> Bool #

KnownNat n => Show (TxBit n) Source # 
Instance details

Defined in RetroClash.SerialTx

Methods

showsPrec :: Int -> TxBit n -> ShowS #

show :: TxBit n -> String #

showList :: [TxBit n] -> ShowS #

Generic (TxBit n) Source # 
Instance details

Defined in RetroClash.SerialTx

Associated Types

type Rep (TxBit n) :: Type -> Type #

Methods

from :: TxBit n -> Rep (TxBit n) x #

to :: Rep (TxBit n) x -> TxBit n #

KnownNat n => NFDataX (TxBit n) Source # 
Instance details

Defined in RetroClash.SerialTx

Methods

deepErrorX :: String -> TxBit n #

hasUndefined :: TxBit n -> Bool #

ensureSpine :: TxBit n -> TxBit n #

rnfX :: TxBit n -> () #

type Rep (TxBit n) Source # 
Instance details

Defined in RetroClash.SerialTx

type Rep (TxBit n) = D1 ('MetaData "TxBit" "RetroClash.SerialTx" "retroclash-lib-0.1.2.1-3QYYIIVHJO83EmrUE6AW6v" 'False) (C1 ('MetaCons "StartBit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BitVector n))) :+: (C1 ('MetaCons "DataBit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BitVector n)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Index n))) :+: C1 ('MetaCons "StopBit" 'PrefixI 'False) (U1 :: Type -> Type)))

txStep :: forall n. KnownNat n => Word32 -> Maybe (BitVector n) -> State (TxState n) (Bit, Bool) Source #