Simple application demonstrating how to show the Receive Radio Strength Indication (RSSI) and the usage of PWM.
Application file - main.c
#include "EO3100I_API.h"
#include "EO3100I_CFG.h"
#define RADIO_TRHD_3 45
#define RADIO_TRHD_2 60
#define RADIO_TRHD_1 70
#define RADIO_TRHD_0 93
#define IO_PWM_PERIOD 320
#define IO_PWM_DUTY_4 (1.0 * IO_PWM_PERIOD)
#define IO_PWM_DUTY_3 (0.7 * IO_PWM_PERIOD)
#define IO_PWM_DUTY_2 (0.5 * IO_PWM_PERIOD)
#define IO_PWM_DUTY_1 (0.3 * IO_PWM_PERIOD)
#define IO_PWM_DUTY_0 (0.1 * IO_PWM_PERIOD)
#define IO_PWM_DUTY_INIT (IO_PWM_DUTY_0)
#define IO_PWM_HOLD 500
code uint8 RSSI_VERSION[] = {0xE0,'V','E','R','S','I','O','N',1,0,2,0,'A','R','S','S','I',0x00,0xE0};
void main()
{
mainInit() ;
while(1)
{
{
if(pTel2.p_rx.
u8Dbm < RADIO_TRHD_3)
{
}
else if(pTel2.p_rx.
u8Dbm < RADIO_TRHD_2)
{
}
else if(pTel2.p_rx.
u8Dbm < RADIO_TRHD_1)
{
}
else if(pTel2.p_rx.
u8Dbm < RADIO_TRHD_0)
{
}
else
{
}
}
}
}
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 uint16 timer1_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()
{
}
void mainInit()
{
}
volatile uint32 xdata u32gFilterValue[FILTER_NUM];
volatile uint8 xdata u8gFilterCfg[FILTER_NUM];
uint16 timer1_param[] = {
0x0140,
0x0000,
0x0020,
0x0001
};
uint8 code io_param[] = {
0x07,
0x04,
0x00,
0x01,
0x00,
0x00,
0x00,
0x03,
0x00,
0x00,
0x0C,
0x00,
0x00,
0x00,
0x00,
};