mirror of
https://github.com/esp8266/Arduino.git
synced 2025-08-01 03:47:23 +03:00
Initial Arduino IDE based on Processing.
This commit is contained in:
68
build/shared/lib/avrlib/rsl/edp.h
Executable file
68
build/shared/lib/avrlib/rsl/edp.h
Executable file
@ -0,0 +1,68 @@
|
||||
/*! \file edp.h \brief Emerald Data Protocol System. */
|
||||
//*****************************************************************************
|
||||
//
|
||||
// File Name : 'edp.h'
|
||||
// Title : Emerald Data Protocol System
|
||||
// Author : Pascal Stang - Copyright (C) 2003
|
||||
// Created : 2003.07.01
|
||||
// Revised : 2003.07.21
|
||||
// Version : 0.1
|
||||
// Target MCU : Atmel AVR series
|
||||
// Editor Tabs : 4
|
||||
//
|
||||
// This code is distributed under the GNU Public License
|
||||
// which can be found at http://www.gnu.org/licenses/gpl.txt
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
#ifndef EDP_H
|
||||
#define EDP_H
|
||||
|
||||
#include "edpdefs.h"
|
||||
|
||||
// defines
|
||||
//#define EDP_DEBUG
|
||||
// edp reply buffer size
|
||||
#ifndef EDP_REPLY_BUFFER_SIZE
|
||||
#define EDP_REPLY_BUFFER_SIZE 128
|
||||
#endif
|
||||
// edpSendCommand return values
|
||||
#define EDP_COMMAND_OK 0
|
||||
#define EDP_COMMAND_NODEV 1
|
||||
// edpGetCommandReply return values
|
||||
#define EDP_REPLY_OK 0
|
||||
#define EDP_REPLY_BADCHKSUM 1
|
||||
|
||||
// structs and typedefs
|
||||
typedef struct
|
||||
{
|
||||
u08 SrcAddr;
|
||||
u08 Command;
|
||||
u08 Data[];
|
||||
} EdpCommand;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u08 Length;
|
||||
u08 Data[];
|
||||
} EdpReply;
|
||||
|
||||
// typedefs
|
||||
typedef u08 (*EdpSlaveHandlerFuncType)(u08 edpCmdLength, EdpCommand* edpCmd,
|
||||
u08 edpReplyLengthMax, EdpReply* edpReply);
|
||||
|
||||
// functions
|
||||
void edpInit(void);
|
||||
void edpSetSlaveHandler(EdpSlaveHandlerFuncType edpSlaveHandlerFunction);
|
||||
|
||||
// ************ EDP Master operations ************
|
||||
u08 edpSendCommand(u08 deviceAddr, u08 cmdLength, EdpCommand* edpCommand);
|
||||
u08 edpGetCommandReply(u08* responseCode, EdpReply** edpReply);
|
||||
//u08 edpSendCommand(u08 deviceAddr, u08 sendLength, u08* sendData);
|
||||
//u08 edpGetCommandReply(u08* responseCode, u08* replyLength, u08** replyData);
|
||||
|
||||
// ************ EDP Slave operations ************
|
||||
void edpSlaveReceiveService(u08 receiveDataLength, u08* receiveData);
|
||||
u08 edpSlaveTransmitService(u08 transmitDataLengthMax, u08* transmitData);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user