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

📄 twi.h

📁 PTR8000无线通信模块的单片机控制程序
💻 H
字号:
// This is a headfile for twi communication
#include <iom8v.h>
#include <macros.h>
#include <math.h>
#include <string.h>
#define num 4
//*************************PTR8000宏定义部分*****************************************
#define 	WC 		0x00		//Write configuration register Command
#define  	RC 		0x10		//Read configuration register Command
#define 	WTP 	0x20		//Write TX payload Command
#define 	RTP 	0x21		//Read TX payload Command
#define 	WTA 	0x22		//Write TX Address Command
#define 	RTA 	0x23		//Read TX Address Command
#define 	RRP 	0x24		//Read RX payload Command
//Interrupt  中断入口地址
#pragma interrupt_handler twi_isr:18

//函数声明
void StopDelay(void);
void start(void);
void stop(void);
void twi_init(void);
void checkstate(void);
void twiWriteByte(unsigned char WriteAddress,char data);
void twiReadByte(unsigned char ReadAaddress);

⌨️ 快捷键说明

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