本文整理汇总了C++中SetAddress函数的典型用法代码示例。如果您正苦于以下问题:C++ SetAddress函数的具体用法?C++ SetAddress怎么用?C++ SetAddress使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetAddress函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPixel
WORD GetPixel(SHORT x, SHORT y)
{
DWORD address;
WORD result;
#if (DISP_ORIENTATION == 0)
address = (long)LINE_MEM_PITCH * y + x;
#else
y = GetMaxY() - y;
address = (long)LINE_MEM_PITCH * x + y;
#endif
CS_LAT_BIT = 0;
SetAddress(address);
// Temporary change wait cycles for reading (250ns = 4 cycles)
#if defined(__C30__)
PMMODEbits.WAITM = 4;
#elif defined(__PIC32MX__)
PMMODEbits.WAITM = 8;
#else
#error Need wait states for the device
#endif
RS_LAT_BIT = 1;
// First RD cycle to move data from GRAM to Read Data Latch
result = PMDIN1;
while(PMMODEbits.BUSY);
// Second RD cycle to get data from Read Data Latch
result = PMDIN1;
while(PMMODEbits.BUSY);
// Disable LCD
CS_LAT_BIT = 1;
// Disable PMP
PMCONbits.PMPEN = 1;
// Read result
result = PMDIN1;
// Restore wait cycles for writing (60ns)
#if defined(__dsPIC33F__) || defined(__PIC24H__)
PMMODEbits.WAITM = 2;
#else
PMMODEbits.WAITM = 1;
#endif
// Enable PMP
PMCONbits.PMPEN = 1;
return (result);
}
示例2: GetPixel
/*********************************************************************
* Function: WORD GetPixel(SHORT x, SHORT y)
*
* PreCondition: none
*
* Input: x,y - pixel coordinates
*
* Output: pixel color
*
* Side Effects: none
*
* Overview: returns pixel color at x,y position
*
* Note: none
*
********************************************************************/
WORD GetPixel(SHORT x, SHORT y){
DWORD_VAL address;
WORD_VAL result;
#ifdef USE_PORTRAIT
address.Val = (long)LINE_MEM_PITCH*y + x;
#else
y = GetMaxY() - y;
address.Val = (long)LINE_MEM_PITCH*x + y;
#endif
CS_LAT_BIT = 0;
SetAddress(address.v[2],address.v[1],address.v[0]);
// Temporary change wait cycles for reading (250ns = 4 cycles)
PMMODEbits.WAITM = 4;
RS_LAT_BIT = 1;
// First RD cycle to move data from GRAM to Read Data Latch
result.v[1] = PMDIN1;
while(PMMODEbits.BUSY);
// Second RD cycle to move data from GRAM to Read Data Latch
result.v[1] = PMDIN1;
while(PMMODEbits.BUSY);
// First RD cycle to get data from Read Data Latch
// Read previous dummy value
result.v[1] = PMDIN1;
while(PMMODEbits.BUSY);
// Second RD cycle to get data from Read Data Latch
// Read MSB
result.v[1] = PMDIN1;
while(PMMODEbits.BUSY);
// Disable LCD
CS_LAT_BIT = 1;
// Disable PMP
PMCONbits.PMPEN = 1;
// Read LSB
result.v[0] = PMDIN1;
// Restore wait cycles for writing (60ns = 1 cycle)
PMMODEbits.WAITM = 1;
// Enable PMP
PMCONbits.PMPEN = 1;
return result.Val;
}
示例3: ClearDevice
/*********************************************************************
* Function: void ClearDevice(void)
*
* PreCondition: none
*
* Input: none
*
* Output: none
*
* Side Effects: none
*
* Overview: clears screen with current color
*
* Note: none
*
********************************************************************/
void ClearDevice(void){
DWORD counter;
CS_LAT_BIT = 0;
SetAddress(0);
for(counter=0; counter<(DWORD)(GetMaxX()+1)*(GetMaxY()+1); counter++){
WriteData(_color);
}
CS_LAT_BIT = 1;
}
示例4: SetAddress
bool
TCPIPPort::SetAddress(const String &address)
{
IPAddress listeningAddress;
if (!listeningAddress.TryParse(address))
return false;
SetAddress(listeningAddress);
return true;
}
示例5: FUNCTION_BEGIN
//-----------------------------------------------------------------------------------
// Purpose :
// Return :
//-----------------------------------------------------------------------------------
// Called by Worker TH ( IOCP )
//-----------------------------------------------------------------------------------
int CNtlConnection::CompleteAccept(DWORD dwTransferedBytes)
{
FUNCTION_BEGIN();
UNREFERENCED_PARAMETER( dwTransferedBytes );
SOCKADDR_IN * pLocalAddr = NULL;
SOCKADDR_IN * pRemoteAddr = NULL;
int nLocalAddrLen = 0;
int nRemoteAddrLen = 0;
m_socket.GetAcceptExSockaddrs( m_recvContext.wsabuf.buf,
0,
sizeof(SOCKADDR_IN) + 16,
sizeof(SOCKADDR_IN) + 16,
(SOCKADDR**) &pLocalAddr,
&nLocalAddrLen,
(SOCKADDR**) &pRemoteAddr,
&nRemoteAddrLen);
SetAddress( pLocalAddr, pRemoteAddr );
ZeroMemory( m_recvContext.wsabuf.buf, sizeof(SOCKADDR_IN) + 16 + sizeof(SOCKADDR_IN) + 16 );
m_bConnected = true;
int rc = m_pNetworkRef->Associate( this, true );
if( NTL_SUCCESS != rc )
{
NTL_LOGDL( LOG_NETWORK, "Session[%X] Associate Error[%d:%s]", this, rc, NtlGetErrorMessage(rc) );
return rc;
}
SetStatus( STATUS_ACTIVE );
m_dwConnectTime = GetTickCount();
m_pAcceptorRef->OnAccepted();
m_pNetworkRef->PostNetEventMessage( (WPARAM)NETEVENT_ACCEPT, (LPARAM)this );
rc = PostRecv();
if( NTL_SUCCESS != rc )
{
return rc;
}
//NTL_PRINT(PRINT_SYSTEM, "Session[%X]\tCompleteAccept Called Local[%s:%u] Remote[%s:%u]", pSession, GetLocalIP(), GetLocalPort(), GetRemoteIP(), GetRemotePort());
return NTL_SUCCESS;
}
示例6: GetContextAddress
void CodeViewWidget::OnFollowBranch()
{
const u32 addr = GetContextAddress();
u32 branch_addr = GetBranchFromAddress(addr);
if (!branch_addr)
return;
SetAddress(branch_addr, SetAddressUpdate::WithUpdate);
}
示例7: PutImage16BPP
/*********************************************************************
* Function: void PutImage16BPP(SHORT left, SHORT top, FLASH_BYTE* image, BYTE stretch)
*
* PreCondition: none
*
* Input: left,top - left top image corner, image - image pointer,
* stretch - image stretch factor
*
* Output: none
*
* Side Effects: none
*
* Overview: outputs hicolor image starting from left,top coordinates
*
* Note: image must be located in flash
*
********************************************************************/
void PutImage16BPP(SHORT left, SHORT top, FLASH_BYTE *image, BYTE stretch)
{
register DWORD address;
register FLASH_WORD *flashAddress;
register FLASH_WORD *tempFlashAddress;
WORD sizeX, sizeY;
register WORD x, y;
WORD temp;
register BYTE stretchX, stretchY;
// Move pointer to size information
flashAddress = (FLASH_WORD *)image + 1;
// Set start address
address = BUF_MEM_OFFSET + (long)LINE_MEM_PITCH * top + left;
// Read image size
sizeY = *flashAddress;
flashAddress++;
sizeX = *flashAddress;
flashAddress++;
DisplayEnable();
for(y = 0; y < sizeY; y++)
{
tempFlashAddress = flashAddress;
for(stretchY = 0; stretchY < stretch; stretchY++)
{
flashAddress = tempFlashAddress;
SetAddress(address);
for(x = 0; x < sizeX; x++)
{
// Read pixels from flash
temp = *flashAddress;
flashAddress++;
// Set color
SetColor(temp);
// Write pixel to screen
for(stretchX = 0; stretchX < stretch; stretchX++)
{
DeviceWrite(SETCOLOR_HIBYTE(_color));
DeviceWrite(SETCOLOR_LOWBYTE(_color));
}
}
address += LINE_MEM_PITCH;
}
}
DisplayDisable();
}
示例8: SetAddress
/* rcode 0 if no errors. rcode 01-0f is relayed from HRSL */
uint8_t USB::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data) {
EpInfo *pep = NULL;
uint16_t nak_limit = 0;
uint8_t rcode = SetAddress(addr, ep, &pep, nak_limit);
if(rcode)
return rcode;
return OutTransfer(pep, nak_limit, nbytes, data);
}
示例9: SetAddress
/* rcode 0 if no errors. rcode 01-0f is relayed from dispatchPkt(). Rcode f0 means RCVDAVIRQ error,
fe USB xfer timeout */
uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data) {
EpInfo *pep = NULL;
uint16_t nak_limit = 0;
uint8_t rcode = SetAddress(addr, ep, &pep, nak_limit);
if (rcode) {
//printf("SetAddress Failed");
return rcode;
}
return InTransfer(pep, nak_limit, nbytesptr, data);
}
示例10: GetActiveHTML
LRESULT CMainFrame::OnMDIActivate (WPARAM wParam, LPARAM lPAram)
{
m_wndClientArea.SendMessage (WM_MDIACTIVATE, wParam, lPAram);
CHtmlView* pView = GetActiveHTML ();
if (pView != NULL)
{
SetAddress (pView->GetLocationURL ());
}
return 0L;
}
示例11: memset
void
BNetworkAddress::SetTo(const in6_addr& inet6Address, uint16 port)
{
memset(&fAddress, 0, sizeof(sockaddr_storage));
fAddress.ss_family = AF_INET6;
fAddress.ss_len = sizeof(sockaddr_in6);
SetAddress(inet6Address);
SetPort(port);
fStatus = B_OK;
}
示例12: Init
bool ToSaMeshNode::Init(uint16_t newaddr) {
if (!SetAddress(newaddr))
return false;
while (addr == TOSA_MESH_NOADDRESS) {
SendDhcpRequest();
unsigned long resubmit = millis() + 15000; // ToDo : variable resubmit delay - here 15 seconds
while ((addr == TOSA_MESH_NOADDRESS) && (millis() < resubmit)) {
TickRx();
}
}
return true;
}
示例13: SetAddress
/* rcode 0 if no errors. rcode 01-0f is relayed from dispatchPkt(). Rcode f0 means RCVDAVIRQ error,
fe USB xfer timeout */
uint8_t UsbHost_::inTransfer( uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data)
{
EpInfo *pep = NULL;
uint16_t nak_limit = 0;
uint8_t rcode = SetAddress(addr, ep, &pep, nak_limit);
if (rcode)
return rcode;
return InTransfer(pep, nak_limit, nbytesptr, data);
}
示例14: ClearDevice
/*********************************************************************
* Function: void ClearDevice(void)
*
* PreCondition: none
*
* Input: none
*
* Output: none
*
* Side Effects: none
*
* Overview: clears screen with current color
*
* Note: none
*
********************************************************************/
void ClearDevice(void)
{
DWORD counter;
DisplayEnable();
SetAddress(0);
for(counter = 0; counter < (DWORD) (GetMaxX() + 1) * (GetMaxY() + 1); counter++)
{
WritePixel(_color);
}
DisplayDisable();
}
示例15: ClearDevice
/*********************************************************************
* Function: void ClearDevice(void)
*
* PreCondition: none
*
* Input: none
*
* Output: none
*
* Side Effects: none
*
* Overview: clears screen with current color
*
* Note: none
*
********************************************************************/
void ClearDevice(void)
{
DWORD counter;
DeviceSelect;
SetAddress(0, 0);
for(counter = 0; counter < (DWORD) (GetMaxX() + 1) * (GetMaxY() + 1); counter++)
{
WritePixel(_color);
}
DeviceDeselect;
}