亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fap.h

?? 非常全的nrf2401設計資料
?? H
?? 第 1 頁 / 共 2 頁
字號:
/* Copyright (c) 2007 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is property of Nordic Semiconductor ASA.
 * Terms and conditions of usage are described in detail in NORDIC
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 * $LastChangedRevision: 2290 $
 */ 

/** @file
 * Interface functions for the Frequency Agility Protocol.
 *
 * @author Lasse Olsen
 *
 * @defgroup nordic_protocol_fap Frequency Agility Protocol
 * @{ 
 * Implementation of frequency agility protocol for better robustness against
 * interference from co-existing radio frequency sources.  
 */
#ifndef FAP_H__
#define FAP_H__

#include <stdint.h>
#include <stdbool.h>
#include "fap_setup.h"
#include "fap_macros.h"
#include "hal_nrf.h"

//***************************************************************************** 
// FAP static parameters
//*****************************************************************************

#define FAP_DATARATE HAL_NRF_2MBPS    // 2Mbps datarate 

#define FAP_OUTPUT_POWER HAL_NRF_0DBM // 0 dBm output power 
#define FAP_CRC HAL_NRF_CRC_16BIT     // 16 bit CRC (maximum)
#define FAP_ADDRESS_WIDTH 5           // 5 byte address
#define FAP_LP_RX_LISTEN_PERIODS 1    // Low power RX on time                                       

#if(FAP_MAX_FW_PL_LENGTH > FAP_MAX_ACK_PL_LENGTH)
  #define FAP_MAX_PL_LENGTH FAP_MAX_FW_PL_LENGTH 
#else
  #define FAP_MAX_PL_LENGTH FAP_MAX_ACK_PL_LENGTH 
#endif
         
#if(FAP_MAX_ACK_PL_LENGTH > 15)
  #define FAP_AUTO_RETR_DELAY 500       
#else
  #define FAP_AUTO_RETR_DELAY 250       
#endif  

#define FAP_MAX_TX_PERIOD (130+37+(FAP_MAX_FW_PL_LENGTH*4)+FAP_AUTO_RETR_DELAY)    

//***************************************************************************** 
// Misc. macros
//*****************************************************************************

#define FAP_GET_BIT(a, b) ((a >> b) & 0x01)
#define FAP_CLEAR_BIT(a, b) (a &= ~(1 << b))
#define FAP_SET_BIT(a, b) (a |= (1 << b)) 

//***************************************************************************** 
// Derived parameters
//*****************************************************************************

/**
Specifies the radio wakeup from power down time. This constant is specifies in
number of FAP_RX_PERIODs. 
*/
#define FAP_RADIO_PWR_UP_DELAY ((2000/FAP_RX_PERIOD)+1)   // ~ 2 ms radio startup

/**
Equals the number of transmit periods the transmitter resides at one channel before
channel switch. This period equals the duration between the start of each 
retransmit, and is derived form the retransmit delay and "on air" packet length.
The maximum length of one transmit period in [us] is specified by #FAP_MAX_TX_PERIOD.
*/
#define FAP_TX_SINGLE_CH_REV ((FAP_NRF_AUTO_RETRIES+1)*FAP_AUTO_RETRIES_EXTEND)//[#]  

/*
Equals the maximum time in [us] the transmitter resides on a single channel before 
channel switch. This parameter is derived from the device maximum payload length.
*/  
#define FAP_TX_SINGLE_CH_REV_TIME (FAP_TX_SINGLE_CH_REV*FAP_TX_PERIOD_MAX)//[us]

/*
Equals the number of transmit periods necessary  for a full revolution
through all channels. It is recommended that the transmit timeout period 
specified when using fap_tx_data() is equal or greater than this value.
The maximum length of one transmit period in [us] is specified by #FAP_MAX_TX_PERIOD.
*/
#define FAP_TX_FULL_CH_REV (FAP_TX_SINGLE_CH_REV*FAP_CH_TAB_SIZE)//[#]

/*
Equals the time in [us] necessary for the transmitter to revolve through 
all channels.
*/
#define FAP_TX_FULL_CH_REV_TIME (FAP_TX_FULL_CH_REV*FAP_TX_PERIOD_MAX)//[us]

