SZSPTP ez430-RF2480 1.0

ZigBee Sensor Network with synchronized time and time-stamped measurements.
cc2480ai.h File Reference

CC2480 interface. More...

#include <xdc/std.h>
+ Include dependency graph for cc2480ai.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CCAI_ZP_NV_APP_ITEM_1   0x0300
 Item 1 attribute id, size: 2 bytes.
 
#define CCAI_ZP_NV_APP_ITEM_2   0x0301
 Item 2 attribute id, size: 2 bytes.
 
#define CCAI_ZP_NV_APP_ITEM_3   0x0302
 Item 3 attribute id, size: 2 bytes.
 
#define CCAI_ZP_NV_APP_ITEM_4   0x0303
 Item 4 attribute id, size: 2 bytes.
 
#define CCAI_ZP_NV_APP_ITEM_5   0x0304
 Item 5 attribute id, size: 16 bytes.
 
#define CCAI_ZP_NV_APP_ITEM_6   0x0305
 Item 6 attribute id, size: 16 bytes.
 
#define CCAI_ADC_AIN0   0x06
 Input from A0, pin 17.
 
#define CCAI_ADC_AIN1   0x07
 Input from A1, pin 18.
 
#define CCAI_ADC_AIN0_1_DIFERENTIAL   0x0B
 Diferential input of A0 and A1 (A0 - A1), pins 17 and 18.
 
#define CCAI_ADC_TEMPERATURE_SENSOR   0x0E
 Input from internal temperature sensor.
 
#define CCAI_ADC_VOLTAGE_READING   0x0F
 Input is AVDD_SOC/3. AVDD_SOC is supply at pin 20.
 
#define CCAI_ADC_7_BIT   0x00
 7-bit resolution.
 
#define CCAI_ADC_9_BIT   0x01
 9-bit resolution.
 
#define CCAI_ADC_10_BIT   0x02
 10-bit resolution.
 
#define CCAI_ADC_12_BIT   0x03
 12-bit resolution.
 
#define CCAI_GPIO_SETDIRECTION   0x00
 Set direction, 0 to input and 1 to output.
 
#define CCAI_GPIO_SETINPUTMODE   0x01
 Set Input mode, 0 to pull-up and 1 to tri-state. GPIO0 and GPIO1 can only be set in tri-state mode.
 
#define CCAI_GPIO_SET   0x02
 Set specified bit(s).
 
#define CCAI_GPIO_CLEAR   0x03
 Clear specified bit(s).
 
#define CCAI_GPIO_TOGGLE   0x04
 Toggle specified bit(s).
 
#define CCAI_GPIO_READ   0x05
 Read specified bit(s).
 
#define CCAI_GPIO_BIT0   0x01
 Bit 0.
 
#define CCAI_GPIO_BIT1   0x02
 Bit 1.
 
#define CCAI_GPIO_BIT2   0x10
 Bit 2.
 
#define CCAI_GPIO_BIT3   0x20
 Bit 3.
 
#define CCAI_TESTRF_MODE_UNMODULATED   0X00
 Transmit unmodulated carrier.
 
#define CCAI_TESTRF_MODE_RANDOMDATA   0X00
 Transmit pseudo-random data.
 
#define CCAI_TESTRF_MODE_RECEIVEMODE   0X00
 Receive mode.
 
#define CCAI_TESTRF_PWR_P006   0xFF
 +0.6dBm.
 
#define CCAI_TESTRF_PWR_P005   0xDF
 +0.5dBm.
 
#define CCAI_TESTRF_PWR_P003   0xBF
 +0.3dBm.
 
#define CCAI_TESTRF_PWR_P002   0x9F
 +0.2dBm.
 
#define CCAI_TESTRF_PWR_N001   0x7F
 -0.1dBm.
 
#define CCAI_TESTRF_PWR_N004   0x5F
 -0.4dBm.
 
#define CCAI_TESTRF_PWR_N009   0x3F
 -0.9dBm.
 
#define CCAI_TESTRF_PWR_N015   0x1F
 -1.5dBm.
 
#define CCAI_TESTRF_PWR_N027   0x1B
 -2.7dBm.
 
#define CCAI_TESTRF_PWR_N040   0x17
 -4.0dBm.
 
#define CCAI_TESTRF_PWR_N057   0x13
 -5.7dBm.
 
#define CCAI_TESTRF_PWR_N079   0x0F
 -7.9dBm.
 
#define CCAI_TESTRF_PWR_N108   0x0B
 -10.8dBm.
 
#define CCAI_TESTRF_PWR_N154   0x07
 -15.4dBm.
 
#define CCAI_TESTRF_PWR_N186   0x06
 -18.6dBm.
 
#define CCAI_TESTRF_PWR_N252   0x03
 -25.2dBm.
 
#define CCAI_CFGD_ZCD_NV_STARTUP_OPTION   0x03
 Device startup options.
 
#define CCAI_CFGD_BIT_STARTOPT_CLEAR_CONFIG   1
 Overwrite all configuration parameters except this one.
 
#define CCAI_CFGD_BIT_STARTOPT_CLEAR_STATE   2
 Clear network state.
 
#define CCAI_CFGD_BIT_STARTOPT_AUTO_START   4
 This is undocumented. This bit is present on ZASA cc2480.h file, but reserved on the description of swra175a.pdf.
 
#define CCAI_CFGD_ZCD_NV_LOGICAL_TYPE   0x87
 Logical type of the device in the ZigBee network.
 
#define CCAI_CFGD_LOGICAL_TYPE_COORDINATOR   0
 Set device type as a coordinator.
 
#define CCAI_CFGD_LOGICAL_TYPE_ROUTER   1
 Set device type as a router.
 
#define CCAI_CFGD_LOGICAL_TYPE_ENDDEVICE   2
 Set device type as an end-device.
 
#define CCAI_CFGD_ZCD_NV_POLL_RATE   0x24
 Duration of data polling when configured as an end-device.
 
#define CCAI_CFGD_ZCD_NV_QUEUED_POLL_RATE   0x25
 When configured to an end-device, if parent have queued data, poll again with this duration.
 
#define CCAI_CFGD_ZCD_NV_RESPONSE_POLL_RATE   0x26
 When configured as an end-device, poll for data after sending.
 
#define CCAI_CFGD_ZCD_NV_POLL_FAILURE_RETRIES   0x29
 Number of fail retries an end-device do before trying to rejoin.
 
#define CCAI_CFGD_ZCD_NV_INDIRECT_MSG_TIMEOUT   0x2B
 Time (s), that a parent device will buffer messages to its children.
 
#define CCAI_CFGD_ZCD_NV_APS_FRAME_RETRIES   0x43
 Number of retransmissions when the packet is transmitted with ACK enabled.
 
#define CCAI_CFGD_ZCD_NV_APS_ACK_WAIT_DURATION   0x44
 Time (ms) to wait for an ACK before retransmit packet.
 
#define CCAI_CFGD_ZCD_NV_BINDING_TIME   0x46
 Time (ms) to wait a response to a binding request.
 
#define CCAI_CFGD_ZCD_NV_USERDESC   0x81
 Optional text description for the device.
 
#define CCAI_CFGN_ZCD_NV_PANID   0x83
 Identifies the ZigBee network.
 
#define CCAI_CFGN_ZCD_NV_CHANLIST   0x84
 List of channels to operate on, each bit is a channel.
 
#define CCAI_CFGN_ZCD_NV_PRECFGKEY   0x62
 Used to secure and un-secure packets when security is enabled.
 
#define CCAI_CFGN_ZCD_NV_PRECFGKEYS_ENABLE   0x63
 Configure if key is pre-configured (1) or sent when device joins (0).
 
#define CCAI_CFGN_ZCD_NV_SECURITY_MODE   0x64
 Turn security on or off.
 
#define CCAI_CFGN_ZCD_NV_BCAST_RETRIES   0x2E
 Maximum retransmissions when sending a broadcast packet.
 
#define CCAI_CFGN_ZCD_NV_PASSIVE_ACK_TIMEOUT   0x2F
 Time (units of 100ms) to wait before retransmitting a broadcast packet.
 
#define CCAI_CFGN_ZCD_NV_BCAST_DELIVERY_TIME   0x30
 Maximum time (units of 100ms) to a broadcast packet propagate through the entire network.
 
#define CCAI_CFGN_ZCD_NV_ROUTE_EXPIRY_TIME   0x2C
 Time (s) after an idle route is marked as expired.
 
#define CCAI_INFO_STATE   0
 Request state of the device.
 
#define CCAI_INFO_IEEEADDRESS   1
 Request IEEE address of the device.
 
#define CCAI_INFO_SHORTADDRESS   2
 Request shor address of the device.
 
#define CCAI_INFO_PARENTSHORTADDRESS   3
 Request short address of the parent device.
 
#define CCAI_INFO_PARENTIEEEADDRESS   4
 Request IEEE address of the parent device.
 
#define CCAI_INFO_ZBCHANNEL   5
 Request operation channel of the ZigBee network.
 
#define CCAI_INFO_ZBPANID   6
 Request PAN id of the ZigBee network.
 
