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

📄 app.c

📁 This is a sensor module build in NesC
💻 C
📖 第 1 页 / 共 5 页
字号:
enum __nesc_unnamed4273 {  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_unnamed4274 {  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;# 48 "/opt/tinyos-2.1.0/tos/platforms/telosa/platform_message.h"#line 45typedef union message_header {  cc2420_header_t cc2420;  serial_header_t serial;} message_header_t;#line 50typedef union TOSRadioFooter {  cc2420_footer_t cc2420;} message_footer_t;#line 54typedef union TOSRadioMetadata {  cc2420_metadata_t cc2420;  serial_metadata_t serial;} message_metadata_t;# 19 "/opt/tinyos-2.1.0/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;# 59 "/opt/tinyos-2.1.0/tos/chips/msp430/adc12/Msp430Adc12.h"#line 48typedef struct __nesc_unnamed4275 {  unsigned int inch : 4;  unsigned int sref : 3;  unsigned int ref2_5v : 1;  unsigned int adc12ssel : 2;  unsigned int adc12div : 3;  unsigned int sht : 4;  unsigned int sampcon_ssel : 2;  unsigned int sampcon_id : 2;  unsigned int  : 0;} msp430adc12_channel_config_t;#line 61typedef struct __nesc_unnamed4276 {  volatile unsigned   inch : 4,   sref : 3,   eos : 1;} __attribute((packed))  adc12memctl_t;enum inch_enum {  INPUT_CHANNEL_A0 = 0,   INPUT_CHANNEL_A1 = 1,   INPUT_CHANNEL_A2 = 2,   INPUT_CHANNEL_A3 = 3,   INPUT_CHANNEL_A4 = 4,   INPUT_CHANNEL_A5 = 5,   INPUT_CHANNEL_A6 = 6,   INPUT_CHANNEL_A7 = 7,   EXTERNAL_REF_VOLTAGE_CHANNEL = 8,   REF_VOLTAGE_NEG_TERMINAL_CHANNEL = 9,   TEMPERATURE_DIODE_CHANNEL = 10,   SUPPLY_VOLTAGE_HALF_CHANNEL = 11,   INPUT_CHANNEL_NONE = 12};enum sref_enum {  REFERENCE_AVcc_AVss = 0,   REFERENCE_VREFplus_AVss = 1,   REFERENCE_VeREFplus_AVss = 2,   REFERENCE_AVcc_VREFnegterm = 4,   REFERENCE_VREFplus_VREFnegterm = 5,   REFERENCE_VeREFplus_VREFnegterm = 6};enum ref2_5v_enum {  REFVOLT_LEVEL_1_5 = 0,   REFVOLT_LEVEL_2_5 = 1,   REFVOLT_LEVEL_NONE = 0};enum adc12ssel_enum {  SHT_SOURCE_ADC12OSC = 0,   SHT_SOURCE_ACLK = 1,   SHT_SOURCE_MCLK = 2,   SHT_SOURCE_SMCLK = 3};enum adc12div_enum {  SHT_CLOCK_DIV_1 = 0,   SHT_CLOCK_DIV_2 = 1,   SHT_CLOCK_DIV_3 = 2,   SHT_CLOCK_DIV_4 = 3,   SHT_CLOCK_DIV_5 = 4,   SHT_CLOCK_DIV_6 = 5,   SHT_CLOCK_DIV_7 = 6,   SHT_CLOCK_DIV_8 = 7};enum sht_enum {  SAMPLE_HOLD_4_CYCLES = 0,   SAMPLE_HOLD_8_CYCLES = 1,   SAMPLE_HOLD_16_CYCLES = 2,   SAMPLE_HOLD_32_CYCLES = 3,   SAMPLE_HOLD_64_CYCLES = 4,   SAMPLE_HOLD_96_CYCLES = 5,   SAMPLE_HOLD_123_CYCLES = 6,   SAMPLE_HOLD_192_CYCLES = 7,   SAMPLE_HOLD_256_CYCLES = 8,   SAMPLE_HOLD_384_CYCLES = 9,   SAMPLE_HOLD_512_CYCLES = 10,   SAMPLE_HOLD_768_CYCLES = 11,   SAMPLE_HOLD_1024_CYCLES = 12};enum sampcon_ssel_enum {  SAMPCON_SOURCE_TACLK = 0,   SAMPCON_SOURCE_ACLK = 1,   SAMPCON_SOURCE_SMCLK = 2,   SAMPCON_SOURCE_INCLK = 3};enum sampcon_id_enum {  SAMPCON_CLOCK_DIV_1 = 0,   SAMPCON_CLOCK_DIV_2 = 1,   SAMPCON_CLOCK_DIV_3 = 2,   SAMPCON_CLOCK_DIV_4 = 3};# 33 "/opt/tinyos-2.1.0/tos/types/Resource.h"typedef uint8_t resource_client_id_t;# 38 "/opt/tinyos-2.1.0/tos/chips/cc2420/IEEE802154.h"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};enum iee154_fcf_addr_mode_enums {  IEEE154_ADDR_NONE = 0,   IEEE154_ADDR_SHORT = 2,   IEEE154_ADDR_EXT = 3};# 56 "/opt/tinyos-2.1.0/tos/chips/msp430/usart/msp430usart.h"#line 48typedef enum __nesc_unnamed4277 {  USART_NONE = 0,   USART_UART = 1,   USART_UART_TX = 2,   USART_UART_RX = 3,   USART_SPI = 4,   USART_I2C = 5} msp430_usartmode_t;#line 58typedef struct __nesc_unnamed4278 {  unsigned int swrst : 1;  unsigned int mm : 1;  unsigned int sync : 1;  unsigned int listen : 1;  unsigned int clen : 1;  unsigned int spb : 1;  unsigned int pev : 1;  unsigned int pena : 1;} __attribute((packed))  msp430_uctl_t;#line 69typedef struct __nesc_unnamed4279 {  unsigned int txept : 1;  unsigned int stc : 1;  unsigned int txwake : 1;  unsigned int urxse : 1;  unsigned int ssel : 2;  unsigned int ckpl : 1;  unsigned int ckph : 1;} __attribute((packed))  msp430_utctl_t;#line 79typedef struct __nesc_unnamed4280 {  unsigned int rxerr : 1;  unsigned int rxwake : 1;  unsigned int urxwie : 1;  unsigned int urxeie : 1;  unsigned int brk : 1;  unsigned int oe : 1;  unsigned int pe : 1;  unsigned int fe : 1;} __attribute((packed))  msp430_urctl_t;#line 116#line 99typedef struct __nesc_unnamed4281 {  unsigned int ubr : 16;  unsigned int  : 1;  unsigned int mm : 1;  unsigned int  : 1;  unsigned int listen : 1;  unsigned int clen : 1;  unsigned int  : 3;  unsigned int  : 1;  unsigned int stc : 1;  unsigned int  : 2;  unsigned int ssel : 2;  unsigned int ckpl : 1;  unsigned int ckph : 1;  unsigned int  : 0;} msp430_spi_config_t;#line 118typedef struct __nesc_unnamed4282 {  uint16_t ubr;  uint8_t uctl;  uint8_t utctl;} msp430_spi_registers_t;#line 124typedef union __nesc_unnamed4283 {  msp430_spi_config_t spiConfig;  msp430_spi_registers_t spiRegisters;} msp430_spi_union_config_t;msp430_spi_union_config_t msp430_spi_default_config = { { .ubr = 0x0002, .ssel = 0x02, .clen = 1, .listen = 0, .mm = 1, .ckph = 1, .ckpl = 0, .stc = 1 } };#line 169#line 150typedef enum __nesc_unnamed4284 {  UBR_32KHZ_1200 = 0x001B, UMCTL_32KHZ_1200 = 0x94,   UBR_32KHZ_1800 = 0x0012, UMCTL_32KHZ_1800 = 0x84,   UBR_32KHZ_2400 = 0x000D, UMCTL_32KHZ_2400 = 0x6D,   UBR_32KHZ_4800 = 0x0006, UMCTL_32KHZ_4800 = 0x77,   UBR_32KHZ_9600 = 0x0003, UMCTL_32KHZ_9600 = 0x29,   UBR_1MHZ_1200 = 0x0369, UMCTL_1MHZ_1200 = 0x7B,   UBR_1MHZ_1800 = 0x0246, UMCTL_1MHZ_1800 = 0x55,   UBR_1MHZ_2400 = 0x01B4, UMCTL_1MHZ_2400 = 0xDF,   UBR_1MHZ_4800 = 0x00DA, UMCTL_1MHZ_4800 = 0xAA,   UBR_1MHZ_9600 = 0x006D, UMCTL_1MHZ_9600 = 0x44,   UBR_1MHZ_19200 = 0x0036, UMCTL_1MHZ_19200 = 0xB5,   UBR_1MHZ_38400 = 0x001B, UMCTL_1MHZ_38400 = 0x94,   UBR_1MHZ_57600 = 0x0012, UMCTL_1MHZ_57600 = 0x84,   UBR_1MHZ_76800 = 0x000D, UMCTL_1MHZ_76800 = 0x6D,   UBR_1MHZ_115200 = 0x0009, UMCTL_1MHZ_115200 = 0x10,   UBR_1MHZ_230400 = 0x0004, UMCTL_1MHZ_230400 = 0x55} msp430_uart_rate_t;#line 200#line 171typedef struct __nesc_unnamed4285 {  unsigned int ubr : 16;  unsigned int umctl : 8;  unsigned int  : 1;  unsigned int mm : 1;  unsigned int  : 1;  unsigned int listen : 1;  unsigned int clen : 1;  unsigned int spb : 1;  unsigned int pev : 1;  unsigned int pena : 1;  unsigned int  : 0;  unsigned int  : 3;  unsigned int urxse : 1;  unsigned int ssel : 2;  unsigned int ckpl : 1;  unsigned int  : 1;  unsigned int  : 2;  unsigned int urxwie : 1;  unsigned int urxeie : 1;  unsigned int  : 4;  unsigned int  : 0;  unsigned int utxe : 1;  unsigned int urxe : 1;} msp430_uart_config_t;#line 202typedef struct __nesc_unnamed4286 {  uint16_t ubr;  uint8_t umctl;  uint8_t uctl;  uint8_t utctl;  uint8_t urctl;  uint8_t ume;} msp430_uart_registers_t;#line 211typedef union __nesc_unnamed4287 {  msp430_uart_config_t uartConfig;  msp430_uart_registers_t uartRegisters;} msp430_uart_union_config_t;#line 248#line 240typedef struct __nesc_unnamed4288 {  unsigned int i2cstt : 1;  unsigned int i2cstp : 1;  unsigned int i2cstb : 1;  unsigned int i2cctrx : 1;  unsigned int i2cssel : 2;  unsigned int i2ccrm : 1;  unsigned int i2cword : 1;} __attribute((packed))  msp430_i2ctctl_t;#line 276#line 253typedef struct __nesc_unnamed4289 {  unsigned int  : 1;  unsigned int mst : 1;  unsigned int  : 1;  unsigned int listen : 1;  unsigned int xa : 1;  unsigned int  : 1;  unsigned int txdmaen : 1;  unsigned int rxdmaen : 1;  unsigned int  : 4;

⌨️ 快捷键说明

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