/**
Equals the number of receive periods the transmitter
resides on a single channel before channel switch. 
The length of one transmit period in [us] is specified by FAP_RX_PERIOD.
*/
#define FAP_RX_SINGLE_CH_REV ((uint16_t)(((FAP_TX_SINGLE_CH_REV*FAP_MAX_TX_PERIOD)/FAP_RX_PERIOD)+1))//[#]

/**
Function used internally by the FAP for a device to synchronize to the host receive channel rotation. 
This function must be customized for the actual MCU implementation. It is required from this 
function that when issued, the FAP protocol timer shall be adjusted to generate an interrupt 
FAP_TIMER_MODIFY_PERIOD microseconds after the point issued. Subsequently this interrupt the 
protocol timer shall retain the original setup (timeout every FAP_RX_PERIOD us).
*/
void fap_modify_timer_period(void);
          
/**
Specifies the time in [us] that equals the time the transmitter
resides on a single channel before channel switch.
Thus, FAP_RX_SINGLE_CH_REV_TIME=FAP_TX_SINGLE_CH_REV_TIME.      
*/
#define FAP_RX_SINGLE_CH_REV_TIME (FAP_RX_SINGLE_CH_REV*FAP_RX_PERIOD) //[us]

/**
Equals the number of receive periods the transmitter
uses on a full revolution through all channels. The length of one transmit 
period in [us] is specified by FAP_RX_PERIOD.     
*/
#define FAP_RX_FULL_CH_REV (FAP_RX_SINGLE_CH_REV*FAP_CH_TAB_SIZE) // [#]

/**
Equals the time in [us] that the transmitter uses on 
a full revolution through all channels. Thus
FAP_RX_FULL_CH_REV=FAP_TX_FULL_CH_REV.    
*/
#define FAP_RX_FULL_CH_REV_TIME (FAP_RX_FULL_CH_REV*FAP_RX_PERIOD) // [us]

//***************************************************************************** 
// Typedefs
//*****************************************************************************

/**
Type used for storing payload, payload length and pipe number    
*/
typedef struct
{
  uint8_t pl[FAP_MAX_PL_LENGTH];  
  uint8_t pl_length;
  uint8_t pipe;
} fap_tx_rx_struct_t;

/**
Possible FAP modes. Return values for function fap_get_mode().    
*/
typedef enum
{
  FAP_IDLE,
  FAP_TRANSMITTING,
  FAP_RECEIVING
}fap_modes_t;

/**
Possible RX fifo states. Return values for function fap_get_rx_fifo_status().    
*/
typedef enum
{
  FAP_RX_FIFO_EMPTY,
  FAP_RX_DATA_IN_FIFO,
  FAP_RX_FIFO_FULL,
}fap_rx_status_t;

/**
Possible radio modes during FAP IDLE mode. Input parameters for 
function fap_select_radio_idle_mode().    
*/
typedef enum
{
  FAP_PDOWN_IDLE,
  FAP_STANDBY_IDLE 
}fap_radio_idle_modes_t;

#define FAP_DEVICE0 HAL_NRF_PIPE0
#define FAP_DEVICE1 HAL_NRF_PIPE1
#define FAP_DEVICE2 HAL_NRF_PIPE2
#define FAP_DEVICE3 HAL_NRF_PIPE3
#define FAP_DEVICE4 HAL_NRF_PIPE4
#define FAP_DEVICE5 HAL_NRF_PIPE5
#define FAP_LP_RX_BIT (FAP_DEVICE5+1)

//***************************************************************************** 
// Function prototypes and function parameter defines
//*****************************************************************************

/** @name General functions */
//@{
/**
Initialization function for the frequency agility protocol (FAP). This function
must be called at least once before any of the remaining FAP functions may be used. 
It is recommended that the FAP timer interrupt service routine is not 
enabled until after the FAP is initialized.
*/
void fap_init(void);

/**
Function for setting the explicit receive address for a given pipe.

The radio can monitor up to 6 addresses (pipes) simultaneously. The addresses
for pipe 0 and 1 are specified using 5 bytes, while the address for pipe 2-5 
are specified using a 1 byte address. This 1 byte address specifies 
the LSByte address whilst the remaining address bytes for these 
pipes will equal those for pipe 1.

Note that the FAP must be in IDLE mode in order for this function to 
have any effect.

@param dev specifies the pipe number (0-5) for which to set the address.    

@param adr is a pointer to the address to be used for the given pipe. 
This address is copied and stored in the radio hardware, 
thus the address does not need to reside on this location during receive.   

@return
@retval false if failure due to the FAP not beeing in IDLE prior to function call.
@retval success.
     
@sa fap_rx_data(), fap_tx_data(), fap_goto_idle_mode()
*/
bool fap_set_address(uint8_t dev, uint8_t* adr); 

