27#ifndef included_Retro_RlinkCommand
28#define included_Retro_RlinkCommand 1
56 void CmdRblk(uint16_t addr,
size_t size);
57 void CmdRblk(uint16_t addr, uint16_t* pblock,
size_t size);
58 void CmdWreg(uint16_t addr, uint16_t data);
59 void CmdWblk(uint16_t addr,
const std::vector<uint16_t>& block);
60 void CmdWblk(uint16_t addr, std::vector<uint16_t>&& block);
61 void CmdWblk(uint16_t addr,
const uint16_t* pblock,
size_t size);
64 void CmdInit(uint16_t addr, uint16_t data);
66 void SetCommand(uint8_t cmd, uint16_t addr=0, uint16_t data=0);
89 uint16_t
Data()
const;
90 const std::vector<uint16_t>&
Block()
const;
98 uint32_t
Flags()
const;
112 size_t abase=16,
size_t dbase=16,
113 size_t sbase=16)
const;
115 void Dump(std::ostream& os,
int ind=0,
const char* text=0,
static const uint8_t kBBit01
static const uint8_t kBBit00
static const uint8_t kBBit02
static const uint8_t kBBit03
void SetStatus(uint8_t stat)
FIXME_docs.
void SetCommand(uint8_t cmd, uint16_t addr=0, uint16_t data=0)
FIXME_docs.
void SetExpect(exp_uptr_t &&upexp)
FIXME_docs.
static const uint8_t kStat_B_Stat
RlinkCommand()
Default constructor.
static const uint32_t kFlagPktEnd
command last in packet
static const uint8_t kCmdInit
command code send initialize
uint8_t fExpectStatusVal
status value
void SetBlockExt(uint16_t *pblock, size_t size)
FIXME_docs.
void SetFlagBit(uint32_t mask)
FIXME_docs.
void SetCmdSimple(uint8_t cmd, uint16_t addr, uint16_t data)
static const uint32_t kFlagSend
command send
uint16_t Data() const
FIXME_docs.
void SetRcvSize(size_t rsize)
FIXME_docs.
~RlinkCommand()
Destructor.
uint8_t Request() const
FIXME_docs.
static const uint8_t kCmdRblk
command code read block
uint8_t fExpectStatusMsk
status mask
bool BlockDoneAll() const
FIXME_docs.
void SetExpectStatusDefault(uint8_t stat=0, uint8_t statmsk=0x0)
FIXME_docs.
void SetBlockRead(size_t size)
FIXME_docs.
static const uint32_t kFlagChkStat
stat expect check failed
uint8_t fStatus
rlink command status
size_t fBlockDone
valid transfer count
uint16_t Address() const
FIXME_docs.
uint8_t ExpectStatusMask() const
FIXME_docs.
size_t RcvSize() const
FIXME_docs.
bool TestFlagAny(uint32_t mask) const
FIXME_docs.
void CmdRreg(uint16_t addr)
FIXME_docs.
static const uint8_t kStat_M_RbErr
stat: rberr flag set
uint8_t SeqNumber() const
FIXME_docs.
void CmdAttn()
FIXME_docs.
uint8_t Status() const
FIXME_docs.
static const char * CommandName(uint8_t cmd)
FIXME_docs.
size_t fBlockExtSize
transfer size if data external
void CmdWreg(uint16_t addr, uint16_t data)
FIXME_docs.
const std::vector< uint16_t > & Block() const
FIXME_docs.
void CmdRblk(uint16_t addr, size_t size)
FIXME_docs.
bool ExpectStatusSet() const
FIXME_docs.
void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
uint8_t fRequest
rlink request (cmd+seqnum)
bool StatusIsChecked() const
FIXME_docs.
bool fExpectStatusSet
stat chk set explicitely
void Print(std::ostream &os, const RlinkAddrMap *pamap=0, size_t abase=16, size_t dbase=16, size_t sbase=16) const
FIXME_docs.
bool StatusCheck() const
FIXME_docs.
static const uint32_t kFlagErrNak
error: nak abort
static const uint8_t kStat_M_RbNak
stat: rbnak flag set
uint8_t ExpectStatusValue() const
FIXME_docs.
bool TestFlagAll(uint32_t mask) const
FIXME_docs.
uint16_t fAddress
rbus address
void CmdLabo()
FIXME_docs.
static const uint8_t kStat_M_Attn
stat: attn flag set
static const uint8_t kStat_M_RbTout
stat: rbtout flag set
static const uint32_t kFlagDone
command done
RlinkCommand & operator=(const RlinkCommand &rhs)
FIXME_docs.
static const uint32_t kFlagLabo
command labo'ed
void SetData(uint16_t data)
FIXME_docs.
uint8_t Command() const
FIXME_docs.
uint16_t * fpBlockExt
external data for blk commands
size_t BlockSize() const
FIXME_docs.
static const uint8_t kCmdRreg
command code read register
static const uint32_t kFlagChkDone
done expect check failed
std::vector< uint16_t > fBlock
data vector for blk commands
static const uint8_t kStat_V_Stat
uint32_t Flags() const
FIXME_docs.
static const uint8_t kCmdWreg
command code write register
static const uint32_t kFlagPktBeg
command first in packet
void CmdWblk(uint16_t addr, const std::vector< uint16_t > &block)
FIXME_docs.
void SetSeqNumber(uint8_t snum)
FIXME_docs.
void SetAddress(uint16_t addr)
FIXME_docs.
static const RflagName * FlagNames()
FIXME_docs.
bool HasBlockExt() const
FIXME_docs.
size_t BlockDone() const
FIXME_docs.
static const uint32_t kFlagErrDec
error: decode error
void SetExpectStatus(uint8_t stat, uint8_t statmsk=0xff)
FIXME_docs.
bool HasExpect() const
FIXME_docs.
exp_uptr_t fupExpect
pointer to expect container
void SetBlockDone(uint16_t dcnt)
FIXME_docs.
size_t fRcvSize
receive size for command
static const uint8_t kStat_M_Stat
stat: external stat bits
void CmdInit(uint16_t addr, uint16_t data)
FIXME_docs.
static const uint32_t kFlagChkData
data expect check failed
static const uint8_t kCmdAttn
command code get attention
std::unique_ptr< RlinkCommandExpect > exp_uptr_t
static const uint8_t kCmdLabo
command code list abort
const RlinkCommandExpect & Expect() const
FIXME_docs.
void SetBlockWrite(const std::vector< uint16_t > &block)
FIXME_docs.
std::string CommandInfo() const
FIXME_docs.
uint16_t * BlockPointer()
FIXME_docs.
RlinkCommandExpect & EnsureExpect()
FIXME_docs.
void ClearFlagBit(uint32_t mask)
FIXME_docs.
uint32_t fFlags
state bits
static const uint32_t kFlagInit
cmd,addr,data setup
static const uint8_t kCmdWblk
command code write block
Declaration of class ReventLoop.