Application file - main.c
#include "EO3100I_API.h"
#include "EO3100I_CFG.h"
#define led_pwrOn(); io_setDigital(SCSEDIO_0,1);
#define led_pwrOff(); io_setDigital(SCSEDIO_0,0);
#define led_txOn(); io_setDigital(SCLKDIO_1,1);
#define led_txOff(); io_setDigital(SCLKDIO_1,0);
code uint8 VERSION_APP[] = {0xE0,'V','E','R','S','I','O','N',1,0,1,0,'A','A','U','T','A','R','K','I','C','S','E','N','S','O','R',0x00,0xE0};
typedef union
{
uint8 u8byte[32];
struct
{
uint8 u8Counter;
} value;
} RAM0_SHADOW;
RAM0_SHADOW ungRam0;
void measurement(uint8 *pu8ADIO0);
void main()
{
uint32 data u32WatchdogPeriode;
uint8 u8Meas;
mainInit();
led_pwrOn();
rTel2.raw.
bytes[1] = 0x00;
rTel2.raw.
bytes[2] = 0x00;
rTel2.raw.
bytes[3] = 0x00;
rTel2.raw.
bytes[4] = 0x00;
rTel2.raw.
bytes[5] = 0x00;
rTel2.raw.
bytes[6] = 0x00;
rTel2.raw.
bytes[7] = 0x00;
rTel2.raw.
bytes[8] = 0x00;
measurement(&u8Meas);
switch (u8ResetSrc)
{
ungRam0.value.u8Counter = 0;
break;
default:
break;
}
rTel2.raw.
bytes[5] = ungRam0.value.u8Counter;
rTel2.raw.
bytes[7] = u8Meas;
led_txOn();
led_txOff();
ungRam0.value.u8Counter++;
led_pwrOff();
while(1);
}
void measurement(uint8 *pu8ADIO0)
{
sint16 s16adio0value;
sint16 s16posref;
uint16 u16MeasScaled;
*pu8ADIO0 = (uint8)u16MeasScaled;
}
Config file - EO3100I_CFG.h
#ifndef _EO3100I_CFG_H_INCLUDED
#define _EO3100I_CFG_H_INCLUDED
void startupInit();
void mainInit();
#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 uint32 xdata u32gFilterValue[FILTER_NUM];
volatile uint8 xdata u8gFilterCfg[FILTER_NUM];
uint8 code io_param[] = {
0x07,
0x00,
0x0C,
0x03,
0x01,
0x00,
0x00,
0x03,
0x00,
0xFF,
0x0C,
0x00,
0x00,
0x00,
0x00,
};