/**
Function for reading the address set for a given pipe. 

@param dev specifies the pipe number(0-5) for which to get the address.    

@param adr is a pointer to where the address shall be written. For pipe 1-2 5 bytes 
are returned, whilst for the remaining pipes a single byte is returned.
  
@sa  fap_set_address()
*/
void fap_get_address(uint8_t dev, uint8_t* adr);  

/**
Function for setting up the subset of channels to be used by the FAP.

Note that the receiver and the transmitter must be set up using the same subset of channels. 
The number of channels to be used is specified by the constant 
FAP_CH_TAB_SIZE in fap_setup.h. 

It is recommended that the selected channels are distributed over a 
wide frequency range. The possible channel range 
for nRF24L01 is 0 to 123. 

@param channels is a pointer to an array holding the FAP_CH_TAB_SIZE number of
channels to be used.  
*/
void fap_set_channels(uint8_t *channels);
      
/**
Function for selecting in which mode the radio shall reside when
the FAP is in IDLE mode. The nRF radio may reside in two different modes 
when not transmitting or receiving (FAP IDLE), 
which are STANDBY or POWER DOWN, respectively.
In STANDBY the radio consumes more power than in POWER DOWN, but 
the radio start-up time is shorter, which will result in a lower transmit 
latency when starting a new transmit operation. When the radio resides
in power down one must account for an increased latency of typically 1.5 ms. 

The FAP must be in IDLE mode in order for this function to have any effect.

@param mode selects the radio mode.    
Possible arguments are: 
@arg @c FAP_PDOWN_IDLE   
@arg @c FAP_STANDBY_IDLE 

@return 

@retval false if failure due to the FAP not being in IDLE prior to function call. 
@retval true if function executed successfully. 

*/
bool fap_select_radio_idle_mode(fap_radio_idle_modes_t mode); // Power down / standby

