refact: 将读写的应用层接口根据主从分开
This commit is contained in:
11
app/tiny_frame/by_tiny_frame_master_read.h
Normal file
11
app/tiny_frame/by_tiny_frame_master_read.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#ifndef _BY_TINY_FRAME_MASTER_READ_H__
|
||||||
|
#define _BY_TINY_FRAME_MASTER_READ_H__
|
||||||
|
|
||||||
|
#include "by_tiny_frame_config.h"
|
||||||
|
|
||||||
|
#if defined(BY_TF_DEVICE_MASTER)
|
||||||
|
|
||||||
|
#define BY_TINY_FRAME_WRITE_CMD_CODE (0x03)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
@@ -1,16 +1,18 @@
|
|||||||
#ifndef _BY_TINY_FRAME_WRITE_H__
|
#ifndef _BY_TINY_FRAME_MASTER_WRITE_H__
|
||||||
#define _BY_TINY_FRAME_WRITE_H__
|
#define _BY_TINY_FRAME_MASTER_WRITE_H__
|
||||||
|
|
||||||
#include "by_tiny_frame_config.h"
|
#include "by_tiny_frame_config.h"
|
||||||
|
|
||||||
|
#if defined(BY_TF_DEVICE_MASTER)
|
||||||
|
|
||||||
#include "by_tiny_frame_parse.h"
|
#include "by_tiny_frame_parse.h"
|
||||||
#include "by_tiny_frame_pack.h"
|
#include "by_tiny_frame_pack.h"
|
||||||
|
|
||||||
#define BY_TINY_FRAME_WRITE_CMD_CODE (0x06)
|
#define BY_TINY_FRAME_WRITE_CMD_CODE (0x06)
|
||||||
|
|
||||||
#if defined(BY_TF_DEVICE_MASTER)
|
|
||||||
extern void by_tiny_frame_write(uint8_t slave_id, uint16_t reg_addr, uint32_t data);
|
extern void by_tiny_frame_write(uint8_t slave_id, uint16_t reg_addr, uint32_t data);
|
||||||
#elif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#ifndef _BY_TINY_FRAME_READ_H__
|
|
||||||
#define _BY_TINY_FRAME_READ_H__
|
|
||||||
|
|
||||||
#define BY_TINY_FRAME_WRITE_CMD_CODE (0x03)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
2
app/tiny_frame/by_tiny_frame_slave_read_write.c
Normal file
2
app/tiny_frame/by_tiny_frame_slave_read_write.c
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#include "by_tiny_frame_slave_read_write.h"
|
||||||
|
|
||||||
12
app/tiny_frame/by_tiny_frame_slave_read_write.h
Normal file
12
app/tiny_frame/by_tiny_frame_slave_read_write.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef _BY_TINY_FRAME_SLAVE_READ_WRITE_H__
|
||||||
|
#define _BY_TINY_FRAME_SLAVE_READ_WRITE_H__
|
||||||
|
|
||||||
|
#include "by_tiny_frame_config.h"
|
||||||
|
|
||||||
|
#if defined(BY_TF_DEVICE_SLAVE)
|
||||||
|
|
||||||
|
#define BY_TINY_FRAME_WRITE_CMD_CODE (0x03)
|
||||||
|
#define BY_TINY_FRAME_WRITE_CMD_CODE (0x06)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user