⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 app.c

📁 tinyos下的BLINKRADIO程序
💻 C
📖 第 1 页 / 共 5 页
字号:
# 32 "/opt/tinyos-2.x/tos/types/Leds.h"enum __nesc_unnamed4311 {  LEDS_LED0 = 1 << 0,   LEDS_LED1 = 1 << 1,   LEDS_LED2 = 1 << 2,   LEDS_LED3 = 1 << 3,   LEDS_LED4 = 1 << 4,   LEDS_LED5 = 1 << 5,   LEDS_LED6 = 1 << 6,   LEDS_LED7 = 1 << 7};# 42 "/opt/tinyos-2.x/tos/chips/rf230/IEEE154Packet.h"#line 27typedef nx_struct ieee154_header_t {  nxle_uint8_t length;  nxle_uint16_t fcf;  nxle_uint8_t dsn;  nxle_uint16_t destpan;  nxle_uint16_t dest;  nxle_uint16_t src;  nxle_uint8_t type;} __attribute__((packed)) ieee154_header_t;#line 45typedef nx_struct ieee154_footer_t {  nxle_uint16_t crc;} __attribute__((packed)) ieee154_footer_t;enum ieee154_fcf_enums {  IEEE154_FCF_FRAME_TYPE = 0,   IEEE154_FCF_SECURITY_ENABLED = 3,   IEEE154_FCF_FRAME_PENDING = 4,   IEEE154_FCF_ACK_REQ = 5,   IEEE154_FCF_INTRAPAN = 6,   IEEE154_FCF_DEST_ADDR_MODE = 10,   IEEE154_FCF_SRC_ADDR_MODE = 14};enum ieee154_fcf_type_enums {  IEEE154_TYPE_BEACON = 0,   IEEE154_TYPE_DATA = 1,   IEEE154_TYPE_ACK = 2,   IEEE154_TYPE_MAC_CMD = 3,   IEEE154_TYPE_MASK = 7};enum iee154_fcf_addr_mode_enums {  IEEE154_ADDR_NONE = 0,   IEEE154_ADDR_SHORT = 2,   IEEE154_ADDR_EXT = 3,   IEEE154_ADDR_MASK = 3};# 29 "/opt/tinyos-2.x/tos/chips/rf230/RF230Packet.h"typedef ieee154_header_t rf230packet_header_t;#line 31typedef nx_struct rf230packet_footer_t {} __attribute__((packed)) rf230packet_footer_t;#line 36typedef struct rf230packet_metadata_t {  uint8_t flags;  uint8_t lqi;  uint8_t power;  uint32_t timestamp;} rf230packet_metadata_t;enum rf230packet_metadata_flags {  RF230PACKET_WAS_ACKED = 0x01,   RF230PACKET_TIMESTAMP = 0x02,   RF230PACKET_TXPOWER = 0x04,   RF230PACKET_RSSI = 0x08,   RF230PACKET_TIMESYNC = 0x10,   RF230PACKET_CLEAR_METADATA = 0x00};# 6 "/opt/tinyos-2.x/tos/types/AM.h"typedef nx_uint8_t nx_am_id_t;typedef nx_uint8_t nx_am_group_t;typedef nx_uint16_t nx_am_addr_t;typedef uint8_t am_id_t;typedef uint8_t am_group_t;typedef uint16_t am_addr_t;enum __nesc_unnamed4312 {  AM_BROADCAST_ADDR = 0xffff};enum __nesc_unnamed4313 {  TOS_AM_GROUP = 0x22,   TOS_AM_ADDRESS = 1};# 72 "/opt/tinyos-2.x/tos/lib/serial/Serial.h"typedef uint8_t uart_id_t;enum __nesc_unnamed4314 {  HDLC_FLAG_BYTE = 0x7e,   HDLC_CTLESC_BYTE = 0x7d};enum __nesc_unnamed4315 {  TOS_SERIAL_ACTIVE_MESSAGE_ID = 0,   TOS_SERIAL_CC1000_ID = 1,   TOS_SERIAL_802_15_4_ID = 2,   TOS_SERIAL_UNKNOWN_ID = 255};enum __nesc_unnamed4316 {  SERIAL_PROTO_ACK = 67,   SERIAL_PROTO_PACKET_ACK = 68,   SERIAL_PROTO_PACKET_NOACK = 69,   SERIAL_PROTO_PACKET_UNKNOWN = 255};#line 110#line 98typedef struct radio_stats {  uint8_t version;  uint8_t flags;  uint8_t reserved;  uint8_t platform;  uint16_t MTU;  uint16_t radio_crc_fail;  uint16_t radio_queue_drops;  uint16_t serial_crc_fail;  uint16_t serial_tx_fail;  uint16_t serial_short_packets;  uint16_t serial_proto_drops;} radio_stats_t;#line 112typedef nx_struct serial_header {  nx_am_addr_t dest;  nx_am_addr_t src;  nx_uint8_t length;  nx_am_group_t group;  nx_am_id_t type;} __attribute__((packed)) serial_header_t;#line 120typedef nx_struct serial_packet {  serial_header_t header;  nx_uint8_t data[];} __attribute__((packed)) serial_packet_t;#line 125typedef nx_struct serial_metadata {  nx_uint8_t ack;} __attribute__((packed)) serial_metadata_t;# 71 "/opt/tinyos-2.x/tos/platforms/iris/platform_message.h"#line 68typedef union message_header {  rf230packet_header_t rf230;  serial_header_t serial;} message_header_t;#line 73typedef union message_footer {  rf230packet_footer_t rf230;} message_footer_t;#line 77typedef union message_metadata {  rf230packet_metadata_t rf230;} message_metadata_t;# 19 "/opt/tinyos-2.x/tos/types/message.h"#line 14typedef nx_struct message_t {  nx_uint8_t header[sizeof(message_header_t )];  nx_uint8_t data[28];  nx_uint8_t footer[sizeof(message_footer_t )];  nx_uint8_t metadata[sizeof(message_metadata_t )];} __attribute__((packed)) message_t;# 27 "/opt/tinyos-2.x/tos/chips/rf230/RF230.h"enum rf230_registers_enum {  RF230_TRX_STATUS = 0x01,   RF230_TRX_STATE = 0x02,   RF230_TRX_CTRL_0 = 0x03,   RF230_PHY_TX_PWR = 0x05,   RF230_PHY_RSSI = 0x06,   RF230_PHY_ED_LEVEL = 0x07,   RF230_PHY_CC_CCA = 0x08,   RF230_CCA_THRES = 0x09,   RF230_IRQ_MASK = 0x0E,   RF230_IRQ_STATUS = 0x0F,   RF230_VREG_CTRL = 0x10,   RF230_BATMON = 0x11,   RF230_XOSC_CTRL = 0x12,   RF230_PLL_CF = 0x1A,   RF230_PLL_DCU = 0x1B,   RF230_PART_NUM = 0x1C,   RF230_VERSION_NUM = 0x1D,   RF230_MAN_ID_0 = 0x1E,   RF230_MAN_ID_1 = 0x1F,   RF230_SHORT_ADDR_0 = 0x20,   RF230_SHORT_ADDR_1 = 0x21,   RF230_PAN_ID_0 = 0x22,   RF230_PAN_ID_1 = 0x23,   RF230_IEEE_ADDR_0 = 0x24,   RF230_IEEE_ADDR_1 = 0x25,   RF230_IEEE_ADDR_2 = 0x26,   RF230_IEEE_ADDR_3 = 0x27,   RF230_IEEE_ADDR_4 = 0x28,   RF230_IEEE_ADDR_5 = 0x29,   RF230_IEEE_ADDR_6 = 0x2A,   RF230_IEEE_ADDR_7 = 0x2B,   RF230_XAH_CTRL = 0x2C,   RF230_CSMA_SEED_0 = 0x2D,   RF230_CSMA_SEED_1 = 0x2E};enum rf230_trx_register_enums {  RF230_CCA_DONE = 1 << 7,   RF230_CCA_STATUS = 1 << 6,   RF230_TRX_STATUS_MASK = 0x1F,   RF230_P_ON = 0,   RF230_BUSY_RX = 1,   RF230_BUSY_TX = 2,   RF230_RX_ON = 6,   RF230_TRX_OFF = 8,   RF230_PLL_ON = 9,   RF230_SLEEP = 15,   RF230_BUSY_RX_AACK = 16,   RF230_BUSR_TX_ARET = 17,   RF230_RX_AACK_ON = 22,   RF230_TX_ARET_ON = 25,   RF230_RX_ON_NOCLK = 28,   RF230_AACK_ON_NOCLK = 29,   RF230_BUSY_RX_AACK_NOCLK = 30,   RF230_STATE_TRANSITION_IN_PROGRESS = 31,   RF230_TRAC_STATUS_MASK = 0xE0,   RF230_TRAC_SUCCESS = 0,   RF230_TRAC_CHANNEL_ACCESS_FAILURE = 3 << 5,   RF230_TRAC_NO_ACK = 5 << 5,   RF230_TRX_CMD_MASK = 0x1F,   RF230_NOP = 0,   RF230_TX_START = 2,   RF230_FORCE_TRX_OFF = 3};enum rf230_phy_register_enums {  RF230_TX_AUTO_CRC_ON = 1 << 7,   RF230_TX_PWR_MASK = 0x0F,   RF230_TX_PWR_DEFAULT = 0,   RF230_RSSI_MASK = 0x1F,   RF230_CCA_REQUEST = 1 << 7,   RF230_CCA_MODE_0 = 0 << 5,   RF230_CCA_MODE_1 = 1 << 5,   RF230_CCA_MODE_2 = 2 << 5,   RF230_CCA_MODE_3 = 3 << 5,   RF230_CHANNEL_DEFAULT = 11,   RF230_CHANNEL_MASK = 0x1F,   RF230_CCA_CS_THRES_SHIFT = 4,   RF230_CCA_ED_THRES_SHIFT = 0};enum rf230_irq_register_enums {  RF230_IRQ_BAT_LOW = 1 << 7,   RF230_IRQ_TRX_UR = 1 << 6,   RF230_IRQ_TRX_END = 1 << 3,   RF230_IRQ_RX_START = 1 << 2,   RF230_IRQ_PLL_UNLOCK = 1 << 1,   RF230_IRQ_PLL_LOCK = 1 << 0};enum rf230_control_register_enums {  RF230_AVREG_EXT = 1 << 7,   RF230_AVDD_OK = 1 << 6,   RF230_DVREG_EXT = 1 << 3,   RF230_DVDD_OK = 1 << 2,   RF230_BATMON_OK = 1 << 5,   RF230_BATMON_VHR = 1 << 4,   RF230_BATMON_VTH_MASK = 0x0F,   RF230_XTAL_MODE_OFF = 0 << 4,   RF230_XTAL_MODE_EXTERNAL = 4 << 4,   RF230_XTAL_MODE_INTERNAL = 15 << 4};enum rf230_pll_register_enums {  RF230_PLL_CF_START = 1 << 7,   RF230_PLL_DCU_START = 1 << 7};enum rf230_spi_command_enums {  RF230_CMD_REGISTER_READ = 0x80,   RF230_CMD_REGISTER_WRITE = 0xC0,   RF230_CMD_REGISTER_MASK = 0x3F,   RF230_CMD_FRAME_READ = 0x20,   RF230_CMD_FRAME_WRITE = 0x60,   RF230_CMD_SRAM_READ = 0x00,   RF230_CMD_SRAM_WRITE = 0x40};# 29 "/opt/tinyos-2.x/tos/platforms/iris/chips/rf230/HplRF230.h"enum __nesc_unnamed4317 {  RF230_TRX_CTRL_0_VALUE = 0,   RF230_CCA_MODE_VALUE = RF230_CCA_MODE_3,   RF230_CCA_THRES_VALUE = 0xC7};typedef TOne TRF230;# 28 "/opt/tinyos-2.x/tos/chips/rf230/TimeSyncMessage.h"typedef nx_int32_t timesync_relative_t;typedef uint32_t timesync_absolute_t;# 251 "/usr/lib/gcc/avr/3.4.6/../../../../avr/include/util/crc16.h" 3#line 250static __inline uint16_t _crc_ccitt_update(uint16_t __crc, uint8_t __data);# 32 "/opt/tinyos-2.x/tos/chips/atm128/spi/Atm128Spi.h"enum __nesc_unnamed4318 {  ATM128_SPI_CLK_DIVIDE_4 = 0,   ATM128_SPI_CLK_DIVIDE_16 = 1,   ATM128_SPI_CLK_DIVIDE_64 = 2,   ATM128_SPI_CLK_DIVIDE_128 = 3};#line 49#line 40typedef struct __nesc_unnamed4319 {  uint8_t spie : 1;  uint8_t spe : 1;  uint8_t dord : 1;  uint8_t mstr : 1;  uint8_t cpol : 1;  uint8_t cpha : 1;  uint8_t spr : 2;} Atm128SPIControl_s;#line 50typedef union __nesc_unnamed4320 {  uint8_t flat;  Atm128SPIControl_s bits;} Atm128SPIControl_t;typedef Atm128SPIControl_t Atm128_SPCR_t;#line 58typedef struct __nesc_unnamed4321 {  uint8_t spif : 1;  uint8_t wcol : 1;  uint8_t rsvd : 5;  uint8_t spi2x : 1;} Atm128SPIStatus_s;#line 65typedef union __nesc_unnamed4322 {  uint8_t flat;  Atm128SPIStatus_s bits;} Atm128SPIStatus_t;typedef Atm128SPIStatus_t Atm128_SPSR_t;typedef uint8_t Atm128_SPDR_t;# 33 "/opt/tinyos-2.x/tos/types/Resource.h"typedef uint8_t resource_client_id_t;typedef TMilli BlinkToRadioC$Timer0$precision_tag;enum HilTimerMilliC$__nesc_unnamed4323 {  HilTimerMilliC$TIMER_COUNT = 2U};typedef TMilli /*AlarmCounterMilliP.Atm128AlarmAsyncC*/Atm128AlarmAsyncC$0$precision;typedef /*AlarmCounterMilliP.Atm128AlarmAsyncC*/Atm128AlarmAsyncC$0$precision /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$precision;typedef /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$precision /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Alarm$precision_tag;typedef uint32_t /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Alarm$size_type;typedef /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$precision /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Counter$precision_tag;typedef uint32_t /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Counter$size_type;typedef uint8_t /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Compare$size_type;typedef uint8_t /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Timer$timer_size;typedef uint8_t HplAtm1281Timer2AsyncP$Compare$size_type;typedef uint8_t HplAtm1281Timer2AsyncP$Timer$timer_size;typedef TMilli /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$precision_tag;typedef /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$precision_tag /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$Alarm$precision_tag;typedef uint32_t /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$Alarm$size_type;typedef /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$precision_tag /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$Timer$precision_tag;typedef TMilli /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC$0$precision_tag;typedef /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC$0$precision_tag /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC$0$TimerFrom$precision_tag;typedef /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC$0$precision_tag /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC$0$Timer$precision_tag;typedef TMilli /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$precision_tag;typedef /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$precision_tag /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$LocalTime$precision_tag;typedef /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$precision_tag /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$Counter$precision_tag;typedef uint32_t /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$Counter$size_type;typedef uint8_t RF230PacketP$PacketRSSI$value_type;typedef uint8_t RF230PacketP$PacketTransmitPower$value_type;typedef uint16_t RF230PacketP$PacketSleepInterval$value_type;typedef uint8_t RF230PacketP$PacketTimeSyncOffset$value_type;typedef TRF230 RF230PacketP$PacketTimeStampRadio$precision_tag;typedef uint32_t RF230PacketP$PacketTimeStampRadio$size_type;typedef TRF230 RF230PacketP$LocalTimeRadio$precision_tag;typedef uint8_t RF230PacketP$PacketLinkQuality$value_type;typedef TMilli RF230PacketP$LocalTimeMilli$precision_tag;typedef TMilli RF230PacketP$PacketTimeStampMilli$precision_tag;typedef uint32_t RF230PacketP$PacketTimeStampMilli$size_type;typedef uint16_t HplAtm1281Timer1P$CompareA$size_type;typedef uint16_t HplAtm1281Timer1P$Capture$size_type;typedef uint16_t HplAtm1281Timer1P$CompareB$size_type;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -