REMAN Device application example files
REMAN Device Application file - main.c
#include "EO3100I_API.h"
#include "EO3100I_CFG.h"
#include <string.h>
code uint8 VERSION_APP[] = {0xE0,'V','E','R','S','I','O','N',1,0,3,1,'A','R','E','M','A','N','D','E','V','I','C','E',0x00,0xE0};
code uint16 reman_rpc[] = {
};
#define REMAN_DEFAULT_CODE (0x01)
void main()
{
uint16 u16FnNumber;
uint16 u16DataSize;
uint32 u32Code;
uint16 u16NumBytes = 0;
uint16 u16FlashAddr = 0;
uint8 u8Val;
mainInit();
while (1)
{
if (u8Val == 0)
{
u32Code = REMAN_DEFAULT_CODE;
}
{
}
continue;
{
switch(u16FnNumber)
{
break;
{
}
break;
{
u16FlashAddr = u8gRmDataBuffer[0]<<8 | u8gRmDataBuffer[1];
u16NumBytes = u8gRmDataBuffer[2]<<8 | u8gRmDataBuffer[3];
if (u16FlashAddr<0x7D00 || u16FlashAddr>0x7EFF)
{
break;
}
{
}
}
break;
u16FlashAddr = u8gRmDataBuffer[0]<<8 | u8gRmDataBuffer[1];
u16NumBytes = u8gRmDataBuffer[2]<<8 | u8gRmDataBuffer[3];
if (u16FlashAddr<0x7D00 || u16FlashAddr>0x7EFF)
{
break;
}
if (u16NumBytes>256)
{
break;
}
else
break;
break;
}
}
}
}
Config file - EO3100I_CFG.h
#ifndef _EO3100I_CFG_H_INCLUDED
#define _EO3100I_CFG_H_INCLUDED
void startupInit();
void mainInit();
#define EEP_ORG 0xFF
#define EEP_FUNC 0x3F
#define EEP_TYPE 0x7F
#define MANUFACTURER_ID 0x7FF
#define RM_BUFF_SIZE 0x14
#define RM_CODE_ADDR 0x7E00
extern uint8 xdata u8gRmDataBuffer[RM_BUFF_SIZE];
extern uint16 code reman_param[];
#define RADIO_BUFF_NUM 10
#define RADIO_MATURITY_TIME 100
#define FILTER_NUM 1
extern volatile uint32 xdata u32gFilterValue[FILTER_NUM];
extern volatile uint8 xdata u8gFilterCfg[FILTER_NUM];
extern uint8 code io_param[];
#endif //_EO3100I_CFG_H_INCLUDED
Config file - EO3100I_CFG.c
#include "EO3100I_API.h"
#include "EO3100I_CFG.h"
void startupInit()
{
}
void mainInit()
{
}
uint8 xdata u8gRmDataBuffer[RM_BUFF_SIZE];
uint16 code reman_param[] = {
(EEP_ORG<<8) | (EEP_FUNC<<2) | (EEP_TYPE>>5),
(EEP_TYPE<<11),
MANUFACTURER_ID,
RM_BUFF_SIZE,
RM_CODE_ADDR,
50
};
volatile uint32 xdata u32gFilterValue[FILTER_NUM];
volatile uint8 xdata u8gFilterCfg[FILTER_NUM];
uint8 code io_param[] = {
0x07,
0x00,
0x0F,
0x00,
0x00,
0x00,
0x00,
0x03,
0x80,
0x7F,
0x0C,
0x00,
0x00,
0x00,
0x00,
};