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

📄 s8051.h

📁 芯科rf资料
💻 H
字号:
/*** ============================================================================**** FILE**  S8051.h**** DESCRIPTION**  Contains the 8051 specific declarations, IO declarations, type declarations**** CREATED**  Silicon Laboratories Hungary Ltd**** COPYRIGHT**  Copyright 2008 Silicon Laboratories, Inc.  **	http://www.silabs.com**** ============================================================================*/#ifndef S8051_H#define S8051_H#include <compiler_defs.h>             // compiler declarations#include <C8051F930_defs.h>#include <stdio.h>#include <stdlib.h>#include <string.h>                /* ======================================= *                 *     T Y P E   D E C L A R A T I O N     *                 * ======================================= *///Only these type of variables are used in this software#undef	uint8#undef	sint8#undef	uint16#undef	sint16#undef	uint32#undef	sint32#define	uint8	unsigned char#define	sint8	signed char#define	uint16	unsigned short#define	sint16	signed short#define	uint32	unsigned long#define	sint32	signed longtypedef struct{unsigned int bit0 : 1;unsigned int bit1 : 1;unsigned int bit2 : 1;unsigned int bit3 : 1;unsigned int bit4 : 1;unsigned int bit5 : 1;unsigned int bit6 : 1;unsigned int bit7 : 1;} reg;typedef union{   reg testreg;   uint8 adat;}reg_union;typedef union{   reg_union bytes[2];   uint16 adat;}reg16_union;					                /* ======================================= *					                 *          D E F I N I T I O N S          *					                 * ======================================= */#undef	TRUE#undef 	FALSE#undef	INPUT#undef	OUTPUT#define TRUE						(1)#define FALSE						(0)#define	INPUT						(1)#define	OUTPUT						(0)SBIT (RF_NSEL, SFR_P1, 3);SBIT (RF_NIRQ, SFR_P0, 6);SBIT (RF_FFIT, SFR_P2, 4);SBIT (RF_NFFS, SFR_P2, 3);SBIT (SPI_MISO, SFR_P1, 1);SBIT (SPI_MOSI, SFR_P1, 2);SBIT (RC_LED,  	SFR_P2, 0);      // '0' means ON, '1' means OFFSBIT (TR_LED,	SFR_P1, 6);          // '0' means ON, '1' means OFFSBIT (PB,       SFR_P0, 7);          // PB == 0 means switch pressedSBIT (CMD_PIN,	SFR_P1, 4);	#define SYSCLK       			(24500000)        // SYSCLK frequency in Hz#define	SPI_CLOCK				(1020833)	#define	EnableGlobalIt()		EA = 1#define	DisableGlobalIt()		EA = 0								               				/* ======================================= *                 			 *  F U N C T I O N   P R O T O T Y P E S  *                			 * ======================================= */void SetHwMasterSpi(void);void delay_ms(uint8 delay);uint8 spi_read_write_byte(uint8 spi_in);uint16 send_control_command(uint16 control_command);void Timer2Init(void);#endif 

⌨️ 快捷键说明

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