Advanced application demonstrating how to creata an actuator with DolphinV4.
Application file - main.c
#include "main.h"
#include "EO3100I_CFG.h"
#include "mod_button.h"
#include "mod_id.h"
#include "gateway.h"
#include "switch.h"
#include "learn.h"
APP_CONTEXT gContext;
BTN_STRUCT btnLearn = { ADIO_3,
0,
200,
200 };
BTN_STRUCT btnClear = { ADIO_4,
0,
200,
200 };
code uint8 VERSION_APP[] = {0xE0,'V','E','R','S','I','O','N',1,0,0,0,'A','A','C','T','U','A','T','O','R','_','V','4',0x00,0xE0};
void mainInit()
{
}
void main()
{
mainInit();
gContext.bTel = 0;
gContext.u8State = STATE_NORMAL;
gContext.u8BtnLearn = BTN_IDLE;
gContext.u8BtnClear = BTN_IDLE;
id_init();
gateway_init();
switch_init();
learn_init();
while (1)
{
gContext.u8BtnLearn = btn_getState(&btnLearn);
gContext.u8BtnClear = btn_getState(&btnClear);
if (gContext.u8State == STATE_NORMAL)
{
switch_exec();
}
gateway_exec();
learn_exec();
}
}
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 4
extern volatile uint32 xdata u32gFilterValue[FILTER_NUM];
extern volatile uint8 xdata u8gFilterCfg[FILTER_NUM];
extern uint8 filter_param[];
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()
{
}
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 filter_param[] = {
FILTER_NUM,
};
uint8 code io_param[] = {
0x07,
0x00,
0x00,
0x0F,
0x00,
0x00,
0xC0,
0x03,
0xA0,
0x5F,
0x0C,
0x00,
0x00,
0x00,
0x00,
};