/**
Function for forcing the FAP to IDLE mode. 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线中文字幕一区| 久久精品国产免费| 在线这里只有精品| 五月天亚洲精品| 日韩一区二区免费在线观看| 日本人妖一区二区| 久久久久99精品一区| 成人午夜视频网站| 一区二区三区在线观看国产| 91九色最新地址| 日本不卡一区二区| 久久久精品黄色| 97精品超碰一区二区三区| 亚洲超丰满肉感bbw| 日韩欧美国产一区在线观看| 国产精品白丝av| 亚洲精品成a人| 日韩一二三四区| 国产成a人无v码亚洲福利| 亚洲青青青在线视频| 337p亚洲精品色噜噜噜| 国产一区二区女| 亚洲另类一区二区| 精品久久久影院| 99国产精品久| 久草中文综合在线| 综合欧美一区二区三区| 欧美剧情片在线观看| 国产精品一二三区在线| 又紧又大又爽精品一区二区| 日韩欧美国产综合| 91色视频在线| 久久超碰97中文字幕| 亚洲精品va在线观看| 精品久久久久99| 在线看日韩精品电影| 国产精品亚洲一区二区三区在线| 一区二区三区在线免费观看| 精品成人a区在线观看| 色哟哟在线观看一区二区三区| 麻豆91在线观看| 一区二区三区日韩精品| 精品99一区二区三区| 欧美体内she精高潮| 粉嫩av亚洲一区二区图片| 天使萌一区二区三区免费观看| 中文字幕一区不卡| 久久久久久久综合| 日韩视频在线永久播放| 91啪九色porn原创视频在线观看| 国产一区二区三区久久悠悠色av| 午夜精品福利久久久| 亚洲精品国产a| 国产精品久久久久久久裸模| 日韩欧美一区二区不卡| 欧美日韩中字一区| 色吊一区二区三区| 成人av在线看| 国产精品亚洲一区二区三区在线 | 色综合久久久久综合体| 国产裸体歌舞团一区二区| 日本成人在线不卡视频| 五月激情综合婷婷| 一区二区三区欧美久久| 国产精品久久免费看| 久久久久久久一区| 日韩免费高清视频| 这里只有精品99re| 正在播放一区二区| 欧美精品精品一区| 欧美久久久久久蜜桃| 欧美日韩视频不卡| 88在线观看91蜜桃国自产| 欧美在线视频你懂得| 一本一道综合狠狠老| 色综合久久中文字幕| 色哟哟一区二区三区| 一本大道久久精品懂色aⅴ| 91视频精品在这里| 欧洲一区二区av| 欧美日韩一级二级三级| 欧美另类z0zxhd电影| 日韩写真欧美这视频| 欧美大片在线观看| 久久久久久久久久久黄色 | 国产欧美视频在线观看| 国产天堂亚洲国产碰碰| 国产精品网站导航| 一区二区三区在线播放| 亚洲国产人成综合网站| 午夜欧美在线一二页| 秋霞国产午夜精品免费视频 | 免费在线观看视频一区| 久久国产欧美日韩精品| 国产传媒日韩欧美成人| 不卡av在线网| 欧美人妖巨大在线| 欧美精品一区二区三区高清aⅴ| 久久久久久久久久久久久久久99 | 99久久综合狠狠综合久久| 91在线视频网址| 欧美日韩国产成人在线免费| 日韩一区二区不卡| 欧美韩国一区二区| 亚洲另类一区二区| 麻豆精品久久久| 99久久精品99国产精品| 欧美日韩中文国产| 久久久久久久久久久电影| 一区在线中文字幕| 日韩国产精品大片| 国产成人亚洲综合色影视| 色网站国产精品| 精品999在线播放| 亚洲美女在线一区| 久久国产精品免费| 欧美在线制服丝袜| 久久久久免费观看| 亚洲国产美女搞黄色| 九九**精品视频免费播放| 色婷婷综合五月| 精品福利二区三区| 午夜视频一区二区| 不卡av电影在线播放| 欧美一级视频精品观看| 最新日韩av在线| 久久国产精品第一页| 日本韩国欧美国产| 中文字幕高清不卡| 激情五月激情综合网| 91国偷自产一区二区三区成为亚洲经典 | 国产精品女人毛片| 日韩av中文字幕一区二区| 99re热这里只有精品免费视频| 日韩一区二区高清| 亚洲图片欧美视频| www.欧美精品一二区| 精品国产免费久久| 日本不卡视频在线观看| 欧美视频在线一区二区三区 | 这里是久久伊人| 亚洲欧美一区二区三区久本道91 | 亚洲小说欧美激情另类| 国产成人亚洲综合a∨猫咪| 日韩一区二区三区免费看| 亚洲在线免费播放| 91麻豆自制传媒国产之光| 国产女同性恋一区二区| 麻豆成人久久精品二区三区红| 精品视频一区二区不卡| 亚洲精品五月天| 99精品国产视频| 欧美极品少妇xxxxⅹ高跟鞋| 久久99久国产精品黄毛片色诱| 欧美精品视频www在线观看| 亚洲国产一区二区视频| 在线观看精品一区| 亚洲国产综合色| 欧美性一区二区| 亚洲国产精品天堂| 在线观看欧美黄色| 亚洲小说欧美激情另类| 日本高清不卡aⅴ免费网站| 亚洲天堂久久久久久久| 成人动漫在线一区| 国产精品久久久久久久午夜片| 不卡的av电影| 亚洲欧美另类久久久精品| 91久久精品一区二区三| 亚洲国产成人91porn| 欧美性感一类影片在线播放| 亚洲在线观看免费视频| 精品污污网站免费看| 日韩av电影免费观看高清完整版| 欧美一区二区精品| 久草在线在线精品观看| 久久久99精品免费观看| 国产91精品一区二区麻豆网站 | 91精品办公室少妇高潮对白| 亚洲精选一二三| 精品视频1区2区3区| 免费在线观看视频一区| 久久亚洲综合色| 99在线精品观看| 亚洲综合色成人| 日韩视频一区二区三区在线播放| 久久se精品一区精品二区| 中文字幕不卡的av| 在线观看欧美日本| 久久国产精品72免费观看| 中文字幕乱码亚洲精品一区| 一本久久a久久精品亚洲 | 久久不见久久见免费视频1| 久久久亚洲午夜电影| 91在线观看地址| 免费视频最近日韩| 国产精品系列在线| 欧美美女黄视频| 国产精品乡下勾搭老头1| 亚洲码国产岛国毛片在线|