retroclash-lib-0.1.2.2: Code shared across the code samples in the book "Retrocomputing with Clash"
Safe HaskellSafe-Inferred
LanguageHaskell2010

RetroClash.SerialRx

Documentation

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

data RxState n Source #

Constructors

RxIdle 
RxBit Word32 (Maybe Bit) (RxBit n) 

Instances

Instances details
Generic (RxState n) Source # 
Instance details

Defined in RetroClash.SerialRx

Associated Types

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

Methods

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

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

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

Defined in RetroClash.SerialRx

Methods

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

show :: RxState n -> String #

showList :: [RxState n] -> ShowS #

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

Defined in RetroClash.SerialRx

KnownNat n => Eq (RxState n) Source # 
Instance details

Defined in RetroClash.SerialRx

Methods

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

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

type Rep (RxState n) Source # 
Instance details

Defined in RetroClash.SerialRx

type Rep (RxState n) = D1 ('MetaData "RxState" "RetroClash.SerialRx" "retroclash-lib-0.1.2.2-8zTx05WshYzIbWBY4X0pgW" 'False) (C1 ('MetaCons "RxIdle" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RxBit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bit)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RxBit n)))))

data RxBit n Source #

Constructors

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

Instances

Instances details
Generic (RxBit n) Source # 
Instance details

Defined in RetroClash.SerialRx

Associated Types

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

Methods

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

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

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

Defined in RetroClash.SerialRx

Methods

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

show :: RxBit n -> String #

showList :: [RxBit n] -> ShowS #

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

Defined in RetroClash.SerialRx

Methods

deepErrorX :: String -> RxBit n #

hasUndefined :: RxBit n -> Bool #

ensureSpine :: RxBit n -> RxBit n #

rnfX :: RxBit n -> () #

KnownNat n => Eq (RxBit n) Source # 
Instance details

Defined in RetroClash.SerialRx

Methods

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

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

type Rep (RxBit n) Source # 
Instance details

Defined in RetroClash.SerialRx

type Rep (RxBit n) = D1 ('MetaData "RxBit" "RetroClash.SerialRx" "retroclash-lib-0.1.2.2-8zTx05WshYzIbWBY4X0pgW" 'False) (C1 ('MetaCons "StartBit" 'PrefixI 'False) (U1 :: Type -> Type) :+: (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) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BitVector n)))))