Commit 6e703847 authored by Benoit Rat's avatar Benoit Rat

all: end of big restructuration (part 3/3).

* Correct bug with Mask on type
* Correct old TRACE_P_VVDEBUG
* Rename cvtWBNodetoPrmList into setParams() function
* Setback the sync() method using block for EWBPeriph
parent 9b31ef9c
...@@ -181,11 +181,21 @@ asynStatus EWBAsynPortDrvr::createParam(const char* name, EWBParam* pPrm,int *pI ...@@ -181,11 +181,21 @@ asynStatus EWBAsynPortDrvr::createParam(const char* name, EWBParam* pPrm,int *pI
{ {
pIndex=(pIndex)?pIndex:&tmp; pIndex=(pIndex)?pIndex:&tmp;
if(pPrm->getType() == EWBParam::EWBF_STRING) if(pPrm->getType() == EWBParam::EWBF_STRING)
{
type=asynParamOctet; type=asynParamOctet;
else if(pPrm->getType() && EWBParam::EWBF_TM_FIXED_POINT) }
type=asynParamFloat64; else if(pPrm->getType() & EWBParam::EWBF_TM_TYPE_FIELD)
{
if(pPrm->getType() & EWBParam::EWBF_TM_FIXED_POINT)
type=asynParamFloat64;
else
type=asynParamInt32;
}
else else
type=asynParamInt32; {
TRACE_P_WARNING("Unknown type 0x%x for Param %s (pv:%s)",pPrm->getType(), pPrm->getCName(), name);
return asynError;
}
//if(list==1) list=0; //if(list==1) list=0;
...@@ -197,7 +207,7 @@ asynStatus EWBAsynPortDrvr::createParam(const char* name, EWBParam* pPrm,int *pI ...@@ -197,7 +207,7 @@ asynStatus EWBAsynPortDrvr::createParam(const char* name, EWBParam* pPrm,int *pI
if(pPrm->getType() == EWBParam::EWBF_STRING) { if(pPrm->getType() == EWBParam::EWBF_STRING) {
//setStringParam(*pIndex,((EWBParamStr*)pPrm)->getCValue()); //setStringParam(*pIndex,((EWBParamStr*)pPrm)->getCValue());
} }
else if(pPrm->getType() && EWBParam::EWBF_TM_FIXED_POINT) else if(pPrm->getType() & EWBParam::EWBF_TM_FIXED_POINT)
setDoubleParam(*pIndex,((EWBField*)pPrm)->getFloat()); setDoubleParam(*pIndex,((EWBField*)pPrm)->getFloat());
else else
setIntegerParam(*pIndex,((EWBField*)pPrm)->getU32()); setIntegerParam(*pIndex,((EWBField*)pPrm)->getU32());
...@@ -311,12 +321,12 @@ asynStatus EWBAsynPortDrvr::readInt32(asynUser* pasynUser, epicsInt32* value) ...@@ -311,12 +321,12 @@ asynStatus EWBAsynPortDrvr::readInt32(asynUser* pasynUser, epicsInt32* value)
//Convert the WBField to a float //Convert the WBField to a float
pFld->convert(&u32val,true); pFld->convert(&u32val,true);
*value=(epicsInt32)u32val; *value=(epicsInt32)u32val;
}
TRACE_P_VVDEBUG("@0x%08X %s.%s : 0x%08x (val=%d)", TRACE_P_VVDEBUG("@0x%08X %s.%s : 0x%08x (val=%d)",
aWF.pPrm->getReg()->getOffset(true), pFld->getReg()->getOffset(true),
aWF.pPrm->getReg()->getCName(),aWF.pPrm->getCName(), pFld->getReg()->getCName(),pFld->getCName(),
aWF.pPrm->getReg()->getData(),*value); pFld->getReg()->getData(),*value);
}
//And set value to the parameters list //And set value to the parameters list
status = (asynStatus) setIntegerParam(function,*value); status = (asynStatus) setIntegerParam(function,*value);
...@@ -388,12 +398,12 @@ asynStatus EWBAsynPortDrvr::readFloat64(asynUser* pasynUser, ...@@ -388,12 +398,12 @@ asynStatus EWBAsynPortDrvr::readFloat64(asynUser* pasynUser,
//Convert the WBField to a float //Convert the WBField to a float
pFld->convert(&f32val,true); pFld->convert(&f32val,true);
*value=(epicsFloat64)f32val; *value=(epicsFloat64)f32val;
}
TRACE_P_VVDEBUG("@0x%08X %s.%s : 0x%08x (val=%f)", TRACE_P_VVDEBUG("@0x%08X %s.%s : 0x%08x (val=%f)",
aWF.pPrm->getReg()->getOffset(true), pFld->getReg()->getOffset(true),
aWF.pPrm->getReg()->getCName(),aWF.pPrm->getCName(), pFld->getReg()->getCName(),pFld->getCName(),
aWF.pPrm->getReg()->getData(),f32val); pFld->getReg()->getData(),f32val);
}
//And set value to the parameters list //And set value to the parameters list
status = (asynStatus) setDoubleParam(function,*value); status = (asynStatus) setDoubleParam(function,*value);
...@@ -456,12 +466,14 @@ asynStatus EWBAsynPortDrvr::writeInt32(asynUser* pasynUser, epicsInt32 value) ...@@ -456,12 +466,14 @@ asynStatus EWBAsynPortDrvr::writeInt32(asynUser* pasynUser, epicsInt32 value)
uint32_t u32val=value; uint32_t u32val=value;
if((pFld=aWF.pPrm->castField())!=NULL) if((pFld=aWF.pPrm->castField())!=NULL)
{
pFld->convert(&u32val,false); pFld->convert(&u32val,false);
TRACE_P_VVDEBUG("@0x%08X %s.%s : %08x", TRACE_P_VVDEBUG("@0x%08X %s.%s : %08x",
aWF.pPrm->getReg()->getOffset(true), pFld->getReg()->getOffset(true),
aWF.pPrm->getReg()->getCName(),aWF.pPrm->getCName(), pFld->getReg()->getCName(),pFld->getCName(),
aWF.pPrm->getReg()->getData()); pFld->getReg()->getData());
}
//Finally sync WBField using the connector to memory //Finally sync WBField using the connector to memory
if(syncNow & EWBSync::EWB_AM_W) if(syncNow & EWBSync::EWB_AM_W)
...@@ -471,10 +483,13 @@ asynStatus EWBAsynPortDrvr::writeInt32(asynUser* pasynUser, epicsInt32 value) ...@@ -471,10 +483,13 @@ asynStatus EWBAsynPortDrvr::writeInt32(asynUser* pasynUser, epicsInt32 value)
} }
else aWF.pPrm->setToSync(); else aWF.pPrm->setToSync();
TRACE_P_VVDEBUG("===>>>>>>>>>>>>>>@0x%08X %s.%s : %08x", if(pFld)
aWF.pPrm->getReg()->getOffset(true), {
aWF.pPrm->getReg()->getCName(),aWF.pPrm->getCName(), TRACE_P_VVDEBUG("===>>>>>>>>>>>>>>@0x%08X %s.%s : %08x",
aWF.pPrm->getReg()->getData()); pFld->getReg()->getOffset(true),
pFld->getReg()->getCName(),pFld->getCName(),
pFld->getReg()->getData());
}
} }
else if(function==P_BlkSyncIdx) else if(function==P_BlkSyncIdx)
{ {
...@@ -662,36 +677,41 @@ asynStatus EWBAsynPortDrvr::readOctet(asynUser *pasynUser, char *value, size_t m ...@@ -662,36 +677,41 @@ asynStatus EWBAsynPortDrvr::readOctet(asynUser *pasynUser, char *value, size_t m
//bool EWBAsynPortDrvr::cvtWBNodetoPrmList(WBNode *node) bool EWBAsynPortDrvr::setParams(EWBPeriph *pPrh)
//{ {
// WBReg *reg=NULL; EWBReg *reg=NULL;
// uint32_t u32val; EWBField *pFld=NULL;
// float f32val; uint32_t u32val;
// bool ret=true; float f32val;
// bool ret=true;
// TRACE_CHECK_PTR(node,false);
// TRACE_CHECK_PTR(pPrh,false);
// for(size_t i=0;i<fldPrms.size();i++)
// { for(size_t i=0;i<fldPrms.size();i++)
// if(fldPrms[i].pFld==NULL) continue; {
//
// while((reg=node->getNextReg(reg))!=NULL) if(fldPrms[i].pPrm==NULL) continue;
// { pFld=fldPrms[i].pPrm->castField();
// if(reg!=fldPrms[i].pFld->getReg()) continue; if(pFld==NULL) continue;
//
// if(fldPrms[i].pFld->getType()==WBField::WBF_32U) while((reg=pPrh->getNextReg(reg))!=NULL)
// { {
// ret &= fldPrms[i].pFld->convert(&u32val,true);
// ret &= setIntegerParam(i,u32val); if(reg!=pFld->getReg()) continue;
// }
// else if(pFld->getType() & EWBParam::EWBF_TM_FIXED_POINT)
// { {
// ret &= fldPrms[i].pFld->convert(&f32val,true); ret &= pFld->convert(&f32val,true);
// ret &= setDoubleParam(i,f32val); ret &= setDoubleParam(i,f32val);
// } }
// } else
// } {
// return ret; ret &= pFld->convert(&u32val,true);
//} ret &= setIntegerParam(i,u32val);
}
}
}
return ret;
}
...@@ -87,7 +87,8 @@ protected: ...@@ -87,7 +87,8 @@ protected:
asynStatus createParam(EWBField *fld, int *index=NULL,int syncmode=AWB_SYNC_DEVICE); asynStatus createParam(EWBField *fld, int *index=NULL,int syncmode=AWB_SYNC_DEVICE);
asynStatus createParam(const char *name, EWBParam *pPrm, int *index=NULL, int syncmode=AWB_SYNC_DEVICE); asynStatus createParam(const char *name, EWBParam *pPrm, int *index=NULL, int syncmode=AWB_SYNC_DEVICE);
asynStatus createParam(const char *name, asynParamType type,int *index=NULL,int syncmode=AWB_SYNC_PRMLIST); asynStatus createParam(const char *name, asynParamType type,int *index=NULL,int syncmode=AWB_SYNC_PRMLIST);
//bool cvtWBNodetoPrmList(WBNode *node);
bool setParams(EWBPeriph *pPrh);
int getParamIndex(const char *name); int getParamIndex(const char *name);
EWBBus *pRoot; //!< pointer on the WB root tree structure. EWBBus *pRoot; //!< pointer on the WB root tree structure.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <EWBBus.h> #include <EWBBus.h>
#define TRACE_P_VDEBUG(...) TRACE_P_DEBUG( __VA_ARGS__) #define TRACE_P_VDEBUG(...) //TRACE_P_DEBUG( __VA_ARGS__)
#define TRACE_P_VVDEBUG(...) //TRACE_P_DEBUG( __VA_ARGS__) #define TRACE_P_VVDEBUG(...) //TRACE_P_DEBUG( __VA_ARGS__)
#define BUFF_MAX_SIZEB 4096 //Size in bytes #define BUFF_MAX_SIZEB 4096 //Size in bytes
......
...@@ -7,4 +7,4 @@ ...@@ -7,4 +7,4 @@
#include "EWBParam.h" #include "EWBParam.h"
//For the moment the object will be empty.
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "EWBField.h" #include "EWBField.h"
#include "EWBReg.h" #include "EWBReg.h"
#include "EWBBus.h" #include "EWBBus.h"
#include "EWBBridge.h"
#include <string> #include <string>
...@@ -20,6 +21,9 @@ ...@@ -20,6 +21,9 @@
int EWBPeriph::sCount=0; int EWBPeriph::sCount=0;
#define TRACE_P_VDEBUG(...) //TRACE_P_DEBUG( __VA_ARGS__)
#define TRACE_P_VVDEBUG(...) //TRACE_P_DEBUG( __VA_ARGS__)
/** /**
* Constructor for a EWBPeriph * Constructor for a EWBPeriph
* *
...@@ -157,146 +161,148 @@ bool EWBPeriph::sync(EWBSync::AMode amode) { ...@@ -157,146 +161,148 @@ bool EWBPeriph::sync(EWBSync::AMode amode) {
return ret; return ret;
} }
///** /**
// * Sync EWBPeriph using DMA buffer * Sync EWBPeriph using DMA buffer
// * *
// * To write/read in a fast way we can use the DMA memory connection. * To write/read in a fast way we can use the DMA memory connection.
// * - In write mode: we fill all our EWBPeriph structure into a buffer that is * - In write mode: we fill all our EWBPeriph structure into a buffer that is
// * send to the device at a specified offset. * send to the device at a specified offset.
// * - In read mode: we get a specific piece of memory using DMA and we then * - In read mode: we get a specific piece of memory using DMA and we then
// * extract the value from the buffer to the EWBPeriph structure * extract the value from the buffer to the EWBPeriph structure
// * *
// * \param[in] con An abstract class to connect to the memory. * \param[in] con An abstract class to connect to the memory.
// * \param[in] amode The operation mode (R,W,RW) * \param[in] amode The operation mode (R,W,RW)
// * \param[in] dma_dev_offset The position on the device where we are going to * \param[in] dma_dev_offset The position on the device where we are going to
// * perform the R/W. By setting EWB_NODE_DMA_OWNADDR, the address define for * perform the R/W. By setting EWB_NODE_DMA_OWNADDR, the address define for
// * the node is used. * the node is used.
// * \return true if everything ok, false otherwise. * \return true if everything ok, false otherwise.
// * *
// */ */
//bool EWBPeriph::sync(EWBSync::AMode amode, uint32_t dma_dev_offset) bool EWBPeriph::sync(EWBSync::AMode amode, uint32_t dma_dev_offset)
//{ {
// bool ret=true; bool ret=true;
// uint32_t *pData32, prh_bsize, ker_bsize; uint32_t *pData32, prh_bsize, ker_bsize;
// TRACE_CHECK_PTR(con,false); TRACE_CHECK(isValid(),"isValid()",false);
// if(dma_dev_offset==EWB_NODE_MEMBCK_OWNADDR) dma_dev_offset=offset; if(dma_dev_offset==EWB_NODE_MEMBCK_OWNADDR) dma_dev_offset=this->getOffset(true);
//
// //Check if the latest register has the latest size. //Check if the latest register has the latest size.
// prh_bsize=getLastReg()->getOffset()+4; prh_bsize=getLastReg()->getOffset()+4;
//
// TRACE_P_DEBUG("%s 0x%08X + [0x0,0x%X] (DMA sync)",getCName(),dma_dev_offset,getLastReg()->getOffset()); TRACE_P_DEBUG("%s 0x%08X + [0x0,0x%X] (DMA sync)",getCName(),dma_dev_offset,getLastReg()->getOffset());
// EWBBridge *pBgd=this->getBridge();
// //first write to dev
// if(amode & EWB_AM_W) //first write to dev
// { if(amode & EWB_AM_W)
// //Get the internal to_dev buffer {
// ker_bsize=con->get_block_buffer(&pData32,true); //Get the internal to_dev buffer
// if(prh_bsize>ker_bsize) return false; ker_bsize=pBgd->get_block_buffer(&pData32,true);
// if(prh_bsize>ker_bsize) return false;
// //Fill it with the data of all registers
// for(std::map<uint32_t,EWBReg*>::iterator ii=registers.begin(); ii!=registers.end(); ++ii) //Fill it with the data of all registers
// { for(std::map<uint32_t,EWBReg*>::iterator ii=registers.begin(); ii!=registers.end(); ++ii)
// pData32[(*ii).first/sizeof(uint32_t)]=((*ii).second)->getData(); {
// } pData32[(*ii).first/sizeof(uint32_t)]=((*ii).second)->getData();
// }
// //send it to the device
// ret &= con->mem_block_access(dma_dev_offset,prh_bsize,true); //Write buffer to dev //send it to the device
// } ret &= pBgd->mem_block_access(dma_dev_offset,prh_bsize,true); //Write buffer to dev
// }
// //then read from dev
// if(amode & EWB_AM_R) //then read from dev
// { if(amode & EWB_AM_R)
// //fill the user space buffer from the memory device {
// ret &= con->mem_block_access(dma_dev_offset,prh_bsize,false); //Read buffer from dev //fill the user space buffer from the memory device
// ret &= pBgd->mem_block_access(dma_dev_offset,prh_bsize,false); //Read buffer from dev
// //Get the internal from_dev kernel buffer
// ker_bsize=con->get_block_buffer(&pData32,false); //Get the internal from_dev kernel buffer
// TRACE_CHECK_VA(prh_bsize<=ker_bsize,false,"size of periph is %d bytes (max=%d)",prh_bsize,ker_bsize); ker_bsize=pBgd->get_block_buffer(&pData32,false);
// TRACE_CHECK_VA(prh_bsize<=ker_bsize,false,"size of periph is %d bytes (max=%d)",prh_bsize,ker_bsize);
// //Extract each value to the corresponding register
// for(std::map<uint32_t,EWBReg*>::iterator ii=registers.begin(); ii!=registers.end(); ++ii) //Extract each value to the corresponding register
// { for(std::map<uint32_t,EWBReg*>::iterator ii=registers.begin(); ii!=registers.end(); ++ii)
// ((*ii).second)->data=pData32[(*ii).first/sizeof(uint32_t)]; {
// TRACE_P_VDEBUG("%20s @0x%08X (%02d) <= 0x%x",((*ii).second)->getCName(), ((*ii).second)->data=pData32[(*ii).first/sizeof(uint32_t)];
// ((*ii).second)->getOffset(true),(*ii).first/sizeof(uint32_t), TRACE_P_VDEBUG("%20s @0x%08X (%02d) <= 0x%x",((*ii).second)->getCName(),
// ((*ii).second)->getData()); ((*ii).second)->getOffset(true),(*ii).first/sizeof(uint32_t),
// } ((*ii).second)->getData());
// }
// }
// return ret; }
//} return ret;
///** }
// * Sync EWBPeriph using internal memory
// * /**
// * This method is similar as EWBPeriph::sync(EWBMemCon,EWBSync::AMode,uint32_t) method * Sync EWBPeriph using internal memory
// * except that here have direct access to the internal/kernel buffer that is going *
// * to be used with the EWBMemCon. * This method is similar as EWBPeriph::sync(EWBMemCon,EWBSync::AMode,uint32_t) method
// * * except that here have direct access to the internal/kernel buffer that is going
// * If we want to partially sync the memory with our EWBPeriph this is the method * to be used with the EWBMemCon.
// * to use. For example if we want to read only the the words (32bits) 0x10 to 0x16 *
// * from the internal buffer to our EWBPeriph we should perform the following: * If we want to partially sync the memory with our EWBPeriph this is the method
// * * to use. For example if we want to read only the the words (32bits) 0x10 to 0x16
// * <code> * from the internal buffer to our EWBPeriph we should perform the following:
// * uint32_t *pData32, r_bsize; *
// * //First setup the internal buffer from the device * <code>
// * pCon->mem_block_access(pNode->getAddress(),pNode->getLastReg()->getOffset()/sizeof(uint32_t),false); * uint32_t *pData32, r_bsize;
// * r_bsize=pCon->get_block_buffer(&pData32,false); * //First setup the internal buffer from the device
// * //Then read from the internal buffer to the EWBPeriph only words [0x10-0x16] * pCon->mem_block_access(pNode->getAddress(),pNode->getLastReg()->getOffset()/sizeof(uint32_t),false);
// * pNode->sync(pData32,0x6,EWB_AM_R,0x10); * r_bsize=pCon->get_block_buffer(&pData32,false);
// * </code> * //Then read from the internal buffer to the EWBPeriph only words [0x10-0x16]
// * * pNode->sync(pData32,0x6,EWB_AM_R,0x10);
// * \param[in] pData32 Pointer on an internal buffer. * </code>
// * \param[in] bsize Size of the buffer that we want to R/W in bytes *
// * \param[in] amode The operation mode (R,W,RW) * \param[in] pData32 Pointer on an internal buffer.
// * \param[in] doffset Offset on the data buffer and its correspondence in registers of EWBPeriph (bytes). * \param[in] bsize Size of the buffer that we want to R/W in bytes
// * \return true if everything ok, false otherwise. * \param[in] amode The operation mode (R,W,RW)
// * * \param[in] doffset Offset on the data buffer and its correspondence in registers of EWBPeriph (bytes).
// */ * \return true if everything ok, false otherwise.
//bool EWBPeriph::sync(uint32_t* pData32, uint32_t bsize, EWBSync::AMode amode, uint32_t doffset) *
//{ */
// bool ret=true; bool EWBPeriph::sync(uint32_t* pData32, uint32_t bsize, EWBSync::AMode amode, uint32_t doffset)
// uint32_t prh_bsize; {
// TRACE_CHECK_PTR(pData32,false); bool ret=true;
// uint32_t prh_bsize;
// //Check if the latest register has the latest size. TRACE_CHECK_PTR(pData32,false);
// prh_bsize=getLastReg()->getOffset()+4;
// bsize=std::min(prh_bsize-doffset,bsize); //Check if the latest register has the latest size.
// TRACE_CHECK_VA((doffset+4)<=prh_bsize,false, prh_bsize=getLastReg()->getOffset()+4;
// "Size overflow: offset=%d+4 > prh_bsize=%d", bsize=std::min(prh_bsize-doffset,bsize);
// doffset,prh_bsize); TRACE_CHECK_VA((doffset+4)<=prh_bsize,false,
// "Size overflow: offset=%d+4 > prh_bsize=%d",
// TRACE_P_DEBUG("%s 0x%08X + [0x%x,0x%X] (DataBuff)",getCName(),(uint32_t)pData32,doffset,doffset+bsize); doffset,prh_bsize);
//
// //first write to buffer TRACE_P_DEBUG("%s 0x%08X + [0x%x,0x%X] (DataBuff)",getCName(),(uint32_t)pData32,doffset,doffset+bsize);
// if(amode & EWB_AM_W)
// { //first write to buffer
// //Fill it with the data of all registers if(amode & EWB_AM_W)
// for(std::map<uint32_t,EWBReg*>::iterator ii=registers.begin(); ii!=registers.end(); ++ii) {
// { //Fill it with the data of all registers
// if(doffset <= (*ii).first && (*ii).first <= doffset+bsize) for(std::map<uint32_t,EWBReg*>::iterator ii=registers.begin(); ii!=registers.end(); ++ii)
// pData32[(*ii).first/sizeof(uint32_t)]=((*ii).second)->getData(); {
// } if(doffset <= (*ii).first && (*ii).first <= doffset+bsize)
// } pData32[(*ii).first/sizeof(uint32_t)]=((*ii).second)->getData();
// }
// //then read from buffer }
// if(amode & EWB_AM_R)
// { //then read from buffer
// if(amode & EWB_AM_R)
// //Extract each value to the corresponding register {
// for(std::map<uint32_t,EWBReg*>::iterator ii=registers.begin(); ii!=registers.end(); ++ii)
// { //Extract each value to the corresponding register
// if(doffset <= (*ii).first && (*ii).first <= doffset+bsize) for(std::map<uint32_t,EWBReg*>::iterator ii=registers.begin(); ii!=registers.end(); ++ii)
// { {
// ((*ii).second)->data=pData32[(*ii).first/sizeof(uint32_t)]; if(doffset <= (*ii).first && (*ii).first <= doffset+bsize)
// TRACE_P_VDEBUG("%20s @0x%08X (%02d) <= 0x%x",((*ii).second)->getCName(), {
// ((*ii).second)->getOffset(true),(*ii).first/sizeof(uint32_t), ((*ii).second)->data=pData32[(*ii).first/sizeof(uint32_t)];
// ((*ii).second)->getData()); TRACE_P_VDEBUG("%20s @0x%08X (%02d) <= 0x%x",((*ii).second)->getCName(),
// } ((*ii).second)->getOffset(true),(*ii).first/sizeof(uint32_t),
// } ((*ii).second)->getData());
// }
// } }
// return ret;
//} }
return ret;
}
/** /**
......
...@@ -20,7 +20,14 @@ class EWBReg; ...@@ -20,7 +20,14 @@ class EWBReg;
#define EWB_NODE_MEMBCK_OWNADDR 0xFFFFFFFF //!< Used by WBNode::sync() #define EWB_NODE_MEMBCK_OWNADDR 0xFFFFFFFF //!< Used by WBNode::sync()
#define WB2_PRH_ARGS(pname,offset) \ #define WB2_PRH_ARGS(pname) \
WB2_##pname##_PERIPH_PREFIX, \
WB2_##pname##_PERIPH_OFFSET, \
WB2_##pname##_PERIPH_VENID, \
WB2_##pname##_PERIPH_DEVID, \
WB2_##pname##_PERIPH_DESC
#define WB2_PRH_ARGS_OFFSET(pname,offset) \
WB2_##pname##_PERIPH_PREFIX, \ WB2_##pname##_PERIPH_PREFIX, \
offset, \ offset, \
WB2_##pname##_PERIPH_VENID, \ WB2_##pname##_PERIPH_VENID, \
...@@ -44,8 +51,8 @@ public: ...@@ -44,8 +51,8 @@ public:
EWBReg* getLastReg() const { return (registers.size()>0)?registers.rbegin()->second:NULL; } //!< Get the highest WBReg in the node. EWBReg* getLastReg() const { return (registers.size()>0)?registers.rbegin()->second:NULL; } //!< Get the highest WBReg in the node.
bool sync(EWBSync::AMode amode=EWB_AM_RW); bool sync(EWBSync::AMode amode=EWB_AM_RW);
// bool sync(EWBSync::AMode amode, uint32_t dma_dev_offset=WB_NODE_MEMBCK_OWNADDR); bool sync(EWBSync::AMode amode, uint32_t dma_dev_offset=EWB_NODE_MEMBCK_OWNADDR);
// bool sync(uint32_t* pData32, uint32_t length, EWBSync::AMode amode, uint32_t doffset=0); bool sync(uint32_t* pData32, uint32_t length, EWBSync::AMode amode, uint32_t doffset=0);
bool isValid(int level=-1) const { return (level!=0)?(bus && bus->isValid(level-1)):bus!=NULL; } //!< Return true when all pointers are defined bool isValid(int level=-1) const { return (level!=0)?(bus && bus->isValid(level-1)):bus!=NULL; } //!< Return true when all pointers are defined
bool isID(uint64_t venID, uint32_t devID) const { return (venID==this->venID && devID==this->devID); } bool isID(uint64_t venID, uint32_t devID) const { return (venID==this->venID && devID==this->devID); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment