• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ RawMove函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中RawMove函数的典型用法代码示例。如果您正苦于以下问题:C++ RawMove函数的具体用法?C++ RawMove怎么用?C++ RawMove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了RawMove函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AllocateMgmtTxBuffer

/*****************************************************************************
  Function:
    BOOL AllocateMgmtTxBuffer(uint16_t bytesNeeded)

  Summary:
    Allocates a Mgmt Tx buffer

  Description:
    Determines if WiFi chip has enough memory to allocate a tx mgmt buffer, and,
    if so, allocates it.

  Precondition:
    None

  Parameters:
    bytesNeeded -- number of bytes needed for the mgmt tx message

  Returns:
    True if mgmt tx buffer successfully allocated, else False

  Remarks:
    None
*****************************************************************************/
bool AllocateMgmtTxBuffer(uint16_t bytesNeeded)
{
    uint16_t bufAvail;
    uint16_t byteCount;

    /* get total bytes available for MGMT tx memory pool */
    bufAvail = Read16BitWFRegister(WF_HOST_WFIFO_BCNT1_REG) & 0x0fff; /* LS 12 bits contain length */

    /* if enough bytes available to allocate */
    if ( bufAvail >= bytesNeeded )
    {
        /* allocate and create the new Mgmt Tx buffer */
        byteCount = RawMove(RAW_MGMT_TX_ID, RAW_MGMT_POOL, true, bytesNeeded);
        if (byteCount == 0)
        {
             EventEnqueue(WF_EVENT_ERROR, UD_ERROR_MGMT_BUFFER_ALLOCATION_FAILED);
             return false;
        }
        ClearIndexOutOfBoundsFlag(RAW_MGMT_TX_ID);
        return true;
    }
    /* else not enough bytes available at this time to satisfy request */
    else
    {
        /* if we allocated some bytes, but not enough, then deallocate what was allocated */
        if (bufAvail > 0)
        {
            RawMove(RAW_MGMT_RX_ID, RAW_MGMT_POOL, false, 0);
        }
        return false;
    }
}
开发者ID:logansam,项目名称:WS2812WearableDemo,代码行数:55,代码来源:wf_raw.c


示例2: AllocateMgmtTxBuffer

/*****************************************************************************
  Function:
	BOOL AllocateMgmtTxBuffer(UINT16 bytesNeeded)

  Summary:
	Allocates a Mgmt Tx buffer

  Description:
    Determines if WiFi chip has enough memory to allocate a tx mgmt buffer, and, 
    if so, allocates it.

  Precondition:
	None

  Parameters:
	bytesNeeded -- number of bytes needed for the mgmt tx message
	             
  Returns:
  	True if mgmt tx buffer successfully allocated, else False
  	
  Remarks:
	None
*****************************************************************************/
BOOL AllocateMgmtTxBuffer(UINT16 bytesNeeded)
{
    UINT16 bufAvail;
    UINT16 byteCount;

    /* get total bytes available for MGMT tx memory pool */
    bufAvail = Read16BitWFRegister(WF_HOST_WFIFO_BCNT1_REG) & 0x0fff; /* LS 12 bits contain length */                    
    
    /* if enough bytes available to allocate */
    if ( bufAvail >= bytesNeeded )
    {
        /* allocate and create the new Mgmt Tx buffer */
        byteCount = RawMove(RAW_MGMT_TX_ID, RAW_MGMT_POOL, TRUE, bytesNeeded);
        WF_ASSERT(byteCount != 0);
        return TRUE;
    }
    /* else not enough bytes available at this time to satisfy request */
    else
    {
        /* if we allocated some bytes, but not enough, then dealloacate what was allocated */
        if (bufAvail > 0)
        {
            RawMove(RAW_MGMT_RX_ID, RAW_MGMT_POOL, FALSE, 0);
        }    
        return FALSE;
    }
}    
开发者ID:garyStofer,项目名称:wifi_wx_station,代码行数:50,代码来源:WFDriverRaw_24G.c


示例3: AllocateDataTxBuffer

/*****************************************************************************
  Function:
	BOOL AllocateDataTxBuffer(UINT16 bytesNeeded)

  Summary:
	Allocates a Data Tx buffer for use by the TCP/IP stack.

  Description:
    Determines if WiFi chip has enough memory to allocate a tx data buffer, and, 
    if so, allocates it.

  Precondition:
	None

  Parameters:
	bytesNeeded -- number of bytes needed for the data tx message
	             
  Returns:
  	True if data tx buffer successfully allocated, else False
  	
  Remarks:
	None
*****************************************************************************/
BOOL AllocateDataTxBuffer(UINT16 bytesNeeded)
{
    UINT16 bufAvail;
    UINT16 byteCount;
    
    WF_ASSERT(GetRawWindowState(RAW_DATA_TX_ID) != WF_RAW_DATA_MOUNTED);
    
    /* Ensure the MRF24W is awake (only applies if PS-Poll was enabled) */
    EnsureWFisAwake();

    
    /* get total bytes available for DATA tx memory pool */
    bufAvail = Read16BitWFRegister(WF_HOST_WFIFO_BCNT0_REG) & 0x0fff; /* LS 12 bits contain length */                    
    
    /* if enough bytes available to allocate */
    if ( bufAvail >= bytesNeeded )
    {
        /* allocate and create the new Tx buffer (mgmt or data) */
        byteCount = RawMove(RAW_DATA_TX_ID, RAW_DATA_POOL, TRUE, bytesNeeded);
        WF_ASSERT(byteCount != 0);
        
        /* flag this raw window as mounted (in use) */
        SetRawWindowState(RAW_DATA_TX_ID, WF_RAW_DATA_MOUNTED);
        return TRUE;

    }
    /* else not enough bytes available at this time to satisfy request */
    else
    {
        return FALSE;
    }

}    
开发者ID:garyStofer,项目名称:wifi_wx_station,代码行数:56,代码来源:WFDriverRaw_24G.c


示例4: AllocateDataTxBuffer

/*****************************************************************************
  Function:
    bool AllocateDataTxBuffer(uint16_t bytesNeeded)

  Summary:
    Allocates a Data Tx buffer for use by the TCP/IP stack.

  Description:
    Determines if WiFi chip has enough memory to allocate a tx data buffer, and,
    if so, allocates it.

  Precondition:
    None

  Parameters:
    bytesNeeded -- number of bytes needed for the data tx message

  Returns:
    True if data tx buffer successfully allocated, else False

  Remarks:
    None
*****************************************************************************/
bool AllocateDataTxBuffer(uint16_t bytesNeeded)
{
    uint16_t bufAvail;
    uint16_t byteCount;

    /* get total bytes available for DATA tx memory pool */
    bufAvail = Read16BitWFRegister(WF_HOST_WFIFO_BCNT0_REG) & 0x0fff; /* LS 12 bits contain length */

    /* if enough bytes available to allocate */
    if ( bufAvail >= bytesNeeded )
    {
        /* allocate and create the new Tx buffer (mgmt or data) */
        byteCount = RawMove(RAW_DATA_TX_ID, RAW_DATA_POOL, true, bytesNeeded);
        if (byteCount == 0)
        {
            EventEnqueue(WF_EVENT_ERROR, UD_TX_ALLOCATION_FAILED);
            return false;
        }

        /* flag this raw window as mounted (in use) */
        SetRawDataWindowState(RAW_DATA_TX_ID, WF_RAW_DATA_MOUNTED);
        return true;
    }
    /* else not enough bytes available at this time to satisfy request */
    else
    {
        return false;
    }
}
开发者ID:logansam,项目名称:WS2812WearableDemo,代码行数:52,代码来源:wf_raw.c


示例5: RawSendTxBuffer

/* If a data message mounted in RAW window then will be transmitted to 802.11 network */
void RawSendTxBuffer(UINT16 len)
{
    RawMove(RAW_TX_ID, RAW_MAC, FALSE, len);
    RawWindowReady[RAW_TX_ID] = FALSE;
    SetRawWindowState(RAW_TX_ID, WF_RAW_UNMOUNTED);

} 
开发者ID:guillaume9433,项目名称:Microchip,代码行数:8,代码来源:WFDriverRaw.c


示例6: DeallocateDataRxBuffer

/*****************************************************************************
  Function:
    void DeallocateDataRxBuffer(void)

  Summary:
    Deallocates a Data Rx buffer

  Description:
    Typically called by MACGetHeader(), the assumption being that when the stack
    is checking for a newly received data message it is finished with the previously
    received data message.  Also called by MACGetHeader() if the SNAP header is invalid
    and the packet is thrown away.

  Precondition:
    None

  Parameters:
    None
                 
  Returns:
    None
      
  Remarks:
    None
*****************************************************************************/
void DeallocateDataRxBuffer(void)
{
    EnsureWFisAwake();

    /* perform deallocation of raw rx buffer */
    RawMove(RAW_DATA_RX_ID, RAW_DATA_POOL, false, 0);
}    
开发者ID:ufanders,项目名称:wordClock,代码行数:32,代码来源:drv_wifi_raw.c


示例7: ScratchMount

/*
 * Mounts RAW scratch window.
 * Returns size, in bytes, of Scratch buffer.
 *
 * The scratch window is not dynamically allocated, but references a static
 * portion of the WiFi device RAM. Thus, the Scratch data is not lost when
 * the scratch window is unmounted.
 *
 * Parameters:
 *  rawId -- RAW window ID being used to mount the scratch data
 */
uint16_t ScratchMount(uint8_t rawId)
{
    uint16_t byteCount;

    byteCount = RawMove(rawId, RAW_SCRATCH_POOL, true, 0);
    return byteCount;
}
开发者ID:denrusio,项目名称:vak-opensource,代码行数:18,代码来源:wf_raw.c


示例8: AllocateMgmtTxBuffer

bool AllocateMgmtTxBuffer(uint16_t bytesNeeded)
{
    uint16_t bufAvail;
    uint16_t byteCount;

    /* get total bytes available for MGMT tx memory pool */
    bufAvail = Read16BitWFRegister(WF_HOST_WFIFO_BCNT1_REG) & 0x0fff; /* LS 12 bits contain length */

    /* if enough bytes available to allocate */
    if ( bufAvail >= bytesNeeded )
    {
        /* allocate and create the new Tx buffer (mgmt or data) */
        byteCount = RawMove(RAW_TX_ID, RAW_MGMT_POOL, true, bytesNeeded);
        if (byteCount == 0)
            return false; // just return and let host retry again
    }
    /* else not enough bytes available at this time to satisfy request */
    else
    {
        return false;
    }

    RawWindowReady[RAW_TX_ID] = true;
    SetRawWindowState(RAW_TX_ID, WF_RAW_MGMT_MOUNTED);

    return true;
}
开发者ID:243-510-MA,项目名称:243-510-A15,代码行数:27,代码来源:drv_wifi_raw.c


示例9: AllocateMgmtTxBuffer

BOOL AllocateMgmtTxBuffer(UINT16 bytesNeeded)
{
    UINT16 bufAvail;
    UINT16 byteCount;
    
    /* get total bytes available for MGMT tx memory pool */
    bufAvail = Read16BitWFRegister(WF_HOST_WFIFO_BCNT1_REG) & 0x0fff; /* LS 12 bits contain length */                    
    
    /* if enough bytes available to allocate */
    if ( bufAvail >= bytesNeeded )
    {
        /* allocate and create the new Tx buffer (mgmt or data) */
        byteCount = RawMove(RAW_TX_ID, RAW_MGMT_POOL, TRUE, bytesNeeded);
        WF_ASSERT(byteCount != 0);
    }
    /* else not enough bytes available at this time to satisfy request */
    else
    {
        return FALSE;
    }
    
    RawWindowReady[RAW_TX_ID] = TRUE;
    SetRawWindowState(RAW_TX_ID, WF_RAW_MGMT_MOUNTED);
    
    return TRUE;
}    
开发者ID:guillaume9433,项目名称:Microchip,代码行数:26,代码来源:WFDriverRaw.c


示例10: PopRawWindow

/*****************************************************************************
  Function:
	UINT16 PopRawWindow(UINT8 rawId)

  Summary:
	Pops a Raw window

  Description:
    Each RAW window can have its context saved in a 'stack' that is one level 
    deep.  When this function is called the saved context is restored and reads
    and writes to the window are operational.  The currently mounted window state
    is lost.

  Precondition:
	None

  Parameters:
	rawId -- RAW window that is being popped
	             
  Returns:
  	Byte count of the RAW window buffer being restored.  If no context has 
  	been saved this function returns a 0.
  	
  Remarks:
	None
*****************************************************************************/
UINT16 PopRawWindow(UINT8 rawId)
{
    UINT16 byteCount;

    byteCount = RawMove(rawId, RAW_STACK_MEM, TRUE, 0);

    return byteCount;
}
开发者ID:garyStofer,项目名称:wifi_wx_station,代码行数:34,代码来源:WFDriverRaw_24G.c


示例11: ScratchMount

/*****************************************************************************
  Function:
	UINT16 ScratchMount(UINT8 rawId)

  Summary:
	Mounts RAW scratch window

  Description:
    The scratch window is not dynamically allocated, but references a static
    portion of the WiFi device RAM. Thus, the Scratch data is not lost when
    the scratch window is unmounted.

  Precondition:
	None

  Parameters:
	rawId -- RAW window ID being used to mount the scratch data
	             
  Returns:
  	Size, in bytes, of Scratch buffer
  	
  Remarks:
	None
*****************************************************************************/
UINT16 ScratchMount(UINT8 rawId)
{
    UINT16 byteCount;

    byteCount = RawMove(rawId, RAW_SCRATCH_POOL, TRUE, 0);
    WF_ASSERT(byteCount > 0);  /* scratch mount should always return value > 0 */
    
    return byteCount;
}    
开发者ID:garyStofer,项目名称:wifi_wx_station,代码行数:33,代码来源:WFDriverRaw_24G.c


示例12: DeallocateDataRxBuffer

/*****************************************************************************
  Function:
    void DeallocateDataRxBuffer(void)

  Summary:
    Deallocates a Data Rx buffer

  Description:
    Typically called by MACGetHeader(), the assumption being that when the stack
    is checking for a newly received data message it is finished with the previously
    received data message.  Also called by MACGetHeader() if the SNAP header is invalid
    and the packet is thrown away.

  Precondition:
    None

  Parameters:
    None

  Returns:
    None

  Remarks:
    None
*****************************************************************************/
void DeallocateDataRxBuffer(void)
{
    // TODO: verify data rx is mounted

    SetRawDataWindowState(RAW_DATA_RX_ID, WF_RAW_UNMOUNTED);

    /* perform deallocation of raw rx buffer */
    RawMove(RAW_DATA_RX_ID, RAW_DATA_POOL, false, 0);
}
开发者ID:logansam,项目名称:WS2812WearableDemo,代码行数:34,代码来源:wf_raw.c


示例13: RawMountRxBuffer

/* mounts the most recent Rx message.  Could be a management or data message. */
uint16_t RawMountRxBuffer(void)
{
    uint16_t length;

    length = RawMove(RAW_RX_ID, RAW_MAC, true, 0);

    RawWindowReady[RAW_RX_ID] = true;
    SetRawWindowState(RAW_RX_ID, WF_RAW_DATA_MOUNTED);

    return length;
}
开发者ID:243-510-MA,项目名称:243-510-A15,代码行数:12,代码来源:drv_wifi_raw.c


示例14: RawMountRxBuffer

/* mounts the most recent Rx message.  Could be a management or data message. */
UINT16 RawMountRxBuffer(void)
{
    UINT16 length;
    
    length = RawMove(RAW_RX_ID, RAW_MAC, TRUE, 0);
    
    RawWindowReady[RAW_RX_ID] = TRUE;
    SetRawWindowState(RAW_RX_ID, WF_RAW_DATA_MOUNTED);
    
    
    return length;
} 
开发者ID:guillaume9433,项目名称:Microchip,代码行数:13,代码来源:WFDriverRaw.c


示例15: RawToRawCopy

/*****************************************************************************
  Function:
	void RawToRawCopy(UINT8 rawDestId, UINT8 rawSourceId, UINT16 length)

  Summary:
	Performs a data copy from one raw window to another.

  Description:
    There is an additional step needed before invoking RawMove(); need to 
    write the source and destination values to ScratchPad0 register so that
    the information is there before the WiFi chip starts the copy operation.

  Precondition:
	None

  Parameters:
	rawDestId   -- RAW ID that is the destination of copy
	rawSourceId -- RAW ID that is the source of copy
	length      -- number of bytes to copy from source to destination
	             
  Returns:
  	None
  	
  Remarks:
	None
*****************************************************************************/
void RawToRawCopy(UINT8 rawDestId, UINT8 rawSourceId, UINT16 length)
{
    /* write source and destination address to scratchpad 0 register. The WiFi firmware */
    /* will get these values when it starts processing the raw move operation and       */
    /* determines a raw copy operation is taking place.                                 */
    Write16BitWFRegister(WF_INDEX_ADDR_REG, WF_SCRATCHPAD_0_REG);     
    Write16BitWFRegister(WF_INDEX_DATA_REG, (((UINT16)rawSourceId << 8) | (UINT16)rawDestId));

    /* always perform the actual move on RAW 0, the firmware will check the scratchpad register */
    /* for the actual source and destination                                                    */
    RawMove(RAW_ID_0, RAW_COPY, TRUE, length);
}          
开发者ID:garyStofer,项目名称:wifi_wx_station,代码行数:38,代码来源:WFDriverRaw_24G.c


示例16: RawCalculateChecksum

UINT16 RawCalculateChecksum(UINT16 length)
{
    UINT16 checksum;
    UINT8 rawId;
    
    rawId = GetReadPtrRawWindow(); /* get raw window id for window being pointed to by read pointer */
    
    checksum = RawMove(rawId, RAW_COPY, FALSE, length); /* this raw move instructs the firmware to do a checksum   */
                                                        /* for 'length' bytes starting at current raw window index */
    
    return checksum;
    
} 
开发者ID:garyStofer,项目名称:wifi_wx_station,代码行数:13,代码来源:WFDriverRaw_24G.c


