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

📄 hal_nrf_hw.h

📁 这是nrf24lu1的无线鼠标源代码,应用平台是keil c
💻 H
字号:
/* Copyright (c) 2006 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is confidential property of Nordic Semiconductor. The use,
 * copying, transfer or disclosure of such information is prohibited except by express written
 * agreement with Nordic Semiconductor.
 */

/** @file
 * Header file defining the hardware depenent interface of the C8051F320
 *
 *
 */

#ifndef HAL_NRF_HW_H__
#define HAL_NRF_HW_H__

#include <c8051f320.h>

sbit CSN = P0^3;  // CSN PIN for BFB
sbit CE = P0^4;   // CE PIN

/** Macro that set radio's CSN line LOW.
 *
 */
#define CSN_LOW() do {CSN = 0;} while(0)

/** Macro that set radio's CSN line HIGH.
 *
 */
#define CSN_HIGH() do {CSN = 1;} while(0)

/** Macro that set radio's CE line LOW.
 *
 */
#define CE_LOW() do {CE = 0;} while(0)

/** Macro that set radio's CE line HIGH.
 *
 */
#define CE_HIGH() do {CE = 1;} while(0)

/**
 * Pulses the CE to nRF24L01 for at least 10 us
 */
#define CE_PULSE() do { \
  uint8_t count; \
  count = 20; \
  CE_HIGH();  \
  while(count--) \
    ; \
  CE_LOW();  \
  } while(0)

#endif /* HAL_NRF_HW_H__ */

⌨️ 快捷键说明

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