#define CCAI_INFO_ZBEXTENDEDPANID   7
 Request Extended PAN id of the ZigBee network.
 
#define CCAI_STA_ZSUCCESS   0x00
 ZSuccess.
 
#define CCAI_STA_ZFAILURE   0x01
 ZFailure.
 
#define CCAI_STA_ZINVALIDPARAMETER   0x02
 ZInvalidParameter.
 
#define CCAI_STA_ZMEMERROR   0x10
 ZMemError.
 
#define CCAI_STA_ZBUFFERFULL   0x11
 ZBufferFull.
 
#define CCAI_STA_ZUNSUPPORTEDMODE   0x12
 ZUnsupportedMode.
 
#define CCAI_STA_ZUNSUPPORTEDMODE   0x12
 ZUnsupportedMode.
 
#define CCAI_STA_ZMACMEMERROR   0x13
 ZMacMemError.
 
#define CCAI_STA_ZSECNOKEY   0xA1
 ZSecNoKey.
 
#define CCAI_STA_ZSECMAXFRMCOUNT   0xA3
 ZSecMaxFrmCount.
 
#define CCAI_STA_ZDOINVALIDREQUESTTYPE   0x80
 zdoInvalidRequestType.
 
#define CCAI_STA_ZDOINVALIDENDPOINT   0x82
 zdoInvalidEndpoint.
 
#define CCAI_STA_ZDOUNSUPPORTED   0x84
 zdoUnsupported.
 
#define CCAI_STA_ZDOTIMEOUT   0x85
 zdoTimeout.
 
#define CCAI_STA_ZDONOMATCH   0x86
 zdoNoMatch.
 
#define CCAI_STA_ZDOTABLEFULL   0x87
 zdoTableFull.
 
#define CCAI_STA_ZDONOBINDENTRY   0x88
 zdoNoBindEntry.
 
#define CCAI_STA_ZAPSFAIL   0xB1
 ZApsFail.
 
#define CCAI_STA_ZAPSTABLEFULL   0xB2
 ZApsTableFull.
 
#define CCAI_STA_ZAPSILLEGALREQUEST   0xB3
 ZApsIllegalRequest.
 
#define CCAI_STA_ZAPSINVALIDBINDING   0xB4
 ZApsInvalidBinding.
 
#define CCAI_STA_ZAPSUNSUPPORTEDATTRIB   0xB5
 ZApsUnsupportedAttrib.
 
#define CCAI_STA_ZAPSNOTSUPPORTED   0xB6
 ZApsNotSupported.
 
#define CCAI_STA_ZAPSNOACK   0xB7
 ZApsNoAck.
 
#define CCAI_STA_ZAPSDUPLICATEENTRY   0xB8
 ZApsDuplicateEntry.
 
#define CCAI_STA_ZAPSNOBOUNDDEVICE   0xB9
 ZApsNoBoundDevice.
 
#define CCAI_STA_ZNWKINVALIDPARAM   0xC1
 ZNwkInvalidParam.
 
#define CCAI_STA_ZNWKINVALIDREQUEST   0xC2
 ZNwkInvalidRequest.
 
#define CCAI_STA_ZNWKNOTPERMITTED   0xC3
 ZNwkNotPermitted.
 
#define CCAI_STA_ZNWKSTARTUPFAILURE   0xC4
 ZNwkStartupFailure.
 
#define CCAI_STA_ZNWKTABLEFULL   0xC7
 ZNwkTableFull.
 
#define CCAI_STA_ZNWKUNKNOWNDEVICE   0xC8
 ZNwkUnknownDevice.
 
#define CCAI_STA_ZNWKUNSUPPORTEDATTRIBUTE   0xC9
 ZNwkUnsupportedAttribute.
 
#define CCAI_STA_ZNWKNONETWORKS   0xCA
 ZNwkNoNetworks.
 
#define CCAI_STA_ZNWKLEAVEUNCONFIRMED   0xCB
 ZNwkLeaveUnconfirmed.
 
#define CCAI_STA_ZNWKNOACK   0xCC
 ZNwkNoAck.
 
#define CCAI_STA_ZNWKNOROUTE   0xCD
 ZNwkNoRoute.
 

Typedefs

typedef enum ccai_devStates_t ccai_devStates_t
 From ZASA, file cc2480.h. This is not documented on swra175a.pdf.
 

Enumerations

enum  ccai_devStates_t {
  CCAI_DEV_HOLD, CCAI_DEV_INIT, CCAI_CCAI_DEV_NWK_DISC, CCAI_DEV_NWK_JOINING,
  CCAI_DEV_NWK_REJOIN, CCAI_DEV_END_DEVICE_UNAUTH, CCAI_DEV_END_DEVICE, CCAI_DEV_ROUTER,
  CCAI_DEV_COORD_STARTING, CCAI_DEV_ZB_COORD, CCAI_DEV_NWK_ORPHAN
}
 From ZASA, file cc2480.h. This is not documented on swra175a.pdf. More...
 

Functions

void ccai_init ()
 This function initializes the CC2480 Application Interface variables. More...
 
UInt16 ccai_proccess ()
 This function processes the tasks of the CC2480 Application Interface. More...
 
void ccai_process_message ()
 Proccess a received message. More...
 
void ccai_resetFull ()
 Full reset. More...
 
void ccai_resetLight ()
 Reset. More...
 
UInt8 ccai_a_sys_reset_req ()
 Reset Request. More...
 
UInt8 ccai_s_sys_version ()
 Version request. More...
 
UInt8 ccai_s_sys_osal_nv_read (UInt16 id, UInt8 offset)
 Read memory request. More...
 
UInt8 ccai_s_sys_osal_nv_write (UInt16 id, UInt8 offset, UInt8 len, char *pBuf)
 Write memory request. More...
 
UInt8 ccai_s_sys_osal_start_timer (UInt8 id, UInt16 timeout)
 Timer start request. More...
 
UInt8 ccai_s_sys_osal_stop_timer (UInt8 id)
 Stop timer request. More...
 
UInt8 ccai_s_sys_random ()
 Random request. More...
 
UInt8 ccai_s_sys_adc_read (UInt8 channel, UInt8 resolution)
 Read ADC request. More...
 
UInt8 ccai_s_sys_gpio (UInt8 operation, UInt8 value)
 GPIO access request. More...
 
UInt8 ccai_a_sys_test_rf (UInt8 testMode, UInt16 frequency, UInt8 txPower)
 RF test configuration. More...
 
UInt8 ccai_s_sys_test_loopback (UInt8 len, char *pBuf)
 Loopback test request. More...
 
UInt8 ccai_s_zb_read_configuration (UInt8 configId)
 Read configuration request. More...
 
UInt8 ccai_s_zb_write_configuration (UInt8 configId, UInt8 len, void *pBuf)
 Write configuration request. More...
 
UInt8 ccai_s_zb_app_register_request (UInt8 appEndPoint, UInt16 appProfileId, UInt16 DeviCeId, UInt8 DeviceVersion, UInt8 inputCommandsNum, char *InputCommandsList, UInt8 OutputCommandsNum, char *OutputCommandsList)
 Application register request. More...
 
UInt8 ccai_s_zb_start_request ()
 Start request. More...
 
UInt8 ccai_s_zb_permit_joining_request (UInt16 destination, UInt8 timeOut)
 Permit join change request. More...
 
UInt8 ccai_s_zb_bind_device (UInt8 create, UInt16 commandId, uint64_t destination)
 Bind device request. More...
 
UInt8 ccai_s_zb_allow_bind (UInt8 timeout)
 Allow bind request. More...
 
UInt8 ccai_s_zb_send_data_request (UInt16 destination, UInt16 commandId, UInt8 handle, UInt8 ack, UInt8 radius, UInt8 len, void *data)
 Send data request. More...
 
UInt8 ccai_s_zb_send_data_request_begin (UInt16 destination, UInt16 commandId, UInt8 handle, UInt8 ack, UInt8 radius, UInt8 len)
 Begin request to send data. More...
 
UInt8 ccai_s_zb_send_data_request_payload (UInt8 len, void *pBuf)
 Append data to the payload of send data request. More...
 
void ccai_s_zb_send_data_request_end (UInt8 forwardToSerial)
 Terminate the request to send data and send it to CC2480. More...
 
UInt8 ccai_s_zb_get_device_info (UInt8 param)
 Get device information request. More...
 
UInt8 ccai_s_zb_find_device_request (uint64_t searchKey)
 Find device request. More...
 
UInt8 ccai_s_af_register ()
 Not implemented. More...
 
UInt8 ccai_s_af_data_request ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_nwk_addr_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_ieee_addr_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_node_desc_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_simple_desc_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_active_ep_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_match_desc_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_user_desc_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_user_desc_set ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_end_device_annce ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_end_device_bind_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_bind_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_unbind_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_mgmt_lqi_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_mgmt_leave_req ()
 Not implemented. More...
 
UInt8 ccai_s_zdo_mgmt_permit_join_req ()
 Not implemented. More...
 

Detailed Description

CC2480 interface.

CC2480 Application Interface based on swra175a.pdf section 6

Definition in file cc2480ai.h.