📄 hal.c
字号:
#pragma DI
#pragma EI
#pragma SFR
#pragma NOP
#pragma STOP
#pragma HALT
///#pragma section @@DATA IXDATA
#include "mac_headers.h"
//-------------------------------------------------------------------------------------------------------
// void halWait(UINT16 timeout)
//
// DESCRIPTION:
// Runs an idle loop for [timeout] microseconds.
//
// ARGUMENTS:
// UINT16 timeout
// The timeout in microseconds
//-------------------------------------------------------------------------------------------------------
void halWait(UINT16 timeout) {
// This sequence uses exactly 8 clock cycle for each round
do {
NOP();
NOP();
NOP();///
NOP();///
} while (--timeout);
} // halWait
//-------------------------------------------------------------------------------------------------------
// void rfWaitForCrystalOscillator(void)
//
// DESCRIPTION:
// Waits for the crystal oscillator to become stable. The flag is polled via the SPI status byte.
//
// Note that this function will lock up if the SXOSCON command strobe has not been given before the
// function call. Also note that global interrupts will always be enabled when this function
// returns.
//-------------------------------------------------------------------------------------------------------
void halRfWaitForCrystalOscillator(void) {
BYTE spiStatusByte;
// Poll the SPI status byte until the crystal oscillator is stable
do {
DISABLE_GLOBAL_INT();
FASTSPI_UPD_STATUS(spiStatusByte);
ENABLE_GLOBAL_INT();
} while (!(spiStatusByte & CC2420_XOSC16M_STABLE_BM));
} // halRfWaitForCrystalOscillator
//-------------------------------------------------------------------------------------------------------
// void halWriteAdress(BYTE *pData)
//
// DESCRIPTION:
// Writes address into FLASH memory
//
// ARGUMENTS:
// BYTE *pData
// A pointer to the write buffer
//-------------------------------------------------------------------------------------------------------
void halWriteAddress(BYTE *pData){
}
//-------------------------------------------------------------------------------------------------------
// halReadAdress(BYTE *pData)
//
// DESCRIPTION:
// Reads address from FLASH
//
// ARGUMENTS:
// BYTE *pData
// A pointer to the read buffer
//-------------------------------------------------------------------------------------------------------
void halReadAddress(BYTE *pData){
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -