DolphinV4 API  1.6.1.0
VLD Receiver Demo





Application file - main.c

#include "EO3100I_API.h"
#include "EO3100I_CFG.h"
#include <string.h>
/************************************************************************-
EVA Board:
EVA300-3
Input PIN:
Output PIN:
SCSEDIO_0 (LED CH1) signals received VLD telegram with the length 6 byte
SCLKDIO_1 (LED CH2) signals received telegrams
UART:
ADIO7 (ADIO6) used for UART 57.6kBaud.
Outputs received VLD telegram with the length 6 byte on UART
Description:
Demonstartes the usage of the VLD (Variable Length Data) telegrams
Notes:
-************************************************************************/
code uint8 VERSION_APP[] = {0xE0,'V','E','R','S','I','O','N',1,0,1,0,'A','V','L','D','-','R','x','D','e','m','o',0x00,0xE0};
#define MY_DATA_LEN (0x0C)
void main()
{
mainInit();
while(1)
{
if(radio_getTelegram2(&rTel2, &pTel2)==OK)
{
io_setDigital(SCLKDIO_1, 1);
if(rTel2.raw.u8Length==MY_DATA_LEN)
{
// do something
io_setDigital(SCSEDIO_0, 1);
sTel.u8DataBuffer = &rTel2.raw.bytes[0];
memcpy(&sTel.u8DataBuffer[rTel2.raw.u8Length], &pTel2.p_rx, 2);
sTel.u16DataLength = rTel2.raw.u8Length;
sTel.u8OptionLength = 2;
while (uart_sendPacket(&sTel) != OK);
}
}
time_wait(200);
io_setDigital(SCSEDIO_0, 0);
}
}



Config file - EO3100I_CFG.h

// Generated on 2013-06-07 15:57:21 by DolphinAPIConfigurator 1.1.0.20
#ifndef _EO3100I_CFG_H_INCLUDED
#define _EO3100I_CFG_H_INCLUDED
void startupInit();
void mainInit();
//*********************UART PARAM***************************
#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[];
//*********************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:15:26 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);
UART_INIT(uart_param, SET_ALL_PARAM);
}
//*********************UART PARAM***************************
volatile uint8 xdata u8RxRing[RX_RING_SIZE];
volatile uint8 xdata u8TxRing[TX_RING_SIZE];
uint8 uart_param[] = {
BAUD_57600, //IDX_BAUD
RX_RING_SIZE, //IDX_RX_RING_SIZE
TX_RING_SIZE, //IDX_TX_RING_SIZE
};
//*********************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
0x0C, //IDX_GPIO0_PULL_CONF
0x03, //IDX_GPIO0_DIR
0x00, //IDX_GPIO1_AN
0x00, //IDX_GPIO1_CONF0
0xC0, //IDX_GPIO1_CONF1
0x03, //IDX_GPIO1_DIG_CONF
0x80, //IDX_GPIO1_DIR
0x7F, //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 Out None 0 No
// SCLKDIO1 : Digital I/O Out None 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 : UART In Up 0 No
// ADIO7 : UART Out None 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