Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
hwme_tdme.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019, Cascoda Ltd.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * 3. Neither the name of the copyright holder nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
40 #ifndef HWME_TDME_H
41 #define HWME_TDME_H
42 
43 #include "ca821x_config.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 #define MAX_HWME_ATTRIBUTE_SIZE 16
50 #define MAX_TDME_ATTRIBUTE_SIZE 2
51 
52 #define MAX_TXPOWER_CH26 4
53 
56 {
57  HWME_SUCCESS = 0x00,
58  HWME_UNKNOWN = 0x01,
59  HWME_INVALID = 0x02,
60  HWME_NO_ACCESS = 0x03,
61 };
62 
65 {
67  HWME_WAKEUP_WDT = 0x01,
73 };
74 
77 {
78  HWME_LQIMODE_CS = 0x00,
79  HWME_LQIMODE_ED = 0x01,
80 };
81 
82 #if CASCODA_CA_VER >= 8212
84 enum dcdc_level_mode
85 {
86  HWME_DCDCMODE_OFF = 0x00,
87  HWME_DCDCMODE_TRXONLY = 0x01,
88  HWME_DCDCMODE_ALWAYSON = 0x02,
89 };
90 
92 enum dcdc_frequency_tracking_mode
93 {
94  HWME_FREQ_TRACKING_DISABLED = 0x00,
95  HWME_FREQ_TRACKING_ENABLED = 0x01,
96 };
97 
99 enum dcdc_bod_mode
100 {
101  HWME_BODMODE_OFF = 0x00,
102  HWME_BODMODE_DCDC = 0x01,
103  HWME_BODMODE_ALWAYSON = 0x02,
104 };
105 
107 enum rcosc_tracking_mode
108 {
109  HWME_RCOSC_TRMD_OFF = 0x00,
110  HWME_RCOSC_TRMD_GUARD = 0x01,
111  HWME_RCOSC_TRMD_GUARDR = 0x02,
112  HWME_RCOSC_TRMD_INST = 0x03,
113 };
114 #endif // CASCODA_CA_VER >= 8212
115 
118 {
119  HWME_POWERCON = 0x00,
120  HWME_CHIPID = 0x01,
121  HWME_TXPOWER = 0x02,
122  HWME_CCAMODE = 0x03,
125  HWME_EDVALUE = 0x06,
126  HWME_CSVALUE = 0x07,
127  HWME_EDVALLP = 0x08,
128  HWME_CSVALLP = 0x09,
129  HWME_FREQOFFS = 0x0A,
130  HWME_MACTIMER = 0x0B,
131  HWME_RANDOMNUM = 0x0C,
133  HWME_HSKEY = 0x0E,
134  HWME_SYSCLKOUT = 0x0F,
135  HWME_LQIMODE = 0x10,
136  HWME_LQILIMIT = 0x11,
137 #if CASCODA_CA_VER >= 8211
138  HWME_RXMODE = 0x12,
139  HWME_POLLINDMODE = 0x13,
140  HWME_ENHANCEDFP = 0x14,
141  HWME_MAXDIRECTS = 0x15,
142  HWME_MAXINDIRECTS = 0x16,
143 #endif // CASCODA_CA_VER >= 8211
144 #if CASCODA_CA_VER >= 8212
145  HWME_DCDCMODE = 0x18,
146  HWME_RCOSCTRMODE = 0x19,
147  HWME_LOTXCALVALUES = 0x1A,
148  HWME_LOTXCALOVERWRITEMODE = 0x1B
149 #else
151 #endif // CASCODA_CA_VER >= 8212
152 };
153 
156 {
158  HAES_MODE_DECRYPT = 1
159 };
160 
163 {
165  CCAM_ED = 1,
166  CCAM_CS = 2,
167  CCAM_EDANDCS = 3
168 };
169 
172 {
182  TDME_ERR_SYSTEM_ERROR = 0x90
183 };
184 
187 {
188  TDME_SUCCESS = 0x00,
189  TDME_UNKNOWN = 0x01,
190  TDME_INVALID = 0x02,
191  TDME_NO_ACCESS = 0x03,
192  TDME_LO_ERROR = 0x04,
193  TDME_FCS_ERROR = 0x05,
194  TDME_SHR_ERROR = 0x06,
195  TDME_PHR_ERROR = 0x07,
196 #if CASCODA_CA_VER >= 8212
197  TDME_ERR_BOD_DETECT = 0xA0,
198  TDME_ERR_DCDC_ERR = 0xB0,
199  TDME_ERR_QUEUE = 0xC0,
200 #endif // CASCODA_CA_VER >= 8212
201 };
202 
205 {
206  TDME_TEST_OFF = 0x00,
207  TDME_TEST_IDLE = 0x01,
208  TDME_TEST_TX = 0x02,
209  TDME_TEST_RX = 0x03,
210  TDME_TEST_ED = 0x04,
211  TDME_TEST_LO_1 = 0x05,
212  TDME_TEST_LO_2 = 0x06,
213  TDME_TEST_LO_3 = 0x07,
214 };
215 
216 /* Tx Packet PHY Payload Data Type */
218 {
221  TDME_TXD_COUNT = 0x02,
223 };
224 
227 {
228  TDME_CHANNEL = 0x00,
229  TDME_TX_CONFIG = 0x01,
230  TDME_ED_CONFIG = 0x02,
231  TDME_RX_CONFIG = 0x03,
235 #if CASCODA_CA_VER <= 8211
237 #endif // CASCODA_CA_VER <= 8211
238 };
239 
240 #ifdef __cplusplus
241 }
242 #endif
243 
248 #endif // HWME_TDME_H
hwme_status
HWME Status Codes.
Definition: hwme_tdme.h:56
tdme_payload_type
Definition: hwme_tdme.h:218
tdme_test_mode
TDME Test Modes.
Definition: hwme_tdme.h:205
cca_mode
CCA Mode.
Definition: hwme_tdme.h:163
tdme_hw_err
Hardware Error Messages from TDME_ERROR_indication.
Definition: hwme_tdme.h:172
hwme_attribute
HWME Attribute IDs.
Definition: hwme_tdme.h:118
haes_mode
Hardware AES mode values.
Definition: hwme_tdme.h:156
tdme_status
TDME Status Codes.
Definition: hwme_tdme.h:187
hwme_wakeup_condition
Potential values for HWME_WAKEUP_indication's WakeUpCondition parameter.
Definition: hwme_tdme.h:65
tdme_attribute
TDME Attribute IDs.
Definition: hwme_tdme.h:227
lqi_mode
Potential values of HWME_LQIMODE.
Definition: hwme_tdme.h:77
@ HWME_UNKNOWN
Unknown HWME Attribute or Parameter.
Definition: hwme_tdme.h:58
@ HWME_SUCCESS
The requested Primitive has been executed successfully.
Definition: hwme_tdme.h:57
@ HWME_INVALID
Invalid HWME Attribute Value or Parameter Value.
Definition: hwme_tdme.h:59
@ HWME_NO_ACCESS
The requested Attribute cannot currently be accessed.
Definition: hwme_tdme.h:60
@ TDME_TXD_RANDOM
Random Data, internally generated.
Definition: hwme_tdme.h:219
@ TDME_TXD_COUNT
Count (Increment) Data, internally generated.
Definition: hwme_tdme.h:221
@ TDME_TXD_SEQRANDOM
Sequence Number in 1st Byte and all other Data Random, internally generated.
Definition: hwme_tdme.h:220
@ TDME_TXD_APPENDED
Data external and appended to TDME-TXPKT Request.
Definition: hwme_tdme.h:222
@ TDME_TEST_LO_2
LO Test Mode 2 (VCO Open Loop / Initialisation, PA enabled)
Definition: hwme_tdme.h:212
@ TDME_TEST_LO_3
LO Test Mode 3 (Locking Test, PA disabled)
Definition: hwme_tdme.h:213
@ TDME_TEST_IDLE
Idle Test Mode.
Definition: hwme_tdme.h:207
@ TDME_TEST_LO_1
LO Test Mode 1 (Tx/Rx with no Modulation on 802.15.4 Channel, PA enabled)
Definition: hwme_tdme.h:211
@ TDME_TEST_OFF
All Test Modes are disabled (default)
Definition: hwme_tdme.h:206
@ TDME_TEST_RX
Receive Test Mode.
Definition: hwme_tdme.h:209
@ TDME_TEST_ED
Energy Detect Test Mode (Energy Sniffer)
Definition: hwme_tdme.h:210
@ TDME_TEST_TX
Transmit Test Mode.
Definition: hwme_tdme.h:208
@ CCAM_ED
CCA Mode: ED level exceeded.
Definition: hwme_tdme.h:165
@ CCAM_EDANDCS
CCA Mode: Both ED and CS level exceeded.
Definition: hwme_tdme.h:167
@ CCAM_EDORCS
CCA Mode: Either ED or CS level exceeded.
Definition: hwme_tdme.h:164
@ CCAM_CS
CCA Mode: CS level exceeded.
Definition: hwme_tdme.h:166
@ TDME_ERR_UNEXP_IRQ
Unexpected Interrupt (+0x0F)
Definition: hwme_tdme.h:180
@ TDME_ERR_EX_STOF
Exception: Stack Overflow.
Definition: hwme_tdme.h:176
@ TDME_ERR_MALLOC_FAIL
Memory Allocation Failure.
Definition: hwme_tdme.h:181
@ TDME_ERR_SPI_INVALID
Invalid SPI Message.
Definition: hwme_tdme.h:175
@ TDME_ERR_LO_UNLOCK
LO Unlocked.
Definition: hwme_tdme.h:174
@ TDME_ERR_EX_STUF
Exception: Stack Underflow.
Definition: hwme_tdme.h:177
@ TDME_ERR_SYSTEM_ERROR
System Error.
Definition: hwme_tdme.h:182
@ TDME_ERR_EX_DIVBY0
Exception: Divide by 0.
Definition: hwme_tdme.h:178
@ TDME_ERR_DMA_ACCESS
DMA Access Overflow/Underflow (+0x0F)
Definition: hwme_tdme.h:179
@ TDME_ERR_NO_ERROR
Everything OK.
Definition: hwme_tdme.h:173
@ HWME_EDVALLP
Energy Detect (ED) Value of last received Packet.
Definition: hwme_tdme.h:127
@ HWME_SYSCLKOUT
System Clock Output to a specific GPIO.
Definition: hwme_tdme.h:134
@ HWME_CHIPID
Product ID and Version Number.
Definition: hwme_tdme.h:120
@ HWME_LQILIMIT
LQI minimal value to accept a received MAC frame.
Definition: hwme_tdme.h:136
@ HWME_MACTIMER
MAC Symbol Timer Value.
Definition: hwme_tdme.h:130
@ HWME_EDTHRESHOLD
Energy Detect (ED) Threshold for CCA.
Definition: hwme_tdme.h:123
@ HWME_CSTHRESHOLD
Carrier Sense (CS) Threshold for CCA.
Definition: hwme_tdme.h:124
@ HWME_EDVALUE
Energy Detect (ED) Value of current channel.
Definition: hwme_tdme.h:125
@ HWME_FREQOFFS
Frequency Offset of last received Packet.
Definition: hwme_tdme.h:129
@ HWME_CSVALLP
Carrier Sense (CS) Value of last received Packet.
Definition: hwme_tdme.h:128
@ HWME_POWERCON
Power Saving Mode Control.
Definition: hwme_tdme.h:119
@ HWME_CSVALUE
Carrier Sense (CS) Value of current channel.
Definition: hwme_tdme.h:126
@ HWME_TXPOWER
Transmit Power Setting.
Definition: hwme_tdme.h:121
@ HWME_CCAMODE
Clear Channel Assessment Mode, according to 802.15.4 Section 6.9.9.
Definition: hwme_tdme.h:122
@ HWME_TEMPERATURE
Temperature Sensor Measurement Value.
Definition: hwme_tdme.h:132
@ HWME_IMAGINARYINDIRECT
0=Normal Indirect behaviour, 1=Imaginary mode, don't send indirect frames
Definition: hwme_tdme.h:150
@ HWME_RANDOMNUM
Random Number Value.
Definition: hwme_tdme.h:131
@ HWME_LQIMODE
LQI Reporting Mode for Data Indications and PanDescriptors.
Definition: hwme_tdme.h:135
@ HWME_HSKEY
Host Security Key for AES-128 Encryption or Decryption.
Definition: hwme_tdme.h:133
@ HAES_MODE_ENCRYPT
Encrypt given buffer.
Definition: hwme_tdme.h:157
@ HAES_MODE_DECRYPT
Decrypt given buffer.
Definition: hwme_tdme.h:158
@ TDME_FCS_ERROR
Received Packet Frame Check Sequence (CRC) Error.
Definition: hwme_tdme.h:193
@ TDME_UNKNOWN
Unknown TDME Value or Parameter.
Definition: hwme_tdme.h:189
@ TDME_NO_ACCESS
The requested Value cannot currently be accessed.
Definition: hwme_tdme.h:191
@ TDME_PHR_ERROR
Received Packet Packet Header Error.
Definition: hwme_tdme.h:195
@ TDME_LO_ERROR
LO Locking Error.
Definition: hwme_tdme.h:192
@ TDME_INVALID
Invalid TDME Value or Parameter Value.
Definition: hwme_tdme.h:190
@ TDME_SUCCESS
The requested Primitive has been executed successfully.
Definition: hwme_tdme.h:188
@ TDME_SHR_ERROR
Received Packet Synchronisation Header Error.
Definition: hwme_tdme.h:194
@ HWME_WAKEUP_POWERUP
Transceiver woken up from Power Up / System Reset.
Definition: hwme_tdme.h:66
@ HWME_WAKEUP_POFF_SLT
Transceiver woken up from Power-Off by Sleep Timer Time-Out.
Definition: hwme_tdme.h:68
@ HWME_WAKEUP_ACTIVE_SLT
Sleep-Timer Time-Out in Active Mode.
Definition: hwme_tdme.h:72
@ HWME_WAKEUP_STBY_SLT
Transceiver woken up from Standby by Sleep Timer Time-Out.
Definition: hwme_tdme.h:70
@ HWME_WAKEUP_STBY_GPIO
Transceiver woken up from Standby by GPIO Activity.
Definition: hwme_tdme.h:71
@ HWME_WAKEUP_WDT
Watchdog Timer Time-Out.
Definition: hwme_tdme.h:67
@ HWME_WAKEUP_POFF_GPIO
Transceiver woken up from Power-Off by GPIO Activity.
Definition: hwme_tdme.h:69
@ TDME_RX_CONFIG
Receiver Test Configuration.
Definition: hwme_tdme.h:231
@ TDME_LO_1_CONFIG
LO Test 1 Configuration (Tx/Rx with no Modulation on 802.15.4 Channel)
Definition: hwme_tdme.h:232
@ TDME_ATM_CONFIG
Analog Test Bus Configuration.
Definition: hwme_tdme.h:234
@ TDME_LO_2_CONFIG
LO Test 2 Configuration (VCO Open Loop / Initialisation)
Definition: hwme_tdme.h:233
@ TDME_CHANNEL
IEEE802.15.4 Channel Selection.
Definition: hwme_tdme.h:228
@ TDME_TX_CONFIG
Transmit (Tx) Test Configuration.
Definition: hwme_tdme.h:229
@ TDME_ED_CONFIG
Energy Detect Configuration.
Definition: hwme_tdme.h:230
@ TDME_MPW2_OVWR
Definition: hwme_tdme.h:236
@ HWME_LQIMODE_ED
ED (Energy Detect) is reported as LQI.
Definition: hwme_tdme.h:79
@ HWME_LQIMODE_CS
CS (Carrier Sense) is reported as LQI.
Definition: hwme_tdme.h:78