示例17: ScratchUnmount

/*
*********************************************************************************************************
*                                   ScratchUnmount()
*    
* Description : Unmounts Scratch from the specified RAW window.
*
* Argument(s) : rawId -- RAW window ID that scratch had been mounted to.
*
* Return(s)   : None
*
* Caller(s)   : WF Driver
*
* Notes:      : None
*
*********************************************************************************************************
*/
void ScratchUnmount(UINT8 rawId)
{
    RawMove(rawId, RAW_SCRATCH_POOL, FALSE, 0);
    if (rawId == RAW_RX_ID)
    {
        SetRawWindowState(RAW_RX_ID, WF_RAW_UNMOUNTED);
    }
    else
    {
        SetRawWindowState(RAW_TX_ID, WF_RAW_UNMOUNTED);        
    }    
        
}    
开发者ID:guillaume9433,项目名称:Microchip,代码行数:29,代码来源:WFDriverRaw.c


示例18: DeallocateDataRxBuffer

/*****************************************************************************
  Function:
	void DeallocateDataRxBuffer(void)

  Summary:
	Deallocates a Data Rx buffer

  Description:
    Typically called by MACGetHeader(), the assumption being that when the stack
    is checking for a newly received data message it is finished with the previously
    received data message.  Also called by MACGetHeader() if the SNAP header is invalid
    and the packet is thrown away.

  Precondition:
	None

  Parameters:
	None
	             
  Returns:
  	None
  	
  Remarks:
	None
*****************************************************************************/
void DeallocateDataRxBuffer(void)
{
    WF_ASSERT(GetRawWindowState(RAW_DATA_RX_ID) == WF_RAW_DATA_MOUNTED);
    
    /* perform deallocation of raw rx buffer */
    RawMove(RAW_DATA_RX_ID, RAW_DATA_POOL, FALSE, 0);

    /* set state flag */
    SetRawWindowState(RAW_DATA_RX_ID, WF_RAW_UNMOUNTED);
    
    /* the current length of the Rx data packet is now 0 (used by MAC) */
    SetRxDataPacketLength(0);
}    
开发者ID:garyStofer,项目名称:wifi_wx_station,代码行数:38,代码来源:WFDriverRaw_24G.c


示例19: ScratchMount

/*
*********************************************************************************************************
*                                   ScratchMount()
*
* Description : Mounts Scratch using the specified RAW window.
*
* Argument(s) : rawId -- desired RAW window to mount Scratch to.
*
* Return(s)   : None
*
* Caller(s)   : WF Driver
*
* Notes:      : None
*
*********************************************************************************************************
*/
uint16_t ScratchMount(uint8_t rawId)
{
    uint16_t byteCount;

    byteCount = RawMove(rawId, RAW_SCRATCH_POOL, true, 0);
    if (byteCount == 0)
    {
        /* work-around, somehow the scratch was already mounted to the other raw window */
        rawId = !rawId;
        //   WF_ASSERT(byteCount > 0);  /* scratch mount should always return value > 0 */
    }

    SetRawWindowState(rawId, WF_SCRATCH_MOUNTED);
    return byteCount;
}
开发者ID:243-510-MA,项目名称:243-510-A15,代码行数:31,代码来源:drv_wifi_raw.c


示例20: ScratchUnmount

/*
*********************************************************************************************************
*                                   ScratchUnmount()
*
* Description : Unmounts Scratch from the specified RAW window.
*
* Argument(s) : rawId -- RAW window ID that scratch had been mounted to.
*
* Return(s)   : None
*
* Caller(s)   : WF Driver
*
* Notes:      : None
*
*********************************************************************************************************
*/
void ScratchUnmount(uint8_t rawId)
{
    RawMove(rawId, RAW_SCRATCH_POOL, false, 0);

    SetRawWindowState(rawId, WF_RAW_UNMOUNTED);

//    if (rawId == RAW_RX_ID)
//    {
//        SetRawWindowState(RAW_RX_ID, WF_RAW_UNMOUNTED);
//    }
//    else
//    {
//        SetRawWindowState(RAW_TX_ID, WF_RAW_UNMOUNTED);
//    }

}
开发者ID:243-510-MA,项目名称:243-510-A15,代码行数:32,代码来源:drv_wifi_raw.c



注:本文中的RawMove函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ RawPointer函数代码示例发布时间:2022-05-30
下一篇:
C++ Rational函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap