hal.c
来自「ucos在NEC平台下的移植」· C语言 代码 · 共 90 行
C
90 行
#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 + =
减小字号Ctrl + -
显示快捷键?