Add initial CC1101 wireless logic from Uros

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3617 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-05-16 15:09:39 +00:00
parent c2052ea364
commit 1ba2240762
32 changed files with 1966 additions and 796 deletions
+13 -62
View File
@@ -39,79 +39,35 @@ ifeq ($(WINTOOL),y)
INCDIROPT = -w
endif
ROOTDEPPATH = --dep-path .
DEPPATH = --dep-path .
ASRCS =
CSRCS =
VPATH = .
# Include support for various drivers. Each Make.defs file will add its
# files to the source file list, add its DEPPATH info, and will add
# the appropriate paths to the VPATH variable
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
include serial/Make.defs
SERIALDEPPATH = --dep-path serial
endif
ifeq ($(CONFIG_NET),y)
include net/Make.defs
NETDEPPATH = --dep-path net
endif
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
include pipes/Make.defs
PIPEDEPPATH = --dep-path pipes
endif
ifeq ($(CONFIG_USBDEV),y)
include usbdev/Make.defs
USBDEVDEPPATH = --dep-path usbdev
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbdev}
endif
ifeq ($(CONFIG_USBHOST),y)
include usbhost/Make.defs
USBHOSTDEPPATH = --dep-path usbhost
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbhost}
endif
include mmcsd/Make.defs
MMCSDDEPPATH = --dep-path mmcsd
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/mmcsd}
include lcd/Make.defs
LCDDEPPATH = --dep-path lcd
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/lcd}
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
include bch/Make.defs
BCHDEPPATH = --dep-path bch
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/bch}
endif
endif
include mtd/Make.defs
MTDDEPPATH = --dep-path mtd
include sensors/Make.defs
SENSORSDEPPATH = --dep-path sensors
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/sensors}
ifeq ($(CONFIG_WIRELESS),y)
include wireless/Make.defs
WIRELESSDEPPATH = --dep-path wireless
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/wireless}
endif
ASRCS = $(SERIAL_ASRCS) $(NET_ASRCS) $(PIPE_ASRCS) $(USBDEV_ASRCS) \
$(USBHOST_ASRCS) $(MMCSD_ASRCS) $(LCD_ASRCS) $(BCH_ASRCS) \
$(MTD_ASRCS) $(SENSOR_ASRCS) $(WIRELESS_ASRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS =
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
CSRCS += dev_null.c dev_zero.c loop.c can.c
CSRCS += dev_null.c dev_zero.c loop.c can.c
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
CSRCS += ramdisk.c rwbuffer.c
CSRCS += ramdisk.c rwbuffer.c
endif
endif
CSRCS += $(SERIAL_CSRCS) $(NET_CSRCS) $(PIPE_CSRCS) $(USBDEV_CSRCS) \
$(USBHOST_CSRCS) $(MMCSD_CSRCS) $(LCD_CSRCS) $(BCH_CSRCS) \
$(MTD_CSRCS) $(SENSOR_CSRCS) $(WIRELESS_CSRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
@@ -119,8 +75,6 @@ OBJS = $(AOBJS) $(COBJS)
BIN = libdrivers$(LIBEXT)
VPATH = serial:net:pipes:usbdev:usbhost:mmcsd:lcd:bch:mtd:sensors:wireless
all: $(BIN)
$(AOBJS): %$(OBJEXT): %.S
@@ -135,10 +89,7 @@ $(BIN): $(OBJS)
done ; )
.depend: Makefile $(SRCS)
@$(MKDEP) $(ROOTDEPPATH) $(SERIALDEPPATH) $(NETDEPPATH) $(PIPEDEPPATH) \
$(USBDEVDEPPATH) $(USBHOSTDEPPATH) $(MMCSDDEPPATH) $(LCDDEPPATH) \
$(BCHDEPPATH) $(MTDDEPPATH) $(SENSORSDEPPATH) $(WIRELESSDEPPATH) \
$(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
depend: .depend
+17 -5
View File
@@ -1,7 +1,7 @@
############################################################################
# drivers/bch/Make.defs
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,20 @@
#
############################################################################
BCH_ASRCS =
BCH_CSRCS = bchlib_setup.c bchlib_teardown.c bchlib_read.c bchlib_write.c \
bchlib_cache.c bchlib_sem.c bchdev_register.c bchdev_unregister.c \
bchdev_driver.c
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
# Include BCH driver
CSRCS += bchlib_setup.c bchlib_teardown.c bchlib_read.c bchlib_write.c \
bchlib_cache.c bchlib_sem.c bchdev_register.c bchdev_unregister.c \
bchdev_driver.c
# Include BCH driver build support
DEPPATH += --dep-path bch
VPATH += :bch
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/bch}
endif
endif
+11 -7
View File
@@ -1,7 +1,7 @@
############################################################################
# drivers/lcd/Make.defs
#
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -33,24 +33,28 @@
#
############################################################################
LCD_ASRCS =
LCD_CSRCS =
# Don't build anything if there is no NX support for LCD drivers
ifeq ($(CONFIG_NX_LCDDRIVER),y)
# Include LCD drivers
ifeq ($(CONFIG_LCD_P14201),y)
LCD_CSRCS = p14201.c
CSRCS += p14201.c
endif
ifeq ($(CONFIG_LCD_NOKIA6100),y)
LCD_CSRCS = nokia6100.c
CSRCS += nokia6100.c
endif
ifeq ($(CONFIG_LCD_UG9664HSWAG01),y)
LCD_CSRCS = ug-9664hswag01.c
CSRCS += ug-9664hswag01.c
endif
# Include LCD driver build support
DEPPATH += --dep-path lcd
VPATH += :lcd
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/lcd}
endif
+11 -3
View File
@@ -1,7 +1,7 @@
############################################################################
# drivers/mmcsd/Make.defs
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -33,6 +33,14 @@
#
############################################################################
MMCSD_ASRCS =
MMCSD_CSRCS = mmcsd_sdio.c mmcsd_spi.c mmcsd_debug.c
# Include MMC/SD drivers
CSRCS += mmcsd_sdio.c mmcsd_spi.c mmcsd_debug.c
# Include MMC/SD driver build support
DEPPATH += --dep-path mmcsd
VPATH += :mmcsd
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/mmcsd}
+10 -3
View File
@@ -2,7 +2,7 @@
# drivers/mtd/Make.defs
# This driver supports a block of RAM as a NuttX MTD device
#
# Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2009-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -34,5 +34,12 @@
#
############################################################################
MTD_ASRCS =
MTD_CSRCS = ftl.c m25px.c at45db.c ramtron.c rammtd.c
# Include MTD drivers
CSRCS += ftl.c m25px.c at45db.c ramtron.c rammtd.c
# Include MTD driver support
DEPPATH += --dep-path mtd
VPATH += :mtd
+28 -17
View File
@@ -1,7 +1,7 @@
############################################################################
# drivers/net/Make.defs
#
# Copyright (C) 2007, 2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2007, 2010-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -33,24 +33,35 @@
#
############################################################################
NET_ASRCS =
NET_CSRCS =
# Include nothing if networking is disabled
ifeq ($(CONFIG_NET),y)
# Include network interface drivers
ifeq ($(CONFIG_NET_DM90x0),y)
NET_CSRCS += dm90x0.c
endif
ifeq ($(CONFIG_NET_CS89x0),y)
NET_CSRCS += cs89x0.c
endif
ifeq ($(CONFIG_NET_ENC28J60),y)
NET_CSRCS += enc28j60.c
endif
ifeq ($(CONFIG_NET_VNET),y)
NET_CSRCS += vnet.c
endif
ifeq ($(CONFIG_NET_SLIP),y)
NET_CSRCS += slip.c
endif
CSRCS += dm90x0.c
endif
ifeq ($(CONFIG_NET_CS89x0),y)
CSRCS += cs89x0.c
endif
ifeq ($(CONFIG_NET_ENC28J60),y)
CSRCS += enc28j60.c
endif
ifeq ($(CONFIG_NET_VNET),y)
CSRCS += vnet.c
endif
ifeq ($(CONFIG_NET_SLIP),y)
CSRCS += slip.c
endif
# Include network build support
DEPPATH += --dep-path net
VPATH += :net
endif
+10 -5
View File
@@ -1,7 +1,7 @@
############################################################################
# drivers/pipes/Make.defs
#
# Copyright (C) 2009 Gregory Nutt. All rights reserved.
# Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -33,9 +33,14 @@
#
############################################################################
PIPE_ASRCS =
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
PIPE_CSRCS = pipe.c fifo.c pipe_common.c
else
PIPE_CSRCS =
# Include pipe driver
CSRCS += pipe.c fifo.c pipe_common.c
# Include pipe build support
DEPPATH += --dep-path pipes
VPATH += :pipes
endif
+7 -4
View File
@@ -33,12 +33,15 @@
#
############################################################################
SENSOR_ASRCS =
SENSOR_CSRCS =
# Include sensor drivers
# These drivers depend on I2C support
ifeq ($(CONFIG_I2C),y)
SENSOR_CSRCS += lis331dl.c
CSRCS += lis331dl.c
endif
# Include sensor driver build support
DEPPATH += --dep-path sensors
VPATH += :sensors
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/sensors}
+3 -1
View File
@@ -189,8 +189,10 @@ struct lis331dl_dev_s * lis331dl_init(struct i2c_dev_s * i2c, uint16_t address)
ASSERT(i2c);
ASSERT(address);
if ( (dev = kmalloc( sizeof(struct lis331dl_dev_s) )) == NULL )
if ( (dev = kmalloc( sizeof(struct lis331dl_dev_s) )) == NULL ) {
errno = ENOMEM;
return NULL;
}
memset(dev, 0, sizeof(struct lis331dl_dev_s));
dev->i2c = i2c;
+11 -5
View File
@@ -33,12 +33,18 @@
#
############################################################################
SERIAL_ASRCS =
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
SERIAL_CSRCS = serial.c serialirq.c lowconsole.c
# Include serial drivers
CSRCS += serial.c serialirq.c lowconsole.c
ifeq ($(CONFIG_16550_UART),y)
SERIAL_CSRCS += uart_16550.c
CSRCS += uart_16550.c
endif
else
SERIAL_CSRCS =
# Include serial build support
DEPPATH += --dep-path serial
VPATH += :serial
endif
+17 -10
View File
@@ -1,7 +1,7 @@
############################################################################
# drivers/usbdev/Make.defs
#
# Copyright (C) 2008, 2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2008, 2010-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -33,16 +33,23 @@
#
############################################################################
USBDEV_ASRCS =
USBDEV_CSRCS =
ifeq ($(CONFIG_USBDEV),y)
# Include USB device drivers
ifeq ($(CONFIG_USBSER),y)
USBDEV_CSRCS += usbdev_serial.c
endif
ifeq ($(CONFIG_USBSTRG),y)
USBDEV_CSRCS += usbdev_storage.c usbdev_scsi.c
endif
USBDEV_CSRCS += usbdev_trace.c usbdev_trprintf.c
CSRCS += usbdev_serial.c
endif
ifeq ($(CONFIG_USBSTRG),y)
CSRCS += usbdev_storage.c usbdev_scsi.c
endif
CSRCS += usbdev_trace.c usbdev_trprintf.c
# Include USB device build support
DEPPATH += --dep-path usbdev
VPATH += :usbdev
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbdev}
endif
+15 -9
View File
@@ -1,7 +1,7 @@
############################################################################
# drivers/usbhost/Make.defs
#
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -33,19 +33,25 @@
#
############################################################################
USBHOST_ASRCS =
USBHOST_CSRCS = hid_parser.c
# Built-in USB driver logic
CSRCS += hid_parser.c
ifeq ($(CONFIG_USBHOST),y)
USBHOST_CSRCS += usbhost_registry.c usbhost_registerclass.c usbhost_findclass.c
USBHOST_CSRCS += usbhost_enumerate.c usbhost_storage.c usbhost_hidkbd.c
# Add-on USB driver logic (see misc/drivers)
# Include built-in USB host driver logic
CSRCS += usbhost_registry.c usbhost_registerclass.c usbhost_findclass.c
CSRCS += usbhost_enumerate.c usbhost_storage.c usbhost_hidkbd.c
# Include add-on USB host driver logic (see misc/drivers)
ifeq ($(CONFIG_NET),y)
RTL8187_CSRC := ${shell if [ -f usbhost/rtl8187x.c ]; then echo "rtl8187x.c"; fi}
USBHOST_CSRCS += $(RTL8187_CSRC)
CSRCS += $(RTL8187_CSRC)
endif
endif
# Include USB host driver build logic
DEPPATH += --dep-path usbhost
VPATH += :usbhost
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbhost}
+10 -4
View File
@@ -33,9 +33,15 @@
#
############################################################################
WIRELESS_ASRCS =
WIRELESS_CSRCS =
ifeq ($(CONFIG_WIRELESS),y)
WIRELESS_CSRCS += cc1101.c
# Include wireless drivers
CSRCS += cc1101.c ISM1_868MHzGFSK100kbps.c ISM2_905MHzGFSK250kbps.c
# Include wireless build support
DEPPATH += --dep-path wireless/cc1101
VPATH += :wireless/cc1101
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/wireless/cc1101}
endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,113 @@
/****************************************************************************
* drivers/wireless/cc1101/ISM1_868MHzGFSK100kbps.c
*
* Copyright (C) 2011 Uros Platise. All rights reserved.
* Copyright (C) 2011 Ales Verbic. All rights reserved.
*
* Authors: Uros Platise <uros.platise@isotel.eu>
* Ales Verbic <ales.verbic@isotel.eu>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <nuttx/wireless/cc1101.h>
/** Settings for 868 MHz, GFSK at 100kbps
*
* ISM Region 1 (Europe) only, Band 868870 MHz
*
* Frequency ERP Duty Cycle Bandwidth Remarks
* 868 868.6 MHz +14 dBm < 1% No limits
* 868.7 869.2 MHz +14 dBm < 0.1% No limits
* 869.3 869.4 MHz +10 dBm No limits < 25 kHz Appropriate access protocol required
* 869.4 869.65 MHz +27 dBm < 10% < 25 kHz Channels may be combined to one high speed channel
* 869.7 -870 MHz +7 dBm No limits No limits
*
* Deviation = 46.142578
* Base frequency = 867.999985
* Carrier frequency = 867.999985
* Channel number = 0
* Carrier frequency = 867.999985
* Modulated = true
* Modulation format = GFSK
* Manchester enable = false
* Sync word qualifier mode = 30/32 sync word bits detected
* Preamble count = 4
* Channel spacing = 199.813843
* Carrier frequency = 867.999985
* Data rate = 99.9069
* RX filter BW = 210.937500
* Data format = Normal mode
* Length config = Fixed packet length mode. Length configured in PKTLEN register
* CRC enable = true
* Packet length = 62
* Device address = 00
* Address config = NO Address check, no broadcast
* CRC autoflush = true
* PA ramping = false
* TX power = 0
*/
const struct c1101_rfsettings_s cc1101_rfsettings_ISM1_868MHzGFSK100kbps = {
.FSCTRL1 = 0x08, // FSCTRL1 Frequency Synthesizer Control
.FSCTRL0 = 0x00, // FSCTRL0 Frequency Synthesizer Control
.FREQ2 = 0x20, // FREQ2 Frequency Control Word, High Byte
.FREQ1 = 0x25, // FREQ1 Frequency Control Word, Middle Byte
.FREQ0 = 0xED, // FREQ0 Frequency Control Word, Low Byte
.MDMCFG4 = 0x8B, // MDMCFG4 Modem Configuration
.MDMCFG3 = 0xE5, // MDMCFG3 Modem Configuration
.MDMCFG2 = 0x13, // MDMCFG2 Modem Configuration
.MDMCFG1 = 0x22, // MDMCFG1 Modem Configuration
.MDMCFG0 = 0xE5, // MDMCFG0 Modem Configuration
.DEVIATN = 0x46, // DEVIATN Modem Deviation Setting
.FOCCFG = 0x1D, // FOCCFG Frequency Offset Compensation Configuration
.BSCFG = 0x1C, // BSCFG Bit Synchronization Configuration
.AGCCTRL2= 0xC7, // AGCCTRL2 AGC Control
.AGCCTRL1= 0x00, // AGCCTRL1 AGC Control
.AGCCTRL0= 0xB2, // AGCCTRL0 AGC Control
.FREND1 = 0xB6, // FREND1 Front End RX Configuration
.FREND0 = 0x10, // FREND0 Front End TX Configuration
.FSCAL3 = 0xEA, // FSCAL3 Frequency Synthesizer Calibration
.FSCAL2 = 0x2A, // FSCAL2 Frequency Synthesizer Calibration
.FSCAL1 = 0x00, // FSCAL1 Frequency Synthesizer Calibration
.FSCAL0 = 0x1F, // FSCAL0 Frequency Synthesizer Calibration
.CHMIN = 0, // Fix at 9th channel: 869.80 MHz +- 100 kHz RF Bandwidth
.CHMAX = 9, // single channel
.PAMAX = 8, // 0 means power OFF, 8 represents PA[7]
.PA = {0x03, 0x0F, 0x1E, 0x27, 0x67, 0x50, 0x81, 0xC2}
};
@@ -0,0 +1,111 @@
/****************************************************************************
* drivers/wireless/cc1101/ISM2_905MHzGFSK250kbps.c
*
* Copyright (C) 2011 Uros Platise. All rights reserved.
* Copyright (C) 2011 Ales Verbic. All rights reserved.
*
* Authors: Uros Platise <uros.platise@isotel.eu>
* Ales Verbic <ales.verbic@isotel.eu>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <nuttx/wireless/cc1101.h>
/** Settings for 905 MHz, GFSK at 250kbps
*
* ISM Region 2 (America) only, Band 902928 MHz
*
* Cordless phones 1 W
* Microwave ovens 750 W
* Industrial heaters 100 kW
* Military radar 1000 kW
*
* Deviation = 126.953125
* Base frequency = 901.999969
* Carrier frequency = 905.998993
* Channel number = 20
* Carrier frequency = 905.998993
* Modulated = true
* Modulation format = GFSK
* Manchester enable = false
* Sync word qualifier mode = 30/32 sync word bits detected
* Preamble count = 4
* Channel spacing = 199.951172
* Carrier frequency = 905.998993
* Data rate = 249.939
* RX filter BW = 541.666667
* Data format = Normal mode
* Length config = Variable packet length mode. Packet length configured by the first byte after sync word
* CRC enable = true
* Packet length = 61
* Device address = 0
* Address config = No address check
* CRC autoflush = false
* PA ramping = false
* TX power = 0
*/
const struct c1101_rfsettings_s cc1101_rfsettings_ISM2_905MHzGFSK250kbps = {
.FSCTRL1 = 0x0C, // FSCTRL1 Frequency Synthesizer Control
.FSCTRL0 = 0x00, // FSCTRL0 Frequency Synthesizer Control
.FREQ2 = 0x22, // FREQ2 Frequency Control Word, High Byte
.FREQ1 = 0xB1, // FREQ1 Frequency Control Word, Middle Byte
.FREQ0 = 0x3B, // FREQ0 Frequency Control Word, Low Byte
.MDMCFG4 = 0x2D, // MDMCFG4 Modem Configuration
.MDMCFG3 = 0x3B, // MDMCFG3 Modem Configuration
.MDMCFG2 = 0x13, // MDMCFG2 Modem Configuration
.MDMCFG1 = 0x22, // MDMCFG1 Modem Configuration
.MDMCFG0 = 0xF8, // MDMCFG0 Modem Configuration
.DEVIATN = 0x62, // DEVIATN Modem Deviation Setting
.FOCCFG = 0x1D, // FOCCFG Frequency Offset Compensation Configuration
.BSCFG = 0x1C, // BSCFG Bit Synchronization Configuration
.AGCCTRL2= 0xC7, // AGCCTRL2 AGC Control
.AGCCTRL1= 0x00, // AGCCTRL1 AGC Control
.AGCCTRL0= 0xB0, // AGCCTRL0 AGC Control
.FREND1 = 0xB6, // FREND1 Front End RX Configuration
.FREND0 = 0x10, // FREND0 Front End TX Configuration
.FSCAL3 = 0xEA, // FSCAL3 Frequency Synthesizer Calibration
.FSCAL2 = 0x2A, // FSCAL2 Frequency Synthesizer Calibration
.FSCAL1 = 0x00, // FSCAL1 Frequency Synthesizer Calibration
.FSCAL0 = 0x1F, // FSCAL0 Frequency Synthesizer Calibration
.CHMIN = 0, // VERIFY REGULATIONS!
.CHMAX = 0xFF,
.PAMAX = 8, // 0 means power OFF, 8 represents PA[7]
.PA = {0x03, 0x0E, 0x1E, 0x27, 0x39, 0x8E, 0xCD, 0xC0}
};
+773
View File
File diff suppressed because it is too large Load Diff