20 #ifndef BLE_WPTS_COMMON_H__
21 #define BLE_WPTS_COMMON_H__
25 #define BLE_WPTS_SEC_MODE_1_LEVEL_1 BLE_GAP_CONN_SEC_MODE_SET_OPEN
26 #define BLE_WPTS_SEC_MODE_1_LEVEL_2 BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM
29 #define BLE_WPTS_ADV_UUID_POS 0
30 #define BLE_WPTS_ADV_UUID_LEN 2
33 #define BLE_WPTS_ADV_SERVICE_HANDLE_POS 0
34 #define BLE_WPTS_ADV_SERVICE_HANDLE_LEN 2
36 #define BLE_WPTS_ADV_PRU_RSSI_PARAMS_POS (BLE_WPTS_ADV_SERVICE_HANDLE_POS + BLE_WPTS_ADV_SERVICE_HANDLE_LEN)
37 #define BLE_WPTS_ADV_PRU_RSSI_PARAMS_LEN 1
39 #define BLE_WPTS_ADV_ANTENNA_GAIN_OFFSET 5
40 #define BLE_WPTS_ADV_ANTENNA_GAIN_UNKNOWN_VAL 0xFF
41 #define BLE_WPTS_ADV_PRU_TX_POWER_LEVEL_OFFSET 20
42 #define BLE_WPTS_ADV_POWER_UNKNOWN_VAL 0xFF
44 #define BLE_WPTS_ADV_PRU_RSSI_PRU_GAIN_BITPOS 0
45 #define BLE_WPTS_ADV_PRU_RSSI_PRU_GAIN_BITMSK 0x07
46 #define BLE_WPTS_ADV_PRU_RSSI_PRU_PWR_BITPOS 3
47 #define BLE_WPTS_ADV_PRU_RSSI_PRU_PWR_BITMSK (0x1F << BLE_WPTS_ADV_PRU_RSSI_PRU_PWR_BITPOS)
49 #define BLE_WPTS_ADV_FLAGS_POS (BLE_WPTS_ADV_PRU_RSSI_PARAMS_POS + BLE_WPTS_ADV_PRU_RSSI_PARAMS_LEN)
50 #define BLE_WPTS_ADV_FLAGS_LEN 1
53 #define BLE_WPTS_ADV_SERVICE_DATA_LENGTH (BLE_WPTS_ADV_UUID_LEN + BLE_WPTS_ADV_SERVICE_HANDLE_LEN + BLE_WPTS_ADV_PRU_RSSI_PARAMS_LEN + BLE_WPTS_ADV_FLAGS_LEN)
55 #define BLE_WPTS_ADV_FLAG_IMPEDANCE_SHIFT_BITPOS 5
56 #define BLE_WPTS_ADV_FLAG_IMPEDANCE_SHIFT_BITMSK (0x07 << BLE_WPTS_ADV_FLAG_IMPEDANCE_SHIFT_BITPOS)
57 #define BLE_WPTS_ADV_FLAG_REBOOT_INDICATOR_BITPOS 4
58 #define BLE_WPTS_ADV_FLAG_REBOOT_INDICATOR_BITMSK (1 << BLE_WPTS_ADV_FLAG_REBOOT_INDICATOR_BITPOS)
59 #define BLE_WPTS_ADV_FLAG_OVP_STATUS_BITPOS 3
60 #define BLE_WPTS_ADV_FLAG_OVP_STATUS_BITMSK (1 << BLE_WPTS_ADV_FLAG_OVP_STATUS_BITPOS)
61 #define BLE_WPTS_ADV_FLAG_TIME_SET_SUPPORT_BITPOS 2
62 #define BLE_WPTS_ADV_FLAG_TIME_SET_SUPPORT_BITMSK (1 << BLE_WPTS_ADV_FLAG_TIME_SET_SUPPORT_BITPOS)
64 #define BLE_WPTS_ADV_FLAG_REBOOT_INDICATOR_REBOOTED_VAL 0
65 #define BLE_WPTS_ADV_FLAG_REBOOT_INDICATOR_NOT_REBOOTED_VAL 1
67 #define BLE_WPTS_ADV_SERVICE_DATA_LEN (BLE_WPTS_ADV_FLAGS_POS + BLE_WPTS_ADV_FLAGS_LEN)
70 #define BLE_WPTS_PRU_CONTROL_ENABLES_POS 0
71 #define BLE_WPTS_PRU_CONTROL_PERMISSION_POS 1
72 #define BLE_WPTS_PRU_CONTROL_TIME_SET_POS 2
75 #define BLE_WPTS_ENABLE_PRU_OUTPUT_BITPOS 7
76 #define BLE_WPTS_ENABLE_PRU_OUTPUT_BITMSK (0x01 << BLE_WPTS_ENABLE_PRU_OUTPUT_BITPOS)
77 #define BLE_WPTS_ENABLE_PRU_OUTPUT_ENABLE_VAL 0x01
78 #define BLE_WPTS_ENABLE_PRU_OUTPUT_DISABLE_VAL 0x00
80 #define BLE_WPTS_ENABLE_PRU_CHARGE_INDICATOR_BITPOS 6
81 #define BLE_WPTS_ENABLE_PRU_CHARGE_INDICATOR_BITMSK (0x01 << BLE_WPTS_ENABLE_PRU_CHARGE_INDICATOR_BITPOS)
82 #define BLE_WPTS_ENABLE_PRU_CHARGE_INDICATOR_ENABLE_VAL 0x01
83 #define BLE_WPTS_ENABLE_PRU_CHARGE_INDICATOR_DISABLE_VAL 0x00
85 #define BLE_WPTS_ENABLE_PRU_ADJ_POWER_BITPOS 4
86 #define BLE_WPTS_ENABLE_PRU_ADJ_POWER_BITMSK (0x03 << BLE_WPTS_ENABLE_PRU_ADJ_POWER_BITPOS)
87 #define BLE_WPTS_ENABLE_PRU_ADJ_POWER_MAX_VAL 0x00
88 #define BLE_WPTS_ENABLE_PRU_ADJ_POWER_66_PCT_VAL 0x01
89 #define BLE_WPTS_ENABLE_PRU_ADJ_POWER_33_PCT_VAL 0x02
90 #define BLE_WPTS_ENABLE_PRU_ADJ_POWER_2_5_W_VAL 0x03
93 #define BLE_WPTS_PERMISSION_PERMITTED 0x00
94 #define BLE_WPTS_PERMISSION_PERMITTED_WAITING 0x01
95 #define BLE_WPTS_PERMISSION_DENIED_CC 0x80
96 #define BLE_WPTS_PERMISSION_DENIED_POWER 0x81
97 #define BLE_WPTS_PERMISSION_DENIED_DEVICES 0x82
98 #define BLE_WPTS_PERMISSION_DENIED_CLASS 0x83
99 #define BLE_WPTS_PERMISSION_DENIED_HIGH_TEMP 0x84
102 #define BLE_WPTS_TIME_SET_DENIED 0x00
103 #define BLE_WPTS_TIME_SET_10MS 0x01
104 #define BLE_WPTS_TIME_SET_20MS 0x02
105 #define BLE_WPTS_TIME_SET_30MS 0x03
106 #define BLE_WPTS_TIME_SET_40MS 0x04
107 #define BLE_WPTS_TIME_SET_50MS 0x05
108 #define BLE_WPTS_TIME_SET_60MS 0x06
109 #define BLE_WPTS_TIME_SET_70MS 0x07
110 #define BLE_WPTS_TIME_SET_80MS 0x08
113 #define BLE_WPTS_PTU_STATIC_OPTIONAL_FIELDS_POS 0
114 #define BLE_WPTS_PTU_STATIC_PTU_POWER_POS 1
115 #define BLE_WPTS_PTU_STATIC_PTU_MAX_SRC_IMPED_POS 2
116 #define BLE_WPTS_PTU_STATIC_PTU_MAX_LOAD_RES_POS 3
117 #define BLE_WPTS_PTU_STATIC_PTU_CLASS_POS 6
118 #define BLE_WPTS_PTU_STATIC_HW_REV_POS 7
119 #define BLE_WPTS_PTU_STATIC_FW_REV_POS 8
120 #define BLE_WPTS_PTU_STATIC_PROTOCOL_REV_POS 9
121 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_SUPPORTED_POS 10
124 #define BLE_WPTS_OPTION_INVALID_VAL 0
125 #define BLE_WPTS_OPTION_VALID_VAL 1
128 #define BLE_WPTS_PTU_STATIC_OPTION_MAX_IMPEDANCE_BITPOS 0x07
129 #define BLE_WPTS_PTU_STATIC_OPTION_MAX_IMPEDANCE_BITMSK (0x01 << BLE_WPTS_PTU_STATIC_OPTION_MAX_IMPEDANCE_BITPOS)
131 #define BLE_WPTS_PTU_STATIC_OPTION_MAX_RESISTANCE_BITPOS 0x06
132 #define BLE_WPTS_PTU_STATIC_OPTION_MAX_RESISTANCE_BITMSK (0x01 << BLE_WPTS_PTU_STATIC_OPTION_MAX_RESISTANCE_BITPOS)
135 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_BITPOS 3
136 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_BITMSK (0x1F << BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_BITPOS)
137 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_50_VAL 0
138 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_60_VAL 1
139 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_70_VAL 2
140 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_80_VAL 3
141 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_90_VAL 4
142 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_100_VAL 5
143 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_110_VAL 6
144 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_120_VAL 7
145 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_130_VAL 8
146 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_140_VAL 9
147 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_150_VAL 10
148 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_175_VAL 11
149 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_200_VAL 12
150 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_225_VAL 13
151 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_250_VAL 14
152 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_275_VAL 15
153 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_300_VAL 16
154 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_350_VAL 17
155 #define BLE_WPTS_PTU_STATIC_MAX_SOURCE_IMPEDANCE_375_VAL 18
158 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_BITPOS 3
159 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_BITMSK (0x1F << BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_BITPOS)
160 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_5_VAL 0
161 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_10_VAL 1
162 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_15_VAL 2
163 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_20_VAL 3
164 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_25_VAL 4
165 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_30_VAL 5
166 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_35_VAL 6
167 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_40_VAL 7
168 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_45_VAL 8
169 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_50_VAL 9
170 #define BLE_WPTS_PTU_STATIC_MAX_LOAD_RESISTANCE_55_VAL 10
173 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_BITPOS 0
174 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_BITMSK (0x0F << BLE_WPTS_PTU_STATIC_NUM_DEVICES_BITPOS)
175 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_1_VAL 0
176 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_2_VAL 1
177 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_3_VAL 2
178 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_4_VAL 3
179 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_5_VAL 4
180 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_6_VAL 5
181 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_7_VAL 6
182 #define BLE_WPTS_PTU_STATIC_NUM_DEVICES_8_VAL 7
185 #define BLE_WPTS_PTU_CLASS_1 0
186 #define BLE_WPTS_PTU_CLASS_2 1
187 #define BLE_WPTS_PTU_CLASS_3 2
188 #define BLE_WPTS_PTU_CLASS_4 3
189 #define BLE_WPTS_PTU_CLASS_5 4
190 #define BLE_WPTS_PTU_CLASS_6 5
193 #define BLE_WPTS_PRU_STATIC_OPTIONAL_FIELDS_POS 0
194 #define BLE_WPTS_PRU_STATIC_PROTOCOL_REV_POS 1
195 #define BLE_WPTS_PRU_STATIC_PRU_CATEGORY_POS 3
196 #define BLE_WPTS_PRU_STATIC_PRU_INFORMATION_POS 4
197 #define BLE_WPTS_PRU_STATIC_HW_REV_POS 5
198 #define BLE_WPTS_PRU_STATIC_FW_REV_POS 6
199 #define BLE_WPTS_PRU_STATIC_PRECT_MAX_POS 7
200 #define BLE_WPTS_PRU_STATIC_VRECT_MIN_STATIC_POS 8
201 #define BLE_WPTS_PRU_STATIC_VRECT_HIGH_STATIC_POS 10
202 #define BLE_WPTS_PRU_STATIC_VRECT_SET_POS 12
203 #define BLE_WPTS_PRU_STATIC_DELTA_R1_POS 14
206 #define BLE_WPTS_PRU_STATIC_OPTION_DELTA_R1_BITPOS 0x07
207 #define BLE_WPTS_PRU_STATIC_OPTION_DELTA_R1_BITMSK (0x01 << BLE_WPTS_PRU_STATIC_OPTION_DELTA_R1_BITPOS)
210 #define BLE_WPTS_PRU_CATEGORY_NO_IMP_SHIFT 0
211 #define BLE_WPTS_PRU_CATEGORY_1 1
212 #define BLE_WPTS_PRU_CATEGORY_2 2
213 #define BLE_WPTS_PRU_CATEGORY_3 3
214 #define BLE_WPTS_PRU_CATEGORY_4 4
215 #define BLE_WPTS_PRU_CATEGORY_5 5
216 #define BLE_WPTS_PRU_CATEGORY_6 6
217 #define BLE_WPTS_PRU_CATEGORY_7 7
220 #define BLE_WPTS_PRU_INFO_NFC_BITPOS 0x07
221 #define BLE_WPTS_PRU_INFO_NFC_BITMSK (0x01 << BLE_WPTS_PRU_INFO_NFC_BITPOS)
222 #define BLE_WPTS_PRU_INFO_NFC_SUPPORTED_VAL 1
223 #define BLE_WPTS_PRU_INFO_NFC_NOT_SUPPORTED_VAL 0
225 #define BLE_WPTS_PRU_INFO_BLE_BITPOS 0x06
226 #define BLE_WPTS_PRU_INFO_BLE_BITMSK (0x01 << BLE_WPTS_PRU_INFO_BLE_BITPOS)
227 #define BLE_WPTS_PRU_INFO_BLE_SUPPORTED_VAL 0x01
228 #define BLE_WPTS_PRU_INFO_BLE_NOT_SUPPORTED_VAL 0x00
230 #define BLE_WPTS_PRU_INFO_POWER_CONTROL_PREF_BITPOS 0x05
231 #define BLE_WPTS_PRU_INFO_POWER_CONTROL_PREF_BITMSK (0x01 << BLE_WPTS_PRU_INFO_POWER_CONTROL_PREF_BITPOS)
232 #define BLE_WPTS_PRU_INFO_POWER_CONTROL_PREF_VRECT_MIN_ERROR_VAL 0x00
233 #define BLE_WPTS_PRU_INFO_POWER_CONTROL_PREF_MAX_SYS_EFC_VAL 0x01
235 #define BLE_WPTS_PRU_INFO_ADJUST_POWER_BITPOS 0x04
236 #define BLE_WPTS_PRU_INFO_ADJUST_POWER_BITMSK (0x01 << BLE_WPTS_PRU_INFO_ADJUST_POWER_BITPOS)
237 #define BLE_WPTS_PRU_INFO_ADJUST_POWER_SUPPORTED_VAL 0x01
238 #define BLE_WPTS_PRU_INFO_ADJUST_POWER_NOT_SUPPORTED_VAL 0x00
240 #define BLE_WPTS_PRU_INFO_CHARGE_COMPLETE_CONN_MODE_BITPOS 0x03
241 #define BLE_WPTS_PRU_INFO_CHARGE_COMPLETE_CONN_MODE_BITMSK (0x01 << BLE_WPTS_PRU_INFO_CHARGE_COMPLETE_CONN_MODE_BITPOS)
242 #define BLE_WPTS_PRU_INFO_CHARGE_COMPLETE_CONN_MODE_SUPPORTED_VAL 0x01
243 #define BLE_WPTS_PRU_INFO_CHARGE_COMPLETE_CONN_MODE_NOT_SUPPORTED_VAL 0x00
245 #define BLE_WPTS_PRU_INFO_PTU_TEST_MODE_BITPOS 0x02
246 #define BLE_WPTS_PRU_INFO_PTU_TEST_MODE_BITMSK (0x01 << BLE_WPTS_PRU_INFO_PTU_TEST_MODE_BITPOS)
247 #define BLE_WPTS_PRU_INFO_PTU_TEST_MODE_ENABLED_VAL 0x01
248 #define BLE_WPTS_PRU_INFO_PTU_TEST_MODE_DISABLED_VAL 0x00
253 #define BLE_WPTS_PRU_DYNAMIC_ALERT_CHARGE_PORT_BITPOS 0x01
254 #define BLE_WPTS_PRU_DYNAMIC_ALERT_CHARGE_PORT_BITMSK (0x01 << BLE_WPTS_PRU_DYNAMIC_ALERT_CHARGE_PORT_BITPOS)
255 #define BLE_WPTS_PRU_DYNAMIC_ALERT_ADJ_POWER_RESP_BITPOS 0x00
256 #define BLE_WPTS_PRU_DYNAMIC_ALERT_ADJ_POWER_RESP_BITMSK (0x01 << BLE_WPTS_PRU_DYNAMIC_ALERT_ADJ_POWER_RESP_BITPOS)
259 #define BLE_WPTS_PRU_DYNAMIC_OPTIONAL_FIELDS_POS 0
260 #define BLE_WPTS_PRU_DYNAMIC_VRECT_POS 1
261 #define BLE_WPTS_PRU_DYNAMIC_IRECT_POS 3
262 #define BLE_WPTS_PRU_DYNAMIC_VOUT_POS 5
263 #define BLE_WPTS_PRU_DYNAMIC_IOUT_POS 7
264 #define BLE_WPTS_PRU_DYNAMIC_TEMPERATURE_POS 9
265 #define BLE_WPTS_PRU_DYNAMIC_VRECT_MIN_DYN_POS 10
266 #define BLE_WPTS_PRU_DYNAMIC_VRECT_SET_DYN_POS 12
267 #define BLE_WPTS_PRU_DYNAMIC_VRECT_HIGH_DYN_POS 14
268 #define BLE_WPTS_PRU_DYNAMIC_PRU_ALERT_POS 16
269 #define BLE_WPTS_PRU_DYNAMIC_PTU_TESTER_COMMAND_POS 17
271 #define BLE_WPTS_PRU_DYNAMIC_OPTION_VOUT_BITPOS 7
273 #define BLE_WPTS_PRU_DYNAMIC_OPTION_IOUT_BITPOS 6
274 #define BLE_WPTS_PRU_DYNAMIC_OPTION_TEMPERATURE_BITPOS 5
275 #define BLE_WPTS_PRU_DYNAMIC_OPTION_VRECT_MIN_DYN_BITPOS 4
276 #define BLE_WPTS_PRU_DYNAMIC_OPTION_VRECT_SET_DYN_BITPOS 3
277 #define BLE_WPTS_PRU_DYNAMIC_OPTION_VRECT_HIGH_DYN_BITPOS 2
279 #define BLE_WPTS_PRU_DYNAMIC_OPTION_VOUT_BITMSK (1 << BLE_WPTS_PRU_DYNAMIC_OPTION_VOUT_BITPOS)
280 #define BLE_WPTS_PRU_DYNAMIC_OPTION_IOUT_BITMSK (1 << BLE_WPTS_PRU_DYNAMIC_OPTION_IOUT_BITPOS)
281 #define BLE_WPTS_PRU_DYNAMIC_OPTION_TEMPERATURE_BITMSK (1 << BLE_WPTS_PRU_DYNAMIC_OPTION_TEMPERATURE_BITPOS)
282 #define BLE_WPTS_PRU_DYNAMIC_OPTION_VRECT_MIN_DYN_BITMSK (1 << BLE_WPTS_PRU_DYNAMIC_OPTION_VRECT_MIN_DYN_BITPOS)
283 #define BLE_WPTS_PRU_DYNAMIC_OPTION_VRECT_SET_DYN_BITMSK (1 << BLE_WPTS_PRU_DYNAMIC_OPTION_VRECT_SET_DYN_BITPOS)
284 #define BLE_WPTS_PRU_DYNAMIC_OPTION_VRECT_HIGH_DYN_BITMSK (1 << BLE_WPTS_PRU_DYNAMIC_OPTION_VRECT_HIGH_DYN_BITPOS)
287 #define BLE_WPTS_PRU_ALERT_POS 0
288 #define BLE_WPTS_PRU_ADDRESS_POS 1
291 #define BLE_WPTS_PRU_ALERT_OVER_VOLTAGE_BITPOS 0x07
292 #define BLE_WPTS_PRU_ALERT_OVER_VOLTAGE_BITMSK (0x01 << BLE_WPTS_PRU_ALERT_OVER_VOLTAGE_BITPOS)
293 #define BLE_WPTS_PRU_ALERT_OVER_CURRENT_BITPOS 0x06
294 #define BLE_WPTS_PRU_ALERT_OVER_CURRENT_BITMSK (0x01 << BLE_WPTS_PRU_ALERT_OVER_CURRENT_BITPOS)
295 #define BLE_WPTS_PRU_ALERT_OVER_TEMPERATURE_BITPOS 0x05
296 #define BLE_WPTS_PRU_ALERT_OVER_TEMPERATURE_BITMSK (0x01 << BLE_WPTS_PRU_ALERT_OVER_TEMPERATURE_BITPOS)
297 #define BLE_WPTS_PRU_ALERT_SELF_PROTECTION_BITPOS 0x04
298 #define BLE_WPTS_PRU_ALERT_SELF_PROTECTION_BITMSK (0x01 << BLE_WPTS_PRU_ALERT_SELF_PROTECTION_BITPOS)
299 #define BLE_WPTS_PRU_ALERT_CHARGE_COMPLETE_BITPOS 0x03
300 #define BLE_WPTS_PRU_ALERT_CHARGE_COMPLETE_BITMSK (0x01 << BLE_WPTS_PRU_ALERT_CHARGE_COMPLETE_BITPOS)
301 #define BLE_WPTS_PRU_ALERT_WIRED_CHARGER_DETECT_BITPOS 0x02
302 #define BLE_WPTS_PRU_ALERT_WIRED_CHARGER_DETECT_BITMSK (0x01 << BLE_WPTS_PRU_ALERT_WIRED_CHARGER_DETECT_BITPOS)
303 #define BLE_WPTS_PRU_ALERT_MODE_TRANSITION_BITPOS 0x00
304 #define BLE_WPTS_PRU_ALERT_MODE_TRANSITION_BITMSK (0x03 << BLE_WPTS_PRU_ALERT_MODE_TRANSITION_BITPOS)
305 #define BLE_WPTS_PRU_ALERT_NO_SELF_PROTECTION_VAL 0x00
307 #define BLE_WPTS_PRU_ALERT_MODE_NO_MODE_TRANSITION_VAL 0x00
309 #define BLE_WPTS_PRU_ALERT_MODE_2S_MODE_TRANSITION_VAL 0x01
310 #define BLE_WPTS_PRU_ALERT_MODE_3S_MODE_TRANSITION_VAL 0x02
311 #define BLE_WPTS_PRU_ALERT_MODE_6S_MODE_TRANSITION_VAL 0x03
314 #define BLE_WPTS_UUID16 0xFFFE
315 #define BLE_WPTS_UUID16_LEN 2
316 #define BLE_WPTS_UUID128_CHAR_BASE {0x67, 0x9A, 0x0C, 0x20, 0x00, 0x08, 0x96, 0x9E, 0xE2, 0x11, 0x46, 0xA1, 0x70, 0xE6, 0x55, 0x64}
317 #define BLE_WPTS_UUID128_LEN 16
318 #define BLE_WPTS_UUID_PRU_CONTROL_CHAR_OFFSET 0
319 #define BLE_WPTS_UUID_PTU_STATIC_PARAMETER_CHAR_OFFSET 1
320 #define BLE_WPTS_UUID_PRU_ALERT_CHAR_OFFSET 2
321 #define BLE_WPTS_UUID_PRU_STATIC_PARAMETER_CHAR_OFFSET 3
322 #define BLE_WPTS_UUID_PRU_DYNAMIC_PARAMETER_CHAR_OFFSET 4
323 #define BLE_WPTS_MODIFIED_BYTE 0
326 #define BLE_WPTS_HANDLE_OFFSET_PRU_CONTROL 2
327 #define BLE_WPTS_HANDLE_OFFSET_PTU_STATIC 4
328 #define BLE_WPTS_HANDLE_OFFSET_PRU_ALERT 6
329 #define BLE_WPTS_HANDLE_OFFSET_PRU_ALERT_CCCD 7
330 #define BLE_WPTS_HANDLE_OFFSET_PRU_STATIC 9
331 #define BLE_WPTS_HANDLE_OFFSET_PRU_DYNAMIC 11
332 #define BLE_WPTS_HANDLE_OFFSET_MIN 2
333 #define BLE_WPTS_HANDLE_OFFSET_MAX 11
336 #define BLE_WPTS_PRU_CONTROL_LEN 5
337 #define BLE_WPTS_PTU_STATIC_LEN 17
338 #define BLE_WPTS_PRU_ALERT_MIN_LEN 1
339 #define BLE_WPTS_PRU_ALERT_MAX_LEN 7
340 #define BLE_WPTS_PRU_STATIC_LEN 20
341 #define BLE_WPTS_PRU_DYNAMIC_LEN 20
344 #define BLE_WPTS_PTU_POWER_0_1W 0
345 #define BLE_WPTS_PTU_POWER_0_2W 1
346 #define BLE_WPTS_PTU_POWER_0_3W 2
347 #define BLE_WPTS_PTU_POWER_0_4W 3
348 #define BLE_WPTS_PTU_POWER_0_5W 4
349 #define BLE_WPTS_PTU_POWER_0_6W 5
350 #define BLE_WPTS_PTU_POWER_0_7W 6
351 #define BLE_WPTS_PTU_POWER_0_8W 7
352 #define BLE_WPTS_PTU_POWER_0_9W 8
353 #define BLE_WPTS_PTU_POWER_1_0W 10
354 #define BLE_WPTS_PTU_POWER_1_1W 11
355 #define BLE_WPTS_PTU_POWER_1_2W 12
356 #define BLE_WPTS_PTU_POWER_1_3W 13
357 #define BLE_WPTS_PTU_POWER_1_4W 14
358 #define BLE_WPTS_PTU_POWER_1_5W 15
359 #define BLE_WPTS_PTU_POWER_1_6W 16
360 #define BLE_WPTS_PTU_POWER_1_7W 17
361 #define BLE_WPTS_PTU_POWER_1_8W 18
362 #define BLE_WPTS_PTU_POWER_1_9W 19
363 #define BLE_WPTS_PTU_POWER_2_0W 20
365 #define BLE_WPTS_PTU_POWER_2_2W 21
366 #define BLE_WPTS_PTU_POWER_2_4W 22
367 #define BLE_WPTS_PTU_POWER_2_6W 23
368 #define BLE_WPTS_PTU_POWER_2_8W 24
369 #define BLE_WPTS_PTU_POWER_3_0W 25
370 #define BLE_WPTS_PTU_POWER_3_2W 26
371 #define BLE_WPTS_PTU_POWER_3_4W 27
372 #define BLE_WPTS_PTU_POWER_3_6W 28
373 #define BLE_WPTS_PTU_POWER_3_8W 29
374 #define BLE_WPTS_PTU_POWER_4_0W 30
375 #define BLE_WPTS_PTU_POWER_4_2W 31
376 #define BLE_WPTS_PTU_POWER_4_4W 32
377 #define BLE_WPTS_PTU_POWER_4_6W 33
378 #define BLE_WPTS_PTU_POWER_4_8W 34
379 #define BLE_WPTS_PTU_POWER_5_0W 35
380 #define BLE_WPTS_PTU_POWER_5_2W 36
381 #define BLE_WPTS_PTU_POWER_5_4W 37
382 #define BLE_WPTS_PTU_POWER_5_6W 38
383 #define BLE_WPTS_PTU_POWER_5_8W 39
385 #define BLE_WPTS_PTU_POWER_6_0W 40
386 #define BLE_WPTS_PTU_POWER_6_3W 41
387 #define BLE_WPTS_PTU_POWER_6_6W 42
388 #define BLE_WPTS_PTU_POWER_6_9W 43
389 #define BLE_WPTS_PTU_POWER_7_2W 44
390 #define BLE_WPTS_PTU_POWER_7_5W 45
391 #define BLE_WPTS_PTU_POWER_7_8W 46
392 #define BLE_WPTS_PTU_POWER_8_1W 47
393 #define BLE_WPTS_PTU_POWER_8_4W 48
394 #define BLE_WPTS_PTU_POWER_8_7W 49
395 #define BLE_WPTS_PTU_POWER_9_0W 50
396 #define BLE_WPTS_PTU_POWER_9_3W 51
397 #define BLE_WPTS_PTU_POWER_9_6W 52
398 #define BLE_WPTS_PTU_POWER_9_9W 53
399 #define BLE_WPTS_PTU_POWER_10_2W 54
400 #define BLE_WPTS_PTU_POWER_10_5W 55
401 #define BLE_WPTS_PTU_POWER_10_8W 56
402 #define BLE_WPTS_PTU_POWER_11_1W 57
403 #define BLE_WPTS_PTU_POWER_11_4W 58
404 #define BLE_WPTS_PTU_POWER_11_7W 59
406 #define BLE_WPTS_PTU_POWER_12_0W 60
407 #define BLE_WPTS_PTU_POWER_12_4W 61
408 #define BLE_WPTS_PTU_POWER_12_8W 62
409 #define BLE_WPTS_PTU_POWER_13_2W 63
410 #define BLE_WPTS_PTU_POWER_13_6W 64
411 #define BLE_WPTS_PTU_POWER_13_0W 65
412 #define BLE_WPTS_PTU_POWER_14_4W 66
413 #define BLE_WPTS_PTU_POWER_14_8W 67
414 #define BLE_WPTS_PTU_POWER_15_2W 68
415 #define BLE_WPTS_PTU_POWER_15_6W 69
416 #define BLE_WPTS_PTU_POWER_16_0W 70
417 #define BLE_WPTS_PTU_POWER_16_4W 71
418 #define BLE_WPTS_PTU_POWER_16_8W 72
419 #define BLE_WPTS_PTU_POWER_17_2W 73
420 #define BLE_WPTS_PTU_POWER_17_6W 74
421 #define BLE_WPTS_PTU_POWER_18_0W 75
422 #define BLE_WPTS_PTU_POWER_18_4W 76
423 #define BLE_WPTS_PTU_POWER_18_8W 77
424 #define BLE_WPTS_PTU_POWER_19_2W 78
425 #define BLE_WPTS_PTU_POWER_19_6W 79
427 #define BLE_WPTS_PTU_POWER_20_0W 80
428 #define BLE_WPTS_PTU_POWER_20_5W 81
429 #define BLE_WPTS_PTU_POWER_21_0W 82
430 #define BLE_WPTS_PTU_POWER_21_5W 83
431 #define BLE_WPTS_PTU_POWER_22_0W 84
432 #define BLE_WPTS_PTU_POWER_22_5W 85
433 #define BLE_WPTS_PTU_POWER_23_0W 86
434 #define BLE_WPTS_PTU_POWER_23_5W 87
435 #define BLE_WPTS_PTU_POWER_24_0W 88
436 #define BLE_WPTS_PTU_POWER_24_5W 89
437 #define BLE_WPTS_PTU_POWER_25_0W 90
438 #define BLE_WPTS_PTU_POWER_25_5W 91
439 #define BLE_WPTS_PTU_POWER_26_0W 92
440 #define BLE_WPTS_PTU_POWER_26_5W 93
441 #define BLE_WPTS_PTU_POWER_27_0W 94
442 #define BLE_WPTS_PTU_POWER_27_5W 95
443 #define BLE_WPTS_PTU_POWER_28_0W 96
444 #define BLE_WPTS_PTU_POWER_28_5W 97
445 #define BLE_WPTS_PTU_POWER_29_0W 98
446 #define BLE_WPTS_PTU_POWER_29_5W 99
448 #define BLE_WPTS_PTU_POWER_30_0W 100
449 #define BLE_WPTS_PTU_POWER_30_6W 101
450 #define BLE_WPTS_PTU_POWER_31_2W 102
451 #define BLE_WPTS_PTU_POWER_31_8W 103
452 #define BLE_WPTS_PTU_POWER_32_4W 104
453 #define BLE_WPTS_PTU_POWER_33_0W 105
454 #define BLE_WPTS_PTU_POWER_33_6W 106
455 #define BLE_WPTS_PTU_POWER_34_2W 107
456 #define BLE_WPTS_PTU_POWER_34_8W 108
457 #define BLE_WPTS_PTU_POWER_35_4W 109
458 #define BLE_WPTS_PTU_POWER_36_0W 110
459 #define BLE_WPTS_PTU_POWER_36_6W 111
460 #define BLE_WPTS_PTU_POWER_37_2W 112
461 #define BLE_WPTS_PTU_POWER_37_8W 113
462 #define BLE_WPTS_PTU_POWER_38_4W 114
463 #define BLE_WPTS_PTU_POWER_39_0W 115
464 #define BLE_WPTS_PTU_POWER_39_6W 116
465 #define BLE_WPTS_PTU_POWER_40_2W 117
466 #define BLE_WPTS_PTU_POWER_40_8W 118
467 #define BLE_WPTS_PTU_POWER_41_4W 119
469 #define BLE_WPTS_PTU_POWER_42_0W 120
470 #define BLE_WPTS_PTU_POWER_43_0W 121
471 #define BLE_WPTS_PTU_POWER_44_0W 122
472 #define BLE_WPTS_PTU_POWER_45_0W 123
473 #define BLE_WPTS_PTU_POWER_46_0W 124
474 #define BLE_WPTS_PTU_POWER_47_0W 125
475 #define BLE_WPTS_PTU_POWER_48_0W 126
476 #define BLE_WPTS_PTU_POWER_49_0W 127
530 #define BLE_WPTS_BITFIELD_WRITE(bitfield, msk, pos, val) do{ \
531 bitfield = (bitfield & ~msk) | ((val << pos) & msk); \
542 #define BLE_WPTS_BITFIELD_READ(bitfield, msk, pos) ((bitfield & msk) >> pos)
545 #endif // BLE_WPTS_COMMON_H__
uint32_t ble_wpts_uuid_init(void)
Prepare softdevice for using the WPTS 128 bit UUIDs.
Struct holding contents of "Service data AD type".
timer_user_op_type_t
Set of available timer operation types.
void ble_wpts_uuid_get(ble_wpts_uuid128_t uuid128, ble_uuid_t *ble_uuid)
Get ble_uuid representation of 128 bit UUID.
uint16_t gatt_prim_srv_handle
ble_wpts_uuid128_t
Identification of 128 bit UUIDs.