forked from xuos/xiuos
support e220 for nuttx on xidatong
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
############################################################################
|
||||
# APP_Framework/Framework/connection/lora/Make.defs
|
||||
############################################################################
|
||||
ifneq ($(CONFIG_ADAPTER_SX1278),)
|
||||
ifneq ($(CONFIG_CONNECTION_ADAPTER_LORA),)
|
||||
CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Framework/connection/lora
|
||||
endif
|
||||
include $(wildcard $(APPDIR)/../../../APP_Framework/Framework/connection/lora/*/Make.defs)
|
||||
|
||||
6
APP_Framework/Framework/connection/lora/e220/Make.defs
Normal file
6
APP_Framework/Framework/connection/lora/e220/Make.defs
Normal file
@@ -0,0 +1,6 @@
|
||||
############################################################################
|
||||
# APP_Framework/Framework/connection/lora/e220/Make.defs
|
||||
############################################################################
|
||||
ifneq ($(CONFIG_ADAPTER_E220),)
|
||||
CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Framework/connection/lora/e220
|
||||
endif
|
||||
@@ -133,40 +133,9 @@ int PrivWrite(int fd, const void *buf, size_t len)
|
||||
return write(fd, buf, len);
|
||||
}
|
||||
|
||||
static int PrivSerialIoctl(int fd, int cmd, void *args)
|
||||
int PrivIoctl(int fd, int cmd, unsigned long args)
|
||||
{
|
||||
struct SerialDataCfg *serial_cfg = (struct SerialDataCfg *)args;
|
||||
return ioctl(fd, cmd, serial_cfg);
|
||||
}
|
||||
|
||||
static int PrivPinIoctl(int fd, int cmd, void *args)
|
||||
{
|
||||
struct PinParam *pin_cfg = (struct PinParam *)args;
|
||||
|
||||
return ioctl(fd, cmd, pin_cfg);
|
||||
}
|
||||
|
||||
int PrivIoctl(int fd, int cmd, void *args)
|
||||
{
|
||||
int ret = 0;
|
||||
struct PrivIoctlCfg *ioctl_cfg = (struct PrivIoctlCfg *)args;
|
||||
|
||||
switch (ioctl_cfg->ioctl_driver_type)
|
||||
{
|
||||
case SERIAL_TYPE:
|
||||
ret = PrivSerialIoctl(fd, cmd, ioctl_cfg->args);
|
||||
break;
|
||||
case PIN_TYPE:
|
||||
ret = PrivPinIoctl(fd, cmd, ioctl_cfg->args);
|
||||
break;
|
||||
case I2C_TYPE:
|
||||
ret = ioctl(fd, cmd, ioctl_cfg->args);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ioctl(fd, cmd, args);
|
||||
}
|
||||
|
||||
/********************memory api************/
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <nuttx/wireless/lpwan/sx127x.h>
|
||||
#include <nuttx/ioexpander/gpio.h>
|
||||
|
||||
typedef uint8_t uint8;
|
||||
typedef uint16_t uint16;
|
||||
@@ -43,10 +44,11 @@ typedef int64_t int64;
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OPE_INT 0x0000
|
||||
#define OPE_CFG 0x0001
|
||||
#define OPE_INT 0x0000
|
||||
#define OPE_CFG 0x0001
|
||||
|
||||
#define NAME_NUM_MAX 32
|
||||
|
||||
#define NAME_NUM_MAX 32
|
||||
|
||||
/*********************GPIO define*********************/
|
||||
#define GPIO_LOW 0x00
|
||||
@@ -201,7 +203,7 @@ int PrivOpen(const char *path, int flags);
|
||||
int PrivRead(int fd, void *buf, size_t len);
|
||||
int PrivWrite(int fd, const void *buf, size_t len);
|
||||
int PrivClose(int fd);
|
||||
int PrivIoctl(int fd, int cmd, void *args);
|
||||
int PrivIoctl(int fd, int cmd, unsigned long args);
|
||||
|
||||
/*********************memory***********************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user