⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hal.h

📁 * "Copyright (c) 2006 Robert B. Reese ("AUTHOR")" * All rights reserved. * (R. Reese, reese@ece.
💻 H
字号:
/*
  V0.1 Initial Release   10/July/2006  RBR

*/
#ifndef HAL_H
#define HAL_H

#include "compiler.h"
#include "lrwpan_config.h"         //user configurations
#include "lrwpan_common_types.h"   //types common acrosss most files
#include "evbConfig.h"             //has Crystal frequency, other evboard specifics

#define PACKET_FOOTER_SIZE  2
#define SYMBOLS_PER_MAC_TICK()        1    //this controls timer0 prescale



//Timer Support


#define SYMBOLS_TO_MACTICKS(x) ((UINT32)x/(UINT32)SYMBOLS_PER_MAC_TICK())  
#define MSECS_TO_MACTICKS(x)   ((UINT32)x*((UINT32)LRWPAN_SYMBOLS_PER_SECOND/(UINT32)1000)*(UINT32)SYMBOLS_PER_MAC_TICK())
#define MACTIMER_MAX_VALUE 0x00FFFFFF   //24 bit counter

UINT32 halMACTimerNowDelta(UINT32 x);

#define halMACTimerDelta(x,y) (((UINT32)x-((UINT32)y))& (UINT32)MACTIMER_MAX_VALUE)

#define SAVE_AND_DISABLE_GLOBAL_INTERRUPT(x) {x=GIEH;GIEH=0;}
#define RESTORE_GLOBAL_INTERRUPT(x)          GIEH=x

#define DISABLE_GLOBAL_INTERRUPT()             GIE=0
#define ENABLE_GLOBAL_INTERRUPT()              GIE=1

#define halSetBaud(baud)  SPBRG = (((FOSC/baud)/16) -1)


void halIdle (void);

#define HAL_SUSPEND(x) 

UINT32 sym_to_ticks(UINT32 x);
UINT32 msecs_to_ticks(UINT32 x);

//software delay loop for x microseconds
#define	halWaitUs(x) { unsigned char _dcnt; \		     _dcnt = ((x* FOSC/1000000)/(12)); \		     while(--_dcnt != 0) \		       continue; }


void evbRadioIntCallback(void);
void halDisableRadio(void);

#endif


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -