Simple application demonstrating receiving telegrams with the radio module and sending it to the serial port using the ESP3 protocol
Application file - main.c
#include "EO3100I_API.h"
#include "EO3100I_CFG.h"
#include <string.h>
#define MODE_ESP3_TYPE_0A // MODE_ESP3_TYPE_01 = ESP3 packet DATA contains a ERP1 telegram.
code uint8 VERSION_APP[] = {0xE0,'V','E','R','S','I','O','N',1,0,0,1,'A','R','A','D','I','O','T','O','E','S','P','3',0x00,0xE0};
#define MAX_DATA_SIZE 512
uint8 u8PacketBuffer[MAX_DATA_SIZE];
uint8 u8Mode = 0;
void main()
{
mainInit();
while(1)
{
memset(&rTel, 0x00, sizeof(rTel));
memset(&rTel2, 0x00, sizeof(rTel2));
{
{
{
}
break;
{
}
break;
{
}
break;
default:
break;
}
}
if(u8Mode == 0)
{
{
}
}
else
{
{
}
}
}
}
Config file - EO3100I_CFG.h
#ifndef _EO3100I_CFG_H_INCLUDED
#define _EO3100I_CFG_H_INCLUDED
void startupInit();
void mainInit();
#define RX_RING_SIZE 34
#define TX_RING_SIZE 34
extern volatile uint8 xdata u8RxRing[RX_RING_SIZE];
extern volatile uint8 xdata u8TxRing[TX_RING_SIZE];
extern uint8 uart_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()
{
}
volatile uint8 xdata u8RxRing[RX_RING_SIZE];
volatile uint8 xdata u8TxRing[TX_RING_SIZE];
uint8 uart_param[] = {
RX_RING_SIZE,
TX_RING_SIZE,
};
volatile uint32 xdata u32gFilterValue[FILTER_NUM];
volatile uint8 xdata u8gFilterCfg[FILTER_NUM];
uint8 code io_param[] = {
0x07,
0x00,
0x0C,
0x03,
0x00,
0x00,
0xC0,
0x03,
0x80,
0x7F,
0x0C,
0x00,
0x00,
0x00,
0x00,
};