DolphinV4 API  1.6.1.0
VLD Sender Demo





Application file - main.c

#include "EO3100I_API.h"
#include "EO3100I_CFG.h"
/************************************************************************-
EVA Board:
EVA300-3 / EVA320-2
Input PIN:
Output PIN:
Description:
Notes:
-************************************************************************/
code uint8 VERSION_APP[] = {0xE0,'V','E','R','S','I','O','N',1,0,1,0,'A','V','L','D','-','T','x','D','e','m','o',0x00,0xE0};
#define MY_DATA_LEN (6)
#define MY_TELEGRAM_LEN (MY_DATA_LEN + 7) // 7 byte (1(u8Choice)+4(u32Id)+1(u8Status)+1(u8Chk))
void main()
{
struct myRadioType{
CHOICE_TYPE u8Choice;
uint8 u8Data[MY_DATA_LEN];
uint32 u32Id;
uint8 u8Status;
uint8 u8Chk;
uint8 u8Fill[RADIO_BUFF_LENGTH-MY_TELEGRAM_LEN]; // align u8Length as last byte in structure !!!
uint8 u8Length;
}myRT;
uint32 u32MyId;
pTel.p_tx.u8SubTelNum = 3;
pTel.p_tx.u32DestinationId = 0;
mainInit();
misc_getId(&u32MyId);
myRT.u8Choice = RADIO_CHOICE_VLD;
myRT.u32Id = u32MyId;
myRT.u8Status = 0x30;
myRT.u8Length = MY_TELEGRAM_LEN;
myRT.u8Data[0]= 0x10;
myRT.u8Data[1]= 0x20;
myRT.u8Data[2]= 0x30;
myRT.u8Data[3]= 0x40;
myRT.u8Data[4]= 0x50;
myRT.u8Data[5]= 0x60;
while(1)
{
while (radio_sendTelegram((TEL_RADIO_TYPE *)&myRT, &pTel)==BUFF_FULL);
time_wait(5000);
}
}



Config file - EO3100I_CFG.h

// Generated on 2013-06-07 16:18:15 by DolphinAPIConfigurator 1.1.0.20
#ifndef _EO3100I_CFG_H_INCLUDED
#define _EO3100I_CFG_H_INCLUDED
void startupInit();
void mainInit();
//*********************RADIO PARAM***************************
#define RADIO_BUFF_NUM 10
#define RADIO_MATURITY_TIME 100
extern volatile RADIO_BUFFER_TYPE xdata gRadioBuff[RADIO_BUFF_NUM];
//*********************FILTER PARAM***************************
#define FILTER_NUM 1
extern volatile uint32 xdata u32gFilterValue[FILTER_NUM];
extern volatile uint8 xdata u8gFilterCfg[FILTER_NUM];
//*********************IO PARAM******************************
extern uint8 code io_param[];
#endif //_EO3100I_CFG_H_INCLUDED



Config file - EO3100I_CFG.c

// Generated on 2013-06-07 16:18:27 by DolphinAPIConfigurator 1.1.0.20
#include "EO3100I_API.h"
#include "EO3100I_CFG.h"
//*********************API INIT***************************
//Note: Function is called from startup.a51. Global variables are not yet initialized!
void startupInit()
{
io_init(io_param);
}
void mainInit()
{
radio_init(RADIO_BUFF_NUM, RADIO_MATURITY_TIME);
}
//*********************RADIO PARAM***************************
volatile RADIO_BUFFER_TYPE xdata gRadioBuff[RADIO_BUFF_NUM];
//*********************FILTER PARAM***************************
volatile uint32 xdata u32gFilterValue[FILTER_NUM];
volatile uint8 xdata u8gFilterCfg[FILTER_NUM];
//*********************IO PARAM******************************
uint8 code io_param[] = {
0x07, //IDX_GPIO_CONF
0x00, //IDX_GPIO0_CONF
0x0F, //IDX_GPIO0_PULL_CONF
0x00, //IDX_GPIO0_DIR
0x00, //IDX_GPIO1_AN
0x00, //IDX_GPIO1_CONF0
0x00, //IDX_GPIO1_CONF1
0x03, //IDX_GPIO1_DIG_CONF
0x00, //IDX_GPIO1_DIR
0xFF, //IDX_GPIO1_PULL
0x0C, //IDX_GPIO2_CONF
0x00, //IDX_GPIO2_DIR
0x00, //IDX_GPIO0
0x00, //IDX_GPIO1
0x00, //IDX_GPIO2
};
// I/O Configuration overview
//
// Pin : Interface Direction Pull InitValue Interrupt
// SCSEDIO0 : Digital I/O In Up 0 No
// SCLKDIO1 : Digital I/O In Up 0 No
// WSDADIO2 : Digital I/O In Up 0 No
// RSDADIO3 : Digital I/O In Up 0 No
// ADIO0 : Digital I/O In Up 0 No
// ADIO1 : Digital I/O In Up 0 No
// ADIO2 : Digital I/O In Up 0 No
// ADIO3 : Digital I/O In Up 0 No
// ADIO4 : Digital I/O In Up 0 No
// ADIO5 : Digital I/O In Up 0 No
// ADIO6 : Digital I/O In Up 0 No
// ADIO7 : Digital I/O In Up 0 No
// WXIDIO : Digital I/O In Up 0 No
// WXODIO : Digital I/O In Up 0 No
// WAKE0 : Digital I/O In None 0 No
// WAKE1 : Digital I/O In None 0 No