nrf_softdevice_s113/
bindings.rs

1/*
2 * Copyright (c) 2012 - 2019, Nordic Semiconductor ASA
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice, this
9 *    list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form, except as embedded into a Nordic
12 *    Semiconductor ASA integrated circuit in a product or a software update for
13 *    such product, must reproduce the above copyright notice, this list of
14 *    conditions and the following disclaimer in the documentation and/or other
15 *    materials provided with the distribution.
16 *
17 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
18 *    contributors may be used to endorse or promote products derived from this
19 *    software without specific prior written permission.
20 *
21 * 4. This software, with or without modification, must only be used with a
22 *    Nordic Semiconductor ASA integrated circuit.
23 *
24 * 5. Any software provided in binary form under this license must not be reverse
25 *    engineered, decompiled, modified and/or disassembled.
26 *
27 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
28 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
29 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
30 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
33 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
36 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 */
38
39#![allow(
40    clippy::fn_to_numeric_cast,
41    clippy::missing_safety_doc,
42    clippy::redundant_static_lifetimes,
43    clippy::useless_transmute
44)]
45
46pub type c_schar = i8;
47pub type c_uchar = u8;
48pub type c_char = u8;
49
50pub type c_short = i16;
51pub type c_ushort = u16;
52
53pub type c_int = i32;
54pub type c_uint = u32;
55
56pub type c_long = i32;
57pub type c_ulong = u32;
58
59pub type c_longlong = i64;
60pub type c_ulonglong = u64;
61
62pub type c_void = core::ffi::c_void;
63
64trait ToAsm {
65    fn to_asm(self) -> u32;
66}
67
68fn to_asm<T: ToAsm>(t: T) -> u32 {
69    t.to_asm()
70}
71
72impl ToAsm for u32 {
73    fn to_asm(self) -> u32 {
74        self
75    }
76}
77
78impl ToAsm for u16 {
79    fn to_asm(self) -> u32 {
80        self as u32
81    }
82}
83
84impl ToAsm for u8 {
85    fn to_asm(self) -> u32 {
86        self as u32
87    }
88}
89
90impl ToAsm for i8 {
91    fn to_asm(self) -> u32 {
92        self as u32
93    }
94}
95
96impl<T> ToAsm for *const T {
97    fn to_asm(self) -> u32 {
98        self as u32
99    }
100}
101
102impl<T> ToAsm for *mut T {
103    fn to_asm(self) -> u32 {
104        self as u32
105    }
106}
107
108impl<T: ToAsm> ToAsm for Option<T> {
109    fn to_asm(self) -> u32 {
110        match self {
111            Some(x) => x.to_asm(),
112            None => 0,
113        }
114    }
115}
116
117impl<X, R> ToAsm for unsafe extern "C" fn(X) -> R {
118    fn to_asm(self) -> u32 {
119        self as u32
120    }
121}
122
123impl<X, Y, R> ToAsm for unsafe extern "C" fn(X, Y) -> R {
124    fn to_asm(self) -> u32 {
125        self as u32
126    }
127}
128
129impl<X, Y, Z, R> ToAsm for unsafe extern "C" fn(X, Y, Z) -> R {
130    fn to_asm(self) -> u32 {
131        self as u32
132    }
133}
134
135/* automatically generated by rust-bindgen 0.55.1 */
136
137#[repr(C)]
138#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
139pub struct __BindgenBitfieldUnit<Storage, Align> {
140    storage: Storage,
141    align: [Align; 0],
142}
143impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align> {
144    #[inline]
145    pub const fn new(storage: Storage) -> Self {
146        Self { storage, align: [] }
147    }
148}
149impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align>
150where
151    Storage: AsRef<[u8]> + AsMut<[u8]>,
152{
153    #[inline]
154    pub fn get_bit(&self, index: usize) -> bool {
155        debug_assert!(index / 8 < self.storage.as_ref().len());
156        let byte_index = index / 8;
157        let byte = self.storage.as_ref()[byte_index];
158        let bit_index = if cfg!(target_endian = "big") {
159            7 - (index % 8)
160        } else {
161            index % 8
162        };
163        let mask = 1 << bit_index;
164        byte & mask == mask
165    }
166    #[inline]
167    pub fn set_bit(&mut self, index: usize, val: bool) {
168        debug_assert!(index / 8 < self.storage.as_ref().len());
169        let byte_index = index / 8;
170        let byte = &mut self.storage.as_mut()[byte_index];
171        let bit_index = if cfg!(target_endian = "big") {
172            7 - (index % 8)
173        } else {
174            index % 8
175        };
176        let mask = 1 << bit_index;
177        if val {
178            *byte |= mask;
179        } else {
180            *byte &= !mask;
181        }
182    }
183    #[inline]
184    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
185        debug_assert!(bit_width <= 64);
186        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
187        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
188        let mut val = 0;
189        for i in 0..(bit_width as usize) {
190            if self.get_bit(i + bit_offset) {
191                let index = if cfg!(target_endian = "big") {
192                    bit_width as usize - 1 - i
193                } else {
194                    i
195                };
196                val |= 1 << index;
197            }
198        }
199        val
200    }
201    #[inline]
202    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
203        debug_assert!(bit_width <= 64);
204        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
205        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
206        for i in 0..(bit_width as usize) {
207            let mask = 1 << i;
208            let val_bit_is_set = val & mask == mask;
209            let index = if cfg!(target_endian = "big") {
210                bit_width as usize - 1 - i
211            } else {
212                i
213            };
214            self.set_bit(index + bit_offset, val_bit_is_set);
215        }
216    }
217}
218#[repr(C)]
219#[derive(Default)]
220pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
221impl<T> __IncompleteArrayField<T> {
222    #[inline]
223    pub const fn new() -> Self {
224        __IncompleteArrayField(::core::marker::PhantomData, [])
225    }
226    #[inline]
227    pub fn as_ptr(&self) -> *const T {
228        self as *const _ as *const T
229    }
230    #[inline]
231    pub fn as_mut_ptr(&mut self) -> *mut T {
232        self as *mut _ as *mut T
233    }
234    #[inline]
235    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
236        ::core::slice::from_raw_parts(self.as_ptr(), len)
237    }
238    #[inline]
239    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
240        ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
241    }
242}
243impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
244    fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
245        fmt.write_str("__IncompleteArrayField")
246    }
247}
248#[repr(C)]
249pub struct __BindgenUnionField<T>(::core::marker::PhantomData<T>);
250impl<T> __BindgenUnionField<T> {
251    #[inline]
252    pub const fn new() -> Self {
253        __BindgenUnionField(::core::marker::PhantomData)
254    }
255    #[inline]
256    pub unsafe fn as_ref(&self) -> &T {
257        ::core::mem::transmute(self)
258    }
259    #[inline]
260    pub unsafe fn as_mut(&mut self) -> &mut T {
261        ::core::mem::transmute(self)
262    }
263}
264impl<T> ::core::default::Default for __BindgenUnionField<T> {
265    #[inline]
266    fn default() -> Self {
267        Self::new()
268    }
269}
270impl<T> ::core::clone::Clone for __BindgenUnionField<T> {
271    #[inline]
272    fn clone(&self) -> Self {
273        Self::new()
274    }
275}
276impl<T> ::core::marker::Copy for __BindgenUnionField<T> {}
277impl<T> ::core::fmt::Debug for __BindgenUnionField<T> {
278    fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
279        fmt.write_str("__BindgenUnionField")
280    }
281}
282impl<T> ::core::hash::Hash for __BindgenUnionField<T> {
283    fn hash<H: ::core::hash::Hasher>(&self, _state: &mut H) {}
284}
285impl<T> ::core::cmp::PartialEq for __BindgenUnionField<T> {
286    fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
287        true
288    }
289}
290impl<T> ::core::cmp::Eq for __BindgenUnionField<T> {}
291pub const NRF_ERROR_BASE_NUM: u32 = 0;
292pub const NRF_ERROR_SDM_BASE_NUM: u32 = 4096;
293pub const NRF_ERROR_SOC_BASE_NUM: u32 = 8192;
294pub const NRF_ERROR_STK_BASE_NUM: u32 = 12288;
295pub const NRF_SUCCESS: u32 = 0;
296pub const NRF_ERROR_SVC_HANDLER_MISSING: u32 = 1;
297pub const NRF_ERROR_SOFTDEVICE_NOT_ENABLED: u32 = 2;
298pub const NRF_ERROR_INTERNAL: u32 = 3;
299pub const NRF_ERROR_NO_MEM: u32 = 4;
300pub const NRF_ERROR_NOT_FOUND: u32 = 5;
301pub const NRF_ERROR_NOT_SUPPORTED: u32 = 6;
302pub const NRF_ERROR_INVALID_PARAM: u32 = 7;
303pub const NRF_ERROR_INVALID_STATE: u32 = 8;
304pub const NRF_ERROR_INVALID_LENGTH: u32 = 9;
305pub const NRF_ERROR_INVALID_FLAGS: u32 = 10;
306pub const NRF_ERROR_INVALID_DATA: u32 = 11;
307pub const NRF_ERROR_DATA_SIZE: u32 = 12;
308pub const NRF_ERROR_TIMEOUT: u32 = 13;
309pub const NRF_ERROR_NULL: u32 = 14;
310pub const NRF_ERROR_FORBIDDEN: u32 = 15;
311pub const NRF_ERROR_INVALID_ADDR: u32 = 16;
312pub const NRF_ERROR_BUSY: u32 = 17;
313pub const NRF_ERROR_CONN_COUNT: u32 = 18;
314pub const NRF_ERROR_RESOURCES: u32 = 19;
315pub const BLE_ERROR_NOT_ENABLED: u32 = 12289;
316pub const BLE_ERROR_INVALID_CONN_HANDLE: u32 = 12290;
317pub const BLE_ERROR_INVALID_ATTR_HANDLE: u32 = 12291;
318pub const BLE_ERROR_INVALID_ADV_HANDLE: u32 = 12292;
319pub const BLE_ERROR_INVALID_ROLE: u32 = 12293;
320pub const BLE_ERROR_BLOCKED_BY_OTHER_LINKS: u32 = 12294;
321pub const NRF_L2CAP_ERR_BASE: u32 = 12544;
322pub const NRF_GAP_ERR_BASE: u32 = 12800;
323pub const NRF_GATTC_ERR_BASE: u32 = 13056;
324pub const NRF_GATTS_ERR_BASE: u32 = 13312;
325pub const BLE_HCI_STATUS_CODE_SUCCESS: u32 = 0;
326pub const BLE_HCI_STATUS_CODE_UNKNOWN_BTLE_COMMAND: u32 = 1;
327pub const BLE_HCI_STATUS_CODE_UNKNOWN_CONNECTION_IDENTIFIER: u32 = 2;
328pub const BLE_HCI_AUTHENTICATION_FAILURE: u32 = 5;
329pub const BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING: u32 = 6;
330pub const BLE_HCI_MEMORY_CAPACITY_EXCEEDED: u32 = 7;
331pub const BLE_HCI_CONNECTION_TIMEOUT: u32 = 8;
332pub const BLE_HCI_STATUS_CODE_COMMAND_DISALLOWED: u32 = 12;
333pub const BLE_HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS: u32 = 18;
334pub const BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION: u32 = 19;
335pub const BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES: u32 = 20;
336pub const BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF: u32 = 21;
337pub const BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION: u32 = 22;
338pub const BLE_HCI_UNSUPPORTED_REMOTE_FEATURE: u32 = 26;
339pub const BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS: u32 = 30;
340pub const BLE_HCI_STATUS_CODE_UNSPECIFIED_ERROR: u32 = 31;
341pub const BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT: u32 = 34;
342pub const BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION: u32 = 35;
343pub const BLE_HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED: u32 = 36;
344pub const BLE_HCI_INSTANT_PASSED: u32 = 40;
345pub const BLE_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED: u32 = 41;
346pub const BLE_HCI_DIFFERENT_TRANSACTION_COLLISION: u32 = 42;
347pub const BLE_HCI_PARAMETER_OUT_OF_MANDATORY_RANGE: u32 = 48;
348pub const BLE_HCI_CONTROLLER_BUSY: u32 = 58;
349pub const BLE_HCI_CONN_INTERVAL_UNACCEPTABLE: u32 = 59;
350pub const BLE_HCI_DIRECTED_ADVERTISER_TIMEOUT: u32 = 60;
351pub const BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE: u32 = 61;
352pub const BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED: u32 = 62;
353pub const BLE_SVC_BASE: u32 = 96;
354pub const BLE_SVC_LAST: u32 = 107;
355pub const BLE_GAP_SVC_BASE: u32 = 108;
356pub const BLE_GAP_SVC_LAST: u32 = 154;
357pub const BLE_GATTC_SVC_BASE: u32 = 155;
358pub const BLE_GATTC_SVC_LAST: u32 = 167;
359pub const BLE_GATTS_SVC_BASE: u32 = 168;
360pub const BLE_GATTS_SVC_LAST: u32 = 183;
361pub const BLE_L2CAP_SVC_BASE: u32 = 184;
362pub const BLE_L2CAP_SVC_LAST: u32 = 191;
363pub const BLE_EVT_INVALID: u32 = 0;
364pub const BLE_EVT_BASE: u32 = 1;
365pub const BLE_EVT_LAST: u32 = 15;
366pub const BLE_GAP_EVT_BASE: u32 = 16;
367pub const BLE_GAP_EVT_LAST: u32 = 47;
368pub const BLE_GATTC_EVT_BASE: u32 = 48;
369pub const BLE_GATTC_EVT_LAST: u32 = 79;
370pub const BLE_GATTS_EVT_BASE: u32 = 80;
371pub const BLE_GATTS_EVT_LAST: u32 = 111;
372pub const BLE_L2CAP_EVT_BASE: u32 = 112;
373pub const BLE_L2CAP_EVT_LAST: u32 = 143;
374pub const BLE_OPT_INVALID: u32 = 0;
375pub const BLE_OPT_BASE: u32 = 1;
376pub const BLE_OPT_LAST: u32 = 31;
377pub const BLE_GAP_OPT_BASE: u32 = 32;
378pub const BLE_GAP_OPT_LAST: u32 = 63;
379pub const BLE_GATT_OPT_BASE: u32 = 64;
380pub const BLE_GATT_OPT_LAST: u32 = 95;
381pub const BLE_GATTC_OPT_BASE: u32 = 96;
382pub const BLE_GATTC_OPT_LAST: u32 = 127;
383pub const BLE_GATTS_OPT_BASE: u32 = 128;
384pub const BLE_GATTS_OPT_LAST: u32 = 159;
385pub const BLE_L2CAP_OPT_BASE: u32 = 160;
386pub const BLE_L2CAP_OPT_LAST: u32 = 191;
387pub const BLE_CFG_INVALID: u32 = 0;
388pub const BLE_CFG_BASE: u32 = 1;
389pub const BLE_CFG_LAST: u32 = 31;
390pub const BLE_CONN_CFG_BASE: u32 = 32;
391pub const BLE_CONN_CFG_LAST: u32 = 63;
392pub const BLE_GAP_CFG_BASE: u32 = 64;
393pub const BLE_GAP_CFG_LAST: u32 = 95;
394pub const BLE_GATT_CFG_BASE: u32 = 96;
395pub const BLE_GATT_CFG_LAST: u32 = 127;
396pub const BLE_GATTC_CFG_BASE: u32 = 128;
397pub const BLE_GATTC_CFG_LAST: u32 = 159;
398pub const BLE_GATTS_CFG_BASE: u32 = 160;
399pub const BLE_GATTS_CFG_LAST: u32 = 191;
400pub const BLE_L2CAP_CFG_BASE: u32 = 192;
401pub const BLE_L2CAP_CFG_LAST: u32 = 223;
402pub const BLE_CONN_HANDLE_INVALID: u32 = 65535;
403pub const BLE_CONN_HANDLE_ALL: u32 = 65534;
404pub const BLE_UUID_UNKNOWN: u32 = 0;
405pub const BLE_UUID_SERVICE_PRIMARY: u32 = 10240;
406pub const BLE_UUID_SERVICE_SECONDARY: u32 = 10241;
407pub const BLE_UUID_SERVICE_INCLUDE: u32 = 10242;
408pub const BLE_UUID_CHARACTERISTIC: u32 = 10243;
409pub const BLE_UUID_DESCRIPTOR_CHAR_EXT_PROP: u32 = 10496;
410pub const BLE_UUID_DESCRIPTOR_CHAR_USER_DESC: u32 = 10497;
411pub const BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG: u32 = 10498;
412pub const BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG: u32 = 10499;
413pub const BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT: u32 = 10500;
414pub const BLE_UUID_DESCRIPTOR_CHAR_AGGREGATE_FORMAT: u32 = 10501;
415pub const BLE_UUID_GATT: u32 = 6145;
416pub const BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED: u32 = 10757;
417pub const BLE_UUID_GAP: u32 = 6144;
418pub const BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME: u32 = 10752;
419pub const BLE_UUID_GAP_CHARACTERISTIC_APPEARANCE: u32 = 10753;
420pub const BLE_UUID_GAP_CHARACTERISTIC_RECONN_ADDR: u32 = 10755;
421pub const BLE_UUID_GAP_CHARACTERISTIC_PPCP: u32 = 10756;
422pub const BLE_UUID_GAP_CHARACTERISTIC_CAR: u32 = 10918;
423pub const BLE_UUID_GAP_CHARACTERISTIC_RPA_ONLY: u32 = 10953;
424pub const BLE_UUID_TYPE_UNKNOWN: u32 = 0;
425pub const BLE_UUID_TYPE_BLE: u32 = 1;
426pub const BLE_UUID_TYPE_VENDOR_BEGIN: u32 = 2;
427pub const BLE_APPEARANCE_UNKNOWN: u32 = 0;
428pub const BLE_APPEARANCE_GENERIC_PHONE: u32 = 64;
429pub const BLE_APPEARANCE_GENERIC_COMPUTER: u32 = 128;
430pub const BLE_APPEARANCE_GENERIC_WATCH: u32 = 192;
431pub const BLE_APPEARANCE_WATCH_SPORTS_WATCH: u32 = 193;
432pub const BLE_APPEARANCE_GENERIC_CLOCK: u32 = 256;
433pub const BLE_APPEARANCE_GENERIC_DISPLAY: u32 = 320;
434pub const BLE_APPEARANCE_GENERIC_REMOTE_CONTROL: u32 = 384;
435pub const BLE_APPEARANCE_GENERIC_EYE_GLASSES: u32 = 448;
436pub const BLE_APPEARANCE_GENERIC_TAG: u32 = 512;
437pub const BLE_APPEARANCE_GENERIC_KEYRING: u32 = 576;
438pub const BLE_APPEARANCE_GENERIC_MEDIA_PLAYER: u32 = 640;
439pub const BLE_APPEARANCE_GENERIC_BARCODE_SCANNER: u32 = 704;
440pub const BLE_APPEARANCE_GENERIC_THERMOMETER: u32 = 768;
441pub const BLE_APPEARANCE_THERMOMETER_EAR: u32 = 769;
442pub const BLE_APPEARANCE_GENERIC_HEART_RATE_SENSOR: u32 = 832;
443pub const BLE_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT: u32 = 833;
444pub const BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE: u32 = 896;
445pub const BLE_APPEARANCE_BLOOD_PRESSURE_ARM: u32 = 897;
446pub const BLE_APPEARANCE_BLOOD_PRESSURE_WRIST: u32 = 898;
447pub const BLE_APPEARANCE_GENERIC_HID: u32 = 960;
448pub const BLE_APPEARANCE_HID_KEYBOARD: u32 = 961;
449pub const BLE_APPEARANCE_HID_MOUSE: u32 = 962;
450pub const BLE_APPEARANCE_HID_JOYSTICK: u32 = 963;
451pub const BLE_APPEARANCE_HID_GAMEPAD: u32 = 964;
452pub const BLE_APPEARANCE_HID_DIGITIZERSUBTYPE: u32 = 965;
453pub const BLE_APPEARANCE_HID_CARD_READER: u32 = 966;
454pub const BLE_APPEARANCE_HID_DIGITAL_PEN: u32 = 967;
455pub const BLE_APPEARANCE_HID_BARCODE: u32 = 968;
456pub const BLE_APPEARANCE_GENERIC_GLUCOSE_METER: u32 = 1024;
457pub const BLE_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR: u32 = 1088;
458pub const BLE_APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE: u32 = 1089;
459pub const BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE: u32 = 1090;
460pub const BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP: u32 = 1091;
461pub const BLE_APPEARANCE_GENERIC_CYCLING: u32 = 1152;
462pub const BLE_APPEARANCE_CYCLING_CYCLING_COMPUTER: u32 = 1153;
463pub const BLE_APPEARANCE_CYCLING_SPEED_SENSOR: u32 = 1154;
464pub const BLE_APPEARANCE_CYCLING_CADENCE_SENSOR: u32 = 1155;
465pub const BLE_APPEARANCE_CYCLING_POWER_SENSOR: u32 = 1156;
466pub const BLE_APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR: u32 = 1157;
467pub const BLE_APPEARANCE_GENERIC_PULSE_OXIMETER: u32 = 3136;
468pub const BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP: u32 = 3137;
469pub const BLE_APPEARANCE_PULSE_OXIMETER_WRIST_WORN: u32 = 3138;
470pub const BLE_APPEARANCE_GENERIC_WEIGHT_SCALE: u32 = 3200;
471pub const BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT: u32 = 5184;
472pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP: u32 = 5185;
473pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP: u32 = 5186;
474pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD: u32 = 5187;
475pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD: u32 = 5188;
476pub const BLE_ERROR_GAP_UUID_LIST_MISMATCH: u32 = 12800;
477pub const BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST: u32 = 12801;
478pub const BLE_ERROR_GAP_INVALID_BLE_ADDR: u32 = 12802;
479pub const BLE_ERROR_GAP_WHITELIST_IN_USE: u32 = 12803;
480pub const BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE: u32 = 12804;
481pub const BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE: u32 = 12805;
482pub const BLE_GAP_ROLE_INVALID: u32 = 0;
483pub const BLE_GAP_ROLE_PERIPH: u32 = 1;
484pub const BLE_GAP_TIMEOUT_SRC_CONN: u32 = 2;
485pub const BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD: u32 = 3;
486pub const BLE_GAP_ADDR_TYPE_PUBLIC: u32 = 0;
487pub const BLE_GAP_ADDR_TYPE_RANDOM_STATIC: u32 = 1;
488pub const BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE: u32 = 2;
489pub const BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE: u32 = 3;
490pub const BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S: u32 = 900;
491pub const BLE_GAP_MAX_PRIVATE_ADDR_CYCLE_INTERVAL_S: u32 = 41400;
492pub const BLE_GAP_ADDR_LEN: u32 = 6;
493pub const BLE_GAP_PRIVACY_MODE_OFF: u32 = 0;
494pub const BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY: u32 = 1;
495pub const BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY: u32 = 2;
496pub const BLE_GAP_POWER_LEVEL_INVALID: u32 = 127;
497pub const BLE_GAP_ADV_SET_HANDLE_NOT_SET: u32 = 255;
498pub const BLE_GAP_ADV_SET_COUNT_DEFAULT: u32 = 1;
499pub const BLE_GAP_ADV_SET_COUNT_MAX: u32 = 1;
500pub const BLE_GAP_ADV_SET_DATA_SIZE_MAX: u32 = 31;
501pub const BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE: u32 = 255;
502pub const BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_TIMEOUT: u32 = 1;
503pub const BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_LIMIT_REACHED: u32 = 2;
504pub const BLE_GAP_AD_TYPE_FLAGS: u32 = 1;
505pub const BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 2;
506pub const BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE: u32 = 3;
507pub const BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 4;
508pub const BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE: u32 = 5;
509pub const BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 6;
510pub const BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE: u32 = 7;
511pub const BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME: u32 = 8;
512pub const BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME: u32 = 9;
513pub const BLE_GAP_AD_TYPE_TX_POWER_LEVEL: u32 = 10;
514pub const BLE_GAP_AD_TYPE_CLASS_OF_DEVICE: u32 = 13;
515pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C: u32 = 14;
516pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R: u32 = 15;
517pub const BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE: u32 = 16;
518pub const BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS: u32 = 17;
519pub const BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE: u32 = 18;
520pub const BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT: u32 = 20;
521pub const BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT: u32 = 21;
522pub const BLE_GAP_AD_TYPE_SERVICE_DATA: u32 = 22;
523pub const BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS: u32 = 23;
524pub const BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS: u32 = 24;
525pub const BLE_GAP_AD_TYPE_APPEARANCE: u32 = 25;
526pub const BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL: u32 = 26;
527pub const BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS: u32 = 27;
528pub const BLE_GAP_AD_TYPE_LE_ROLE: u32 = 28;
529pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256: u32 = 29;
530pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256: u32 = 30;
531pub const BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID: u32 = 32;
532pub const BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID: u32 = 33;
533pub const BLE_GAP_AD_TYPE_LESC_CONFIRMATION_VALUE: u32 = 34;
534pub const BLE_GAP_AD_TYPE_LESC_RANDOM_VALUE: u32 = 35;
535pub const BLE_GAP_AD_TYPE_URI: u32 = 36;
536pub const BLE_GAP_AD_TYPE_3D_INFORMATION_DATA: u32 = 61;
537pub const BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA: u32 = 255;
538pub const BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE: u32 = 1;
539pub const BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE: u32 = 2;
540pub const BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED: u32 = 4;
541pub const BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER: u32 = 8;
542pub const BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST: u32 = 16;
543pub const BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE: u32 = 5;
544pub const BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE: u32 = 6;
545pub const BLE_GAP_ADV_INTERVAL_MIN: u32 = 32;
546pub const BLE_GAP_ADV_INTERVAL_MAX: u32 = 16384;
547pub const BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED: u32 = 1;
548pub const BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE: u32 = 2;
549pub const BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED: u32 = 3;
550pub const BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED: u32 = 4;
551pub const BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED: u32 = 5;
552pub const BLE_GAP_ADV_FP_ANY: u32 = 0;
553pub const BLE_GAP_ADV_FP_FILTER_SCANREQ: u32 = 1;
554pub const BLE_GAP_ADV_FP_FILTER_CONNREQ: u32 = 2;
555pub const BLE_GAP_ADV_FP_FILTER_BOTH: u32 = 3;
556pub const BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX: u32 = 128;
557pub const BLE_GAP_ADV_TIMEOUT_LIMITED_MAX: u32 = 18000;
558pub const BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED: u32 = 0;
559pub const BLE_GAP_DISC_MODE_NOT_DISCOVERABLE: u32 = 0;
560pub const BLE_GAP_DISC_MODE_LIMITED: u32 = 1;
561pub const BLE_GAP_DISC_MODE_GENERAL: u32 = 2;
562pub const BLE_GAP_IO_CAPS_DISPLAY_ONLY: u32 = 0;
563pub const BLE_GAP_IO_CAPS_DISPLAY_YESNO: u32 = 1;
564pub const BLE_GAP_IO_CAPS_KEYBOARD_ONLY: u32 = 2;
565pub const BLE_GAP_IO_CAPS_NONE: u32 = 3;
566pub const BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY: u32 = 4;
567pub const BLE_GAP_AUTH_KEY_TYPE_NONE: u32 = 0;
568pub const BLE_GAP_AUTH_KEY_TYPE_PASSKEY: u32 = 1;
569pub const BLE_GAP_AUTH_KEY_TYPE_OOB: u32 = 2;
570pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_START: u32 = 0;
571pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_IN: u32 = 1;
572pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_OUT: u32 = 2;
573pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_CLEAR: u32 = 3;
574pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_END: u32 = 4;
575pub const BLE_GAP_SEC_STATUS_SUCCESS: u32 = 0;
576pub const BLE_GAP_SEC_STATUS_TIMEOUT: u32 = 1;
577pub const BLE_GAP_SEC_STATUS_PDU_INVALID: u32 = 2;
578pub const BLE_GAP_SEC_STATUS_RFU_RANGE1_BEGIN: u32 = 3;
579pub const BLE_GAP_SEC_STATUS_RFU_RANGE1_END: u32 = 128;
580pub const BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED: u32 = 129;
581pub const BLE_GAP_SEC_STATUS_OOB_NOT_AVAILABLE: u32 = 130;
582pub const BLE_GAP_SEC_STATUS_AUTH_REQ: u32 = 131;
583pub const BLE_GAP_SEC_STATUS_CONFIRM_VALUE: u32 = 132;
584pub const BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP: u32 = 133;
585pub const BLE_GAP_SEC_STATUS_ENC_KEY_SIZE: u32 = 134;
586pub const BLE_GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED: u32 = 135;
587pub const BLE_GAP_SEC_STATUS_UNSPECIFIED: u32 = 136;
588pub const BLE_GAP_SEC_STATUS_REPEATED_ATTEMPTS: u32 = 137;
589pub const BLE_GAP_SEC_STATUS_INVALID_PARAMS: u32 = 138;
590pub const BLE_GAP_SEC_STATUS_DHKEY_FAILURE: u32 = 139;
591pub const BLE_GAP_SEC_STATUS_NUM_COMP_FAILURE: u32 = 140;
592pub const BLE_GAP_SEC_STATUS_BR_EDR_IN_PROG: u32 = 141;
593pub const BLE_GAP_SEC_STATUS_X_TRANS_KEY_DISALLOWED: u32 = 142;
594pub const BLE_GAP_SEC_STATUS_RFU_RANGE2_BEGIN: u32 = 143;
595pub const BLE_GAP_SEC_STATUS_RFU_RANGE2_END: u32 = 255;
596pub const BLE_GAP_SEC_STATUS_SOURCE_LOCAL: u32 = 0;
597pub const BLE_GAP_SEC_STATUS_SOURCE_REMOTE: u32 = 1;
598pub const BLE_GAP_CP_MIN_CONN_INTVL_NONE: u32 = 65535;
599pub const BLE_GAP_CP_MIN_CONN_INTVL_MIN: u32 = 6;
600pub const BLE_GAP_CP_MIN_CONN_INTVL_MAX: u32 = 3200;
601pub const BLE_GAP_CP_MAX_CONN_INTVL_NONE: u32 = 65535;
602pub const BLE_GAP_CP_MAX_CONN_INTVL_MIN: u32 = 6;
603pub const BLE_GAP_CP_MAX_CONN_INTVL_MAX: u32 = 3200;
604pub const BLE_GAP_CP_SLAVE_LATENCY_MAX: u32 = 499;
605pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE: u32 = 65535;
606pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN: u32 = 10;
607pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX: u32 = 3200;
608pub const BLE_GAP_DEVNAME_DEFAULT: &'static [u8; 6usize] = b"nRF5x\0";
609pub const BLE_GAP_DEVNAME_DEFAULT_LEN: u32 = 31;
610pub const BLE_GAP_DEVNAME_MAX_LEN: u32 = 248;
611pub const BLE_GAP_RSSI_THRESHOLD_INVALID: u32 = 255;
612pub const BLE_GAP_PHY_AUTO: u32 = 0;
613pub const BLE_GAP_PHY_1MBPS: u32 = 1;
614pub const BLE_GAP_PHY_2MBPS: u32 = 2;
615pub const BLE_GAP_PHY_CODED: u32 = 4;
616pub const BLE_GAP_PHY_NOT_SET: u32 = 255;
617pub const BLE_GAP_PHYS_SUPPORTED: u32 = 3;
618pub const BLE_GAP_SEC_RAND_LEN: u32 = 8;
619pub const BLE_GAP_SEC_KEY_LEN: u32 = 16;
620pub const BLE_GAP_LESC_P256_PK_LEN: u32 = 64;
621pub const BLE_GAP_LESC_DHKEY_LEN: u32 = 32;
622pub const BLE_GAP_PASSKEY_LEN: u32 = 6;
623pub const BLE_GAP_WHITELIST_ADDR_MAX_COUNT: u32 = 8;
624pub const BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT: u32 = 8;
625pub const BLE_GAP_CONN_COUNT_DEFAULT: u32 = 1;
626pub const BLE_GAP_EVENT_LENGTH_MIN: u32 = 2;
627pub const BLE_GAP_EVENT_LENGTH_DEFAULT: u32 = 3;
628pub const BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT: u32 = 1;
629pub const BLE_GAP_ROLE_COUNT_COMBINED_MAX: u32 = 20;
630pub const BLE_GAP_DATA_LENGTH_AUTO: u32 = 0;
631pub const BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX: u32 = 48000;
632pub const BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MIN: u32 = 1;
633pub const BLE_GAP_SEC_MODE: u32 = 0;
634pub const BLE_GAP_CHAR_INCL_CONFIG_INCLUDE: u32 = 0;
635pub const BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITH_SPACE: u32 = 1;
636pub const BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITHOUT_SPACE: u32 = 2;
637pub const BLE_GAP_PPCP_INCL_CONFIG_DEFAULT: u32 = 0;
638pub const BLE_GAP_CAR_INCL_CONFIG_DEFAULT: u32 = 0;
639pub const BLE_L2CAP_CH_COUNT_MAX: u32 = 64;
640pub const BLE_L2CAP_MTU_MIN: u32 = 23;
641pub const BLE_L2CAP_MPS_MIN: u32 = 23;
642pub const BLE_L2CAP_CID_INVALID: u32 = 0;
643pub const BLE_L2CAP_CREDITS_DEFAULT: u32 = 1;
644pub const BLE_L2CAP_CH_SETUP_REFUSED_SRC_LOCAL: u32 = 1;
645pub const BLE_L2CAP_CH_SETUP_REFUSED_SRC_REMOTE: u32 = 2;
646pub const BLE_L2CAP_CH_STATUS_CODE_SUCCESS: u32 = 0;
647pub const BLE_L2CAP_CH_STATUS_CODE_LE_PSM_NOT_SUPPORTED: u32 = 2;
648pub const BLE_L2CAP_CH_STATUS_CODE_NO_RESOURCES: u32 = 4;
649pub const BLE_L2CAP_CH_STATUS_CODE_INSUFF_AUTHENTICATION: u32 = 5;
650pub const BLE_L2CAP_CH_STATUS_CODE_INSUFF_AUTHORIZATION: u32 = 6;
651pub const BLE_L2CAP_CH_STATUS_CODE_INSUFF_ENC_KEY_SIZE: u32 = 7;
652pub const BLE_L2CAP_CH_STATUS_CODE_INSUFF_ENC: u32 = 8;
653pub const BLE_L2CAP_CH_STATUS_CODE_INVALID_SCID: u32 = 9;
654pub const BLE_L2CAP_CH_STATUS_CODE_SCID_ALLOCATED: u32 = 10;
655pub const BLE_L2CAP_CH_STATUS_CODE_UNACCEPTABLE_PARAMS: u32 = 11;
656pub const BLE_L2CAP_CH_STATUS_CODE_NOT_UNDERSTOOD: u32 = 32768;
657pub const BLE_L2CAP_CH_STATUS_CODE_TIMEOUT: u32 = 49152;
658pub const BLE_GATT_ATT_MTU_DEFAULT: u32 = 23;
659pub const BLE_GATT_HANDLE_INVALID: u32 = 0;
660pub const BLE_GATT_HANDLE_START: u32 = 1;
661pub const BLE_GATT_HANDLE_END: u32 = 65535;
662pub const BLE_GATT_TIMEOUT_SRC_PROTOCOL: u32 = 0;
663pub const BLE_GATT_OP_INVALID: u32 = 0;
664pub const BLE_GATT_OP_WRITE_REQ: u32 = 1;
665pub const BLE_GATT_OP_WRITE_CMD: u32 = 2;
666pub const BLE_GATT_OP_SIGN_WRITE_CMD: u32 = 3;
667pub const BLE_GATT_OP_PREP_WRITE_REQ: u32 = 4;
668pub const BLE_GATT_OP_EXEC_WRITE_REQ: u32 = 5;
669pub const BLE_GATT_EXEC_WRITE_FLAG_PREPARED_CANCEL: u32 = 0;
670pub const BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE: u32 = 1;
671pub const BLE_GATT_HVX_INVALID: u32 = 0;
672pub const BLE_GATT_HVX_NOTIFICATION: u32 = 1;
673pub const BLE_GATT_HVX_INDICATION: u32 = 2;
674pub const BLE_GATT_STATUS_SUCCESS: u32 = 0;
675pub const BLE_GATT_STATUS_UNKNOWN: u32 = 1;
676pub const BLE_GATT_STATUS_ATTERR_INVALID: u32 = 256;
677pub const BLE_GATT_STATUS_ATTERR_INVALID_HANDLE: u32 = 257;
678pub const BLE_GATT_STATUS_ATTERR_READ_NOT_PERMITTED: u32 = 258;
679pub const BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED: u32 = 259;
680pub const BLE_GATT_STATUS_ATTERR_INVALID_PDU: u32 = 260;
681pub const BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION: u32 = 261;
682pub const BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED: u32 = 262;
683pub const BLE_GATT_STATUS_ATTERR_INVALID_OFFSET: u32 = 263;
684pub const BLE_GATT_STATUS_ATTERR_INSUF_AUTHORIZATION: u32 = 264;
685pub const BLE_GATT_STATUS_ATTERR_PREPARE_QUEUE_FULL: u32 = 265;
686pub const BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND: u32 = 266;
687pub const BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_LONG: u32 = 267;
688pub const BLE_GATT_STATUS_ATTERR_INSUF_ENC_KEY_SIZE: u32 = 268;
689pub const BLE_GATT_STATUS_ATTERR_INVALID_ATT_VAL_LENGTH: u32 = 269;
690pub const BLE_GATT_STATUS_ATTERR_UNLIKELY_ERROR: u32 = 270;
691pub const BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION: u32 = 271;
692pub const BLE_GATT_STATUS_ATTERR_UNSUPPORTED_GROUP_TYPE: u32 = 272;
693pub const BLE_GATT_STATUS_ATTERR_INSUF_RESOURCES: u32 = 273;
694pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE1_BEGIN: u32 = 274;
695pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE1_END: u32 = 383;
696pub const BLE_GATT_STATUS_ATTERR_APP_BEGIN: u32 = 384;
697pub const BLE_GATT_STATUS_ATTERR_APP_END: u32 = 415;
698pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE2_BEGIN: u32 = 416;
699pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE2_END: u32 = 479;
700pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE3_BEGIN: u32 = 480;
701pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE3_END: u32 = 508;
702pub const BLE_GATT_STATUS_ATTERR_CPS_WRITE_REQ_REJECTED: u32 = 508;
703pub const BLE_GATT_STATUS_ATTERR_CPS_CCCD_CONFIG_ERROR: u32 = 509;
704pub const BLE_GATT_STATUS_ATTERR_CPS_PROC_ALR_IN_PROG: u32 = 510;
705pub const BLE_GATT_STATUS_ATTERR_CPS_OUT_OF_RANGE: u32 = 511;
706pub const BLE_GATT_CPF_FORMAT_RFU: u32 = 0;
707pub const BLE_GATT_CPF_FORMAT_BOOLEAN: u32 = 1;
708pub const BLE_GATT_CPF_FORMAT_2BIT: u32 = 2;
709pub const BLE_GATT_CPF_FORMAT_NIBBLE: u32 = 3;
710pub const BLE_GATT_CPF_FORMAT_UINT8: u32 = 4;
711pub const BLE_GATT_CPF_FORMAT_UINT12: u32 = 5;
712pub const BLE_GATT_CPF_FORMAT_UINT16: u32 = 6;
713pub const BLE_GATT_CPF_FORMAT_UINT24: u32 = 7;
714pub const BLE_GATT_CPF_FORMAT_UINT32: u32 = 8;
715pub const BLE_GATT_CPF_FORMAT_UINT48: u32 = 9;
716pub const BLE_GATT_CPF_FORMAT_UINT64: u32 = 10;
717pub const BLE_GATT_CPF_FORMAT_UINT128: u32 = 11;
718pub const BLE_GATT_CPF_FORMAT_SINT8: u32 = 12;
719pub const BLE_GATT_CPF_FORMAT_SINT12: u32 = 13;
720pub const BLE_GATT_CPF_FORMAT_SINT16: u32 = 14;
721pub const BLE_GATT_CPF_FORMAT_SINT24: u32 = 15;
722pub const BLE_GATT_CPF_FORMAT_SINT32: u32 = 16;
723pub const BLE_GATT_CPF_FORMAT_SINT48: u32 = 17;
724pub const BLE_GATT_CPF_FORMAT_SINT64: u32 = 18;
725pub const BLE_GATT_CPF_FORMAT_SINT128: u32 = 19;
726pub const BLE_GATT_CPF_FORMAT_FLOAT32: u32 = 20;
727pub const BLE_GATT_CPF_FORMAT_FLOAT64: u32 = 21;
728pub const BLE_GATT_CPF_FORMAT_SFLOAT: u32 = 22;
729pub const BLE_GATT_CPF_FORMAT_FLOAT: u32 = 23;
730pub const BLE_GATT_CPF_FORMAT_DUINT16: u32 = 24;
731pub const BLE_GATT_CPF_FORMAT_UTF8S: u32 = 25;
732pub const BLE_GATT_CPF_FORMAT_UTF16S: u32 = 26;
733pub const BLE_GATT_CPF_FORMAT_STRUCT: u32 = 27;
734pub const BLE_GATT_CPF_NAMESPACE_BTSIG: u32 = 1;
735pub const BLE_GATT_CPF_NAMESPACE_DESCRIPTION_UNKNOWN: u32 = 0;
736pub const BLE_ERROR_GATTC_PROC_NOT_PERMITTED: u32 = 13056;
737pub const BLE_GATTC_ATTR_INFO_FORMAT_16BIT: u32 = 1;
738pub const BLE_GATTC_ATTR_INFO_FORMAT_128BIT: u32 = 2;
739pub const BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT: u32 = 1;
740pub const BLE_ERROR_GATTS_INVALID_ATTR_TYPE: u32 = 13312;
741pub const BLE_ERROR_GATTS_SYS_ATTR_MISSING: u32 = 13313;
742pub const BLE_GATTS_FIX_ATTR_LEN_MAX: u32 = 510;
743pub const BLE_GATTS_VAR_ATTR_LEN_MAX: u32 = 512;
744pub const BLE_GATTS_SRVC_TYPE_INVALID: u32 = 0;
745pub const BLE_GATTS_SRVC_TYPE_PRIMARY: u32 = 1;
746pub const BLE_GATTS_SRVC_TYPE_SECONDARY: u32 = 2;
747pub const BLE_GATTS_ATTR_TYPE_INVALID: u32 = 0;
748pub const BLE_GATTS_ATTR_TYPE_PRIM_SRVC_DECL: u32 = 1;
749pub const BLE_GATTS_ATTR_TYPE_SEC_SRVC_DECL: u32 = 2;
750pub const BLE_GATTS_ATTR_TYPE_INC_DECL: u32 = 3;
751pub const BLE_GATTS_ATTR_TYPE_CHAR_DECL: u32 = 4;
752pub const BLE_GATTS_ATTR_TYPE_CHAR_VAL: u32 = 5;
753pub const BLE_GATTS_ATTR_TYPE_DESC: u32 = 6;
754pub const BLE_GATTS_ATTR_TYPE_OTHER: u32 = 7;
755pub const BLE_GATTS_OP_INVALID: u32 = 0;
756pub const BLE_GATTS_OP_WRITE_REQ: u32 = 1;
757pub const BLE_GATTS_OP_WRITE_CMD: u32 = 2;
758pub const BLE_GATTS_OP_SIGN_WRITE_CMD: u32 = 3;
759pub const BLE_GATTS_OP_PREP_WRITE_REQ: u32 = 4;
760pub const BLE_GATTS_OP_EXEC_WRITE_REQ_CANCEL: u32 = 5;
761pub const BLE_GATTS_OP_EXEC_WRITE_REQ_NOW: u32 = 6;
762pub const BLE_GATTS_VLOC_INVALID: u32 = 0;
763pub const BLE_GATTS_VLOC_STACK: u32 = 1;
764pub const BLE_GATTS_VLOC_USER: u32 = 2;
765pub const BLE_GATTS_AUTHORIZE_TYPE_INVALID: u32 = 0;
766pub const BLE_GATTS_AUTHORIZE_TYPE_READ: u32 = 1;
767pub const BLE_GATTS_AUTHORIZE_TYPE_WRITE: u32 = 2;
768pub const BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS: u32 = 1;
769pub const BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS: u32 = 2;
770pub const BLE_GATTS_SERVICE_CHANGED_DEFAULT: u32 = 1;
771pub const BLE_GATTS_ATTR_TAB_SIZE_MIN: u32 = 248;
772pub const BLE_GATTS_ATTR_TAB_SIZE_DEFAULT: u32 = 1408;
773pub const BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT: u32 = 1;
774pub const BLE_EVT_PTR_ALIGNMENT: u32 = 4;
775pub const BLE_USER_MEM_TYPE_INVALID: u32 = 0;
776pub const BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES: u32 = 1;
777pub const BLE_UUID_VS_COUNT_DEFAULT: u32 = 10;
778pub const BLE_UUID_VS_COUNT_MAX: u32 = 254;
779pub const BLE_CONN_CFG_TAG_DEFAULT: u32 = 0;
780pub const NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN: u32 = 8192;
781pub const NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE: u32 = 8193;
782pub const NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED: u32 = 8194;
783pub const NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN: u32 = 8195;
784pub const NRF_ERROR_SOC_POWER_MODE_UNKNOWN: u32 = 8196;
785pub const NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN: u32 = 8197;
786pub const NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN: u32 = 8198;
787pub const NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES: u32 = 8199;
788pub const NRF_ERROR_SOC_PPI_INVALID_CHANNEL: u32 = 8200;
789pub const NRF_ERROR_SOC_PPI_INVALID_GROUP: u32 = 8201;
790pub const SOC_SVC_BASE: u32 = 32;
791pub const SOC_SVC_BASE_NOT_AVAILABLE: u32 = 44;
792pub const NRF_RADIO_NOTIFICATION_INACTIVE_GUARANTEED_TIME_US: u32 = 62;
793pub const NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US: u32 = 200;
794pub const NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US: u32 = 20;
795pub const NRF_RADIO_MIN_EXTENSION_MARGIN_US: u32 = 82;
796pub const SOC_ECB_KEY_LENGTH: u32 = 16;
797pub const SOC_ECB_CLEARTEXT_LENGTH: u32 = 16;
798pub const SOC_ECB_CIPHERTEXT_LENGTH: u32 = 16;
799pub const NRF_RADIO_LENGTH_MIN_US: u32 = 100;
800pub const NRF_RADIO_LENGTH_MAX_US: u32 = 100000;
801pub const NRF_RADIO_DISTANCE_MAX_US: u32 = 127999999;
802pub const NRF_RADIO_EARLIEST_TIMEOUT_MAX_US: u32 = 127999999;
803pub const NRF_RADIO_START_JITTER_US: u32 = 2;
804pub const SD_TIMERS_USED: u32 = 1;
805pub const SD_SWI_USED: u32 = 54;
806pub const MBR_SVC_BASE: u32 = 24;
807pub const MBR_PAGE_SIZE_IN_WORDS: u32 = 1024;
808pub const MBR_SIZE: u32 = 4096;
809pub const MBR_BOOTLOADER_ADDR: u32 = 4088;
810pub const MBR_PARAM_PAGE_ADDR: u32 = 4092;
811pub const NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN: u32 = 4096;
812pub const NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION: u32 = 4097;
813pub const NRF_ERROR_SDM_INCORRECT_CLENR0: u32 = 4098;
814pub const SD_MAJOR_VERSION: u32 = 7;
815pub const SD_MINOR_VERSION: u32 = 0;
816pub const SD_BUGFIX_VERSION: u32 = 1;
817pub const SD_VARIANT_ID: u32 = 113;
818pub const SD_VERSION: u32 = 7000001;
819pub const SDM_SVC_BASE: u32 = 16;
820pub const SD_UNIQUE_STR_SIZE: u32 = 20;
821pub const SDM_INFO_FIELD_INVALID: u32 = 0;
822pub const SOFTDEVICE_INFO_STRUCT_OFFSET: u32 = 8192;
823pub const SOFTDEVICE_INFO_STRUCT_ADDRESS: u32 = 12288;
824pub const SD_INFO_STRUCT_SIZE_OFFSET: u32 = 8192;
825pub const SD_SIZE_OFFSET: u32 = 8200;
826pub const SD_FWID_OFFSET: u32 = 8204;
827pub const SD_ID_OFFSET: u32 = 8208;
828pub const SD_VERSION_OFFSET: u32 = 8212;
829pub const SD_UNIQUE_STR_OFFSET: u32 = 8216;
830pub const SD_FLASH_SIZE: u32 = 110592;
831pub const NRF_FAULT_ID_SD_RANGE_START: u32 = 0;
832pub const NRF_FAULT_ID_APP_RANGE_START: u32 = 4096;
833pub const NRF_FAULT_ID_SD_ASSERT: u32 = 1;
834pub const NRF_FAULT_ID_APP_MEMACC: u32 = 4097;
835pub const NRF_CLOCK_LF_ACCURACY_250_PPM: u32 = 0;
836pub const NRF_CLOCK_LF_ACCURACY_500_PPM: u32 = 1;
837pub const NRF_CLOCK_LF_ACCURACY_150_PPM: u32 = 2;
838pub const NRF_CLOCK_LF_ACCURACY_100_PPM: u32 = 3;
839pub const NRF_CLOCK_LF_ACCURACY_75_PPM: u32 = 4;
840pub const NRF_CLOCK_LF_ACCURACY_50_PPM: u32 = 5;
841pub const NRF_CLOCK_LF_ACCURACY_30_PPM: u32 = 6;
842pub const NRF_CLOCK_LF_ACCURACY_20_PPM: u32 = 7;
843pub const NRF_CLOCK_LF_ACCURACY_10_PPM: u32 = 8;
844pub const NRF_CLOCK_LF_ACCURACY_5_PPM: u32 = 9;
845pub const NRF_CLOCK_LF_ACCURACY_2_PPM: u32 = 10;
846pub const NRF_CLOCK_LF_ACCURACY_1_PPM: u32 = 11;
847pub const NRF_CLOCK_LF_SRC_RC: u32 = 0;
848pub const NRF_CLOCK_LF_SRC_XTAL: u32 = 1;
849pub const NRF_CLOCK_LF_SRC_SYNTH: u32 = 2;
850pub type int_least64_t = i64;
851pub type uint_least64_t = u64;
852pub type int_fast64_t = i64;
853pub type uint_fast64_t = u64;
854pub type int_least32_t = i32;
855pub type uint_least32_t = u32;
856pub type int_fast32_t = i32;
857pub type uint_fast32_t = u32;
858pub type int_least16_t = i16;
859pub type uint_least16_t = u16;
860pub type int_fast16_t = i16;
861pub type uint_fast16_t = u16;
862pub type int_least8_t = i8;
863pub type uint_least8_t = u8;
864pub type int_fast8_t = i8;
865pub type uint_fast8_t = u8;
866pub type intmax_t = self::c_longlong;
867pub type uintmax_t = self::c_ulonglong;
868#[doc = " @brief 128 bit UUID values."]
869#[repr(C)]
870#[derive(Debug, Copy, Clone)]
871pub struct ble_uuid128_t {
872    #[doc = "< Little-Endian UUID bytes."]
873    pub uuid128: [u8; 16usize],
874}
875#[test]
876fn bindgen_test_layout_ble_uuid128_t() {
877    assert_eq!(
878        ::core::mem::size_of::<ble_uuid128_t>(),
879        16usize,
880        concat!("Size of: ", stringify!(ble_uuid128_t))
881    );
882    assert_eq!(
883        ::core::mem::align_of::<ble_uuid128_t>(),
884        1usize,
885        concat!("Alignment of ", stringify!(ble_uuid128_t))
886    );
887    assert_eq!(
888        unsafe { &(*(::core::ptr::null::<ble_uuid128_t>())).uuid128 as *const _ as usize },
889        0usize,
890        concat!(
891            "Offset of field: ",
892            stringify!(ble_uuid128_t),
893            "::",
894            stringify!(uuid128)
895        )
896    );
897}
898#[doc = " @brief  Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs."]
899#[repr(C)]
900#[derive(Debug, Copy, Clone)]
901pub struct ble_uuid_t {
902    #[doc = "< 16-bit UUID value or octets 12-13 of 128-bit UUID."]
903    pub uuid: u16,
904    #[doc = "< UUID type, see @ref BLE_UUID_TYPES. If type is @ref BLE_UUID_TYPE_UNKNOWN, the value of uuid is undefined."]
905    pub type_: u8,
906}
907#[test]
908fn bindgen_test_layout_ble_uuid_t() {
909    assert_eq!(
910        ::core::mem::size_of::<ble_uuid_t>(),
911        4usize,
912        concat!("Size of: ", stringify!(ble_uuid_t))
913    );
914    assert_eq!(
915        ::core::mem::align_of::<ble_uuid_t>(),
916        2usize,
917        concat!("Alignment of ", stringify!(ble_uuid_t))
918    );
919    assert_eq!(
920        unsafe { &(*(::core::ptr::null::<ble_uuid_t>())).uuid as *const _ as usize },
921        0usize,
922        concat!("Offset of field: ", stringify!(ble_uuid_t), "::", stringify!(uuid))
923    );
924    assert_eq!(
925        unsafe { &(*(::core::ptr::null::<ble_uuid_t>())).type_ as *const _ as usize },
926        2usize,
927        concat!("Offset of field: ", stringify!(ble_uuid_t), "::", stringify!(type_))
928    );
929}
930#[doc = "@brief Data structure."]
931#[repr(C)]
932#[derive(Debug, Copy, Clone)]
933pub struct ble_data_t {
934    #[doc = "< Pointer to the data buffer provided to/from the application."]
935    pub p_data: *mut u8,
936    #[doc = "< Length of the data buffer, in bytes."]
937    pub len: u16,
938}
939#[test]
940fn bindgen_test_layout_ble_data_t() {
941    assert_eq!(
942        ::core::mem::size_of::<ble_data_t>(),
943        8usize,
944        concat!("Size of: ", stringify!(ble_data_t))
945    );
946    assert_eq!(
947        ::core::mem::align_of::<ble_data_t>(),
948        4usize,
949        concat!("Alignment of ", stringify!(ble_data_t))
950    );
951    assert_eq!(
952        unsafe { &(*(::core::ptr::null::<ble_data_t>())).p_data as *const _ as usize },
953        0usize,
954        concat!("Offset of field: ", stringify!(ble_data_t), "::", stringify!(p_data))
955    );
956    assert_eq!(
957        unsafe { &(*(::core::ptr::null::<ble_data_t>())).len as *const _ as usize },
958        4usize,
959        concat!("Offset of field: ", stringify!(ble_data_t), "::", stringify!(len))
960    );
961}
962#[doc = "< Set own Bluetooth Address."]
963pub const BLE_GAP_SVCS_SD_BLE_GAP_ADDR_SET: BLE_GAP_SVCS = 108;
964#[doc = "< Get own Bluetooth Address."]
965pub const BLE_GAP_SVCS_SD_BLE_GAP_ADDR_GET: BLE_GAP_SVCS = 109;
966#[doc = "< Set active whitelist."]
967pub const BLE_GAP_SVCS_SD_BLE_GAP_WHITELIST_SET: BLE_GAP_SVCS = 110;
968#[doc = "< Set device identity list."]
969pub const BLE_GAP_SVCS_SD_BLE_GAP_DEVICE_IDENTITIES_SET: BLE_GAP_SVCS = 111;
970#[doc = "< Set Privacy settings"]
971pub const BLE_GAP_SVCS_SD_BLE_GAP_PRIVACY_SET: BLE_GAP_SVCS = 112;
972#[doc = "< Get Privacy settings"]
973pub const BLE_GAP_SVCS_SD_BLE_GAP_PRIVACY_GET: BLE_GAP_SVCS = 113;
974#[doc = "< Configure an advertising set."]
975pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_SET_CONFIGURE: BLE_GAP_SVCS = 114;
976#[doc = "< Start Advertising."]
977pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_START: BLE_GAP_SVCS = 115;
978#[doc = "< Stop Advertising."]
979pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_STOP: BLE_GAP_SVCS = 116;
980#[doc = "< Connection Parameter Update."]
981pub const BLE_GAP_SVCS_SD_BLE_GAP_CONN_PARAM_UPDATE: BLE_GAP_SVCS = 117;
982#[doc = "< Disconnect."]
983pub const BLE_GAP_SVCS_SD_BLE_GAP_DISCONNECT: BLE_GAP_SVCS = 118;
984#[doc = "< Set TX Power."]
985pub const BLE_GAP_SVCS_SD_BLE_GAP_TX_POWER_SET: BLE_GAP_SVCS = 119;
986#[doc = "< Set Appearance."]
987pub const BLE_GAP_SVCS_SD_BLE_GAP_APPEARANCE_SET: BLE_GAP_SVCS = 120;
988#[doc = "< Get Appearance."]
989pub const BLE_GAP_SVCS_SD_BLE_GAP_APPEARANCE_GET: BLE_GAP_SVCS = 121;
990#[doc = "< Set PPCP."]
991pub const BLE_GAP_SVCS_SD_BLE_GAP_PPCP_SET: BLE_GAP_SVCS = 122;
992#[doc = "< Get PPCP."]
993pub const BLE_GAP_SVCS_SD_BLE_GAP_PPCP_GET: BLE_GAP_SVCS = 123;
994#[doc = "< Set Device Name."]
995pub const BLE_GAP_SVCS_SD_BLE_GAP_DEVICE_NAME_SET: BLE_GAP_SVCS = 124;
996#[doc = "< Get Device Name."]
997pub const BLE_GAP_SVCS_SD_BLE_GAP_DEVICE_NAME_GET: BLE_GAP_SVCS = 125;
998#[doc = "< Initiate Pairing/Bonding."]
999pub const BLE_GAP_SVCS_SD_BLE_GAP_AUTHENTICATE: BLE_GAP_SVCS = 126;
1000#[doc = "< Reply with Security Parameters."]
1001pub const BLE_GAP_SVCS_SD_BLE_GAP_SEC_PARAMS_REPLY: BLE_GAP_SVCS = 127;
1002#[doc = "< Reply with an authentication key."]
1003pub const BLE_GAP_SVCS_SD_BLE_GAP_AUTH_KEY_REPLY: BLE_GAP_SVCS = 128;
1004#[doc = "< Reply with an LE Secure Connections DHKey."]
1005pub const BLE_GAP_SVCS_SD_BLE_GAP_LESC_DHKEY_REPLY: BLE_GAP_SVCS = 129;
1006#[doc = "< Notify of a keypress during an authentication procedure."]
1007pub const BLE_GAP_SVCS_SD_BLE_GAP_KEYPRESS_NOTIFY: BLE_GAP_SVCS = 130;
1008#[doc = "< Get the local LE Secure Connections OOB data."]
1009pub const BLE_GAP_SVCS_SD_BLE_GAP_LESC_OOB_DATA_GET: BLE_GAP_SVCS = 131;
1010#[doc = "< Set the remote LE Secure Connections OOB data."]
1011pub const BLE_GAP_SVCS_SD_BLE_GAP_LESC_OOB_DATA_SET: BLE_GAP_SVCS = 132;
1012#[doc = "< Reply with Security Information."]
1013pub const BLE_GAP_SVCS_SD_BLE_GAP_SEC_INFO_REPLY: BLE_GAP_SVCS = 134;
1014#[doc = "< Obtain connection security level."]
1015pub const BLE_GAP_SVCS_SD_BLE_GAP_CONN_SEC_GET: BLE_GAP_SVCS = 135;
1016#[doc = "< Start reporting of changes in RSSI."]
1017pub const BLE_GAP_SVCS_SD_BLE_GAP_RSSI_START: BLE_GAP_SVCS = 136;
1018#[doc = "< Stop reporting of changes in RSSI."]
1019pub const BLE_GAP_SVCS_SD_BLE_GAP_RSSI_STOP: BLE_GAP_SVCS = 137;
1020#[doc = "< Get the last RSSI sample."]
1021pub const BLE_GAP_SVCS_SD_BLE_GAP_RSSI_GET: BLE_GAP_SVCS = 142;
1022#[doc = "< Initiate or respond to a PHY Update Procedure."]
1023pub const BLE_GAP_SVCS_SD_BLE_GAP_PHY_UPDATE: BLE_GAP_SVCS = 143;
1024#[doc = "< Initiate or respond to a Data Length Update Procedure."]
1025pub const BLE_GAP_SVCS_SD_BLE_GAP_DATA_LENGTH_UPDATE: BLE_GAP_SVCS = 144;
1026#[doc = "< Get the Address used on air while Advertising."]
1027pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_ADDR_GET: BLE_GAP_SVCS = 147;
1028#[doc = "< Get the next connection event counter."]
1029pub const BLE_GAP_SVCS_SD_BLE_GAP_NEXT_CONN_EVT_COUNTER_GET: BLE_GAP_SVCS = 148;
1030pub const BLE_GAP_SVCS_SD_BLE_GAP_CONN_EVT_TRIGGER_START: BLE_GAP_SVCS = 149;
1031#[doc = " Start triggering a given task on connection event start."]
1032pub const BLE_GAP_SVCS_SD_BLE_GAP_CONN_EVT_TRIGGER_STOP: BLE_GAP_SVCS = 150;
1033#[doc = "@brief GAP API SVC numbers."]
1034pub type BLE_GAP_SVCS = self::c_uint;
1035#[doc = "< Connected to peer.                              \\n See @ref ble_gap_evt_connected_t"]
1036pub const BLE_GAP_EVTS_BLE_GAP_EVT_CONNECTED: BLE_GAP_EVTS = 16;
1037#[doc = "< Disconnected from peer.                         \\n See @ref ble_gap_evt_disconnected_t."]
1038pub const BLE_GAP_EVTS_BLE_GAP_EVT_DISCONNECTED: BLE_GAP_EVTS = 17;
1039#[doc = "< Connection Parameters updated.                  \\n See @ref ble_gap_evt_conn_param_update_t."]
1040pub const BLE_GAP_EVTS_BLE_GAP_EVT_CONN_PARAM_UPDATE: BLE_GAP_EVTS = 18;
1041#[doc = "< Request to provide security parameters.         \\n Reply with @ref sd_ble_gap_sec_params_reply.  \\n See @ref ble_gap_evt_sec_params_request_t."]
1042pub const BLE_GAP_EVTS_BLE_GAP_EVT_SEC_PARAMS_REQUEST: BLE_GAP_EVTS = 19;
1043#[doc = "< Request to provide security information.        \\n Reply with @ref sd_ble_gap_sec_info_reply.    \\n See @ref ble_gap_evt_sec_info_request_t."]
1044pub const BLE_GAP_EVTS_BLE_GAP_EVT_SEC_INFO_REQUEST: BLE_GAP_EVTS = 20;
1045#[doc = "< Request to display a passkey to the user.       \\n In LESC Numeric Comparison, reply with @ref sd_ble_gap_auth_key_reply. \\n See @ref ble_gap_evt_passkey_display_t."]
1046pub const BLE_GAP_EVTS_BLE_GAP_EVT_PASSKEY_DISPLAY: BLE_GAP_EVTS = 21;
1047#[doc = "< Notification of a keypress on the remote device.\\n See @ref ble_gap_evt_key_pressed_t"]
1048pub const BLE_GAP_EVTS_BLE_GAP_EVT_KEY_PRESSED: BLE_GAP_EVTS = 22;
1049#[doc = "< Request to provide an authentication key.       \\n Reply with @ref sd_ble_gap_auth_key_reply.    \\n See @ref ble_gap_evt_auth_key_request_t."]
1050pub const BLE_GAP_EVTS_BLE_GAP_EVT_AUTH_KEY_REQUEST: BLE_GAP_EVTS = 23;
1051#[doc = "< Request to calculate an LE Secure Connections DHKey. \\n Reply with @ref sd_ble_gap_lesc_dhkey_reply.  \\n See @ref ble_gap_evt_lesc_dhkey_request_t"]
1052pub const BLE_GAP_EVTS_BLE_GAP_EVT_LESC_DHKEY_REQUEST: BLE_GAP_EVTS = 24;
1053#[doc = "< Authentication procedure completed with status. \\n See @ref ble_gap_evt_auth_status_t."]
1054pub const BLE_GAP_EVTS_BLE_GAP_EVT_AUTH_STATUS: BLE_GAP_EVTS = 25;
1055#[doc = "< Connection security updated.                    \\n See @ref ble_gap_evt_conn_sec_update_t."]
1056pub const BLE_GAP_EVTS_BLE_GAP_EVT_CONN_SEC_UPDATE: BLE_GAP_EVTS = 26;
1057#[doc = "< Timeout expired.                                \\n See @ref ble_gap_evt_timeout_t."]
1058pub const BLE_GAP_EVTS_BLE_GAP_EVT_TIMEOUT: BLE_GAP_EVTS = 27;
1059#[doc = "< RSSI report.                                    \\n See @ref ble_gap_evt_rssi_changed_t."]
1060pub const BLE_GAP_EVTS_BLE_GAP_EVT_RSSI_CHANGED: BLE_GAP_EVTS = 28;
1061#[doc = "< Security Request.                               \\n See @ref ble_gap_evt_sec_request_t."]
1062pub const BLE_GAP_EVTS_BLE_GAP_EVT_SEC_REQUEST: BLE_GAP_EVTS = 30;
1063#[doc = "< Scan request report.                            \\n See @ref ble_gap_evt_scan_req_report_t."]
1064pub const BLE_GAP_EVTS_BLE_GAP_EVT_SCAN_REQ_REPORT: BLE_GAP_EVTS = 32;
1065#[doc = "< PHY Update Request.                             \\n Reply with @ref sd_ble_gap_phy_update. \\n See @ref ble_gap_evt_phy_update_request_t."]
1066pub const BLE_GAP_EVTS_BLE_GAP_EVT_PHY_UPDATE_REQUEST: BLE_GAP_EVTS = 33;
1067#[doc = "< PHY Update Procedure is complete.               \\n See @ref ble_gap_evt_phy_update_t."]
1068pub const BLE_GAP_EVTS_BLE_GAP_EVT_PHY_UPDATE: BLE_GAP_EVTS = 34;
1069#[doc = "< Data Length Update Request.                     \\n Reply with @ref sd_ble_gap_data_length_update. \\n See @ref ble_gap_evt_data_length_update_request_t."]
1070pub const BLE_GAP_EVTS_BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST: BLE_GAP_EVTS = 35;
1071#[doc = "< LL Data Channel PDU payload length updated.     \\n See @ref ble_gap_evt_data_length_update_t."]
1072pub const BLE_GAP_EVTS_BLE_GAP_EVT_DATA_LENGTH_UPDATE: BLE_GAP_EVTS = 36;
1073#[doc = "< Advertising set terminated.                     \\n See @ref ble_gap_evt_adv_set_terminated_t."]
1074pub const BLE_GAP_EVTS_BLE_GAP_EVT_ADV_SET_TERMINATED: BLE_GAP_EVTS = 38;
1075#[doc = "@brief GAP Event IDs."]
1076#[doc = " IDs that uniquely identify an event coming from the stack to the application."]
1077pub type BLE_GAP_EVTS = self::c_uint;
1078#[doc = "< Channel Map. @ref ble_gap_opt_ch_map_t"]
1079pub const BLE_GAP_OPTS_BLE_GAP_OPT_CH_MAP: BLE_GAP_OPTS = 32;
1080#[doc = "< Local connection latency. @ref ble_gap_opt_local_conn_latency_t"]
1081pub const BLE_GAP_OPTS_BLE_GAP_OPT_LOCAL_CONN_LATENCY: BLE_GAP_OPTS = 33;
1082#[doc = "< Set passkey. @ref ble_gap_opt_passkey_t"]
1083pub const BLE_GAP_OPTS_BLE_GAP_OPT_PASSKEY: BLE_GAP_OPTS = 34;
1084#[doc = "< Set Authenticated payload timeout. @ref ble_gap_opt_auth_payload_timeout_t"]
1085pub const BLE_GAP_OPTS_BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT: BLE_GAP_OPTS = 36;
1086#[doc = "< Disable slave latency. @ref ble_gap_opt_slave_latency_disable_t"]
1087pub const BLE_GAP_OPTS_BLE_GAP_OPT_SLAVE_LATENCY_DISABLE: BLE_GAP_OPTS = 37;
1088#[doc = "@brief GAP Option IDs."]
1089#[doc = " IDs that uniquely identify a GAP option."]
1090pub type BLE_GAP_OPTS = self::c_uint;
1091#[doc = "< Role count configuration."]
1092pub const BLE_GAP_CFGS_BLE_GAP_CFG_ROLE_COUNT: BLE_GAP_CFGS = 64;
1093#[doc = "< Device name configuration."]
1094pub const BLE_GAP_CFGS_BLE_GAP_CFG_DEVICE_NAME: BLE_GAP_CFGS = 65;
1095#[doc = "< Peripheral Preferred Connection Parameters characteristic"]
1096#[doc = "inclusion configuration."]
1097pub const BLE_GAP_CFGS_BLE_GAP_CFG_PPCP_INCL_CONFIG: BLE_GAP_CFGS = 66;
1098#[doc = "< Central Address Resolution characteristic"]
1099#[doc = "inclusion configuration."]
1100pub const BLE_GAP_CFGS_BLE_GAP_CFG_CAR_INCL_CONFIG: BLE_GAP_CFGS = 67;
1101#[doc = "@brief GAP Configuration IDs."]
1102#[doc = ""]
1103#[doc = " IDs that uniquely identify a GAP configuration."]
1104pub type BLE_GAP_CFGS = self::c_uint;
1105#[doc = "< Advertiser role."]
1106pub const BLE_GAP_TX_POWER_ROLES_BLE_GAP_TX_POWER_ROLE_ADV: BLE_GAP_TX_POWER_ROLES = 1;
1107#[doc = "< Connection role."]
1108pub const BLE_GAP_TX_POWER_ROLES_BLE_GAP_TX_POWER_ROLE_CONN: BLE_GAP_TX_POWER_ROLES = 3;
1109#[doc = "@brief GAP TX Power roles."]
1110pub type BLE_GAP_TX_POWER_ROLES = self::c_uint;
1111#[doc = "@brief Advertising event properties."]
1112#[repr(C)]
1113#[derive(Debug, Copy, Clone)]
1114pub struct ble_gap_adv_properties_t {
1115    #[doc = "< Advertising type. See @ref BLE_GAP_ADV_TYPES."]
1116    pub type_: u8,
1117    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1118}
1119#[test]
1120fn bindgen_test_layout_ble_gap_adv_properties_t() {
1121    assert_eq!(
1122        ::core::mem::size_of::<ble_gap_adv_properties_t>(),
1123        2usize,
1124        concat!("Size of: ", stringify!(ble_gap_adv_properties_t))
1125    );
1126    assert_eq!(
1127        ::core::mem::align_of::<ble_gap_adv_properties_t>(),
1128        1usize,
1129        concat!("Alignment of ", stringify!(ble_gap_adv_properties_t))
1130    );
1131    assert_eq!(
1132        unsafe { &(*(::core::ptr::null::<ble_gap_adv_properties_t>())).type_ as *const _ as usize },
1133        0usize,
1134        concat!(
1135            "Offset of field: ",
1136            stringify!(ble_gap_adv_properties_t),
1137            "::",
1138            stringify!(type_)
1139        )
1140    );
1141}
1142impl ble_gap_adv_properties_t {
1143    #[inline]
1144    pub fn anonymous(&self) -> u8 {
1145        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
1146    }
1147    #[inline]
1148    pub fn set_anonymous(&mut self, val: u8) {
1149        unsafe {
1150            let val: u8 = ::core::mem::transmute(val);
1151            self._bitfield_1.set(0usize, 1u8, val as u64)
1152        }
1153    }
1154    #[inline]
1155    pub fn include_tx_power(&self) -> u8 {
1156        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
1157    }
1158    #[inline]
1159    pub fn set_include_tx_power(&mut self, val: u8) {
1160        unsafe {
1161            let val: u8 = ::core::mem::transmute(val);
1162            self._bitfield_1.set(1usize, 1u8, val as u64)
1163        }
1164    }
1165    #[inline]
1166    pub fn new_bitfield_1(anonymous: u8, include_tx_power: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
1167        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
1168        __bindgen_bitfield_unit.set(0usize, 1u8, {
1169            let anonymous: u8 = unsafe { ::core::mem::transmute(anonymous) };
1170            anonymous as u64
1171        });
1172        __bindgen_bitfield_unit.set(1usize, 1u8, {
1173            let include_tx_power: u8 = unsafe { ::core::mem::transmute(include_tx_power) };
1174            include_tx_power as u64
1175        });
1176        __bindgen_bitfield_unit
1177    }
1178}
1179#[doc = "@brief Bluetooth Low Energy address."]
1180#[repr(C)]
1181#[derive(Debug, Copy, Clone)]
1182pub struct ble_gap_addr_t {
1183    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1184    #[doc = "< 48-bit address, LSB format."]
1185    pub addr: [u8; 6usize],
1186}
1187#[test]
1188fn bindgen_test_layout_ble_gap_addr_t() {
1189    assert_eq!(
1190        ::core::mem::size_of::<ble_gap_addr_t>(),
1191        7usize,
1192        concat!("Size of: ", stringify!(ble_gap_addr_t))
1193    );
1194    assert_eq!(
1195        ::core::mem::align_of::<ble_gap_addr_t>(),
1196        1usize,
1197        concat!("Alignment of ", stringify!(ble_gap_addr_t))
1198    );
1199    assert_eq!(
1200        unsafe { &(*(::core::ptr::null::<ble_gap_addr_t>())).addr as *const _ as usize },
1201        1usize,
1202        concat!("Offset of field: ", stringify!(ble_gap_addr_t), "::", stringify!(addr))
1203    );
1204}
1205impl ble_gap_addr_t {
1206    #[inline]
1207    pub fn addr_id_peer(&self) -> u8 {
1208        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
1209    }
1210    #[inline]
1211    pub fn set_addr_id_peer(&mut self, val: u8) {
1212        unsafe {
1213            let val: u8 = ::core::mem::transmute(val);
1214            self._bitfield_1.set(0usize, 1u8, val as u64)
1215        }
1216    }
1217    #[inline]
1218    pub fn addr_type(&self) -> u8 {
1219        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) }
1220    }
1221    #[inline]
1222    pub fn set_addr_type(&mut self, val: u8) {
1223        unsafe {
1224            let val: u8 = ::core::mem::transmute(val);
1225            self._bitfield_1.set(1usize, 7u8, val as u64)
1226        }
1227    }
1228    #[inline]
1229    pub fn new_bitfield_1(addr_id_peer: u8, addr_type: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
1230        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
1231        __bindgen_bitfield_unit.set(0usize, 1u8, {
1232            let addr_id_peer: u8 = unsafe { ::core::mem::transmute(addr_id_peer) };
1233            addr_id_peer as u64
1234        });
1235        __bindgen_bitfield_unit.set(1usize, 7u8, {
1236            let addr_type: u8 = unsafe { ::core::mem::transmute(addr_type) };
1237            addr_type as u64
1238        });
1239        __bindgen_bitfield_unit
1240    }
1241}
1242#[doc = "@brief GAP connection parameters."]
1243#[doc = ""]
1244#[doc = " @note  When ble_conn_params_t is received in an event, both min_conn_interval and"]
1245#[doc = "        max_conn_interval will be equal to the connection interval set by the central."]
1246#[doc = ""]
1247#[doc = " @note  If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies:"]
1248#[doc = "        conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval"]
1249#[doc = "        that corresponds to the following Bluetooth Spec requirement:"]
1250#[doc = "        The Supervision_Timeout in milliseconds shall be larger than"]
1251#[doc = "        (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given in milliseconds."]
1252#[repr(C)]
1253#[derive(Debug, Copy, Clone)]
1254pub struct ble_gap_conn_params_t {
1255    #[doc = "< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS."]
1256    pub min_conn_interval: u16,
1257    #[doc = "< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS."]
1258    pub max_conn_interval: u16,
1259    #[doc = "< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS."]
1260    pub slave_latency: u16,
1261    #[doc = "< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS."]
1262    pub conn_sup_timeout: u16,
1263}
1264#[test]
1265fn bindgen_test_layout_ble_gap_conn_params_t() {
1266    assert_eq!(
1267        ::core::mem::size_of::<ble_gap_conn_params_t>(),
1268        8usize,
1269        concat!("Size of: ", stringify!(ble_gap_conn_params_t))
1270    );
1271    assert_eq!(
1272        ::core::mem::align_of::<ble_gap_conn_params_t>(),
1273        2usize,
1274        concat!("Alignment of ", stringify!(ble_gap_conn_params_t))
1275    );
1276    assert_eq!(
1277        unsafe { &(*(::core::ptr::null::<ble_gap_conn_params_t>())).min_conn_interval as *const _ as usize },
1278        0usize,
1279        concat!(
1280            "Offset of field: ",
1281            stringify!(ble_gap_conn_params_t),
1282            "::",
1283            stringify!(min_conn_interval)
1284        )
1285    );
1286    assert_eq!(
1287        unsafe { &(*(::core::ptr::null::<ble_gap_conn_params_t>())).max_conn_interval as *const _ as usize },
1288        2usize,
1289        concat!(
1290            "Offset of field: ",
1291            stringify!(ble_gap_conn_params_t),
1292            "::",
1293            stringify!(max_conn_interval)
1294        )
1295    );
1296    assert_eq!(
1297        unsafe { &(*(::core::ptr::null::<ble_gap_conn_params_t>())).slave_latency as *const _ as usize },
1298        4usize,
1299        concat!(
1300            "Offset of field: ",
1301            stringify!(ble_gap_conn_params_t),
1302            "::",
1303            stringify!(slave_latency)
1304        )
1305    );
1306    assert_eq!(
1307        unsafe { &(*(::core::ptr::null::<ble_gap_conn_params_t>())).conn_sup_timeout as *const _ as usize },
1308        6usize,
1309        concat!(
1310            "Offset of field: ",
1311            stringify!(ble_gap_conn_params_t),
1312            "::",
1313            stringify!(conn_sup_timeout)
1314        )
1315    );
1316}
1317#[doc = "@brief GAP connection security modes."]
1318#[doc = ""]
1319#[doc = " Security Mode 0 Level 0: No access permissions at all (this level is not defined by the Bluetooth Core specification).\\n"]
1320#[doc = " Security Mode 1 Level 1: No security is needed (aka open link).\\n"]
1321#[doc = " Security Mode 1 Level 2: Encrypted link required, MITM protection not necessary.\\n"]
1322#[doc = " Security Mode 1 Level 3: MITM protected encrypted link required.\\n"]
1323#[doc = " Security Mode 1 Level 4: LESC MITM protected encrypted link using a 128-bit strength encryption key required.\\n"]
1324#[doc = " Security Mode 2 Level 1: Signing or encryption required, MITM protection not necessary.\\n"]
1325#[doc = " Security Mode 2 Level 2: MITM protected signing required, unless link is MITM protected encrypted.\\n"]
1326#[repr(C, packed)]
1327#[derive(Debug, Copy, Clone)]
1328pub struct ble_gap_conn_sec_mode_t {
1329    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1330}
1331#[test]
1332fn bindgen_test_layout_ble_gap_conn_sec_mode_t() {
1333    assert_eq!(
1334        ::core::mem::size_of::<ble_gap_conn_sec_mode_t>(),
1335        1usize,
1336        concat!("Size of: ", stringify!(ble_gap_conn_sec_mode_t))
1337    );
1338    assert_eq!(
1339        ::core::mem::align_of::<ble_gap_conn_sec_mode_t>(),
1340        1usize,
1341        concat!("Alignment of ", stringify!(ble_gap_conn_sec_mode_t))
1342    );
1343}
1344impl ble_gap_conn_sec_mode_t {
1345    #[inline]
1346    pub fn sm(&self) -> u8 {
1347        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
1348    }
1349    #[inline]
1350    pub fn set_sm(&mut self, val: u8) {
1351        unsafe {
1352            let val: u8 = ::core::mem::transmute(val);
1353            self._bitfield_1.set(0usize, 4u8, val as u64)
1354        }
1355    }
1356    #[inline]
1357    pub fn lv(&self) -> u8 {
1358        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
1359    }
1360    #[inline]
1361    pub fn set_lv(&mut self, val: u8) {
1362        unsafe {
1363            let val: u8 = ::core::mem::transmute(val);
1364            self._bitfield_1.set(4usize, 4u8, val as u64)
1365        }
1366    }
1367    #[inline]
1368    pub fn new_bitfield_1(sm: u8, lv: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
1369        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
1370        __bindgen_bitfield_unit.set(0usize, 4u8, {
1371            let sm: u8 = unsafe { ::core::mem::transmute(sm) };
1372            sm as u64
1373        });
1374        __bindgen_bitfield_unit.set(4usize, 4u8, {
1375            let lv: u8 = unsafe { ::core::mem::transmute(lv) };
1376            lv as u64
1377        });
1378        __bindgen_bitfield_unit
1379    }
1380}
1381#[doc = "@brief GAP connection security status."]
1382#[repr(C)]
1383#[derive(Debug, Copy, Clone)]
1384pub struct ble_gap_conn_sec_t {
1385    #[doc = "< Currently active security mode for this connection."]
1386    pub sec_mode: ble_gap_conn_sec_mode_t,
1387    #[doc = "< Length of currently active encryption key, 7 to 16 octets (only applicable for bonding procedures)."]
1388    pub encr_key_size: u8,
1389}
1390#[test]
1391fn bindgen_test_layout_ble_gap_conn_sec_t() {
1392    assert_eq!(
1393        ::core::mem::size_of::<ble_gap_conn_sec_t>(),
1394        2usize,
1395        concat!("Size of: ", stringify!(ble_gap_conn_sec_t))
1396    );
1397    assert_eq!(
1398        ::core::mem::align_of::<ble_gap_conn_sec_t>(),
1399        1usize,
1400        concat!("Alignment of ", stringify!(ble_gap_conn_sec_t))
1401    );
1402    assert_eq!(
1403        unsafe { &(*(::core::ptr::null::<ble_gap_conn_sec_t>())).sec_mode as *const _ as usize },
1404        0usize,
1405        concat!(
1406            "Offset of field: ",
1407            stringify!(ble_gap_conn_sec_t),
1408            "::",
1409            stringify!(sec_mode)
1410        )
1411    );
1412    assert_eq!(
1413        unsafe { &(*(::core::ptr::null::<ble_gap_conn_sec_t>())).encr_key_size as *const _ as usize },
1414        1usize,
1415        concat!(
1416            "Offset of field: ",
1417            stringify!(ble_gap_conn_sec_t),
1418            "::",
1419            stringify!(encr_key_size)
1420        )
1421    );
1422}
1423#[doc = "@brief Identity Resolving Key."]
1424#[repr(C)]
1425#[derive(Debug, Copy, Clone)]
1426pub struct ble_gap_irk_t {
1427    #[doc = "< Array containing IRK."]
1428    pub irk: [u8; 16usize],
1429}
1430#[test]
1431fn bindgen_test_layout_ble_gap_irk_t() {
1432    assert_eq!(
1433        ::core::mem::size_of::<ble_gap_irk_t>(),
1434        16usize,
1435        concat!("Size of: ", stringify!(ble_gap_irk_t))
1436    );
1437    assert_eq!(
1438        ::core::mem::align_of::<ble_gap_irk_t>(),
1439        1usize,
1440        concat!("Alignment of ", stringify!(ble_gap_irk_t))
1441    );
1442    assert_eq!(
1443        unsafe { &(*(::core::ptr::null::<ble_gap_irk_t>())).irk as *const _ as usize },
1444        0usize,
1445        concat!("Offset of field: ", stringify!(ble_gap_irk_t), "::", stringify!(irk))
1446    );
1447}
1448#[doc = "@brief Channel mask (40 bits)."]
1449#[doc = " Every channel is represented with a bit positioned as per channel index defined in Bluetooth Core Specification v5.0,"]
1450#[doc = " Vol 6, Part B, Section 1.4.1. The LSB contained in array element 0 represents channel index 0, and bit 39 represents"]
1451#[doc = " channel index 39. If a bit is set to 1, the channel is not used."]
1452pub type ble_gap_ch_mask_t = [u8; 5usize];
1453#[doc = "@brief GAP advertising parameters."]
1454#[repr(C)]
1455#[derive(Debug, Copy, Clone)]
1456pub struct ble_gap_adv_params_t {
1457    #[doc = "< The properties of the advertising events."]
1458    pub properties: ble_gap_adv_properties_t,
1459    #[doc = "< Address of a known peer."]
1460    #[doc = "- When privacy is enabled and the local device uses"]
1461    #[doc = "@ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE addresses,"]
1462    #[doc = "the device identity list is searched for a matching entry. If"]
1463    #[doc = "the local IRK for that device identity is set, the local IRK"]
1464    #[doc = "for that device will be used to generate the advertiser address"]
1465    #[doc = "field in the advertising packet."]
1466    #[doc = "- If @ref ble_gap_adv_properties_t::type is directed, this must be"]
1467    #[doc = "set to the targeted scanner or initiator. If the peer address is"]
1468    #[doc = "in the device identity list, the peer IRK for that device will be"]
1469    #[doc = "used to generate @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE"]
1470    #[doc = "target addresses used in the advertising event PDUs."]
1471    pub p_peer_addr: *const ble_gap_addr_t,
1472    #[doc = "< Advertising interval in 625 us units. @sa BLE_GAP_ADV_INTERVALS."]
1473    #[doc = "@note If @ref ble_gap_adv_properties_t::type is set to"]
1474    #[doc = "@ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE"]
1475    #[doc = "advertising, this parameter is ignored."]
1476    pub interval: u32,
1477    #[doc = "< Advertising duration in 10 ms units. When timeout is reached,"]
1478    #[doc = "an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised."]
1479    #[doc = "@sa BLE_GAP_ADV_TIMEOUT_VALUES."]
1480    #[doc = "@note The SoftDevice will always complete at least one advertising"]
1481    #[doc = "event even if the duration is set too low."]
1482    pub duration: u16,
1483    #[doc = "< Maximum advertising events that shall be sent prior to disabling"]
1484    #[doc = "advertising. Setting the value to 0 disables the limitation. When"]
1485    #[doc = "the count of advertising events specified by this parameter"]
1486    #[doc = "(if not 0) is reached, advertising will be automatically stopped"]
1487    #[doc = "and an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised"]
1488    #[doc = "@note If @ref ble_gap_adv_properties_t::type is set to"]
1489    #[doc = "@ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE,"]
1490    #[doc = "this parameter is ignored."]
1491    pub max_adv_evts: u8,
1492    #[doc = "< Channel mask for primary channels."]
1493    #[doc = "At least one of the primary channels, that is channel index 37-39, must be used."]
1494    pub channel_mask: ble_gap_ch_mask_t,
1495    #[doc = "< Filter Policy. @sa BLE_GAP_ADV_FILTER_POLICIES."]
1496    pub filter_policy: u8,
1497    #[doc = "< Indicates the PHY on which the primary advertising channel packets"]
1498    #[doc = "are transmitted. If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS"]
1499    #[doc = "will be used."]
1500    #[doc = "The only supported value by this SoftDevice is @ref BLE_GAP_PHY_1MBPS."]
1501    pub primary_phy: u8,
1502    #[doc = "< This field is ignored on this SoftDevice."]
1503    pub secondary_phy: u8,
1504    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1505}
1506#[test]
1507fn bindgen_test_layout_ble_gap_adv_params_t() {
1508    assert_eq!(
1509        ::core::mem::size_of::<ble_gap_adv_params_t>(),
1510        24usize,
1511        concat!("Size of: ", stringify!(ble_gap_adv_params_t))
1512    );
1513    assert_eq!(
1514        ::core::mem::align_of::<ble_gap_adv_params_t>(),
1515        4usize,
1516        concat!("Alignment of ", stringify!(ble_gap_adv_params_t))
1517    );
1518    assert_eq!(
1519        unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).properties as *const _ as usize },
1520        0usize,
1521        concat!(
1522            "Offset of field: ",
1523            stringify!(ble_gap_adv_params_t),
1524            "::",
1525            stringify!(properties)
1526        )
1527    );
1528    assert_eq!(
1529        unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).p_peer_addr as *const _ as usize },
1530        4usize,
1531        concat!(
1532            "Offset of field: ",
1533            stringify!(ble_gap_adv_params_t),
1534            "::",
1535            stringify!(p_peer_addr)
1536        )
1537    );
1538    assert_eq!(
1539        unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).interval as *const _ as usize },
1540        8usize,
1541        concat!(
1542            "Offset of field: ",
1543            stringify!(ble_gap_adv_params_t),
1544            "::",
1545            stringify!(interval)
1546        )
1547    );
1548    assert_eq!(
1549        unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).duration as *const _ as usize },
1550        12usize,
1551        concat!(
1552            "Offset of field: ",
1553            stringify!(ble_gap_adv_params_t),
1554            "::",
1555            stringify!(duration)
1556        )
1557    );
1558    assert_eq!(
1559        unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).max_adv_evts as *const _ as usize },
1560        14usize,
1561        concat!(
1562            "Offset of field: ",
1563            stringify!(ble_gap_adv_params_t),
1564            "::",
1565            stringify!(max_adv_evts)
1566        )
1567    );
1568    assert_eq!(
1569        unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).channel_mask as *const _ as usize },
1570        15usize,
1571        concat!(
1572            "Offset of field: ",
1573            stringify!(ble_gap_adv_params_t),
1574            "::",
1575            stringify!(channel_mask)
1576        )
1577    );
1578    assert_eq!(
1579        unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).filter_policy as *const _ as usize },
1580        20usize,
1581        concat!(
1582            "Offset of field: ",
1583            stringify!(ble_gap_adv_params_t),
1584            "::",
1585            stringify!(filter_policy)
1586        )
1587    );
1588    assert_eq!(
1589        unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).primary_phy as *const _ as usize },
1590        21usize,
1591        concat!(
1592            "Offset of field: ",
1593            stringify!(ble_gap_adv_params_t),
1594            "::",
1595            stringify!(primary_phy)
1596        )
1597    );
1598    assert_eq!(
1599        unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).secondary_phy as *const _ as usize },
1600        22usize,
1601        concat!(
1602            "Offset of field: ",
1603            stringify!(ble_gap_adv_params_t),
1604            "::",
1605            stringify!(secondary_phy)
1606        )
1607    );
1608}
1609impl ble_gap_adv_params_t {
1610    #[inline]
1611    pub fn set_id(&self) -> u8 {
1612        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
1613    }
1614    #[inline]
1615    pub fn set_set_id(&mut self, val: u8) {
1616        unsafe {
1617            let val: u8 = ::core::mem::transmute(val);
1618            self._bitfield_1.set(0usize, 4u8, val as u64)
1619        }
1620    }
1621    #[inline]
1622    pub fn scan_req_notification(&self) -> u8 {
1623        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
1624    }
1625    #[inline]
1626    pub fn set_scan_req_notification(&mut self, val: u8) {
1627        unsafe {
1628            let val: u8 = ::core::mem::transmute(val);
1629            self._bitfield_1.set(4usize, 1u8, val as u64)
1630        }
1631    }
1632    #[inline]
1633    pub fn new_bitfield_1(set_id: u8, scan_req_notification: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
1634        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
1635        __bindgen_bitfield_unit.set(0usize, 4u8, {
1636            let set_id: u8 = unsafe { ::core::mem::transmute(set_id) };
1637            set_id as u64
1638        });
1639        __bindgen_bitfield_unit.set(4usize, 1u8, {
1640            let scan_req_notification: u8 = unsafe { ::core::mem::transmute(scan_req_notification) };
1641            scan_req_notification as u64
1642        });
1643        __bindgen_bitfield_unit
1644    }
1645}
1646#[doc = "@brief GAP advertising data buffers."]
1647#[doc = ""]
1648#[doc = " The application must provide the buffers for advertisement. The memory shall reside in application RAM, and"]
1649#[doc = " shall never be modified while advertising. The data shall be kept alive until either:"]
1650#[doc = "  - @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised."]
1651#[doc = "  - @ref BLE_GAP_EVT_CONNECTED is raised with @ref ble_gap_evt_connected_t::adv_handle set to the corresponding"]
1652#[doc = "    advertising handle."]
1653#[doc = "  - Advertising is stopped."]
1654#[doc = "  - Advertising data is changed."]
1655#[doc = " To update advertising data while advertising, provide new buffers to @ref sd_ble_gap_adv_set_configure."]
1656#[repr(C)]
1657#[derive(Debug, Copy, Clone)]
1658pub struct ble_gap_adv_data_t {
1659    #[doc = "< Advertising data."]
1660    #[doc = "@note"]
1661    #[doc = "Advertising data can only be specified for a @ref ble_gap_adv_properties_t::type"]
1662    #[doc = "that is allowed to contain advertising data."]
1663    pub adv_data: ble_data_t,
1664    #[doc = "< Scan response data."]
1665    #[doc = "@note"]
1666    #[doc = "Scan response data can only be specified for a @ref ble_gap_adv_properties_t::type"]
1667    #[doc = "that is scannable."]
1668    pub scan_rsp_data: ble_data_t,
1669}
1670#[test]
1671fn bindgen_test_layout_ble_gap_adv_data_t() {
1672    assert_eq!(
1673        ::core::mem::size_of::<ble_gap_adv_data_t>(),
1674        16usize,
1675        concat!("Size of: ", stringify!(ble_gap_adv_data_t))
1676    );
1677    assert_eq!(
1678        ::core::mem::align_of::<ble_gap_adv_data_t>(),
1679        4usize,
1680        concat!("Alignment of ", stringify!(ble_gap_adv_data_t))
1681    );
1682    assert_eq!(
1683        unsafe { &(*(::core::ptr::null::<ble_gap_adv_data_t>())).adv_data as *const _ as usize },
1684        0usize,
1685        concat!(
1686            "Offset of field: ",
1687            stringify!(ble_gap_adv_data_t),
1688            "::",
1689            stringify!(adv_data)
1690        )
1691    );
1692    assert_eq!(
1693        unsafe { &(*(::core::ptr::null::<ble_gap_adv_data_t>())).scan_rsp_data as *const _ as usize },
1694        8usize,
1695        concat!(
1696            "Offset of field: ",
1697            stringify!(ble_gap_adv_data_t),
1698            "::",
1699            stringify!(scan_rsp_data)
1700        )
1701    );
1702}
1703#[doc = "@brief Privacy."]
1704#[doc = ""]
1705#[doc = "        The privacy feature provides a way for the device to avoid being tracked over a period of time."]
1706#[doc = "        The privacy feature, when enabled, hides the local device identity and replaces it with a private address"]
1707#[doc = "        that is automatically refreshed at a specified interval."]
1708#[doc = ""]
1709#[doc = "        If a device still wants to be recognized by other peers, it needs to share it's Identity Resolving Key (IRK)."]
1710#[doc = "        With this key, a device can generate a random private address that can only be recognized by peers in possession of that key,"]
1711#[doc = "        and devices can establish connections without revealing their real identities."]
1712#[doc = ""]
1713#[doc = "        Both network privacy (@ref BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY) and device privacy (@ref BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY)"]
1714#[doc = "        are supported."]
1715#[doc = ""]
1716#[doc = " @note  If the device IRK is updated, the new IRK becomes the one to be distributed in all"]
1717#[doc = "        bonding procedures performed after @ref sd_ble_gap_privacy_set returns."]
1718#[doc = "        The IRK distributed during bonding procedure is the device IRK that is active when @ref sd_ble_gap_sec_params_reply is called."]
1719#[repr(C)]
1720#[derive(Debug, Copy, Clone)]
1721pub struct ble_gap_privacy_params_t {
1722    #[doc = "< Privacy mode, see @ref BLE_GAP_PRIVACY_MODES. Default is @ref BLE_GAP_PRIVACY_MODE_OFF."]
1723    pub privacy_mode: u8,
1724    #[doc = "< The private address type must be either @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE or @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE."]
1725    pub private_addr_type: u8,
1726    #[doc = "< Private address cycle interval in seconds. Providing an address cycle value of 0 will use the default value defined by @ref BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S."]
1727    pub private_addr_cycle_s: u16,
1728    #[doc = "< When used as input, pointer to IRK structure that will be used as the default IRK. If NULL, the device default IRK will be used."]
1729    #[doc = "When used as output, pointer to IRK structure where the current default IRK will be written to. If NULL, this argument is ignored."]
1730    #[doc = "By default, the default IRK is used to generate random private resolvable addresses for the local device unless instructed otherwise."]
1731    pub p_device_irk: *mut ble_gap_irk_t,
1732}
1733#[test]
1734fn bindgen_test_layout_ble_gap_privacy_params_t() {
1735    assert_eq!(
1736        ::core::mem::size_of::<ble_gap_privacy_params_t>(),
1737        8usize,
1738        concat!("Size of: ", stringify!(ble_gap_privacy_params_t))
1739    );
1740    assert_eq!(
1741        ::core::mem::align_of::<ble_gap_privacy_params_t>(),
1742        4usize,
1743        concat!("Alignment of ", stringify!(ble_gap_privacy_params_t))
1744    );
1745    assert_eq!(
1746        unsafe { &(*(::core::ptr::null::<ble_gap_privacy_params_t>())).privacy_mode as *const _ as usize },
1747        0usize,
1748        concat!(
1749            "Offset of field: ",
1750            stringify!(ble_gap_privacy_params_t),
1751            "::",
1752            stringify!(privacy_mode)
1753        )
1754    );
1755    assert_eq!(
1756        unsafe { &(*(::core::ptr::null::<ble_gap_privacy_params_t>())).private_addr_type as *const _ as usize },
1757        1usize,
1758        concat!(
1759            "Offset of field: ",
1760            stringify!(ble_gap_privacy_params_t),
1761            "::",
1762            stringify!(private_addr_type)
1763        )
1764    );
1765    assert_eq!(
1766        unsafe { &(*(::core::ptr::null::<ble_gap_privacy_params_t>())).private_addr_cycle_s as *const _ as usize },
1767        2usize,
1768        concat!(
1769            "Offset of field: ",
1770            stringify!(ble_gap_privacy_params_t),
1771            "::",
1772            stringify!(private_addr_cycle_s)
1773        )
1774    );
1775    assert_eq!(
1776        unsafe { &(*(::core::ptr::null::<ble_gap_privacy_params_t>())).p_device_irk as *const _ as usize },
1777        4usize,
1778        concat!(
1779            "Offset of field: ",
1780            stringify!(ble_gap_privacy_params_t),
1781            "::",
1782            stringify!(p_device_irk)
1783        )
1784    );
1785}
1786#[doc = "@brief PHY preferences for TX and RX"]
1787#[doc = " @note  tx_phys and rx_phys are bit fields. Multiple bits can be set in them to indicate multiple preferred PHYs for each direction."]
1788#[doc = " @code"]
1789#[doc = " p_gap_phys->tx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS;"]
1790#[doc = " p_gap_phys->rx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS;"]
1791#[doc = " @endcode"]
1792#[doc = ""]
1793#[repr(C)]
1794#[derive(Debug, Copy, Clone)]
1795pub struct ble_gap_phys_t {
1796    #[doc = "< Preferred transmit PHYs, see @ref BLE_GAP_PHYS."]
1797    pub tx_phys: u8,
1798    #[doc = "< Preferred receive PHYs, see @ref BLE_GAP_PHYS."]
1799    pub rx_phys: u8,
1800}
1801#[test]
1802fn bindgen_test_layout_ble_gap_phys_t() {
1803    assert_eq!(
1804        ::core::mem::size_of::<ble_gap_phys_t>(),
1805        2usize,
1806        concat!("Size of: ", stringify!(ble_gap_phys_t))
1807    );
1808    assert_eq!(
1809        ::core::mem::align_of::<ble_gap_phys_t>(),
1810        1usize,
1811        concat!("Alignment of ", stringify!(ble_gap_phys_t))
1812    );
1813    assert_eq!(
1814        unsafe { &(*(::core::ptr::null::<ble_gap_phys_t>())).tx_phys as *const _ as usize },
1815        0usize,
1816        concat!(
1817            "Offset of field: ",
1818            stringify!(ble_gap_phys_t),
1819            "::",
1820            stringify!(tx_phys)
1821        )
1822    );
1823    assert_eq!(
1824        unsafe { &(*(::core::ptr::null::<ble_gap_phys_t>())).rx_phys as *const _ as usize },
1825        1usize,
1826        concat!(
1827            "Offset of field: ",
1828            stringify!(ble_gap_phys_t),
1829            "::",
1830            stringify!(rx_phys)
1831        )
1832    );
1833}
1834#[doc = " @brief Keys that can be exchanged during a bonding procedure."]
1835#[repr(C, packed)]
1836#[derive(Debug, Copy, Clone)]
1837pub struct ble_gap_sec_kdist_t {
1838    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1839}
1840#[test]
1841fn bindgen_test_layout_ble_gap_sec_kdist_t() {
1842    assert_eq!(
1843        ::core::mem::size_of::<ble_gap_sec_kdist_t>(),
1844        1usize,
1845        concat!("Size of: ", stringify!(ble_gap_sec_kdist_t))
1846    );
1847    assert_eq!(
1848        ::core::mem::align_of::<ble_gap_sec_kdist_t>(),
1849        1usize,
1850        concat!("Alignment of ", stringify!(ble_gap_sec_kdist_t))
1851    );
1852}
1853impl ble_gap_sec_kdist_t {
1854    #[inline]
1855    pub fn enc(&self) -> u8 {
1856        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
1857    }
1858    #[inline]
1859    pub fn set_enc(&mut self, val: u8) {
1860        unsafe {
1861            let val: u8 = ::core::mem::transmute(val);
1862            self._bitfield_1.set(0usize, 1u8, val as u64)
1863        }
1864    }
1865    #[inline]
1866    pub fn id(&self) -> u8 {
1867        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
1868    }
1869    #[inline]
1870    pub fn set_id(&mut self, val: u8) {
1871        unsafe {
1872            let val: u8 = ::core::mem::transmute(val);
1873            self._bitfield_1.set(1usize, 1u8, val as u64)
1874        }
1875    }
1876    #[inline]
1877    pub fn sign(&self) -> u8 {
1878        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
1879    }
1880    #[inline]
1881    pub fn set_sign(&mut self, val: u8) {
1882        unsafe {
1883            let val: u8 = ::core::mem::transmute(val);
1884            self._bitfield_1.set(2usize, 1u8, val as u64)
1885        }
1886    }
1887    #[inline]
1888    pub fn link(&self) -> u8 {
1889        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
1890    }
1891    #[inline]
1892    pub fn set_link(&mut self, val: u8) {
1893        unsafe {
1894            let val: u8 = ::core::mem::transmute(val);
1895            self._bitfield_1.set(3usize, 1u8, val as u64)
1896        }
1897    }
1898    #[inline]
1899    pub fn new_bitfield_1(enc: u8, id: u8, sign: u8, link: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
1900        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
1901        __bindgen_bitfield_unit.set(0usize, 1u8, {
1902            let enc: u8 = unsafe { ::core::mem::transmute(enc) };
1903            enc as u64
1904        });
1905        __bindgen_bitfield_unit.set(1usize, 1u8, {
1906            let id: u8 = unsafe { ::core::mem::transmute(id) };
1907            id as u64
1908        });
1909        __bindgen_bitfield_unit.set(2usize, 1u8, {
1910            let sign: u8 = unsafe { ::core::mem::transmute(sign) };
1911            sign as u64
1912        });
1913        __bindgen_bitfield_unit.set(3usize, 1u8, {
1914            let link: u8 = unsafe { ::core::mem::transmute(link) };
1915            link as u64
1916        });
1917        __bindgen_bitfield_unit
1918    }
1919}
1920#[doc = "@brief GAP security parameters."]
1921#[repr(C)]
1922#[derive(Debug, Copy, Clone)]
1923pub struct ble_gap_sec_params_t {
1924    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1925    #[doc = "< Minimum encryption key size in octets between 7 and 16. If 0 then not applicable in this instance."]
1926    pub min_key_size: u8,
1927    #[doc = "< Maximum encryption key size in octets between min_key_size and 16."]
1928    pub max_key_size: u8,
1929    #[doc = "< Key distribution bitmap: keys that the local device will distribute."]
1930    pub kdist_own: ble_gap_sec_kdist_t,
1931    #[doc = "< Key distribution bitmap: keys that the remote device will distribute."]
1932    pub kdist_peer: ble_gap_sec_kdist_t,
1933}
1934#[test]
1935fn bindgen_test_layout_ble_gap_sec_params_t() {
1936    assert_eq!(
1937        ::core::mem::size_of::<ble_gap_sec_params_t>(),
1938        5usize,
1939        concat!("Size of: ", stringify!(ble_gap_sec_params_t))
1940    );
1941    assert_eq!(
1942        ::core::mem::align_of::<ble_gap_sec_params_t>(),
1943        1usize,
1944        concat!("Alignment of ", stringify!(ble_gap_sec_params_t))
1945    );
1946    assert_eq!(
1947        unsafe { &(*(::core::ptr::null::<ble_gap_sec_params_t>())).min_key_size as *const _ as usize },
1948        1usize,
1949        concat!(
1950            "Offset of field: ",
1951            stringify!(ble_gap_sec_params_t),
1952            "::",
1953            stringify!(min_key_size)
1954        )
1955    );
1956    assert_eq!(
1957        unsafe { &(*(::core::ptr::null::<ble_gap_sec_params_t>())).max_key_size as *const _ as usize },
1958        2usize,
1959        concat!(
1960            "Offset of field: ",
1961            stringify!(ble_gap_sec_params_t),
1962            "::",
1963            stringify!(max_key_size)
1964        )
1965    );
1966    assert_eq!(
1967        unsafe { &(*(::core::ptr::null::<ble_gap_sec_params_t>())).kdist_own as *const _ as usize },
1968        3usize,
1969        concat!(
1970            "Offset of field: ",
1971            stringify!(ble_gap_sec_params_t),
1972            "::",
1973            stringify!(kdist_own)
1974        )
1975    );
1976    assert_eq!(
1977        unsafe { &(*(::core::ptr::null::<ble_gap_sec_params_t>())).kdist_peer as *const _ as usize },
1978        4usize,
1979        concat!(
1980            "Offset of field: ",
1981            stringify!(ble_gap_sec_params_t),
1982            "::",
1983            stringify!(kdist_peer)
1984        )
1985    );
1986}
1987impl ble_gap_sec_params_t {
1988    #[inline]
1989    pub fn bond(&self) -> u8 {
1990        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
1991    }
1992    #[inline]
1993    pub fn set_bond(&mut self, val: u8) {
1994        unsafe {
1995            let val: u8 = ::core::mem::transmute(val);
1996            self._bitfield_1.set(0usize, 1u8, val as u64)
1997        }
1998    }
1999    #[inline]
2000    pub fn mitm(&self) -> u8 {
2001        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
2002    }
2003    #[inline]
2004    pub fn set_mitm(&mut self, val: u8) {
2005        unsafe {
2006            let val: u8 = ::core::mem::transmute(val);
2007            self._bitfield_1.set(1usize, 1u8, val as u64)
2008        }
2009    }
2010    #[inline]
2011    pub fn lesc(&self) -> u8 {
2012        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
2013    }
2014    #[inline]
2015    pub fn set_lesc(&mut self, val: u8) {
2016        unsafe {
2017            let val: u8 = ::core::mem::transmute(val);
2018            self._bitfield_1.set(2usize, 1u8, val as u64)
2019        }
2020    }
2021    #[inline]
2022    pub fn keypress(&self) -> u8 {
2023        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
2024    }
2025    #[inline]
2026    pub fn set_keypress(&mut self, val: u8) {
2027        unsafe {
2028            let val: u8 = ::core::mem::transmute(val);
2029            self._bitfield_1.set(3usize, 1u8, val as u64)
2030        }
2031    }
2032    #[inline]
2033    pub fn io_caps(&self) -> u8 {
2034        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 3u8) as u8) }
2035    }
2036    #[inline]
2037    pub fn set_io_caps(&mut self, val: u8) {
2038        unsafe {
2039            let val: u8 = ::core::mem::transmute(val);
2040            self._bitfield_1.set(4usize, 3u8, val as u64)
2041        }
2042    }
2043    #[inline]
2044    pub fn oob(&self) -> u8 {
2045        unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) }
2046    }
2047    #[inline]
2048    pub fn set_oob(&mut self, val: u8) {
2049        unsafe {
2050            let val: u8 = ::core::mem::transmute(val);
2051            self._bitfield_1.set(7usize, 1u8, val as u64)
2052        }
2053    }
2054    #[inline]
2055    pub fn new_bitfield_1(
2056        bond: u8,
2057        mitm: u8,
2058        lesc: u8,
2059        keypress: u8,
2060        io_caps: u8,
2061        oob: u8,
2062    ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
2063        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
2064        __bindgen_bitfield_unit.set(0usize, 1u8, {
2065            let bond: u8 = unsafe { ::core::mem::transmute(bond) };
2066            bond as u64
2067        });
2068        __bindgen_bitfield_unit.set(1usize, 1u8, {
2069            let mitm: u8 = unsafe { ::core::mem::transmute(mitm) };
2070            mitm as u64
2071        });
2072        __bindgen_bitfield_unit.set(2usize, 1u8, {
2073            let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
2074            lesc as u64
2075        });
2076        __bindgen_bitfield_unit.set(3usize, 1u8, {
2077            let keypress: u8 = unsafe { ::core::mem::transmute(keypress) };
2078            keypress as u64
2079        });
2080        __bindgen_bitfield_unit.set(4usize, 3u8, {
2081            let io_caps: u8 = unsafe { ::core::mem::transmute(io_caps) };
2082            io_caps as u64
2083        });
2084        __bindgen_bitfield_unit.set(7usize, 1u8, {
2085            let oob: u8 = unsafe { ::core::mem::transmute(oob) };
2086            oob as u64
2087        });
2088        __bindgen_bitfield_unit
2089    }
2090}
2091#[doc = "@brief GAP Encryption Information."]
2092#[repr(C)]
2093#[derive(Debug, Copy, Clone)]
2094pub struct ble_gap_enc_info_t {
2095    #[doc = "< Long Term Key."]
2096    pub ltk: [u8; 16usize],
2097    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
2098}
2099#[test]
2100fn bindgen_test_layout_ble_gap_enc_info_t() {
2101    assert_eq!(
2102        ::core::mem::size_of::<ble_gap_enc_info_t>(),
2103        17usize,
2104        concat!("Size of: ", stringify!(ble_gap_enc_info_t))
2105    );
2106    assert_eq!(
2107        ::core::mem::align_of::<ble_gap_enc_info_t>(),
2108        1usize,
2109        concat!("Alignment of ", stringify!(ble_gap_enc_info_t))
2110    );
2111    assert_eq!(
2112        unsafe { &(*(::core::ptr::null::<ble_gap_enc_info_t>())).ltk as *const _ as usize },
2113        0usize,
2114        concat!(
2115            "Offset of field: ",
2116            stringify!(ble_gap_enc_info_t),
2117            "::",
2118            stringify!(ltk)
2119        )
2120    );
2121}
2122impl ble_gap_enc_info_t {
2123    #[inline]
2124    pub fn lesc(&self) -> u8 {
2125        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
2126    }
2127    #[inline]
2128    pub fn set_lesc(&mut self, val: u8) {
2129        unsafe {
2130            let val: u8 = ::core::mem::transmute(val);
2131            self._bitfield_1.set(0usize, 1u8, val as u64)
2132        }
2133    }
2134    #[inline]
2135    pub fn auth(&self) -> u8 {
2136        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
2137    }
2138    #[inline]
2139    pub fn set_auth(&mut self, val: u8) {
2140        unsafe {
2141            let val: u8 = ::core::mem::transmute(val);
2142            self._bitfield_1.set(1usize, 1u8, val as u64)
2143        }
2144    }
2145    #[inline]
2146    pub fn ltk_len(&self) -> u8 {
2147        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 6u8) as u8) }
2148    }
2149    #[inline]
2150    pub fn set_ltk_len(&mut self, val: u8) {
2151        unsafe {
2152            let val: u8 = ::core::mem::transmute(val);
2153            self._bitfield_1.set(2usize, 6u8, val as u64)
2154        }
2155    }
2156    #[inline]
2157    pub fn new_bitfield_1(lesc: u8, auth: u8, ltk_len: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
2158        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
2159        __bindgen_bitfield_unit.set(0usize, 1u8, {
2160            let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
2161            lesc as u64
2162        });
2163        __bindgen_bitfield_unit.set(1usize, 1u8, {
2164            let auth: u8 = unsafe { ::core::mem::transmute(auth) };
2165            auth as u64
2166        });
2167        __bindgen_bitfield_unit.set(2usize, 6u8, {
2168            let ltk_len: u8 = unsafe { ::core::mem::transmute(ltk_len) };
2169            ltk_len as u64
2170        });
2171        __bindgen_bitfield_unit
2172    }
2173}
2174#[doc = "@brief GAP Master Identification."]
2175#[repr(C)]
2176#[derive(Debug, Copy, Clone)]
2177pub struct ble_gap_master_id_t {
2178    #[doc = "< Encrypted Diversifier."]
2179    pub ediv: u16,
2180    #[doc = "< Random Number."]
2181    pub rand: [u8; 8usize],
2182}
2183#[test]
2184fn bindgen_test_layout_ble_gap_master_id_t() {
2185    assert_eq!(
2186        ::core::mem::size_of::<ble_gap_master_id_t>(),
2187        10usize,
2188        concat!("Size of: ", stringify!(ble_gap_master_id_t))
2189    );
2190    assert_eq!(
2191        ::core::mem::align_of::<ble_gap_master_id_t>(),
2192        2usize,
2193        concat!("Alignment of ", stringify!(ble_gap_master_id_t))
2194    );
2195    assert_eq!(
2196        unsafe { &(*(::core::ptr::null::<ble_gap_master_id_t>())).ediv as *const _ as usize },
2197        0usize,
2198        concat!(
2199            "Offset of field: ",
2200            stringify!(ble_gap_master_id_t),
2201            "::",
2202            stringify!(ediv)
2203        )
2204    );
2205    assert_eq!(
2206        unsafe { &(*(::core::ptr::null::<ble_gap_master_id_t>())).rand as *const _ as usize },
2207        2usize,
2208        concat!(
2209            "Offset of field: ",
2210            stringify!(ble_gap_master_id_t),
2211            "::",
2212            stringify!(rand)
2213        )
2214    );
2215}
2216#[doc = "@brief GAP Signing Information."]
2217#[repr(C)]
2218#[derive(Debug, Copy, Clone)]
2219pub struct ble_gap_sign_info_t {
2220    #[doc = "< Connection Signature Resolving Key."]
2221    pub csrk: [u8; 16usize],
2222}
2223#[test]
2224fn bindgen_test_layout_ble_gap_sign_info_t() {
2225    assert_eq!(
2226        ::core::mem::size_of::<ble_gap_sign_info_t>(),
2227        16usize,
2228        concat!("Size of: ", stringify!(ble_gap_sign_info_t))
2229    );
2230    assert_eq!(
2231        ::core::mem::align_of::<ble_gap_sign_info_t>(),
2232        1usize,
2233        concat!("Alignment of ", stringify!(ble_gap_sign_info_t))
2234    );
2235    assert_eq!(
2236        unsafe { &(*(::core::ptr::null::<ble_gap_sign_info_t>())).csrk as *const _ as usize },
2237        0usize,
2238        concat!(
2239            "Offset of field: ",
2240            stringify!(ble_gap_sign_info_t),
2241            "::",
2242            stringify!(csrk)
2243        )
2244    );
2245}
2246#[doc = "@brief GAP LE Secure Connections P-256 Public Key."]
2247#[repr(C)]
2248#[derive(Copy, Clone)]
2249pub struct ble_gap_lesc_p256_pk_t {
2250    #[doc = "< LE Secure Connections Elliptic Curve Diffie-Hellman P-256 Public Key. Stored in the standard SMP protocol format: {X,Y} both in little-endian."]
2251    pub pk: [u8; 64usize],
2252}
2253#[test]
2254fn bindgen_test_layout_ble_gap_lesc_p256_pk_t() {
2255    assert_eq!(
2256        ::core::mem::size_of::<ble_gap_lesc_p256_pk_t>(),
2257        64usize,
2258        concat!("Size of: ", stringify!(ble_gap_lesc_p256_pk_t))
2259    );
2260    assert_eq!(
2261        ::core::mem::align_of::<ble_gap_lesc_p256_pk_t>(),
2262        1usize,
2263        concat!("Alignment of ", stringify!(ble_gap_lesc_p256_pk_t))
2264    );
2265    assert_eq!(
2266        unsafe { &(*(::core::ptr::null::<ble_gap_lesc_p256_pk_t>())).pk as *const _ as usize },
2267        0usize,
2268        concat!(
2269            "Offset of field: ",
2270            stringify!(ble_gap_lesc_p256_pk_t),
2271            "::",
2272            stringify!(pk)
2273        )
2274    );
2275}
2276#[doc = "@brief GAP LE Secure Connections DHKey."]
2277#[repr(C)]
2278#[derive(Debug, Copy, Clone)]
2279pub struct ble_gap_lesc_dhkey_t {
2280    #[doc = "< LE Secure Connections Elliptic Curve Diffie-Hellman Key. Stored in little-endian."]
2281    pub key: [u8; 32usize],
2282}
2283#[test]
2284fn bindgen_test_layout_ble_gap_lesc_dhkey_t() {
2285    assert_eq!(
2286        ::core::mem::size_of::<ble_gap_lesc_dhkey_t>(),
2287        32usize,
2288        concat!("Size of: ", stringify!(ble_gap_lesc_dhkey_t))
2289    );
2290    assert_eq!(
2291        ::core::mem::align_of::<ble_gap_lesc_dhkey_t>(),
2292        1usize,
2293        concat!("Alignment of ", stringify!(ble_gap_lesc_dhkey_t))
2294    );
2295    assert_eq!(
2296        unsafe { &(*(::core::ptr::null::<ble_gap_lesc_dhkey_t>())).key as *const _ as usize },
2297        0usize,
2298        concat!(
2299            "Offset of field: ",
2300            stringify!(ble_gap_lesc_dhkey_t),
2301            "::",
2302            stringify!(key)
2303        )
2304    );
2305}
2306#[doc = "@brief GAP LE Secure Connections OOB data."]
2307#[repr(C)]
2308#[derive(Debug, Copy, Clone)]
2309pub struct ble_gap_lesc_oob_data_t {
2310    #[doc = "< Bluetooth address of the device."]
2311    pub addr: ble_gap_addr_t,
2312    #[doc = "< Random Number."]
2313    pub r: [u8; 16usize],
2314    #[doc = "< Confirm Value."]
2315    pub c: [u8; 16usize],
2316}
2317#[test]
2318fn bindgen_test_layout_ble_gap_lesc_oob_data_t() {
2319    assert_eq!(
2320        ::core::mem::size_of::<ble_gap_lesc_oob_data_t>(),
2321        39usize,
2322        concat!("Size of: ", stringify!(ble_gap_lesc_oob_data_t))
2323    );
2324    assert_eq!(
2325        ::core::mem::align_of::<ble_gap_lesc_oob_data_t>(),
2326        1usize,
2327        concat!("Alignment of ", stringify!(ble_gap_lesc_oob_data_t))
2328    );
2329    assert_eq!(
2330        unsafe { &(*(::core::ptr::null::<ble_gap_lesc_oob_data_t>())).addr as *const _ as usize },
2331        0usize,
2332        concat!(
2333            "Offset of field: ",
2334            stringify!(ble_gap_lesc_oob_data_t),
2335            "::",
2336            stringify!(addr)
2337        )
2338    );
2339    assert_eq!(
2340        unsafe { &(*(::core::ptr::null::<ble_gap_lesc_oob_data_t>())).r as *const _ as usize },
2341        7usize,
2342        concat!(
2343            "Offset of field: ",
2344            stringify!(ble_gap_lesc_oob_data_t),
2345            "::",
2346            stringify!(r)
2347        )
2348    );
2349    assert_eq!(
2350        unsafe { &(*(::core::ptr::null::<ble_gap_lesc_oob_data_t>())).c as *const _ as usize },
2351        23usize,
2352        concat!(
2353            "Offset of field: ",
2354            stringify!(ble_gap_lesc_oob_data_t),
2355            "::",
2356            stringify!(c)
2357        )
2358    );
2359}
2360#[doc = "@brief Event structure for @ref BLE_GAP_EVT_CONNECTED."]
2361#[repr(C)]
2362#[derive(Debug, Copy, Clone)]
2363pub struct ble_gap_evt_connected_t {
2364    #[doc = "< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1"]
2365    #[doc = "and the address is the device's identity address."]
2366    pub peer_addr: ble_gap_addr_t,
2367    #[doc = "< BLE role for this connection, see @ref BLE_GAP_ROLES"]
2368    pub role: u8,
2369    #[doc = "< GAP Connection Parameters."]
2370    pub conn_params: ble_gap_conn_params_t,
2371    #[doc = "< Advertising handle in which advertising has ended."]
2372    #[doc = "This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH."]
2373    pub adv_handle: u8,
2374    #[doc = "< Advertising buffers corresponding to the terminated"]
2375    #[doc = "advertising set. The advertising buffers provided in"]
2376    #[doc = "@ref sd_ble_gap_adv_set_configure are now released."]
2377    #[doc = "This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH."]
2378    pub adv_data: ble_gap_adv_data_t,
2379}
2380#[test]
2381fn bindgen_test_layout_ble_gap_evt_connected_t() {
2382    assert_eq!(
2383        ::core::mem::size_of::<ble_gap_evt_connected_t>(),
2384        36usize,
2385        concat!("Size of: ", stringify!(ble_gap_evt_connected_t))
2386    );
2387    assert_eq!(
2388        ::core::mem::align_of::<ble_gap_evt_connected_t>(),
2389        4usize,
2390        concat!("Alignment of ", stringify!(ble_gap_evt_connected_t))
2391    );
2392    assert_eq!(
2393        unsafe { &(*(::core::ptr::null::<ble_gap_evt_connected_t>())).peer_addr as *const _ as usize },
2394        0usize,
2395        concat!(
2396            "Offset of field: ",
2397            stringify!(ble_gap_evt_connected_t),
2398            "::",
2399            stringify!(peer_addr)
2400        )
2401    );
2402    assert_eq!(
2403        unsafe { &(*(::core::ptr::null::<ble_gap_evt_connected_t>())).role as *const _ as usize },
2404        7usize,
2405        concat!(
2406            "Offset of field: ",
2407            stringify!(ble_gap_evt_connected_t),
2408            "::",
2409            stringify!(role)
2410        )
2411    );
2412    assert_eq!(
2413        unsafe { &(*(::core::ptr::null::<ble_gap_evt_connected_t>())).conn_params as *const _ as usize },
2414        8usize,
2415        concat!(
2416            "Offset of field: ",
2417            stringify!(ble_gap_evt_connected_t),
2418            "::",
2419            stringify!(conn_params)
2420        )
2421    );
2422    assert_eq!(
2423        unsafe { &(*(::core::ptr::null::<ble_gap_evt_connected_t>())).adv_handle as *const _ as usize },
2424        16usize,
2425        concat!(
2426            "Offset of field: ",
2427            stringify!(ble_gap_evt_connected_t),
2428            "::",
2429            stringify!(adv_handle)
2430        )
2431    );
2432    assert_eq!(
2433        unsafe { &(*(::core::ptr::null::<ble_gap_evt_connected_t>())).adv_data as *const _ as usize },
2434        20usize,
2435        concat!(
2436            "Offset of field: ",
2437            stringify!(ble_gap_evt_connected_t),
2438            "::",
2439            stringify!(adv_data)
2440        )
2441    );
2442}
2443#[doc = "@brief Event structure for @ref BLE_GAP_EVT_DISCONNECTED."]
2444#[repr(C)]
2445#[derive(Debug, Copy, Clone)]
2446pub struct ble_gap_evt_disconnected_t {
2447    #[doc = "< HCI error code, see @ref BLE_HCI_STATUS_CODES."]
2448    pub reason: u8,
2449}
2450#[test]
2451fn bindgen_test_layout_ble_gap_evt_disconnected_t() {
2452    assert_eq!(
2453        ::core::mem::size_of::<ble_gap_evt_disconnected_t>(),
2454        1usize,
2455        concat!("Size of: ", stringify!(ble_gap_evt_disconnected_t))
2456    );
2457    assert_eq!(
2458        ::core::mem::align_of::<ble_gap_evt_disconnected_t>(),
2459        1usize,
2460        concat!("Alignment of ", stringify!(ble_gap_evt_disconnected_t))
2461    );
2462    assert_eq!(
2463        unsafe { &(*(::core::ptr::null::<ble_gap_evt_disconnected_t>())).reason as *const _ as usize },
2464        0usize,
2465        concat!(
2466            "Offset of field: ",
2467            stringify!(ble_gap_evt_disconnected_t),
2468            "::",
2469            stringify!(reason)
2470        )
2471    );
2472}
2473#[doc = "@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE."]
2474#[repr(C)]
2475#[derive(Debug, Copy, Clone)]
2476pub struct ble_gap_evt_conn_param_update_t {
2477    #[doc = "<  GAP Connection Parameters."]
2478    pub conn_params: ble_gap_conn_params_t,
2479}
2480#[test]
2481fn bindgen_test_layout_ble_gap_evt_conn_param_update_t() {
2482    assert_eq!(
2483        ::core::mem::size_of::<ble_gap_evt_conn_param_update_t>(),
2484        8usize,
2485        concat!("Size of: ", stringify!(ble_gap_evt_conn_param_update_t))
2486    );
2487    assert_eq!(
2488        ::core::mem::align_of::<ble_gap_evt_conn_param_update_t>(),
2489        2usize,
2490        concat!("Alignment of ", stringify!(ble_gap_evt_conn_param_update_t))
2491    );
2492    assert_eq!(
2493        unsafe { &(*(::core::ptr::null::<ble_gap_evt_conn_param_update_t>())).conn_params as *const _ as usize },
2494        0usize,
2495        concat!(
2496            "Offset of field: ",
2497            stringify!(ble_gap_evt_conn_param_update_t),
2498            "::",
2499            stringify!(conn_params)
2500        )
2501    );
2502}
2503#[doc = "@brief Event structure for @ref BLE_GAP_EVT_PHY_UPDATE_REQUEST."]
2504#[repr(C)]
2505#[derive(Debug, Copy, Clone)]
2506pub struct ble_gap_evt_phy_update_request_t {
2507    #[doc = "< The PHYs the peer prefers to use."]
2508    pub peer_preferred_phys: ble_gap_phys_t,
2509}
2510#[test]
2511fn bindgen_test_layout_ble_gap_evt_phy_update_request_t() {
2512    assert_eq!(
2513        ::core::mem::size_of::<ble_gap_evt_phy_update_request_t>(),
2514        2usize,
2515        concat!("Size of: ", stringify!(ble_gap_evt_phy_update_request_t))
2516    );
2517    assert_eq!(
2518        ::core::mem::align_of::<ble_gap_evt_phy_update_request_t>(),
2519        1usize,
2520        concat!("Alignment of ", stringify!(ble_gap_evt_phy_update_request_t))
2521    );
2522    assert_eq!(
2523        unsafe {
2524            &(*(::core::ptr::null::<ble_gap_evt_phy_update_request_t>())).peer_preferred_phys as *const _ as usize
2525        },
2526        0usize,
2527        concat!(
2528            "Offset of field: ",
2529            stringify!(ble_gap_evt_phy_update_request_t),
2530            "::",
2531            stringify!(peer_preferred_phys)
2532        )
2533    );
2534}
2535#[doc = "@brief Event Structure for @ref BLE_GAP_EVT_PHY_UPDATE."]
2536#[repr(C)]
2537#[derive(Debug, Copy, Clone)]
2538pub struct ble_gap_evt_phy_update_t {
2539    #[doc = "< Status of the procedure, see @ref BLE_HCI_STATUS_CODES."]
2540    pub status: u8,
2541    #[doc = "< TX PHY for this connection, see @ref BLE_GAP_PHYS."]
2542    pub tx_phy: u8,
2543    #[doc = "< RX PHY for this connection, see @ref BLE_GAP_PHYS."]
2544    pub rx_phy: u8,
2545}
2546#[test]
2547fn bindgen_test_layout_ble_gap_evt_phy_update_t() {
2548    assert_eq!(
2549        ::core::mem::size_of::<ble_gap_evt_phy_update_t>(),
2550        3usize,
2551        concat!("Size of: ", stringify!(ble_gap_evt_phy_update_t))
2552    );
2553    assert_eq!(
2554        ::core::mem::align_of::<ble_gap_evt_phy_update_t>(),
2555        1usize,
2556        concat!("Alignment of ", stringify!(ble_gap_evt_phy_update_t))
2557    );
2558    assert_eq!(
2559        unsafe { &(*(::core::ptr::null::<ble_gap_evt_phy_update_t>())).status as *const _ as usize },
2560        0usize,
2561        concat!(
2562            "Offset of field: ",
2563            stringify!(ble_gap_evt_phy_update_t),
2564            "::",
2565            stringify!(status)
2566        )
2567    );
2568    assert_eq!(
2569        unsafe { &(*(::core::ptr::null::<ble_gap_evt_phy_update_t>())).tx_phy as *const _ as usize },
2570        1usize,
2571        concat!(
2572            "Offset of field: ",
2573            stringify!(ble_gap_evt_phy_update_t),
2574            "::",
2575            stringify!(tx_phy)
2576        )
2577    );
2578    assert_eq!(
2579        unsafe { &(*(::core::ptr::null::<ble_gap_evt_phy_update_t>())).rx_phy as *const _ as usize },
2580        2usize,
2581        concat!(
2582            "Offset of field: ",
2583            stringify!(ble_gap_evt_phy_update_t),
2584            "::",
2585            stringify!(rx_phy)
2586        )
2587    );
2588}
2589#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST."]
2590#[repr(C)]
2591#[derive(Debug, Copy, Clone)]
2592pub struct ble_gap_evt_sec_params_request_t {
2593    #[doc = "< Initiator Security Parameters."]
2594    pub peer_params: ble_gap_sec_params_t,
2595}
2596#[test]
2597fn bindgen_test_layout_ble_gap_evt_sec_params_request_t() {
2598    assert_eq!(
2599        ::core::mem::size_of::<ble_gap_evt_sec_params_request_t>(),
2600        5usize,
2601        concat!("Size of: ", stringify!(ble_gap_evt_sec_params_request_t))
2602    );
2603    assert_eq!(
2604        ::core::mem::align_of::<ble_gap_evt_sec_params_request_t>(),
2605        1usize,
2606        concat!("Alignment of ", stringify!(ble_gap_evt_sec_params_request_t))
2607    );
2608    assert_eq!(
2609        unsafe { &(*(::core::ptr::null::<ble_gap_evt_sec_params_request_t>())).peer_params as *const _ as usize },
2610        0usize,
2611        concat!(
2612            "Offset of field: ",
2613            stringify!(ble_gap_evt_sec_params_request_t),
2614            "::",
2615            stringify!(peer_params)
2616        )
2617    );
2618}
2619#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SEC_INFO_REQUEST."]
2620#[repr(C)]
2621#[derive(Debug, Copy, Clone)]
2622pub struct ble_gap_evt_sec_info_request_t {
2623    #[doc = "< Bluetooth address of the peer device."]
2624    pub peer_addr: ble_gap_addr_t,
2625    #[doc = "< Master Identification for LTK lookup."]
2626    pub master_id: ble_gap_master_id_t,
2627    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
2628    pub __bindgen_padding_0: u8,
2629}
2630#[test]
2631fn bindgen_test_layout_ble_gap_evt_sec_info_request_t() {
2632    assert_eq!(
2633        ::core::mem::size_of::<ble_gap_evt_sec_info_request_t>(),
2634        20usize,
2635        concat!("Size of: ", stringify!(ble_gap_evt_sec_info_request_t))
2636    );
2637    assert_eq!(
2638        ::core::mem::align_of::<ble_gap_evt_sec_info_request_t>(),
2639        2usize,
2640        concat!("Alignment of ", stringify!(ble_gap_evt_sec_info_request_t))
2641    );
2642    assert_eq!(
2643        unsafe { &(*(::core::ptr::null::<ble_gap_evt_sec_info_request_t>())).peer_addr as *const _ as usize },
2644        0usize,
2645        concat!(
2646            "Offset of field: ",
2647            stringify!(ble_gap_evt_sec_info_request_t),
2648            "::",
2649            stringify!(peer_addr)
2650        )
2651    );
2652    assert_eq!(
2653        unsafe { &(*(::core::ptr::null::<ble_gap_evt_sec_info_request_t>())).master_id as *const _ as usize },
2654        8usize,
2655        concat!(
2656            "Offset of field: ",
2657            stringify!(ble_gap_evt_sec_info_request_t),
2658            "::",
2659            stringify!(master_id)
2660        )
2661    );
2662}
2663impl ble_gap_evt_sec_info_request_t {
2664    #[inline]
2665    pub fn enc_info(&self) -> u8 {
2666        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
2667    }
2668    #[inline]
2669    pub fn set_enc_info(&mut self, val: u8) {
2670        unsafe {
2671            let val: u8 = ::core::mem::transmute(val);
2672            self._bitfield_1.set(0usize, 1u8, val as u64)
2673        }
2674    }
2675    #[inline]
2676    pub fn id_info(&self) -> u8 {
2677        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
2678    }
2679    #[inline]
2680    pub fn set_id_info(&mut self, val: u8) {
2681        unsafe {
2682            let val: u8 = ::core::mem::transmute(val);
2683            self._bitfield_1.set(1usize, 1u8, val as u64)
2684        }
2685    }
2686    #[inline]
2687    pub fn sign_info(&self) -> u8 {
2688        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
2689    }
2690    #[inline]
2691    pub fn set_sign_info(&mut self, val: u8) {
2692        unsafe {
2693            let val: u8 = ::core::mem::transmute(val);
2694            self._bitfield_1.set(2usize, 1u8, val as u64)
2695        }
2696    }
2697    #[inline]
2698    pub fn new_bitfield_1(enc_info: u8, id_info: u8, sign_info: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
2699        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
2700        __bindgen_bitfield_unit.set(0usize, 1u8, {
2701            let enc_info: u8 = unsafe { ::core::mem::transmute(enc_info) };
2702            enc_info as u64
2703        });
2704        __bindgen_bitfield_unit.set(1usize, 1u8, {
2705            let id_info: u8 = unsafe { ::core::mem::transmute(id_info) };
2706            id_info as u64
2707        });
2708        __bindgen_bitfield_unit.set(2usize, 1u8, {
2709            let sign_info: u8 = unsafe { ::core::mem::transmute(sign_info) };
2710            sign_info as u64
2711        });
2712        __bindgen_bitfield_unit
2713    }
2714}
2715#[doc = "@brief Event structure for @ref BLE_GAP_EVT_PASSKEY_DISPLAY."]
2716#[repr(C)]
2717#[derive(Debug, Copy, Clone)]
2718pub struct ble_gap_evt_passkey_display_t {
2719    #[doc = "< 6-digit passkey in ASCII ('0'-'9' digits only)."]
2720    pub passkey: [u8; 6usize],
2721    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
2722}
2723#[test]
2724fn bindgen_test_layout_ble_gap_evt_passkey_display_t() {
2725    assert_eq!(
2726        ::core::mem::size_of::<ble_gap_evt_passkey_display_t>(),
2727        7usize,
2728        concat!("Size of: ", stringify!(ble_gap_evt_passkey_display_t))
2729    );
2730    assert_eq!(
2731        ::core::mem::align_of::<ble_gap_evt_passkey_display_t>(),
2732        1usize,
2733        concat!("Alignment of ", stringify!(ble_gap_evt_passkey_display_t))
2734    );
2735    assert_eq!(
2736        unsafe { &(*(::core::ptr::null::<ble_gap_evt_passkey_display_t>())).passkey as *const _ as usize },
2737        0usize,
2738        concat!(
2739            "Offset of field: ",
2740            stringify!(ble_gap_evt_passkey_display_t),
2741            "::",
2742            stringify!(passkey)
2743        )
2744    );
2745}
2746impl ble_gap_evt_passkey_display_t {
2747    #[inline]
2748    pub fn match_request(&self) -> u8 {
2749        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
2750    }
2751    #[inline]
2752    pub fn set_match_request(&mut self, val: u8) {
2753        unsafe {
2754            let val: u8 = ::core::mem::transmute(val);
2755            self._bitfield_1.set(0usize, 1u8, val as u64)
2756        }
2757    }
2758    #[inline]
2759    pub fn new_bitfield_1(match_request: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
2760        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
2761        __bindgen_bitfield_unit.set(0usize, 1u8, {
2762            let match_request: u8 = unsafe { ::core::mem::transmute(match_request) };
2763            match_request as u64
2764        });
2765        __bindgen_bitfield_unit
2766    }
2767}
2768#[doc = "@brief Event structure for @ref BLE_GAP_EVT_KEY_PRESSED."]
2769#[repr(C)]
2770#[derive(Debug, Copy, Clone)]
2771pub struct ble_gap_evt_key_pressed_t {
2772    #[doc = "< Keypress notification type, see @ref BLE_GAP_KP_NOT_TYPES."]
2773    pub kp_not: u8,
2774}
2775#[test]
2776fn bindgen_test_layout_ble_gap_evt_key_pressed_t() {
2777    assert_eq!(
2778        ::core::mem::size_of::<ble_gap_evt_key_pressed_t>(),
2779        1usize,
2780        concat!("Size of: ", stringify!(ble_gap_evt_key_pressed_t))
2781    );
2782    assert_eq!(
2783        ::core::mem::align_of::<ble_gap_evt_key_pressed_t>(),
2784        1usize,
2785        concat!("Alignment of ", stringify!(ble_gap_evt_key_pressed_t))
2786    );
2787    assert_eq!(
2788        unsafe { &(*(::core::ptr::null::<ble_gap_evt_key_pressed_t>())).kp_not as *const _ as usize },
2789        0usize,
2790        concat!(
2791            "Offset of field: ",
2792            stringify!(ble_gap_evt_key_pressed_t),
2793            "::",
2794            stringify!(kp_not)
2795        )
2796    );
2797}
2798#[doc = "@brief Event structure for @ref BLE_GAP_EVT_AUTH_KEY_REQUEST."]
2799#[repr(C)]
2800#[derive(Debug, Copy, Clone)]
2801pub struct ble_gap_evt_auth_key_request_t {
2802    #[doc = "< See @ref BLE_GAP_AUTH_KEY_TYPES."]
2803    pub key_type: u8,
2804}
2805#[test]
2806fn bindgen_test_layout_ble_gap_evt_auth_key_request_t() {
2807    assert_eq!(
2808        ::core::mem::size_of::<ble_gap_evt_auth_key_request_t>(),
2809        1usize,
2810        concat!("Size of: ", stringify!(ble_gap_evt_auth_key_request_t))
2811    );
2812    assert_eq!(
2813        ::core::mem::align_of::<ble_gap_evt_auth_key_request_t>(),
2814        1usize,
2815        concat!("Alignment of ", stringify!(ble_gap_evt_auth_key_request_t))
2816    );
2817    assert_eq!(
2818        unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_key_request_t>())).key_type as *const _ as usize },
2819        0usize,
2820        concat!(
2821            "Offset of field: ",
2822            stringify!(ble_gap_evt_auth_key_request_t),
2823            "::",
2824            stringify!(key_type)
2825        )
2826    );
2827}
2828#[doc = "@brief Event structure for @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST."]
2829#[repr(C)]
2830#[derive(Debug, Copy, Clone)]
2831pub struct ble_gap_evt_lesc_dhkey_request_t {
2832    #[doc = "< LE Secure Connections remote P-256 Public Key. This will point to the application-supplied memory"]
2833    #[doc = "inside the keyset during the call to @ref sd_ble_gap_sec_params_reply."]
2834    pub p_pk_peer: *mut ble_gap_lesc_p256_pk_t,
2835    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
2836    pub __bindgen_padding_0: [u8; 3usize],
2837}
2838#[test]
2839fn bindgen_test_layout_ble_gap_evt_lesc_dhkey_request_t() {
2840    assert_eq!(
2841        ::core::mem::size_of::<ble_gap_evt_lesc_dhkey_request_t>(),
2842        8usize,
2843        concat!("Size of: ", stringify!(ble_gap_evt_lesc_dhkey_request_t))
2844    );
2845    assert_eq!(
2846        ::core::mem::align_of::<ble_gap_evt_lesc_dhkey_request_t>(),
2847        4usize,
2848        concat!("Alignment of ", stringify!(ble_gap_evt_lesc_dhkey_request_t))
2849    );
2850    assert_eq!(
2851        unsafe { &(*(::core::ptr::null::<ble_gap_evt_lesc_dhkey_request_t>())).p_pk_peer as *const _ as usize },
2852        0usize,
2853        concat!(
2854            "Offset of field: ",
2855            stringify!(ble_gap_evt_lesc_dhkey_request_t),
2856            "::",
2857            stringify!(p_pk_peer)
2858        )
2859    );
2860}
2861impl ble_gap_evt_lesc_dhkey_request_t {
2862    #[inline]
2863    pub fn oobd_req(&self) -> u8 {
2864        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
2865    }
2866    #[inline]
2867    pub fn set_oobd_req(&mut self, val: u8) {
2868        unsafe {
2869            let val: u8 = ::core::mem::transmute(val);
2870            self._bitfield_1.set(0usize, 1u8, val as u64)
2871        }
2872    }
2873    #[inline]
2874    pub fn new_bitfield_1(oobd_req: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
2875        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
2876        __bindgen_bitfield_unit.set(0usize, 1u8, {
2877            let oobd_req: u8 = unsafe { ::core::mem::transmute(oobd_req) };
2878            oobd_req as u64
2879        });
2880        __bindgen_bitfield_unit
2881    }
2882}
2883#[doc = "@brief Security levels supported."]
2884#[doc = " @note  See Bluetooth Specification Version 4.2 Volume 3, Part C, Chapter 10, Section 10.2.1."]
2885#[repr(C, packed)]
2886#[derive(Debug, Copy, Clone)]
2887pub struct ble_gap_sec_levels_t {
2888    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
2889}
2890#[test]
2891fn bindgen_test_layout_ble_gap_sec_levels_t() {
2892    assert_eq!(
2893        ::core::mem::size_of::<ble_gap_sec_levels_t>(),
2894        1usize,
2895        concat!("Size of: ", stringify!(ble_gap_sec_levels_t))
2896    );
2897    assert_eq!(
2898        ::core::mem::align_of::<ble_gap_sec_levels_t>(),
2899        1usize,
2900        concat!("Alignment of ", stringify!(ble_gap_sec_levels_t))
2901    );
2902}
2903impl ble_gap_sec_levels_t {
2904    #[inline]
2905    pub fn lv1(&self) -> u8 {
2906        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
2907    }
2908    #[inline]
2909    pub fn set_lv1(&mut self, val: u8) {
2910        unsafe {
2911            let val: u8 = ::core::mem::transmute(val);
2912            self._bitfield_1.set(0usize, 1u8, val as u64)
2913        }
2914    }
2915    #[inline]
2916    pub fn lv2(&self) -> u8 {
2917        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
2918    }
2919    #[inline]
2920    pub fn set_lv2(&mut self, val: u8) {
2921        unsafe {
2922            let val: u8 = ::core::mem::transmute(val);
2923            self._bitfield_1.set(1usize, 1u8, val as u64)
2924        }
2925    }
2926    #[inline]
2927    pub fn lv3(&self) -> u8 {
2928        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
2929    }
2930    #[inline]
2931    pub fn set_lv3(&mut self, val: u8) {
2932        unsafe {
2933            let val: u8 = ::core::mem::transmute(val);
2934            self._bitfield_1.set(2usize, 1u8, val as u64)
2935        }
2936    }
2937    #[inline]
2938    pub fn lv4(&self) -> u8 {
2939        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
2940    }
2941    #[inline]
2942    pub fn set_lv4(&mut self, val: u8) {
2943        unsafe {
2944            let val: u8 = ::core::mem::transmute(val);
2945            self._bitfield_1.set(3usize, 1u8, val as u64)
2946        }
2947    }
2948    #[inline]
2949    pub fn new_bitfield_1(lv1: u8, lv2: u8, lv3: u8, lv4: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
2950        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
2951        __bindgen_bitfield_unit.set(0usize, 1u8, {
2952            let lv1: u8 = unsafe { ::core::mem::transmute(lv1) };
2953            lv1 as u64
2954        });
2955        __bindgen_bitfield_unit.set(1usize, 1u8, {
2956            let lv2: u8 = unsafe { ::core::mem::transmute(lv2) };
2957            lv2 as u64
2958        });
2959        __bindgen_bitfield_unit.set(2usize, 1u8, {
2960            let lv3: u8 = unsafe { ::core::mem::transmute(lv3) };
2961            lv3 as u64
2962        });
2963        __bindgen_bitfield_unit.set(3usize, 1u8, {
2964            let lv4: u8 = unsafe { ::core::mem::transmute(lv4) };
2965            lv4 as u64
2966        });
2967        __bindgen_bitfield_unit
2968    }
2969}
2970#[doc = "@brief Encryption Key."]
2971#[repr(C)]
2972#[derive(Debug, Copy, Clone)]
2973pub struct ble_gap_enc_key_t {
2974    #[doc = "< Encryption Information."]
2975    pub enc_info: ble_gap_enc_info_t,
2976    #[doc = "< Master Identification."]
2977    pub master_id: ble_gap_master_id_t,
2978}
2979#[test]
2980fn bindgen_test_layout_ble_gap_enc_key_t() {
2981    assert_eq!(
2982        ::core::mem::size_of::<ble_gap_enc_key_t>(),
2983        28usize,
2984        concat!("Size of: ", stringify!(ble_gap_enc_key_t))
2985    );
2986    assert_eq!(
2987        ::core::mem::align_of::<ble_gap_enc_key_t>(),
2988        2usize,
2989        concat!("Alignment of ", stringify!(ble_gap_enc_key_t))
2990    );
2991    assert_eq!(
2992        unsafe { &(*(::core::ptr::null::<ble_gap_enc_key_t>())).enc_info as *const _ as usize },
2993        0usize,
2994        concat!(
2995            "Offset of field: ",
2996            stringify!(ble_gap_enc_key_t),
2997            "::",
2998            stringify!(enc_info)
2999        )
3000    );
3001    assert_eq!(
3002        unsafe { &(*(::core::ptr::null::<ble_gap_enc_key_t>())).master_id as *const _ as usize },
3003        18usize,
3004        concat!(
3005            "Offset of field: ",
3006            stringify!(ble_gap_enc_key_t),
3007            "::",
3008            stringify!(master_id)
3009        )
3010    );
3011}
3012#[doc = "@brief Identity Key."]
3013#[repr(C)]
3014#[derive(Debug, Copy, Clone)]
3015pub struct ble_gap_id_key_t {
3016    #[doc = "< Identity Resolving Key."]
3017    pub id_info: ble_gap_irk_t,
3018    #[doc = "< Identity Address."]
3019    pub id_addr_info: ble_gap_addr_t,
3020}
3021#[test]
3022fn bindgen_test_layout_ble_gap_id_key_t() {
3023    assert_eq!(
3024        ::core::mem::size_of::<ble_gap_id_key_t>(),
3025        23usize,
3026        concat!("Size of: ", stringify!(ble_gap_id_key_t))
3027    );
3028    assert_eq!(
3029        ::core::mem::align_of::<ble_gap_id_key_t>(),
3030        1usize,
3031        concat!("Alignment of ", stringify!(ble_gap_id_key_t))
3032    );
3033    assert_eq!(
3034        unsafe { &(*(::core::ptr::null::<ble_gap_id_key_t>())).id_info as *const _ as usize },
3035        0usize,
3036        concat!(
3037            "Offset of field: ",
3038            stringify!(ble_gap_id_key_t),
3039            "::",
3040            stringify!(id_info)
3041        )
3042    );
3043    assert_eq!(
3044        unsafe { &(*(::core::ptr::null::<ble_gap_id_key_t>())).id_addr_info as *const _ as usize },
3045        16usize,
3046        concat!(
3047            "Offset of field: ",
3048            stringify!(ble_gap_id_key_t),
3049            "::",
3050            stringify!(id_addr_info)
3051        )
3052    );
3053}
3054#[doc = "@brief Security Keys."]
3055#[repr(C)]
3056#[derive(Debug, Copy, Clone)]
3057pub struct ble_gap_sec_keys_t {
3058    #[doc = "< Encryption Key, or NULL."]
3059    pub p_enc_key: *mut ble_gap_enc_key_t,
3060    #[doc = "< Identity Key, or NULL."]
3061    pub p_id_key: *mut ble_gap_id_key_t,
3062    #[doc = "< Signing Key, or NULL."]
3063    pub p_sign_key: *mut ble_gap_sign_info_t,
3064    #[doc = "< LE Secure Connections P-256 Public Key. When in debug mode the application must use the value defined"]
3065    #[doc = "in the Core Bluetooth Specification v4.2 Vol.3, Part H, Section 2.3.5.6.1"]
3066    pub p_pk: *mut ble_gap_lesc_p256_pk_t,
3067}
3068#[test]
3069fn bindgen_test_layout_ble_gap_sec_keys_t() {
3070    assert_eq!(
3071        ::core::mem::size_of::<ble_gap_sec_keys_t>(),
3072        16usize,
3073        concat!("Size of: ", stringify!(ble_gap_sec_keys_t))
3074    );
3075    assert_eq!(
3076        ::core::mem::align_of::<ble_gap_sec_keys_t>(),
3077        4usize,
3078        concat!("Alignment of ", stringify!(ble_gap_sec_keys_t))
3079    );
3080    assert_eq!(
3081        unsafe { &(*(::core::ptr::null::<ble_gap_sec_keys_t>())).p_enc_key as *const _ as usize },
3082        0usize,
3083        concat!(
3084            "Offset of field: ",
3085            stringify!(ble_gap_sec_keys_t),
3086            "::",
3087            stringify!(p_enc_key)
3088        )
3089    );
3090    assert_eq!(
3091        unsafe { &(*(::core::ptr::null::<ble_gap_sec_keys_t>())).p_id_key as *const _ as usize },
3092        4usize,
3093        concat!(
3094            "Offset of field: ",
3095            stringify!(ble_gap_sec_keys_t),
3096            "::",
3097            stringify!(p_id_key)
3098        )
3099    );
3100    assert_eq!(
3101        unsafe { &(*(::core::ptr::null::<ble_gap_sec_keys_t>())).p_sign_key as *const _ as usize },
3102        8usize,
3103        concat!(
3104            "Offset of field: ",
3105            stringify!(ble_gap_sec_keys_t),
3106            "::",
3107            stringify!(p_sign_key)
3108        )
3109    );
3110    assert_eq!(
3111        unsafe { &(*(::core::ptr::null::<ble_gap_sec_keys_t>())).p_pk as *const _ as usize },
3112        12usize,
3113        concat!(
3114            "Offset of field: ",
3115            stringify!(ble_gap_sec_keys_t),
3116            "::",
3117            stringify!(p_pk)
3118        )
3119    );
3120}
3121#[doc = "@brief Security key set for both local and peer keys."]
3122#[repr(C)]
3123#[derive(Debug, Copy, Clone)]
3124pub struct ble_gap_sec_keyset_t {
3125    #[doc = "< Keys distributed by the local device. For LE Secure Connections the encryption key will be generated locally and will always be stored if bonding."]
3126    pub keys_own: ble_gap_sec_keys_t,
3127    #[doc = "< Keys distributed by the remote device. For LE Secure Connections, p_enc_key must always be NULL."]
3128    pub keys_peer: ble_gap_sec_keys_t,
3129}
3130#[test]
3131fn bindgen_test_layout_ble_gap_sec_keyset_t() {
3132    assert_eq!(
3133        ::core::mem::size_of::<ble_gap_sec_keyset_t>(),
3134        32usize,
3135        concat!("Size of: ", stringify!(ble_gap_sec_keyset_t))
3136    );
3137    assert_eq!(
3138        ::core::mem::align_of::<ble_gap_sec_keyset_t>(),
3139        4usize,
3140        concat!("Alignment of ", stringify!(ble_gap_sec_keyset_t))
3141    );
3142    assert_eq!(
3143        unsafe { &(*(::core::ptr::null::<ble_gap_sec_keyset_t>())).keys_own as *const _ as usize },
3144        0usize,
3145        concat!(
3146            "Offset of field: ",
3147            stringify!(ble_gap_sec_keyset_t),
3148            "::",
3149            stringify!(keys_own)
3150        )
3151    );
3152    assert_eq!(
3153        unsafe { &(*(::core::ptr::null::<ble_gap_sec_keyset_t>())).keys_peer as *const _ as usize },
3154        16usize,
3155        concat!(
3156            "Offset of field: ",
3157            stringify!(ble_gap_sec_keyset_t),
3158            "::",
3159            stringify!(keys_peer)
3160        )
3161    );
3162}
3163#[doc = "@brief Data Length Update Procedure parameters."]
3164#[repr(C)]
3165#[derive(Debug, Copy, Clone)]
3166pub struct ble_gap_data_length_params_t {
3167    #[doc = "< Maximum number of payload octets that a Controller supports for transmission of a single Link Layer Data Channel PDU."]
3168    pub max_tx_octets: u16,
3169    #[doc = "< Maximum number of payload octets that a Controller supports for reception of a single Link Layer Data Channel PDU."]
3170    pub max_rx_octets: u16,
3171    #[doc = "< Maximum time, in microseconds, that a Controller supports for transmission of a single Link Layer Data Channel PDU."]
3172    pub max_tx_time_us: u16,
3173    #[doc = "< Maximum time, in microseconds, that a Controller supports for reception of a single Link Layer Data Channel PDU."]
3174    pub max_rx_time_us: u16,
3175}
3176#[test]
3177fn bindgen_test_layout_ble_gap_data_length_params_t() {
3178    assert_eq!(
3179        ::core::mem::size_of::<ble_gap_data_length_params_t>(),
3180        8usize,
3181        concat!("Size of: ", stringify!(ble_gap_data_length_params_t))
3182    );
3183    assert_eq!(
3184        ::core::mem::align_of::<ble_gap_data_length_params_t>(),
3185        2usize,
3186        concat!("Alignment of ", stringify!(ble_gap_data_length_params_t))
3187    );
3188    assert_eq!(
3189        unsafe { &(*(::core::ptr::null::<ble_gap_data_length_params_t>())).max_tx_octets as *const _ as usize },
3190        0usize,
3191        concat!(
3192            "Offset of field: ",
3193            stringify!(ble_gap_data_length_params_t),
3194            "::",
3195            stringify!(max_tx_octets)
3196        )
3197    );
3198    assert_eq!(
3199        unsafe { &(*(::core::ptr::null::<ble_gap_data_length_params_t>())).max_rx_octets as *const _ as usize },
3200        2usize,
3201        concat!(
3202            "Offset of field: ",
3203            stringify!(ble_gap_data_length_params_t),
3204            "::",
3205            stringify!(max_rx_octets)
3206        )
3207    );
3208    assert_eq!(
3209        unsafe { &(*(::core::ptr::null::<ble_gap_data_length_params_t>())).max_tx_time_us as *const _ as usize },
3210        4usize,
3211        concat!(
3212            "Offset of field: ",
3213            stringify!(ble_gap_data_length_params_t),
3214            "::",
3215            stringify!(max_tx_time_us)
3216        )
3217    );
3218    assert_eq!(
3219        unsafe { &(*(::core::ptr::null::<ble_gap_data_length_params_t>())).max_rx_time_us as *const _ as usize },
3220        6usize,
3221        concat!(
3222            "Offset of field: ",
3223            stringify!(ble_gap_data_length_params_t),
3224            "::",
3225            stringify!(max_rx_time_us)
3226        )
3227    );
3228}
3229#[doc = "@brief Data Length Update Procedure local limitation."]
3230#[repr(C)]
3231#[derive(Debug, Copy, Clone)]
3232pub struct ble_gap_data_length_limitation_t {
3233    #[doc = "< If > 0, the requested TX packet length is too long by this many octets."]
3234    pub tx_payload_limited_octets: u16,
3235    #[doc = "< If > 0, the requested RX packet length is too long by this many octets."]
3236    pub rx_payload_limited_octets: u16,
3237    #[doc = "< If > 0, the requested combination of TX and RX packet lengths is too long by this many microseconds."]
3238    pub tx_rx_time_limited_us: u16,
3239}
3240#[test]
3241fn bindgen_test_layout_ble_gap_data_length_limitation_t() {
3242    assert_eq!(
3243        ::core::mem::size_of::<ble_gap_data_length_limitation_t>(),
3244        6usize,
3245        concat!("Size of: ", stringify!(ble_gap_data_length_limitation_t))
3246    );
3247    assert_eq!(
3248        ::core::mem::align_of::<ble_gap_data_length_limitation_t>(),
3249        2usize,
3250        concat!("Alignment of ", stringify!(ble_gap_data_length_limitation_t))
3251    );
3252    assert_eq!(
3253        unsafe {
3254            &(*(::core::ptr::null::<ble_gap_data_length_limitation_t>())).tx_payload_limited_octets as *const _ as usize
3255        },
3256        0usize,
3257        concat!(
3258            "Offset of field: ",
3259            stringify!(ble_gap_data_length_limitation_t),
3260            "::",
3261            stringify!(tx_payload_limited_octets)
3262        )
3263    );
3264    assert_eq!(
3265        unsafe {
3266            &(*(::core::ptr::null::<ble_gap_data_length_limitation_t>())).rx_payload_limited_octets as *const _ as usize
3267        },
3268        2usize,
3269        concat!(
3270            "Offset of field: ",
3271            stringify!(ble_gap_data_length_limitation_t),
3272            "::",
3273            stringify!(rx_payload_limited_octets)
3274        )
3275    );
3276    assert_eq!(
3277        unsafe {
3278            &(*(::core::ptr::null::<ble_gap_data_length_limitation_t>())).tx_rx_time_limited_us as *const _ as usize
3279        },
3280        4usize,
3281        concat!(
3282            "Offset of field: ",
3283            stringify!(ble_gap_data_length_limitation_t),
3284            "::",
3285            stringify!(tx_rx_time_limited_us)
3286        )
3287    );
3288}
3289#[doc = "@brief Event structure for @ref BLE_GAP_EVT_AUTH_STATUS."]
3290#[repr(C)]
3291#[derive(Debug, Copy, Clone)]
3292pub struct ble_gap_evt_auth_status_t {
3293    #[doc = "< Authentication status, see @ref BLE_GAP_SEC_STATUS."]
3294    pub auth_status: u8,
3295    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
3296    #[doc = "< Levels supported in Security Mode 1."]
3297    pub sm1_levels: ble_gap_sec_levels_t,
3298    #[doc = "< Levels supported in Security Mode 2."]
3299    pub sm2_levels: ble_gap_sec_levels_t,
3300    #[doc = "< Bitmap stating which keys were exchanged (distributed) by the local device. If bonding with LE Secure Connections, the enc bit will be always set."]
3301    pub kdist_own: ble_gap_sec_kdist_t,
3302    #[doc = "< Bitmap stating which keys were exchanged (distributed) by the remote device. If bonding with LE Secure Connections, the enc bit will never be set."]
3303    pub kdist_peer: ble_gap_sec_kdist_t,
3304}
3305#[test]
3306fn bindgen_test_layout_ble_gap_evt_auth_status_t() {
3307    assert_eq!(
3308        ::core::mem::size_of::<ble_gap_evt_auth_status_t>(),
3309        6usize,
3310        concat!("Size of: ", stringify!(ble_gap_evt_auth_status_t))
3311    );
3312    assert_eq!(
3313        ::core::mem::align_of::<ble_gap_evt_auth_status_t>(),
3314        1usize,
3315        concat!("Alignment of ", stringify!(ble_gap_evt_auth_status_t))
3316    );
3317    assert_eq!(
3318        unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_status_t>())).auth_status as *const _ as usize },
3319        0usize,
3320        concat!(
3321            "Offset of field: ",
3322            stringify!(ble_gap_evt_auth_status_t),
3323            "::",
3324            stringify!(auth_status)
3325        )
3326    );
3327    assert_eq!(
3328        unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_status_t>())).sm1_levels as *const _ as usize },
3329        2usize,
3330        concat!(
3331            "Offset of field: ",
3332            stringify!(ble_gap_evt_auth_status_t),
3333            "::",
3334            stringify!(sm1_levels)
3335        )
3336    );
3337    assert_eq!(
3338        unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_status_t>())).sm2_levels as *const _ as usize },
3339        3usize,
3340        concat!(
3341            "Offset of field: ",
3342            stringify!(ble_gap_evt_auth_status_t),
3343            "::",
3344            stringify!(sm2_levels)
3345        )
3346    );
3347    assert_eq!(
3348        unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_status_t>())).kdist_own as *const _ as usize },
3349        4usize,
3350        concat!(
3351            "Offset of field: ",
3352            stringify!(ble_gap_evt_auth_status_t),
3353            "::",
3354            stringify!(kdist_own)
3355        )
3356    );
3357    assert_eq!(
3358        unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_status_t>())).kdist_peer as *const _ as usize },
3359        5usize,
3360        concat!(
3361            "Offset of field: ",
3362            stringify!(ble_gap_evt_auth_status_t),
3363            "::",
3364            stringify!(kdist_peer)
3365        )
3366    );
3367}
3368impl ble_gap_evt_auth_status_t {
3369    #[inline]
3370    pub fn error_src(&self) -> u8 {
3371        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
3372    }
3373    #[inline]
3374    pub fn set_error_src(&mut self, val: u8) {
3375        unsafe {
3376            let val: u8 = ::core::mem::transmute(val);
3377            self._bitfield_1.set(0usize, 2u8, val as u64)
3378        }
3379    }
3380    #[inline]
3381    pub fn bonded(&self) -> u8 {
3382        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
3383    }
3384    #[inline]
3385    pub fn set_bonded(&mut self, val: u8) {
3386        unsafe {
3387            let val: u8 = ::core::mem::transmute(val);
3388            self._bitfield_1.set(2usize, 1u8, val as u64)
3389        }
3390    }
3391    #[inline]
3392    pub fn lesc(&self) -> u8 {
3393        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
3394    }
3395    #[inline]
3396    pub fn set_lesc(&mut self, val: u8) {
3397        unsafe {
3398            let val: u8 = ::core::mem::transmute(val);
3399            self._bitfield_1.set(3usize, 1u8, val as u64)
3400        }
3401    }
3402    #[inline]
3403    pub fn new_bitfield_1(error_src: u8, bonded: u8, lesc: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
3404        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
3405        __bindgen_bitfield_unit.set(0usize, 2u8, {
3406            let error_src: u8 = unsafe { ::core::mem::transmute(error_src) };
3407            error_src as u64
3408        });
3409        __bindgen_bitfield_unit.set(2usize, 1u8, {
3410            let bonded: u8 = unsafe { ::core::mem::transmute(bonded) };
3411            bonded as u64
3412        });
3413        __bindgen_bitfield_unit.set(3usize, 1u8, {
3414            let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
3415            lesc as u64
3416        });
3417        __bindgen_bitfield_unit
3418    }
3419}
3420#[doc = "@brief Event structure for @ref BLE_GAP_EVT_CONN_SEC_UPDATE."]
3421#[repr(C)]
3422#[derive(Debug, Copy, Clone)]
3423pub struct ble_gap_evt_conn_sec_update_t {
3424    #[doc = "< Connection security level."]
3425    pub conn_sec: ble_gap_conn_sec_t,
3426}
3427#[test]
3428fn bindgen_test_layout_ble_gap_evt_conn_sec_update_t() {
3429    assert_eq!(
3430        ::core::mem::size_of::<ble_gap_evt_conn_sec_update_t>(),
3431        2usize,
3432        concat!("Size of: ", stringify!(ble_gap_evt_conn_sec_update_t))
3433    );
3434    assert_eq!(
3435        ::core::mem::align_of::<ble_gap_evt_conn_sec_update_t>(),
3436        1usize,
3437        concat!("Alignment of ", stringify!(ble_gap_evt_conn_sec_update_t))
3438    );
3439    assert_eq!(
3440        unsafe { &(*(::core::ptr::null::<ble_gap_evt_conn_sec_update_t>())).conn_sec as *const _ as usize },
3441        0usize,
3442        concat!(
3443            "Offset of field: ",
3444            stringify!(ble_gap_evt_conn_sec_update_t),
3445            "::",
3446            stringify!(conn_sec)
3447        )
3448    );
3449}
3450#[doc = "@brief Event structure for @ref BLE_GAP_EVT_TIMEOUT."]
3451#[repr(C)]
3452#[derive(Debug, Copy, Clone)]
3453pub struct ble_gap_evt_timeout_t {
3454    #[doc = "< Source of timeout event, see @ref BLE_GAP_TIMEOUT_SOURCES."]
3455    pub src: u8,
3456}
3457#[test]
3458fn bindgen_test_layout_ble_gap_evt_timeout_t() {
3459    assert_eq!(
3460        ::core::mem::size_of::<ble_gap_evt_timeout_t>(),
3461        1usize,
3462        concat!("Size of: ", stringify!(ble_gap_evt_timeout_t))
3463    );
3464    assert_eq!(
3465        ::core::mem::align_of::<ble_gap_evt_timeout_t>(),
3466        1usize,
3467        concat!("Alignment of ", stringify!(ble_gap_evt_timeout_t))
3468    );
3469    assert_eq!(
3470        unsafe { &(*(::core::ptr::null::<ble_gap_evt_timeout_t>())).src as *const _ as usize },
3471        0usize,
3472        concat!(
3473            "Offset of field: ",
3474            stringify!(ble_gap_evt_timeout_t),
3475            "::",
3476            stringify!(src)
3477        )
3478    );
3479}
3480#[doc = "@brief Event structure for @ref BLE_GAP_EVT_RSSI_CHANGED."]
3481#[repr(C)]
3482#[derive(Debug, Copy, Clone)]
3483pub struct ble_gap_evt_rssi_changed_t {
3484    #[doc = "< Received Signal Strength Indication in dBm."]
3485    pub rssi: i8,
3486    #[doc = "< Data Channel Index on which the Signal Strength is measured (0-36)."]
3487    pub ch_index: u8,
3488}
3489#[test]
3490fn bindgen_test_layout_ble_gap_evt_rssi_changed_t() {
3491    assert_eq!(
3492        ::core::mem::size_of::<ble_gap_evt_rssi_changed_t>(),
3493        2usize,
3494        concat!("Size of: ", stringify!(ble_gap_evt_rssi_changed_t))
3495    );
3496    assert_eq!(
3497        ::core::mem::align_of::<ble_gap_evt_rssi_changed_t>(),
3498        1usize,
3499        concat!("Alignment of ", stringify!(ble_gap_evt_rssi_changed_t))
3500    );
3501    assert_eq!(
3502        unsafe { &(*(::core::ptr::null::<ble_gap_evt_rssi_changed_t>())).rssi as *const _ as usize },
3503        0usize,
3504        concat!(
3505            "Offset of field: ",
3506            stringify!(ble_gap_evt_rssi_changed_t),
3507            "::",
3508            stringify!(rssi)
3509        )
3510    );
3511    assert_eq!(
3512        unsafe { &(*(::core::ptr::null::<ble_gap_evt_rssi_changed_t>())).ch_index as *const _ as usize },
3513        1usize,
3514        concat!(
3515            "Offset of field: ",
3516            stringify!(ble_gap_evt_rssi_changed_t),
3517            "::",
3518            stringify!(ch_index)
3519        )
3520    );
3521}
3522#[doc = "@brief Event structure for @ref BLE_GAP_EVT_ADV_SET_TERMINATED"]
3523#[repr(C)]
3524#[derive(Debug, Copy, Clone)]
3525pub struct ble_gap_evt_adv_set_terminated_t {
3526    #[doc = "< Reason for why the advertising set terminated. See"]
3527    #[doc = "@ref BLE_GAP_EVT_ADV_SET_TERMINATED_REASON."]
3528    pub reason: u8,
3529    #[doc = "< Advertising handle in which advertising has ended."]
3530    pub adv_handle: u8,
3531    #[doc = "< If @ref ble_gap_adv_params_t::max_adv_evts was not set to 0,"]
3532    #[doc = "this field indicates the number of completed advertising events."]
3533    pub num_completed_adv_events: u8,
3534    #[doc = "< Advertising buffers corresponding to the terminated"]
3535    #[doc = "advertising set. The advertising buffers provided in"]
3536    #[doc = "@ref sd_ble_gap_adv_set_configure are now released."]
3537    pub adv_data: ble_gap_adv_data_t,
3538}
3539#[test]
3540fn bindgen_test_layout_ble_gap_evt_adv_set_terminated_t() {
3541    assert_eq!(
3542        ::core::mem::size_of::<ble_gap_evt_adv_set_terminated_t>(),
3543        20usize,
3544        concat!("Size of: ", stringify!(ble_gap_evt_adv_set_terminated_t))
3545    );
3546    assert_eq!(
3547        ::core::mem::align_of::<ble_gap_evt_adv_set_terminated_t>(),
3548        4usize,
3549        concat!("Alignment of ", stringify!(ble_gap_evt_adv_set_terminated_t))
3550    );
3551    assert_eq!(
3552        unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_set_terminated_t>())).reason as *const _ as usize },
3553        0usize,
3554        concat!(
3555            "Offset of field: ",
3556            stringify!(ble_gap_evt_adv_set_terminated_t),
3557            "::",
3558            stringify!(reason)
3559        )
3560    );
3561    assert_eq!(
3562        unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_set_terminated_t>())).adv_handle as *const _ as usize },
3563        1usize,
3564        concat!(
3565            "Offset of field: ",
3566            stringify!(ble_gap_evt_adv_set_terminated_t),
3567            "::",
3568            stringify!(adv_handle)
3569        )
3570    );
3571    assert_eq!(
3572        unsafe {
3573            &(*(::core::ptr::null::<ble_gap_evt_adv_set_terminated_t>())).num_completed_adv_events as *const _ as usize
3574        },
3575        2usize,
3576        concat!(
3577            "Offset of field: ",
3578            stringify!(ble_gap_evt_adv_set_terminated_t),
3579            "::",
3580            stringify!(num_completed_adv_events)
3581        )
3582    );
3583    assert_eq!(
3584        unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_set_terminated_t>())).adv_data as *const _ as usize },
3585        4usize,
3586        concat!(
3587            "Offset of field: ",
3588            stringify!(ble_gap_evt_adv_set_terminated_t),
3589            "::",
3590            stringify!(adv_data)
3591        )
3592    );
3593}
3594#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SEC_REQUEST."]
3595#[repr(C, packed)]
3596#[derive(Debug, Copy, Clone)]
3597pub struct ble_gap_evt_sec_request_t {
3598    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
3599}
3600#[test]
3601fn bindgen_test_layout_ble_gap_evt_sec_request_t() {
3602    assert_eq!(
3603        ::core::mem::size_of::<ble_gap_evt_sec_request_t>(),
3604        1usize,
3605        concat!("Size of: ", stringify!(ble_gap_evt_sec_request_t))
3606    );
3607    assert_eq!(
3608        ::core::mem::align_of::<ble_gap_evt_sec_request_t>(),
3609        1usize,
3610        concat!("Alignment of ", stringify!(ble_gap_evt_sec_request_t))
3611    );
3612}
3613impl ble_gap_evt_sec_request_t {
3614    #[inline]
3615    pub fn bond(&self) -> u8 {
3616        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
3617    }
3618    #[inline]
3619    pub fn set_bond(&mut self, val: u8) {
3620        unsafe {
3621            let val: u8 = ::core::mem::transmute(val);
3622            self._bitfield_1.set(0usize, 1u8, val as u64)
3623        }
3624    }
3625    #[inline]
3626    pub fn mitm(&self) -> u8 {
3627        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
3628    }
3629    #[inline]
3630    pub fn set_mitm(&mut self, val: u8) {
3631        unsafe {
3632            let val: u8 = ::core::mem::transmute(val);
3633            self._bitfield_1.set(1usize, 1u8, val as u64)
3634        }
3635    }
3636    #[inline]
3637    pub fn lesc(&self) -> u8 {
3638        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
3639    }
3640    #[inline]
3641    pub fn set_lesc(&mut self, val: u8) {
3642        unsafe {
3643            let val: u8 = ::core::mem::transmute(val);
3644            self._bitfield_1.set(2usize, 1u8, val as u64)
3645        }
3646    }
3647    #[inline]
3648    pub fn keypress(&self) -> u8 {
3649        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
3650    }
3651    #[inline]
3652    pub fn set_keypress(&mut self, val: u8) {
3653        unsafe {
3654            let val: u8 = ::core::mem::transmute(val);
3655            self._bitfield_1.set(3usize, 1u8, val as u64)
3656        }
3657    }
3658    #[inline]
3659    pub fn new_bitfield_1(bond: u8, mitm: u8, lesc: u8, keypress: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
3660        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
3661        __bindgen_bitfield_unit.set(0usize, 1u8, {
3662            let bond: u8 = unsafe { ::core::mem::transmute(bond) };
3663            bond as u64
3664        });
3665        __bindgen_bitfield_unit.set(1usize, 1u8, {
3666            let mitm: u8 = unsafe { ::core::mem::transmute(mitm) };
3667            mitm as u64
3668        });
3669        __bindgen_bitfield_unit.set(2usize, 1u8, {
3670            let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
3671            lesc as u64
3672        });
3673        __bindgen_bitfield_unit.set(3usize, 1u8, {
3674            let keypress: u8 = unsafe { ::core::mem::transmute(keypress) };
3675            keypress as u64
3676        });
3677        __bindgen_bitfield_unit
3678    }
3679}
3680#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SCAN_REQ_REPORT."]
3681#[repr(C)]
3682#[derive(Debug, Copy, Clone)]
3683pub struct ble_gap_evt_scan_req_report_t {
3684    #[doc = "< Advertising handle for the advertising set which received the Scan Request"]
3685    pub adv_handle: u8,
3686    #[doc = "< Received Signal Strength Indication in dBm."]
3687    pub rssi: i8,
3688    #[doc = "< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1"]
3689    #[doc = "and the address is the device's identity address."]
3690    pub peer_addr: ble_gap_addr_t,
3691}
3692#[test]
3693fn bindgen_test_layout_ble_gap_evt_scan_req_report_t() {
3694    assert_eq!(
3695        ::core::mem::size_of::<ble_gap_evt_scan_req_report_t>(),
3696        9usize,
3697        concat!("Size of: ", stringify!(ble_gap_evt_scan_req_report_t))
3698    );
3699    assert_eq!(
3700        ::core::mem::align_of::<ble_gap_evt_scan_req_report_t>(),
3701        1usize,
3702        concat!("Alignment of ", stringify!(ble_gap_evt_scan_req_report_t))
3703    );
3704    assert_eq!(
3705        unsafe { &(*(::core::ptr::null::<ble_gap_evt_scan_req_report_t>())).adv_handle as *const _ as usize },
3706        0usize,
3707        concat!(
3708            "Offset of field: ",
3709            stringify!(ble_gap_evt_scan_req_report_t),
3710            "::",
3711            stringify!(adv_handle)
3712        )
3713    );
3714    assert_eq!(
3715        unsafe { &(*(::core::ptr::null::<ble_gap_evt_scan_req_report_t>())).rssi as *const _ as usize },
3716        1usize,
3717        concat!(
3718            "Offset of field: ",
3719            stringify!(ble_gap_evt_scan_req_report_t),
3720            "::",
3721            stringify!(rssi)
3722        )
3723    );
3724    assert_eq!(
3725        unsafe { &(*(::core::ptr::null::<ble_gap_evt_scan_req_report_t>())).peer_addr as *const _ as usize },
3726        2usize,
3727        concat!(
3728            "Offset of field: ",
3729            stringify!(ble_gap_evt_scan_req_report_t),
3730            "::",
3731            stringify!(peer_addr)
3732        )
3733    );
3734}
3735#[doc = "@brief Event structure for @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST."]
3736#[repr(C)]
3737#[derive(Debug, Copy, Clone)]
3738pub struct ble_gap_evt_data_length_update_request_t {
3739    #[doc = "< Peer data length parameters."]
3740    pub peer_params: ble_gap_data_length_params_t,
3741}
3742#[test]
3743fn bindgen_test_layout_ble_gap_evt_data_length_update_request_t() {
3744    assert_eq!(
3745        ::core::mem::size_of::<ble_gap_evt_data_length_update_request_t>(),
3746        8usize,
3747        concat!("Size of: ", stringify!(ble_gap_evt_data_length_update_request_t))
3748    );
3749    assert_eq!(
3750        ::core::mem::align_of::<ble_gap_evt_data_length_update_request_t>(),
3751        2usize,
3752        concat!("Alignment of ", stringify!(ble_gap_evt_data_length_update_request_t))
3753    );
3754    assert_eq!(
3755        unsafe {
3756            &(*(::core::ptr::null::<ble_gap_evt_data_length_update_request_t>())).peer_params as *const _ as usize
3757        },
3758        0usize,
3759        concat!(
3760            "Offset of field: ",
3761            stringify!(ble_gap_evt_data_length_update_request_t),
3762            "::",
3763            stringify!(peer_params)
3764        )
3765    );
3766}
3767#[doc = "@brief Event structure for @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE."]
3768#[repr(C)]
3769#[derive(Debug, Copy, Clone)]
3770pub struct ble_gap_evt_data_length_update_t {
3771    #[doc = "< The effective data length parameters."]
3772    pub effective_params: ble_gap_data_length_params_t,
3773}
3774#[test]
3775fn bindgen_test_layout_ble_gap_evt_data_length_update_t() {
3776    assert_eq!(
3777        ::core::mem::size_of::<ble_gap_evt_data_length_update_t>(),
3778        8usize,
3779        concat!("Size of: ", stringify!(ble_gap_evt_data_length_update_t))
3780    );
3781    assert_eq!(
3782        ::core::mem::align_of::<ble_gap_evt_data_length_update_t>(),
3783        2usize,
3784        concat!("Alignment of ", stringify!(ble_gap_evt_data_length_update_t))
3785    );
3786    assert_eq!(
3787        unsafe { &(*(::core::ptr::null::<ble_gap_evt_data_length_update_t>())).effective_params as *const _ as usize },
3788        0usize,
3789        concat!(
3790            "Offset of field: ",
3791            stringify!(ble_gap_evt_data_length_update_t),
3792            "::",
3793            stringify!(effective_params)
3794        )
3795    );
3796}
3797#[doc = "@brief GAP event structure."]
3798#[repr(C)]
3799#[derive(Copy, Clone)]
3800pub struct ble_gap_evt_t {
3801    #[doc = "< Connection Handle on which event occurred."]
3802    pub conn_handle: u16,
3803    #[doc = "< Event Parameters."]
3804    pub params: ble_gap_evt_t__bindgen_ty_1,
3805}
3806#[repr(C)]
3807#[derive(Copy, Clone)]
3808pub union ble_gap_evt_t__bindgen_ty_1 {
3809    #[doc = "< Connected Event Parameters."]
3810    pub connected: ble_gap_evt_connected_t,
3811    #[doc = "< Disconnected Event Parameters."]
3812    pub disconnected: ble_gap_evt_disconnected_t,
3813    #[doc = "< Connection Parameter Update Parameters."]
3814    pub conn_param_update: ble_gap_evt_conn_param_update_t,
3815    #[doc = "< Security Parameters Request Event Parameters."]
3816    pub sec_params_request: ble_gap_evt_sec_params_request_t,
3817    #[doc = "< Security Information Request Event Parameters."]
3818    pub sec_info_request: ble_gap_evt_sec_info_request_t,
3819    #[doc = "< Passkey Display Event Parameters."]
3820    pub passkey_display: ble_gap_evt_passkey_display_t,
3821    #[doc = "< Key Pressed Event Parameters."]
3822    pub key_pressed: ble_gap_evt_key_pressed_t,
3823    #[doc = "< Authentication Key Request Event Parameters."]
3824    pub auth_key_request: ble_gap_evt_auth_key_request_t,
3825    #[doc = "< LE Secure Connections DHKey calculation request."]
3826    pub lesc_dhkey_request: ble_gap_evt_lesc_dhkey_request_t,
3827    #[doc = "< Authentication Status Event Parameters."]
3828    pub auth_status: ble_gap_evt_auth_status_t,
3829    #[doc = "< Connection Security Update Event Parameters."]
3830    pub conn_sec_update: ble_gap_evt_conn_sec_update_t,
3831    #[doc = "< Timeout Event Parameters."]
3832    pub timeout: ble_gap_evt_timeout_t,
3833    #[doc = "< RSSI Event Parameters."]
3834    pub rssi_changed: ble_gap_evt_rssi_changed_t,
3835    #[doc = "< Advertising Set Terminated Event Parameters."]
3836    pub adv_set_terminated: ble_gap_evt_adv_set_terminated_t,
3837    #[doc = "< Security Request Event Parameters."]
3838    pub sec_request: ble_gap_evt_sec_request_t,
3839    #[doc = "< Scan Request Report Parameters."]
3840    pub scan_req_report: ble_gap_evt_scan_req_report_t,
3841    #[doc = "< PHY Update Request Event Parameters."]
3842    pub phy_update_request: ble_gap_evt_phy_update_request_t,
3843    #[doc = "< PHY Update Parameters."]
3844    pub phy_update: ble_gap_evt_phy_update_t,
3845    #[doc = "< Data Length Update Request Event Parameters."]
3846    pub data_length_update_request: ble_gap_evt_data_length_update_request_t,
3847    #[doc = "< Data Length Update Event Parameters."]
3848    pub data_length_update: ble_gap_evt_data_length_update_t,
3849    _bindgen_union_align: [u32; 9usize],
3850}
3851#[test]
3852fn bindgen_test_layout_ble_gap_evt_t__bindgen_ty_1() {
3853    assert_eq!(
3854        ::core::mem::size_of::<ble_gap_evt_t__bindgen_ty_1>(),
3855        36usize,
3856        concat!("Size of: ", stringify!(ble_gap_evt_t__bindgen_ty_1))
3857    );
3858    assert_eq!(
3859        ::core::mem::align_of::<ble_gap_evt_t__bindgen_ty_1>(),
3860        4usize,
3861        concat!("Alignment of ", stringify!(ble_gap_evt_t__bindgen_ty_1))
3862    );
3863    assert_eq!(
3864        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).connected as *const _ as usize },
3865        0usize,
3866        concat!(
3867            "Offset of field: ",
3868            stringify!(ble_gap_evt_t__bindgen_ty_1),
3869            "::",
3870            stringify!(connected)
3871        )
3872    );
3873    assert_eq!(
3874        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).disconnected as *const _ as usize },
3875        0usize,
3876        concat!(
3877            "Offset of field: ",
3878            stringify!(ble_gap_evt_t__bindgen_ty_1),
3879            "::",
3880            stringify!(disconnected)
3881        )
3882    );
3883    assert_eq!(
3884        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).conn_param_update as *const _ as usize },
3885        0usize,
3886        concat!(
3887            "Offset of field: ",
3888            stringify!(ble_gap_evt_t__bindgen_ty_1),
3889            "::",
3890            stringify!(conn_param_update)
3891        )
3892    );
3893    assert_eq!(
3894        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).sec_params_request as *const _ as usize },
3895        0usize,
3896        concat!(
3897            "Offset of field: ",
3898            stringify!(ble_gap_evt_t__bindgen_ty_1),
3899            "::",
3900            stringify!(sec_params_request)
3901        )
3902    );
3903    assert_eq!(
3904        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).sec_info_request as *const _ as usize },
3905        0usize,
3906        concat!(
3907            "Offset of field: ",
3908            stringify!(ble_gap_evt_t__bindgen_ty_1),
3909            "::",
3910            stringify!(sec_info_request)
3911        )
3912    );
3913    assert_eq!(
3914        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).passkey_display as *const _ as usize },
3915        0usize,
3916        concat!(
3917            "Offset of field: ",
3918            stringify!(ble_gap_evt_t__bindgen_ty_1),
3919            "::",
3920            stringify!(passkey_display)
3921        )
3922    );
3923    assert_eq!(
3924        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).key_pressed as *const _ as usize },
3925        0usize,
3926        concat!(
3927            "Offset of field: ",
3928            stringify!(ble_gap_evt_t__bindgen_ty_1),
3929            "::",
3930            stringify!(key_pressed)
3931        )
3932    );
3933    assert_eq!(
3934        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).auth_key_request as *const _ as usize },
3935        0usize,
3936        concat!(
3937            "Offset of field: ",
3938            stringify!(ble_gap_evt_t__bindgen_ty_1),
3939            "::",
3940            stringify!(auth_key_request)
3941        )
3942    );
3943    assert_eq!(
3944        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).lesc_dhkey_request as *const _ as usize },
3945        0usize,
3946        concat!(
3947            "Offset of field: ",
3948            stringify!(ble_gap_evt_t__bindgen_ty_1),
3949            "::",
3950            stringify!(lesc_dhkey_request)
3951        )
3952    );
3953    assert_eq!(
3954        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).auth_status as *const _ as usize },
3955        0usize,
3956        concat!(
3957            "Offset of field: ",
3958            stringify!(ble_gap_evt_t__bindgen_ty_1),
3959            "::",
3960            stringify!(auth_status)
3961        )
3962    );
3963    assert_eq!(
3964        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).conn_sec_update as *const _ as usize },
3965        0usize,
3966        concat!(
3967            "Offset of field: ",
3968            stringify!(ble_gap_evt_t__bindgen_ty_1),
3969            "::",
3970            stringify!(conn_sec_update)
3971        )
3972    );
3973    assert_eq!(
3974        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).timeout as *const _ as usize },
3975        0usize,
3976        concat!(
3977            "Offset of field: ",
3978            stringify!(ble_gap_evt_t__bindgen_ty_1),
3979            "::",
3980            stringify!(timeout)
3981        )
3982    );
3983    assert_eq!(
3984        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).rssi_changed as *const _ as usize },
3985        0usize,
3986        concat!(
3987            "Offset of field: ",
3988            stringify!(ble_gap_evt_t__bindgen_ty_1),
3989            "::",
3990            stringify!(rssi_changed)
3991        )
3992    );
3993    assert_eq!(
3994        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).adv_set_terminated as *const _ as usize },
3995        0usize,
3996        concat!(
3997            "Offset of field: ",
3998            stringify!(ble_gap_evt_t__bindgen_ty_1),
3999            "::",
4000            stringify!(adv_set_terminated)
4001        )
4002    );
4003    assert_eq!(
4004        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).sec_request as *const _ as usize },
4005        0usize,
4006        concat!(
4007            "Offset of field: ",
4008            stringify!(ble_gap_evt_t__bindgen_ty_1),
4009            "::",
4010            stringify!(sec_request)
4011        )
4012    );
4013    assert_eq!(
4014        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).scan_req_report as *const _ as usize },
4015        0usize,
4016        concat!(
4017            "Offset of field: ",
4018            stringify!(ble_gap_evt_t__bindgen_ty_1),
4019            "::",
4020            stringify!(scan_req_report)
4021        )
4022    );
4023    assert_eq!(
4024        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).phy_update_request as *const _ as usize },
4025        0usize,
4026        concat!(
4027            "Offset of field: ",
4028            stringify!(ble_gap_evt_t__bindgen_ty_1),
4029            "::",
4030            stringify!(phy_update_request)
4031        )
4032    );
4033    assert_eq!(
4034        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).phy_update as *const _ as usize },
4035        0usize,
4036        concat!(
4037            "Offset of field: ",
4038            stringify!(ble_gap_evt_t__bindgen_ty_1),
4039            "::",
4040            stringify!(phy_update)
4041        )
4042    );
4043    assert_eq!(
4044        unsafe {
4045            &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).data_length_update_request as *const _ as usize
4046        },
4047        0usize,
4048        concat!(
4049            "Offset of field: ",
4050            stringify!(ble_gap_evt_t__bindgen_ty_1),
4051            "::",
4052            stringify!(data_length_update_request)
4053        )
4054    );
4055    assert_eq!(
4056        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).data_length_update as *const _ as usize },
4057        0usize,
4058        concat!(
4059            "Offset of field: ",
4060            stringify!(ble_gap_evt_t__bindgen_ty_1),
4061            "::",
4062            stringify!(data_length_update)
4063        )
4064    );
4065}
4066#[test]
4067fn bindgen_test_layout_ble_gap_evt_t() {
4068    assert_eq!(
4069        ::core::mem::size_of::<ble_gap_evt_t>(),
4070        40usize,
4071        concat!("Size of: ", stringify!(ble_gap_evt_t))
4072    );
4073    assert_eq!(
4074        ::core::mem::align_of::<ble_gap_evt_t>(),
4075        4usize,
4076        concat!("Alignment of ", stringify!(ble_gap_evt_t))
4077    );
4078    assert_eq!(
4079        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t>())).conn_handle as *const _ as usize },
4080        0usize,
4081        concat!(
4082            "Offset of field: ",
4083            stringify!(ble_gap_evt_t),
4084            "::",
4085            stringify!(conn_handle)
4086        )
4087    );
4088    assert_eq!(
4089        unsafe { &(*(::core::ptr::null::<ble_gap_evt_t>())).params as *const _ as usize },
4090        4usize,
4091        concat!("Offset of field: ", stringify!(ble_gap_evt_t), "::", stringify!(params))
4092    );
4093}
4094#[doc = " @brief BLE GAP connection configuration parameters, set with @ref sd_ble_cfg_set."]
4095#[doc = ""]
4096#[doc = " @retval ::NRF_ERROR_CONN_COUNT     The connection count for the connection configurations is zero."]
4097#[doc = " @retval ::NRF_ERROR_INVALID_PARAM  One or more of the following is true:"]
4098#[doc = "                                    - The sum of conn_count for all connection configurations combined exceeds UINT8_MAX."]
4099#[doc = "                                    - The event length is smaller than @ref BLE_GAP_EVENT_LENGTH_MIN."]
4100#[repr(C)]
4101#[derive(Debug, Copy, Clone)]
4102pub struct ble_gap_conn_cfg_t {
4103    #[doc = "< The number of concurrent connections the application can create with this configuration."]
4104    #[doc = "The default and minimum value is @ref BLE_GAP_CONN_COUNT_DEFAULT."]
4105    pub conn_count: u8,
4106    #[doc = "< The time set aside for this connection on every connection interval in 1.25 ms units."]
4107    #[doc = "The default value is @ref BLE_GAP_EVENT_LENGTH_DEFAULT, the minimum value is @ref BLE_GAP_EVENT_LENGTH_MIN."]
4108    #[doc = "The event length and the connection interval are the primary parameters"]
4109    #[doc = "for setting the throughput of a connection."]
4110    #[doc = "See the SoftDevice Specification for details on throughput."]
4111    pub event_length: u16,
4112}
4113#[test]
4114fn bindgen_test_layout_ble_gap_conn_cfg_t() {
4115    assert_eq!(
4116        ::core::mem::size_of::<ble_gap_conn_cfg_t>(),
4117        4usize,
4118        concat!("Size of: ", stringify!(ble_gap_conn_cfg_t))
4119    );
4120    assert_eq!(
4121        ::core::mem::align_of::<ble_gap_conn_cfg_t>(),
4122        2usize,
4123        concat!("Alignment of ", stringify!(ble_gap_conn_cfg_t))
4124    );
4125    assert_eq!(
4126        unsafe { &(*(::core::ptr::null::<ble_gap_conn_cfg_t>())).conn_count as *const _ as usize },
4127        0usize,
4128        concat!(
4129            "Offset of field: ",
4130            stringify!(ble_gap_conn_cfg_t),
4131            "::",
4132            stringify!(conn_count)
4133        )
4134    );
4135    assert_eq!(
4136        unsafe { &(*(::core::ptr::null::<ble_gap_conn_cfg_t>())).event_length as *const _ as usize },
4137        2usize,
4138        concat!(
4139            "Offset of field: ",
4140            stringify!(ble_gap_conn_cfg_t),
4141            "::",
4142            stringify!(event_length)
4143        )
4144    );
4145}
4146#[doc = " @brief Configuration of maximum concurrent connections in the peripheral role, set with"]
4147#[doc = " @ref sd_ble_cfg_set."]
4148#[doc = ""]
4149#[doc = " @retval ::NRF_ERROR_CONN_COUNT     The periph_role_count is too large. The maximum"]
4150#[doc = "                                    supported sum of concurrent connections is"]
4151#[doc = "                                    @ref BLE_GAP_ROLE_COUNT_COMBINED_MAX."]
4152#[doc = " @retval ::NRF_ERROR_RESOURCES      The adv_set_count is too large. The maximum"]
4153#[doc = "                                    supported advertising handles is"]
4154#[doc = "                                    @ref BLE_GAP_ADV_SET_COUNT_MAX."]
4155#[repr(C)]
4156#[derive(Debug, Copy, Clone)]
4157pub struct ble_gap_cfg_role_count_t {
4158    #[doc = "< Maximum number of advertising sets. Default value is @ref BLE_GAP_ADV_SET_COUNT_DEFAULT."]
4159    pub adv_set_count: u8,
4160    #[doc = "< Maximum number of connections concurrently acting as a peripheral. Default value is @ref BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT."]
4161    pub periph_role_count: u8,
4162}
4163#[test]
4164fn bindgen_test_layout_ble_gap_cfg_role_count_t() {
4165    assert_eq!(
4166        ::core::mem::size_of::<ble_gap_cfg_role_count_t>(),
4167        2usize,
4168        concat!("Size of: ", stringify!(ble_gap_cfg_role_count_t))
4169    );
4170    assert_eq!(
4171        ::core::mem::align_of::<ble_gap_cfg_role_count_t>(),
4172        1usize,
4173        concat!("Alignment of ", stringify!(ble_gap_cfg_role_count_t))
4174    );
4175    assert_eq!(
4176        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_role_count_t>())).adv_set_count as *const _ as usize },
4177        0usize,
4178        concat!(
4179            "Offset of field: ",
4180            stringify!(ble_gap_cfg_role_count_t),
4181            "::",
4182            stringify!(adv_set_count)
4183        )
4184    );
4185    assert_eq!(
4186        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_role_count_t>())).periph_role_count as *const _ as usize },
4187        1usize,
4188        concat!(
4189            "Offset of field: ",
4190            stringify!(ble_gap_cfg_role_count_t),
4191            "::",
4192            stringify!(periph_role_count)
4193        )
4194    );
4195}
4196#[doc = " @brief Device name and its properties, set with @ref sd_ble_cfg_set."]
4197#[doc = ""]
4198#[doc = " @note  If the device name is not configured, the default device name will be"]
4199#[doc = "        @ref BLE_GAP_DEVNAME_DEFAULT, the maximum device name length will be"]
4200#[doc = "        @ref BLE_GAP_DEVNAME_DEFAULT_LEN, vloc will be set to @ref BLE_GATTS_VLOC_STACK and the device name"]
4201#[doc = "        will have no write access."]
4202#[doc = ""]
4203#[doc = " @note  If @ref max_len is more than @ref BLE_GAP_DEVNAME_DEFAULT_LEN and vloc is set to @ref BLE_GATTS_VLOC_STACK,"]
4204#[doc = "        the attribute table size must be increased to have room for the longer device name (see"]
4205#[doc = "        @ref sd_ble_cfg_set and @ref ble_gatts_cfg_attr_tab_size_t)."]
4206#[doc = ""]
4207#[doc = " @note  If vloc is @ref BLE_GATTS_VLOC_STACK :"]
4208#[doc = "        - p_value must point to non-volatile memory (flash) or be NULL."]
4209#[doc = "        - If p_value is NULL, the device name will initially be empty."]
4210#[doc = ""]
4211#[doc = " @note  If vloc is @ref BLE_GATTS_VLOC_USER :"]
4212#[doc = "        - p_value cannot be NULL."]
4213#[doc = "        - If the device name is writable, p_value must point to volatile memory (RAM)."]
4214#[doc = ""]
4215#[doc = " @retval ::NRF_ERROR_INVALID_PARAM  One or more of the following is true:"]
4216#[doc = "                                    - Invalid device name location (vloc)."]
4217#[doc = "                                    - Invalid device name security mode."]
4218#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH One or more of the following is true:"]
4219#[doc = "                                    - The device name length is invalid (must be between 0 and @ref BLE_GAP_DEVNAME_MAX_LEN)."]
4220#[doc = "                                    - The device name length is too long for the given Attribute Table."]
4221#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED  Device name security mode is not supported."]
4222#[repr(C)]
4223#[derive(Debug, Copy, Clone)]
4224pub struct ble_gap_cfg_device_name_t {
4225    #[doc = "< Write permissions."]
4226    pub write_perm: ble_gap_conn_sec_mode_t,
4227    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
4228    #[doc = "< Pointer to where the value (device name) is stored or will be stored."]
4229    pub p_value: *mut u8,
4230    #[doc = "< Current length in bytes of the memory pointed to by p_value."]
4231    pub current_len: u16,
4232    #[doc = "< Maximum length in bytes of the memory pointed to by p_value."]
4233    pub max_len: u16,
4234}
4235#[test]
4236fn bindgen_test_layout_ble_gap_cfg_device_name_t() {
4237    assert_eq!(
4238        ::core::mem::size_of::<ble_gap_cfg_device_name_t>(),
4239        12usize,
4240        concat!("Size of: ", stringify!(ble_gap_cfg_device_name_t))
4241    );
4242    assert_eq!(
4243        ::core::mem::align_of::<ble_gap_cfg_device_name_t>(),
4244        4usize,
4245        concat!("Alignment of ", stringify!(ble_gap_cfg_device_name_t))
4246    );
4247    assert_eq!(
4248        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_device_name_t>())).write_perm as *const _ as usize },
4249        0usize,
4250        concat!(
4251            "Offset of field: ",
4252            stringify!(ble_gap_cfg_device_name_t),
4253            "::",
4254            stringify!(write_perm)
4255        )
4256    );
4257    assert_eq!(
4258        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_device_name_t>())).p_value as *const _ as usize },
4259        4usize,
4260        concat!(
4261            "Offset of field: ",
4262            stringify!(ble_gap_cfg_device_name_t),
4263            "::",
4264            stringify!(p_value)
4265        )
4266    );
4267    assert_eq!(
4268        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_device_name_t>())).current_len as *const _ as usize },
4269        8usize,
4270        concat!(
4271            "Offset of field: ",
4272            stringify!(ble_gap_cfg_device_name_t),
4273            "::",
4274            stringify!(current_len)
4275        )
4276    );
4277    assert_eq!(
4278        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_device_name_t>())).max_len as *const _ as usize },
4279        10usize,
4280        concat!(
4281            "Offset of field: ",
4282            stringify!(ble_gap_cfg_device_name_t),
4283            "::",
4284            stringify!(max_len)
4285        )
4286    );
4287}
4288impl ble_gap_cfg_device_name_t {
4289    #[inline]
4290    pub fn vloc(&self) -> u8 {
4291        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
4292    }
4293    #[inline]
4294    pub fn set_vloc(&mut self, val: u8) {
4295        unsafe {
4296            let val: u8 = ::core::mem::transmute(val);
4297            self._bitfield_1.set(0usize, 2u8, val as u64)
4298        }
4299    }
4300    #[inline]
4301    pub fn new_bitfield_1(vloc: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
4302        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
4303        __bindgen_bitfield_unit.set(0usize, 2u8, {
4304            let vloc: u8 = unsafe { ::core::mem::transmute(vloc) };
4305            vloc as u64
4306        });
4307        __bindgen_bitfield_unit
4308    }
4309}
4310#[doc = "@brief Peripheral Preferred Connection Parameters include configuration parameters, set with @ref sd_ble_cfg_set."]
4311#[repr(C)]
4312#[derive(Debug, Copy, Clone)]
4313pub struct ble_gap_cfg_ppcp_incl_cfg_t {
4314    #[doc = "< Inclusion configuration of the Peripheral Preferred Connection Parameters characteristic."]
4315    #[doc = "See @ref BLE_GAP_CHAR_INCL_CONFIG. Default is @ref BLE_GAP_PPCP_INCL_CONFIG_DEFAULT."]
4316    pub include_cfg: u8,
4317}
4318#[test]
4319fn bindgen_test_layout_ble_gap_cfg_ppcp_incl_cfg_t() {
4320    assert_eq!(
4321        ::core::mem::size_of::<ble_gap_cfg_ppcp_incl_cfg_t>(),
4322        1usize,
4323        concat!("Size of: ", stringify!(ble_gap_cfg_ppcp_incl_cfg_t))
4324    );
4325    assert_eq!(
4326        ::core::mem::align_of::<ble_gap_cfg_ppcp_incl_cfg_t>(),
4327        1usize,
4328        concat!("Alignment of ", stringify!(ble_gap_cfg_ppcp_incl_cfg_t))
4329    );
4330    assert_eq!(
4331        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_ppcp_incl_cfg_t>())).include_cfg as *const _ as usize },
4332        0usize,
4333        concat!(
4334            "Offset of field: ",
4335            stringify!(ble_gap_cfg_ppcp_incl_cfg_t),
4336            "::",
4337            stringify!(include_cfg)
4338        )
4339    );
4340}
4341#[doc = "@brief Central Address Resolution include configuration parameters, set with @ref sd_ble_cfg_set."]
4342#[repr(C)]
4343#[derive(Debug, Copy, Clone)]
4344pub struct ble_gap_cfg_car_incl_cfg_t {
4345    #[doc = "< Inclusion configuration of the Central Address Resolution characteristic."]
4346    #[doc = "See @ref BLE_GAP_CHAR_INCL_CONFIG. Default is @ref BLE_GAP_CAR_INCL_CONFIG_DEFAULT."]
4347    pub include_cfg: u8,
4348}
4349#[test]
4350fn bindgen_test_layout_ble_gap_cfg_car_incl_cfg_t() {
4351    assert_eq!(
4352        ::core::mem::size_of::<ble_gap_cfg_car_incl_cfg_t>(),
4353        1usize,
4354        concat!("Size of: ", stringify!(ble_gap_cfg_car_incl_cfg_t))
4355    );
4356    assert_eq!(
4357        ::core::mem::align_of::<ble_gap_cfg_car_incl_cfg_t>(),
4358        1usize,
4359        concat!("Alignment of ", stringify!(ble_gap_cfg_car_incl_cfg_t))
4360    );
4361    assert_eq!(
4362        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_car_incl_cfg_t>())).include_cfg as *const _ as usize },
4363        0usize,
4364        concat!(
4365            "Offset of field: ",
4366            stringify!(ble_gap_cfg_car_incl_cfg_t),
4367            "::",
4368            stringify!(include_cfg)
4369        )
4370    );
4371}
4372#[doc = "@brief Configuration structure for GAP configurations."]
4373#[repr(C)]
4374#[derive(Copy, Clone)]
4375pub union ble_gap_cfg_t {
4376    #[doc = "< Role count configuration, cfg_id is @ref BLE_GAP_CFG_ROLE_COUNT."]
4377    pub role_count_cfg: ble_gap_cfg_role_count_t,
4378    #[doc = "< Device name configuration, cfg_id is @ref BLE_GAP_CFG_DEVICE_NAME."]
4379    pub device_name_cfg: ble_gap_cfg_device_name_t,
4380    #[doc = "< Peripheral Preferred Connection Parameters characteristic include"]
4381    #[doc = "configuration, cfg_id is @ref BLE_GAP_CFG_PPCP_INCL_CONFIG."]
4382    pub ppcp_include_cfg: ble_gap_cfg_ppcp_incl_cfg_t,
4383    #[doc = "< Central Address Resolution characteristic include configuration,"]
4384    #[doc = "cfg_id is @ref BLE_GAP_CFG_CAR_INCL_CONFIG."]
4385    pub car_include_cfg: ble_gap_cfg_car_incl_cfg_t,
4386    _bindgen_union_align: [u32; 3usize],
4387}
4388#[test]
4389fn bindgen_test_layout_ble_gap_cfg_t() {
4390    assert_eq!(
4391        ::core::mem::size_of::<ble_gap_cfg_t>(),
4392        12usize,
4393        concat!("Size of: ", stringify!(ble_gap_cfg_t))
4394    );
4395    assert_eq!(
4396        ::core::mem::align_of::<ble_gap_cfg_t>(),
4397        4usize,
4398        concat!("Alignment of ", stringify!(ble_gap_cfg_t))
4399    );
4400    assert_eq!(
4401        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_t>())).role_count_cfg as *const _ as usize },
4402        0usize,
4403        concat!(
4404            "Offset of field: ",
4405            stringify!(ble_gap_cfg_t),
4406            "::",
4407            stringify!(role_count_cfg)
4408        )
4409    );
4410    assert_eq!(
4411        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_t>())).device_name_cfg as *const _ as usize },
4412        0usize,
4413        concat!(
4414            "Offset of field: ",
4415            stringify!(ble_gap_cfg_t),
4416            "::",
4417            stringify!(device_name_cfg)
4418        )
4419    );
4420    assert_eq!(
4421        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_t>())).ppcp_include_cfg as *const _ as usize },
4422        0usize,
4423        concat!(
4424            "Offset of field: ",
4425            stringify!(ble_gap_cfg_t),
4426            "::",
4427            stringify!(ppcp_include_cfg)
4428        )
4429    );
4430    assert_eq!(
4431        unsafe { &(*(::core::ptr::null::<ble_gap_cfg_t>())).car_include_cfg as *const _ as usize },
4432        0usize,
4433        concat!(
4434            "Offset of field: ",
4435            stringify!(ble_gap_cfg_t),
4436            "::",
4437            stringify!(car_include_cfg)
4438        )
4439    );
4440}
4441#[doc = "@brief Channel Map option."]
4442#[doc = ""]
4443#[doc = " @details Used with @ref sd_ble_opt_get to get the current channel map"]
4444#[doc = "          or @ref sd_ble_opt_set to set a new channel map. When setting the"]
4445#[doc = "          channel map, it applies to all current and future connections. When getting the"]
4446#[doc = "          current channel map, it applies to a single connection and the connection handle"]
4447#[doc = "          must be supplied."]
4448#[doc = ""]
4449#[doc = " @note Setting the channel map may take some time, depending on connection parameters."]
4450#[doc = "       The time taken may be different for each connection and the get operation will"]
4451#[doc = "       return the previous channel map until the new one has taken effect."]
4452#[doc = ""]
4453#[doc = " @note After setting the channel map, by spec it can not be set again until at least 1 s has passed."]
4454#[doc = "       See Bluetooth Specification Version 4.1 Volume 2, Part E, Section 7.3.46."]
4455#[doc = ""]
4456#[doc = " @retval ::NRF_SUCCESS Get or set successful."]
4457#[doc = " @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true:"]
4458#[doc = "                                   - Less then two bits in @ref ch_map are set."]
4459#[doc = "                                   - Bits for primary advertising channels (37-39) are set."]
4460#[doc = " @retval ::NRF_ERROR_BUSY Channel map was set again before enough time had passed."]
4461#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied for get."]
4462#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Returned by @ref sd_ble_opt_set in peripheral-only SoftDevices."]
4463#[doc = ""]
4464#[repr(C)]
4465#[derive(Debug, Copy, Clone)]
4466pub struct ble_gap_opt_ch_map_t {
4467    #[doc = "< Connection Handle (only applicable for get)"]
4468    pub conn_handle: u16,
4469    #[doc = "< Channel Map (37-bit)."]
4470    pub ch_map: [u8; 5usize],
4471}
4472#[test]
4473fn bindgen_test_layout_ble_gap_opt_ch_map_t() {
4474    assert_eq!(
4475        ::core::mem::size_of::<ble_gap_opt_ch_map_t>(),
4476        8usize,
4477        concat!("Size of: ", stringify!(ble_gap_opt_ch_map_t))
4478    );
4479    assert_eq!(
4480        ::core::mem::align_of::<ble_gap_opt_ch_map_t>(),
4481        2usize,
4482        concat!("Alignment of ", stringify!(ble_gap_opt_ch_map_t))
4483    );
4484    assert_eq!(
4485        unsafe { &(*(::core::ptr::null::<ble_gap_opt_ch_map_t>())).conn_handle as *const _ as usize },
4486        0usize,
4487        concat!(
4488            "Offset of field: ",
4489            stringify!(ble_gap_opt_ch_map_t),
4490            "::",
4491            stringify!(conn_handle)
4492        )
4493    );
4494    assert_eq!(
4495        unsafe { &(*(::core::ptr::null::<ble_gap_opt_ch_map_t>())).ch_map as *const _ as usize },
4496        2usize,
4497        concat!(
4498            "Offset of field: ",
4499            stringify!(ble_gap_opt_ch_map_t),
4500            "::",
4501            stringify!(ch_map)
4502        )
4503    );
4504}
4505#[doc = "@brief Local connection latency option."]
4506#[doc = ""]
4507#[doc = " @details Local connection latency is a feature which enables the slave to improve"]
4508#[doc = "          current consumption by ignoring the slave latency set by the peer. The"]
4509#[doc = "          local connection latency can only be set to a multiple of the slave latency,"]
4510#[doc = "          and cannot be longer than half of the supervision timeout."]
4511#[doc = ""]
4512#[doc = " @details Used with @ref sd_ble_opt_set to set the local connection latency. The"]
4513#[doc = "          @ref sd_ble_opt_get is not supported for this option, but the actual"]
4514#[doc = "          local connection latency (unless set to NULL) is set as a return parameter"]
4515#[doc = "          when setting the option."]
4516#[doc = ""]
4517#[doc = " @note The latency set will be truncated down to the closest slave latency event"]
4518#[doc = "       multiple, or the nearest multiple before half of the supervision timeout."]
4519#[doc = ""]
4520#[doc = " @note The local connection latency is disabled by default, and needs to be enabled for new"]
4521#[doc = "       connections and whenever the connection is updated."]
4522#[doc = ""]
4523#[doc = " @retval ::NRF_SUCCESS Set successfully."]
4524#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported."]
4525#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter."]
4526#[repr(C)]
4527#[derive(Debug, Copy, Clone)]
4528pub struct ble_gap_opt_local_conn_latency_t {
4529    #[doc = "< Connection Handle"]
4530    pub conn_handle: u16,
4531    #[doc = "< Requested local connection latency."]
4532    pub requested_latency: u16,
4533    #[doc = "< Pointer to storage for the actual local connection latency (can be set to NULL to skip return value)."]
4534    pub p_actual_latency: *mut u16,
4535}
4536#[test]
4537fn bindgen_test_layout_ble_gap_opt_local_conn_latency_t() {
4538    assert_eq!(
4539        ::core::mem::size_of::<ble_gap_opt_local_conn_latency_t>(),
4540        8usize,
4541        concat!("Size of: ", stringify!(ble_gap_opt_local_conn_latency_t))
4542    );
4543    assert_eq!(
4544        ::core::mem::align_of::<ble_gap_opt_local_conn_latency_t>(),
4545        4usize,
4546        concat!("Alignment of ", stringify!(ble_gap_opt_local_conn_latency_t))
4547    );
4548    assert_eq!(
4549        unsafe { &(*(::core::ptr::null::<ble_gap_opt_local_conn_latency_t>())).conn_handle as *const _ as usize },
4550        0usize,
4551        concat!(
4552            "Offset of field: ",
4553            stringify!(ble_gap_opt_local_conn_latency_t),
4554            "::",
4555            stringify!(conn_handle)
4556        )
4557    );
4558    assert_eq!(
4559        unsafe { &(*(::core::ptr::null::<ble_gap_opt_local_conn_latency_t>())).requested_latency as *const _ as usize },
4560        2usize,
4561        concat!(
4562            "Offset of field: ",
4563            stringify!(ble_gap_opt_local_conn_latency_t),
4564            "::",
4565            stringify!(requested_latency)
4566        )
4567    );
4568    assert_eq!(
4569        unsafe { &(*(::core::ptr::null::<ble_gap_opt_local_conn_latency_t>())).p_actual_latency as *const _ as usize },
4570        4usize,
4571        concat!(
4572            "Offset of field: ",
4573            stringify!(ble_gap_opt_local_conn_latency_t),
4574            "::",
4575            stringify!(p_actual_latency)
4576        )
4577    );
4578}
4579#[doc = "@brief Disable slave latency"]
4580#[doc = ""]
4581#[doc = " @details Used with @ref sd_ble_opt_set to temporarily disable slave latency of a peripheral connection"]
4582#[doc = "          (see @ref ble_gap_conn_params_t::slave_latency). And to re-enable it again. When disabled, the"]
4583#[doc = "          peripheral will ignore the slave_latency set by the central."]
4584#[doc = ""]
4585#[doc = " @note  Shall only be called on peripheral links."]
4586#[doc = ""]
4587#[doc = " @retval ::NRF_SUCCESS Set successfully."]
4588#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported."]
4589#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter."]
4590#[repr(C)]
4591#[derive(Debug, Copy, Clone)]
4592pub struct ble_gap_opt_slave_latency_disable_t {
4593    #[doc = "< Connection Handle"]
4594    pub conn_handle: u16,
4595    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
4596    pub __bindgen_padding_0: u8,
4597}
4598#[test]
4599fn bindgen_test_layout_ble_gap_opt_slave_latency_disable_t() {
4600    assert_eq!(
4601        ::core::mem::size_of::<ble_gap_opt_slave_latency_disable_t>(),
4602        4usize,
4603        concat!("Size of: ", stringify!(ble_gap_opt_slave_latency_disable_t))
4604    );
4605    assert_eq!(
4606        ::core::mem::align_of::<ble_gap_opt_slave_latency_disable_t>(),
4607        2usize,
4608        concat!("Alignment of ", stringify!(ble_gap_opt_slave_latency_disable_t))
4609    );
4610    assert_eq!(
4611        unsafe { &(*(::core::ptr::null::<ble_gap_opt_slave_latency_disable_t>())).conn_handle as *const _ as usize },
4612        0usize,
4613        concat!(
4614            "Offset of field: ",
4615            stringify!(ble_gap_opt_slave_latency_disable_t),
4616            "::",
4617            stringify!(conn_handle)
4618        )
4619    );
4620}
4621impl ble_gap_opt_slave_latency_disable_t {
4622    #[inline]
4623    pub fn disable(&self) -> u8 {
4624        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
4625    }
4626    #[inline]
4627    pub fn set_disable(&mut self, val: u8) {
4628        unsafe {
4629            let val: u8 = ::core::mem::transmute(val);
4630            self._bitfield_1.set(0usize, 1u8, val as u64)
4631        }
4632    }
4633    #[inline]
4634    pub fn new_bitfield_1(disable: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
4635        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
4636        __bindgen_bitfield_unit.set(0usize, 1u8, {
4637            let disable: u8 = unsafe { ::core::mem::transmute(disable) };
4638            disable as u64
4639        });
4640        __bindgen_bitfield_unit
4641    }
4642}
4643#[doc = "@brief Passkey Option."]
4644#[doc = ""]
4645#[doc = " @mscs"]
4646#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC}"]
4647#[doc = " @endmscs"]
4648#[doc = ""]
4649#[doc = " @details Structure containing the passkey to be used during pairing. This can be used with @ref"]
4650#[doc = "          sd_ble_opt_set to make the SoftDevice use a preprogrammed passkey for authentication"]
4651#[doc = "          instead of generating a random one."]
4652#[doc = ""]
4653#[doc = " @note Repeated pairing attempts using the same preprogrammed passkey makes pairing vulnerable to MITM attacks."]
4654#[doc = ""]
4655#[doc = " @note @ref sd_ble_opt_get is not supported for this option."]
4656#[doc = ""]
4657#[repr(C)]
4658#[derive(Debug, Copy, Clone)]
4659pub struct ble_gap_opt_passkey_t {
4660    #[doc = "< Pointer to 6-digit ASCII string (digit 0..9 only, no NULL termination) passkey to be used during pairing. If this is NULL, the SoftDevice will generate a random passkey if required."]
4661    pub p_passkey: *const u8,
4662}
4663#[test]
4664fn bindgen_test_layout_ble_gap_opt_passkey_t() {
4665    assert_eq!(
4666        ::core::mem::size_of::<ble_gap_opt_passkey_t>(),
4667        4usize,
4668        concat!("Size of: ", stringify!(ble_gap_opt_passkey_t))
4669    );
4670    assert_eq!(
4671        ::core::mem::align_of::<ble_gap_opt_passkey_t>(),
4672        4usize,
4673        concat!("Alignment of ", stringify!(ble_gap_opt_passkey_t))
4674    );
4675    assert_eq!(
4676        unsafe { &(*(::core::ptr::null::<ble_gap_opt_passkey_t>())).p_passkey as *const _ as usize },
4677        0usize,
4678        concat!(
4679            "Offset of field: ",
4680            stringify!(ble_gap_opt_passkey_t),
4681            "::",
4682            stringify!(p_passkey)
4683        )
4684    );
4685}
4686#[doc = "@brief Authenticated payload timeout option."]
4687#[doc = ""]
4688#[doc = " @details This can be used with @ref sd_ble_opt_set to change the Authenticated payload timeout to a value other"]
4689#[doc = "          than the default of @ref BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX."]
4690#[doc = ""]
4691#[doc = " @note The authenticated payload timeout event ::BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD will be generated"]
4692#[doc = "       if auth_payload_timeout time has elapsed without receiving a packet with a valid MIC on an encrypted"]
4693#[doc = "       link."]
4694#[doc = ""]
4695#[doc = " @note The LE ping procedure will be initiated before the timer expires to give the peer a chance"]
4696#[doc = "       to reset the timer. In addition the stack will try to prioritize running of LE ping over other"]
4697#[doc = "       activities to increase chances of finishing LE ping before timer expires. To avoid side-effects"]
4698#[doc = "       on other activities, it is recommended to use high timeout values."]
4699#[doc = "       Recommended timeout > 2*(connInterval * (6 + connSlaveLatency))."]
4700#[doc = ""]
4701#[doc = " @retval ::NRF_SUCCESS Set successfully."]
4702#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. auth_payload_timeout was outside of allowed range."]
4703#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter."]
4704#[repr(C)]
4705#[derive(Debug, Copy, Clone)]
4706pub struct ble_gap_opt_auth_payload_timeout_t {
4707    #[doc = "< Connection Handle"]
4708    pub conn_handle: u16,
4709    #[doc = "< Requested timeout in 10 ms unit, see @ref BLE_GAP_AUTH_PAYLOAD_TIMEOUT."]
4710    pub auth_payload_timeout: u16,
4711}
4712#[test]
4713fn bindgen_test_layout_ble_gap_opt_auth_payload_timeout_t() {
4714    assert_eq!(
4715        ::core::mem::size_of::<ble_gap_opt_auth_payload_timeout_t>(),
4716        4usize,
4717        concat!("Size of: ", stringify!(ble_gap_opt_auth_payload_timeout_t))
4718    );
4719    assert_eq!(
4720        ::core::mem::align_of::<ble_gap_opt_auth_payload_timeout_t>(),
4721        2usize,
4722        concat!("Alignment of ", stringify!(ble_gap_opt_auth_payload_timeout_t))
4723    );
4724    assert_eq!(
4725        unsafe { &(*(::core::ptr::null::<ble_gap_opt_auth_payload_timeout_t>())).conn_handle as *const _ as usize },
4726        0usize,
4727        concat!(
4728            "Offset of field: ",
4729            stringify!(ble_gap_opt_auth_payload_timeout_t),
4730            "::",
4731            stringify!(conn_handle)
4732        )
4733    );
4734    assert_eq!(
4735        unsafe {
4736            &(*(::core::ptr::null::<ble_gap_opt_auth_payload_timeout_t>())).auth_payload_timeout as *const _ as usize
4737        },
4738        2usize,
4739        concat!(
4740            "Offset of field: ",
4741            stringify!(ble_gap_opt_auth_payload_timeout_t),
4742            "::",
4743            stringify!(auth_payload_timeout)
4744        )
4745    );
4746}
4747#[doc = "@brief Option structure for GAP options."]
4748#[repr(C)]
4749#[derive(Copy, Clone)]
4750pub union ble_gap_opt_t {
4751    #[doc = "< Parameters for the Channel Map option."]
4752    pub ch_map: ble_gap_opt_ch_map_t,
4753    #[doc = "< Parameters for the Local connection latency option"]
4754    pub local_conn_latency: ble_gap_opt_local_conn_latency_t,
4755    #[doc = "< Parameters for the Passkey option."]
4756    pub passkey: ble_gap_opt_passkey_t,
4757    #[doc = "< Parameters for the authenticated payload timeout option."]
4758    pub auth_payload_timeout: ble_gap_opt_auth_payload_timeout_t,
4759    #[doc = "< Parameters for the Disable slave latency option"]
4760    pub slave_latency_disable: ble_gap_opt_slave_latency_disable_t,
4761    _bindgen_union_align: [u32; 2usize],
4762}
4763#[test]
4764fn bindgen_test_layout_ble_gap_opt_t() {
4765    assert_eq!(
4766        ::core::mem::size_of::<ble_gap_opt_t>(),
4767        8usize,
4768        concat!("Size of: ", stringify!(ble_gap_opt_t))
4769    );
4770    assert_eq!(
4771        ::core::mem::align_of::<ble_gap_opt_t>(),
4772        4usize,
4773        concat!("Alignment of ", stringify!(ble_gap_opt_t))
4774    );
4775    assert_eq!(
4776        unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).ch_map as *const _ as usize },
4777        0usize,
4778        concat!("Offset of field: ", stringify!(ble_gap_opt_t), "::", stringify!(ch_map))
4779    );
4780    assert_eq!(
4781        unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).local_conn_latency as *const _ as usize },
4782        0usize,
4783        concat!(
4784            "Offset of field: ",
4785            stringify!(ble_gap_opt_t),
4786            "::",
4787            stringify!(local_conn_latency)
4788        )
4789    );
4790    assert_eq!(
4791        unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).passkey as *const _ as usize },
4792        0usize,
4793        concat!(
4794            "Offset of field: ",
4795            stringify!(ble_gap_opt_t),
4796            "::",
4797            stringify!(passkey)
4798        )
4799    );
4800    assert_eq!(
4801        unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).auth_payload_timeout as *const _ as usize },
4802        0usize,
4803        concat!(
4804            "Offset of field: ",
4805            stringify!(ble_gap_opt_t),
4806            "::",
4807            stringify!(auth_payload_timeout)
4808        )
4809    );
4810    assert_eq!(
4811        unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).slave_latency_disable as *const _ as usize },
4812        0usize,
4813        concat!(
4814            "Offset of field: ",
4815            stringify!(ble_gap_opt_t),
4816            "::",
4817            stringify!(slave_latency_disable)
4818        )
4819    );
4820}
4821#[doc = "@brief  Connection event triggering parameters."]
4822#[repr(C)]
4823#[derive(Debug, Copy, Clone)]
4824pub struct ble_gap_conn_event_trigger_t {
4825    #[doc = "< PPI channel to use. This channel should be regarded as reserved until"]
4826    #[doc = "connection event PPI task triggering is stopped."]
4827    #[doc = "The PPI channel ID can not be one of the PPI channels reserved by"]
4828    #[doc = "the SoftDevice. See @ref NRF_SOC_SD_PPI_CHANNELS_SD_ENABLED_MSK."]
4829    pub ppi_ch_id: u8,
4830    #[doc = "< Task Endpoint to trigger."]
4831    pub task_endpoint: u32,
4832    #[doc = "< The connection event on which the task triggering should start."]
4833    pub conn_evt_counter_start: u16,
4834    #[doc = "< Trigger period. Valid range is [1, 32767]."]
4835    #[doc = "If the device is in slave role and slave latency is enabled,"]
4836    #[doc = "this parameter should be set to a multiple of (slave latency + 1)"]
4837    #[doc = "to ensure low power operation."]
4838    pub period_in_events: u16,
4839}
4840#[test]
4841fn bindgen_test_layout_ble_gap_conn_event_trigger_t() {
4842    assert_eq!(
4843        ::core::mem::size_of::<ble_gap_conn_event_trigger_t>(),
4844        12usize,
4845        concat!("Size of: ", stringify!(ble_gap_conn_event_trigger_t))
4846    );
4847    assert_eq!(
4848        ::core::mem::align_of::<ble_gap_conn_event_trigger_t>(),
4849        4usize,
4850        concat!("Alignment of ", stringify!(ble_gap_conn_event_trigger_t))
4851    );
4852    assert_eq!(
4853        unsafe { &(*(::core::ptr::null::<ble_gap_conn_event_trigger_t>())).ppi_ch_id as *const _ as usize },
4854        0usize,
4855        concat!(
4856            "Offset of field: ",
4857            stringify!(ble_gap_conn_event_trigger_t),
4858            "::",
4859            stringify!(ppi_ch_id)
4860        )
4861    );
4862    assert_eq!(
4863        unsafe { &(*(::core::ptr::null::<ble_gap_conn_event_trigger_t>())).task_endpoint as *const _ as usize },
4864        4usize,
4865        concat!(
4866            "Offset of field: ",
4867            stringify!(ble_gap_conn_event_trigger_t),
4868            "::",
4869            stringify!(task_endpoint)
4870        )
4871    );
4872    assert_eq!(
4873        unsafe {
4874            &(*(::core::ptr::null::<ble_gap_conn_event_trigger_t>())).conn_evt_counter_start as *const _ as usize
4875        },
4876        8usize,
4877        concat!(
4878            "Offset of field: ",
4879            stringify!(ble_gap_conn_event_trigger_t),
4880            "::",
4881            stringify!(conn_evt_counter_start)
4882        )
4883    );
4884    assert_eq!(
4885        unsafe { &(*(::core::ptr::null::<ble_gap_conn_event_trigger_t>())).period_in_events as *const _ as usize },
4886        10usize,
4887        concat!(
4888            "Offset of field: ",
4889            stringify!(ble_gap_conn_event_trigger_t),
4890            "::",
4891            stringify!(period_in_events)
4892        )
4893    );
4894}
4895
4896#[doc = "@brief Set the local Bluetooth identity address."]
4897#[doc = ""]
4898#[doc = "        The local Bluetooth identity address is the address that identifies this device to other peers."]
4899#[doc = "        The address type must be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC."]
4900#[doc = ""]
4901#[doc = " @note  The identity address cannot be changed while advertising."]
4902#[doc = ""]
4903#[doc = " @note  This address will be distributed to the peer during bonding."]
4904#[doc = "        If the address changes, the address stored in the peer device will not be valid and the ability to"]
4905#[doc = "        reconnect using the old address will be lost."]
4906#[doc = ""]
4907#[doc = " @note  By default the SoftDevice will set an address of type @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC upon being"]
4908#[doc = "        enabled. The address is a random number populated during the IC manufacturing process and remains unchanged"]
4909#[doc = "        for the lifetime of each IC."]
4910#[doc = ""]
4911#[doc = " @mscs"]
4912#[doc = " @mmsc{@ref BLE_GAP_ADV_MSC}"]
4913#[doc = " @endmscs"]
4914#[doc = ""]
4915#[doc = " @param[in] p_addr Pointer to address structure."]
4916#[doc = ""]
4917#[doc = " @retval ::NRF_SUCCESS Address successfully set."]
4918#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
4919#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address."]
4920#[doc = " @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry."]
4921#[doc = " @retval ::NRF_ERROR_INVALID_STATE The identity address cannot be changed while advertising."]
4922#[inline(always)]
4923pub unsafe fn sd_ble_gap_addr_set(p_addr: *const ble_gap_addr_t) -> u32 {
4924    let ret: u32;
4925    core::arch::asm!("svc 108",
4926        inout("r0") to_asm(p_addr) => ret,
4927        lateout("r1") _,
4928        lateout("r2") _,
4929        lateout("r3") _,
4930        lateout("r12") _,
4931    );
4932    ret
4933}
4934
4935#[doc = "@brief Get local Bluetooth identity address."]
4936#[doc = ""]
4937#[doc = " @note  This will always return the identity address irrespective of the privacy settings,"]
4938#[doc = "        i.e. the address type will always be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC."]
4939#[doc = ""]
4940#[doc = " @param[out] p_addr Pointer to address structure to be filled in."]
4941#[doc = ""]
4942#[doc = " @retval ::NRF_SUCCESS Address successfully retrieved."]
4943#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied."]
4944#[inline(always)]
4945pub unsafe fn sd_ble_gap_addr_get(p_addr: *mut ble_gap_addr_t) -> u32 {
4946    let ret: u32;
4947    core::arch::asm!("svc 109",
4948        inout("r0") to_asm(p_addr) => ret,
4949        lateout("r1") _,
4950        lateout("r2") _,
4951        lateout("r3") _,
4952        lateout("r12") _,
4953    );
4954    ret
4955}
4956
4957#[doc = "@brief Get the Bluetooth device address used by the advertiser."]
4958#[doc = ""]
4959#[doc = " @note  This function will return the local Bluetooth address used in advertising PDUs. When"]
4960#[doc = "        using privacy, the SoftDevice will generate a new private address every"]
4961#[doc = "        @ref ble_gap_privacy_params_t::private_addr_cycle_s configured using"]
4962#[doc = "        @ref sd_ble_gap_privacy_set. Hence depending on when the application calls this API, the"]
4963#[doc = "        address returned may not be the latest address that is used in the advertising PDUs."]
4964#[doc = ""]
4965#[doc = " @param[in]  adv_handle The advertising handle to get the address from."]
4966#[doc = " @param[out] p_addr     Pointer to address structure to be filled in."]
4967#[doc = ""]
4968#[doc = " @retval ::NRF_SUCCESS                  Address successfully retrieved."]
4969#[doc = " @retval ::NRF_ERROR_INVALID_ADDR       Invalid or NULL pointer supplied."]
4970#[doc = " @retval ::BLE_ERROR_INVALID_ADV_HANDLE The provided advertising handle was not found."]
4971#[doc = " @retval ::NRF_ERROR_INVALID_STATE      The advertising set is currently not advertising."]
4972#[inline(always)]
4973pub unsafe fn sd_ble_gap_adv_addr_get(adv_handle: u8, p_addr: *mut ble_gap_addr_t) -> u32 {
4974    let ret: u32;
4975    core::arch::asm!("svc 147",
4976        inout("r0") to_asm(adv_handle) => ret,
4977        inout("r1") to_asm(p_addr) => _,
4978        lateout("r2") _,
4979        lateout("r3") _,
4980        lateout("r12") _,
4981    );
4982    ret
4983}
4984
4985#[doc = "@brief Set the active whitelist in the SoftDevice."]
4986#[doc = ""]
4987#[doc = " @note  Only one whitelist can be used at a time and the whitelist is shared between the BLE roles."]
4988#[doc = "        The whitelist cannot be set if a BLE role is using the whitelist."]
4989#[doc = ""]
4990#[doc = " @note  If an address is resolved using the information in the device identity list, then the whitelist"]
4991#[doc = "        filter policy applies to the peer identity address and not the resolvable address sent on air."]
4992#[doc = ""]
4993#[doc = " @param[in] pp_wl_addrs Pointer to a whitelist of peer addresses, if NULL the whitelist will be cleared."]
4994#[doc = " @param[in] len         Length of the whitelist, maximum @ref BLE_GAP_WHITELIST_ADDR_MAX_COUNT."]
4995#[doc = ""]
4996#[doc = " @retval ::NRF_SUCCESS The whitelist is successfully set/cleared."]
4997#[doc = " @retval ::NRF_ERROR_INVALID_ADDR The whitelist (or one of its entries) provided is invalid."]
4998#[doc = " @retval ::BLE_ERROR_GAP_WHITELIST_IN_USE The whitelist is in use by a BLE role and cannot be set or cleared."]
4999#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied."]
5000#[doc = " @retval ::NRF_ERROR_DATA_SIZE The given whitelist size is invalid (zero or too large); this can only return when"]
5001#[doc = "                               pp_wl_addrs is not NULL."]
5002#[inline(always)]
5003pub unsafe fn sd_ble_gap_whitelist_set(pp_wl_addrs: *const *const ble_gap_addr_t, len: u8) -> u32 {
5004    let ret: u32;
5005    core::arch::asm!("svc 110",
5006        inout("r0") to_asm(pp_wl_addrs) => ret,
5007        inout("r1") to_asm(len) => _,
5008        lateout("r2") _,
5009        lateout("r3") _,
5010        lateout("r12") _,
5011    );
5012    ret
5013}
5014
5015#[doc = "@brief Set device identity list."]
5016#[doc = ""]
5017#[doc = " @note  Only one device identity list can be used at a time and the list is shared between the BLE roles."]
5018#[doc = "        The device identity list cannot be set if a BLE role is using the list."]
5019#[doc = ""]
5020#[doc = " @param[in] pp_id_keys     Pointer to an array of peer identity addresses and peer IRKs, if NULL the device identity list will be cleared."]
5021#[doc = " @param[in] pp_local_irks  Pointer to an array of local IRKs. Each entry in the array maps to the entry in pp_id_keys at the same index."]
5022#[doc = "                           To fill in the list with the currently set device IRK for all peers, set to NULL."]
5023#[doc = " @param[in] len            Length of the device identity list, maximum @ref BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT."]
5024#[doc = ""]
5025#[doc = " @mscs"]
5026#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_ADV_MSC}"]
5027#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC}"]
5028#[doc = " @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC}"]
5029#[doc = " @endmscs"]
5030#[doc = ""]
5031#[doc = " @retval ::NRF_SUCCESS The device identity list successfully set/cleared."]
5032#[doc = " @retval ::NRF_ERROR_INVALID_ADDR The device identity list (or one of its entries) provided is invalid."]
5033#[doc = "                                  This code may be returned if the local IRK list also has an invalid entry."]
5034#[doc = " @retval ::BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE The device identity list is in use and cannot be set or cleared."]
5035#[doc = " @retval ::BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE The device identity list contains multiple entries with the same identity address."]
5036#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied."]
5037#[doc = " @retval ::NRF_ERROR_DATA_SIZE The given device identity list size invalid (zero or too large); this can"]
5038#[doc = "                               only return when pp_id_keys is not NULL."]
5039#[inline(always)]
5040pub unsafe fn sd_ble_gap_device_identities_set(
5041    pp_id_keys: *const *const ble_gap_id_key_t,
5042    pp_local_irks: *const *const ble_gap_irk_t,
5043    len: u8,
5044) -> u32 {
5045    let ret: u32;
5046    core::arch::asm!("svc 111",
5047        inout("r0") to_asm(pp_id_keys) => ret,
5048        inout("r1") to_asm(pp_local_irks) => _,
5049        inout("r2") to_asm(len) => _,
5050        lateout("r3") _,
5051        lateout("r12") _,
5052    );
5053    ret
5054}
5055
5056#[doc = "@brief Set privacy settings."]
5057#[doc = ""]
5058#[doc = " @note  Privacy settings cannot be changed while advertising."]
5059#[doc = ""]
5060#[doc = " @param[in] p_privacy_params Privacy settings."]
5061#[doc = ""]
5062#[doc = " @mscs"]
5063#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_ADV_MSC}"]
5064#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC}"]
5065#[doc = " @endmscs"]
5066#[doc = ""]
5067#[doc = " @retval ::NRF_SUCCESS Set successfully."]
5068#[doc = " @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry."]
5069#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied."]
5070#[doc = " @retval ::NRF_ERROR_INVALID_ADDR The pointer to privacy settings is NULL or invalid."]
5071#[doc = "                                  Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer."]
5072#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Out of range parameters are provided."]
5073#[doc = " @retval ::NRF_ERROR_INVALID_STATE Privacy settings cannot be changed while advertising."]
5074#[inline(always)]
5075pub unsafe fn sd_ble_gap_privacy_set(p_privacy_params: *const ble_gap_privacy_params_t) -> u32 {
5076    let ret: u32;
5077    core::arch::asm!("svc 112",
5078        inout("r0") to_asm(p_privacy_params) => ret,
5079        lateout("r1") _,
5080        lateout("r2") _,
5081        lateout("r3") _,
5082        lateout("r12") _,
5083    );
5084    ret
5085}
5086
5087#[doc = "@brief Get privacy settings."]
5088#[doc = ""]
5089#[doc = " @note ::ble_gap_privacy_params_t::p_device_irk must be initialized to NULL or a valid address before this function is called."]
5090#[doc = "       If it is initialized to a valid address, the address pointed to will contain the current device IRK on return."]
5091#[doc = ""]
5092#[doc = " @param[in,out] p_privacy_params Privacy settings."]
5093#[doc = ""]
5094#[doc = " @retval ::NRF_SUCCESS            Privacy settings read."]
5095#[doc = " @retval ::NRF_ERROR_INVALID_ADDR The pointer given for returning the privacy settings may be NULL or invalid."]
5096#[doc = "                                  Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer."]
5097#[inline(always)]
5098pub unsafe fn sd_ble_gap_privacy_get(p_privacy_params: *mut ble_gap_privacy_params_t) -> u32 {
5099    let ret: u32;
5100    core::arch::asm!("svc 113",
5101        inout("r0") to_asm(p_privacy_params) => ret,
5102        lateout("r1") _,
5103        lateout("r2") _,
5104        lateout("r3") _,
5105        lateout("r12") _,
5106    );
5107    ret
5108}
5109
5110#[doc = "@brief Configure an advertising set. Set, clear or update advertising and scan response data."]
5111#[doc = ""]
5112#[doc = " @note  The format of the advertising data will be checked by this call to ensure interoperability."]
5113#[doc = "        Limitations imposed by this API call to the data provided include having a flags data type in the scan response data and"]
5114#[doc = "        duplicating the local name in the advertising data and scan response data."]
5115#[doc = ""]
5116#[doc = " @note In order to update advertising data while advertising, new advertising buffers must be provided."]
5117#[doc = ""]
5118#[doc = " @mscs"]
5119#[doc = " @mmsc{@ref BLE_GAP_ADV_MSC}"]
5120#[doc = " @endmscs"]
5121#[doc = ""]
5122#[doc = " @param[in,out] p_adv_handle                         Provide a pointer to a handle containing @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to configure"]
5123#[doc = "                                                     a new advertising set. On success, a new handle is then returned through the pointer."]
5124#[doc = "                                                     Provide a pointer to an existing advertising handle to configure an existing advertising set."]
5125#[doc = " @param[in]     p_adv_data                           Advertising data. If set to NULL, no advertising data will be used. See @ref ble_gap_adv_data_t."]
5126#[doc = " @param[in]     p_adv_params                         Advertising parameters. When this function is used to update advertising data while advertising,"]
5127#[doc = "                                                     this parameter must be NULL. See @ref ble_gap_adv_params_t."]
5128#[doc = ""]
5129#[doc = " @retval ::NRF_SUCCESS                               Advertising set successfully configured."]
5130#[doc = " @retval ::NRF_ERROR_INVALID_PARAM                   Invalid parameter(s) supplied:"]
5131#[doc = "                                                      - Invalid advertising data configuration specified. See @ref ble_gap_adv_data_t."]
5132#[doc = "                                                      - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t."]
5133#[doc = "                                                      - Use of whitelist requested but whitelist has not been set,"]
5134#[doc = "                                                        see @ref sd_ble_gap_whitelist_set."]
5135#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR            ble_gap_adv_params_t::p_peer_addr is invalid."]
5136#[doc = " @retval ::NRF_ERROR_INVALID_STATE                   Invalid state to perform operation. Either:"]
5137#[doc = "                                                     - It is invalid to provide non-NULL advertising set parameters while advertising."]
5138#[doc = "                                                     - It is invalid to provide the same data buffers while advertising. To update"]
5139#[doc = "                                                       advertising data, provide new advertising buffers."]
5140#[doc = " @retval ::BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST Discoverable mode and whitelist incompatible."]
5141#[doc = " @retval ::BLE_ERROR_INVALID_ADV_HANDLE              The provided advertising handle was not found. Use @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to"]
5142#[doc = "                                                     configure a new advertising handle."]
5143#[doc = " @retval ::NRF_ERROR_INVALID_ADDR                    Invalid pointer supplied."]
5144#[doc = " @retval ::NRF_ERROR_INVALID_FLAGS                   Invalid combination of advertising flags supplied."]
5145#[doc = " @retval ::NRF_ERROR_INVALID_DATA                    Invalid data type(s) supplied. Check the advertising data format specification"]
5146#[doc = "                                                     given in Bluetooth Specification Version 5.0, Volume 3, Part C, Chapter 11."]
5147#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH                  Invalid data length(s) supplied."]
5148#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED                   Unsupported data length or advertising parameter configuration."]
5149#[doc = " @retval ::NRF_ERROR_NO_MEM                          Not enough memory to configure a new advertising handle. Update an"]
5150#[doc = "                                                     existing advertising handle instead."]
5151#[doc = " @retval ::BLE_ERROR_GAP_UUID_LIST_MISMATCH Invalid UUID list supplied."]
5152#[inline(always)]
5153pub unsafe fn sd_ble_gap_adv_set_configure(
5154    p_adv_handle: *mut u8,
5155    p_adv_data: *const ble_gap_adv_data_t,
5156    p_adv_params: *const ble_gap_adv_params_t,
5157) -> u32 {
5158    let ret: u32;
5159    core::arch::asm!("svc 114",
5160        inout("r0") to_asm(p_adv_handle) => ret,
5161        inout("r1") to_asm(p_adv_data) => _,
5162        inout("r2") to_asm(p_adv_params) => _,
5163        lateout("r3") _,
5164        lateout("r12") _,
5165    );
5166    ret
5167}
5168
5169#[doc = "@brief Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure)."]
5170#[doc = ""]
5171#[doc = " @note Only one advertiser may be active at any time."]
5172#[doc = ""]
5173#[doc = " @events"]
5174#[doc = " @event{@ref BLE_GAP_EVT_CONNECTED, Generated after connection has been established through connectable advertising.}"]
5175#[doc = " @event{@ref BLE_GAP_EVT_ADV_SET_TERMINATED, Advertising set has terminated.}"]
5176#[doc = " @event{@ref BLE_GAP_EVT_SCAN_REQ_REPORT, A scan request was received.}"]
5177#[doc = " @endevents"]
5178#[doc = ""]
5179#[doc = " @mscs"]
5180#[doc = " @mmsc{@ref BLE_GAP_ADV_MSC}"]
5181#[doc = " @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC}"]
5182#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC}"]
5183#[doc = " @endmscs"]
5184#[doc = ""]
5185#[doc = " @param[in] adv_handle   Advertising handle to advertise on, received from @ref sd_ble_gap_adv_set_configure."]
5186#[doc = " @param[in] conn_cfg_tag Tag identifying a configuration set by @ref sd_ble_cfg_set or"]
5187#[doc = "                         @ref BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration. For non-connectable"]
5188#[doc = "                         advertising, this is ignored."]
5189#[doc = ""]
5190#[doc = " @retval ::NRF_SUCCESS                  The BLE stack has started advertising."]
5191#[doc = " @retval ::NRF_ERROR_INVALID_STATE      adv_handle is not configured or already advertising."]
5192#[doc = " @retval ::NRF_ERROR_CONN_COUNT         The limit of available connections for this connection configuration"]
5193#[doc = "                                        tag has been reached; connectable advertiser cannot be started."]
5194#[doc = "                                        To increase the number of available connections,"]
5195#[doc = "                                        use @ref sd_ble_cfg_set with @ref BLE_GAP_CFG_ROLE_COUNT or @ref BLE_CONN_CFG_GAP."]
5196#[doc = " @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found. Configure a new adveriting handle with @ref sd_ble_gap_adv_set_configure."]
5197#[doc = " @retval ::NRF_ERROR_NOT_FOUND          conn_cfg_tag not found."]
5198#[doc = " @retval ::NRF_ERROR_INVALID_PARAM      Invalid parameter(s) supplied:"]
5199#[doc = "                                        - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t."]
5200#[doc = "                                        - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set."]
5201#[doc = " @retval ::NRF_ERROR_RESOURCES          Either:"]
5202#[doc = "                                        - adv_handle is configured with connectable advertising, but the event_length parameter"]
5203#[doc = "                                          associated with conn_cfg_tag is too small to be able to establish a connection on"]
5204#[doc = "                                          the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length."]
5205#[doc = "                                        - Not enough BLE role slots available."]
5206#[doc = "                                          Stop one or more currently active roles (Peripheral or Broadcaster) and try again"]
5207#[doc = "                                        - p_adv_params is configured with connectable advertising, but the event_length parameter"]
5208#[doc = "                                          associated with conn_cfg_tag is too small to be able to establish a connection on"]
5209#[doc = "                                          the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length."]
5210#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported PHYs supplied to the call."]
5211#[inline(always)]
5212pub unsafe fn sd_ble_gap_adv_start(adv_handle: u8, conn_cfg_tag: u8) -> u32 {
5213    let ret: u32;
5214    core::arch::asm!("svc 115",
5215        inout("r0") to_asm(adv_handle) => ret,
5216        inout("r1") to_asm(conn_cfg_tag) => _,
5217        lateout("r2") _,
5218        lateout("r3") _,
5219        lateout("r12") _,
5220    );
5221    ret
5222}
5223
5224#[doc = "@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure)."]
5225#[doc = ""]
5226#[doc = " @mscs"]
5227#[doc = " @mmsc{@ref BLE_GAP_ADV_MSC}"]
5228#[doc = " @endmscs"]
5229#[doc = ""]
5230#[doc = " @param[in] adv_handle The advertising handle that should stop advertising."]
5231#[doc = ""]
5232#[doc = " @retval ::NRF_SUCCESS The BLE stack has stopped advertising."]
5233#[doc = " @retval ::BLE_ERROR_INVALID_ADV_HANDLE Invalid advertising handle."]
5234#[doc = " @retval ::NRF_ERROR_INVALID_STATE The advertising handle is not advertising."]
5235#[inline(always)]
5236pub unsafe fn sd_ble_gap_adv_stop(adv_handle: u8) -> u32 {
5237    let ret: u32;
5238    core::arch::asm!("svc 116",
5239        inout("r0") to_asm(adv_handle) => ret,
5240        lateout("r1") _,
5241        lateout("r2") _,
5242        lateout("r3") _,
5243        lateout("r12") _,
5244    );
5245    ret
5246}
5247
5248#[doc = "@brief Update connection parameters."]
5249#[doc = ""]
5250#[doc = " @details In the peripheral role, this will send the corresponding L2CAP request and wait for"]
5251#[doc = "          the central to perform the procedure. Regardless of success or failure, the application"]
5252#[doc = "          will be informed of the result with a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE event."]
5253#[doc = ""]
5254#[doc = " @events"]
5255#[doc = " @event{@ref BLE_GAP_EVT_CONN_PARAM_UPDATE, Result of the connection parameter update procedure.}"]
5256#[doc = " @endevents"]
5257#[doc = ""]
5258#[doc = " @mscs"]
5259#[doc = " @mmsc{@ref BLE_GAP_CPU_MSC}"]
5260#[doc = " @endmscs"]
5261#[doc = ""]
5262#[doc = " @param[in] conn_handle Connection handle."]
5263#[doc = " @param[in] p_conn_params  Pointer to desired connection parameters. If NULL is provided on a peripheral role,"]
5264#[doc = "                           the parameters in the PPCP characteristic of the GAP service will be used instead."]
5265#[doc = ""]
5266#[doc = " @retval ::NRF_SUCCESS The Connection Update procedure has been started successfully."]
5267#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5268#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints."]
5269#[doc = " @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress or link has not been established."]
5270#[doc = " @retval ::NRF_ERROR_BUSY Procedure already in progress, wait for pending procedures to complete and retry."]
5271#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5272#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
5273#[inline(always)]
5274pub unsafe fn sd_ble_gap_conn_param_update(conn_handle: u16, p_conn_params: *const ble_gap_conn_params_t) -> u32 {
5275    let ret: u32;
5276    core::arch::asm!("svc 117",
5277        inout("r0") to_asm(conn_handle) => ret,
5278        inout("r1") to_asm(p_conn_params) => _,
5279        lateout("r2") _,
5280        lateout("r3") _,
5281        lateout("r12") _,
5282    );
5283    ret
5284}
5285
5286#[doc = "@brief Disconnect (GAP Link Termination)."]
5287#[doc = ""]
5288#[doc = " @details This call initiates the disconnection procedure, and its completion will be communicated to the application"]
5289#[doc = "          with a @ref BLE_GAP_EVT_DISCONNECTED event."]
5290#[doc = ""]
5291#[doc = " @events"]
5292#[doc = " @event{@ref BLE_GAP_EVT_DISCONNECTED, Generated when disconnection procedure is complete.}"]
5293#[doc = " @endevents"]
5294#[doc = ""]
5295#[doc = " @mscs"]
5296#[doc = " @mmsc{@ref BLE_GAP_CONN_MSC}"]
5297#[doc = " @endmscs"]
5298#[doc = ""]
5299#[doc = " @param[in] conn_handle Connection handle."]
5300#[doc = " @param[in] hci_status_code HCI status code, see @ref BLE_HCI_STATUS_CODES (accepted values are @ref BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION and @ref BLE_HCI_CONN_INTERVAL_UNACCEPTABLE)."]
5301#[doc = ""]
5302#[doc = " @retval ::NRF_SUCCESS The disconnection procedure has been started successfully."]
5303#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5304#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5305#[doc = " @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress or link has not been established."]
5306#[inline(always)]
5307pub unsafe fn sd_ble_gap_disconnect(conn_handle: u16, hci_status_code: u8) -> u32 {
5308    let ret: u32;
5309    core::arch::asm!("svc 118",
5310        inout("r0") to_asm(conn_handle) => ret,
5311        inout("r1") to_asm(hci_status_code) => _,
5312        lateout("r2") _,
5313        lateout("r3") _,
5314        lateout("r12") _,
5315    );
5316    ret
5317}
5318
5319#[doc = "@brief Set the radio's transmit power."]
5320#[doc = ""]
5321#[doc = " @param[in] role The role to set the transmit power for, see @ref BLE_GAP_TX_POWER_ROLES for"]
5322#[doc = "                 possible roles."]
5323#[doc = " @param[in] handle   The handle parameter is interpreted depending on role:"]
5324#[doc = "                     - If role is @ref BLE_GAP_TX_POWER_ROLE_CONN, this value is the specific connection handle."]
5325#[doc = "                     - If role is @ref BLE_GAP_TX_POWER_ROLE_ADV, the advertising set identified with the advertising handle,"]
5326#[doc = "                       will use the specified transmit power, and include it in the advertising packet headers if"]
5327#[doc = "                       @ref ble_gap_adv_properties_t::include_tx_power set."]
5328#[doc = "                     - For all other roles handle is ignored."]
5329#[doc = " @param[in] tx_power Radio transmit power in dBm (see note for accepted values)."]
5330#[doc = ""]
5331#[doc = " @note Supported tx_power values: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +3dBm and +4dBm."]
5332#[doc = " @note The initiator will have the same transmit power as the scanner."]
5333#[doc = " @note When a connection is created it will inherit the transmit power from the initiator or"]
5334#[doc = "       advertiser leading to the connection."]
5335#[doc = ""]
5336#[doc = " @retval ::NRF_SUCCESS Successfully changed the transmit power."]
5337#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5338#[doc = " @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found."]
5339#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5340#[inline(always)]
5341pub unsafe fn sd_ble_gap_tx_power_set(role: u8, handle: u16, tx_power: i8) -> u32 {
5342    let ret: u32;
5343    core::arch::asm!("svc 119",
5344        inout("r0") to_asm(role) => ret,
5345        inout("r1") to_asm(handle) => _,
5346        inout("r2") to_asm(tx_power) => _,
5347        lateout("r3") _,
5348        lateout("r12") _,
5349    );
5350    ret
5351}
5352
5353#[doc = "@brief Set GAP Appearance value."]
5354#[doc = ""]
5355#[doc = " @param[in] appearance Appearance (16-bit), see @ref BLE_APPEARANCES."]
5356#[doc = ""]
5357#[doc = " @retval ::NRF_SUCCESS  Appearance value set successfully."]
5358#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5359#[inline(always)]
5360pub unsafe fn sd_ble_gap_appearance_set(appearance: u16) -> u32 {
5361    let ret: u32;
5362    core::arch::asm!("svc 120",
5363        inout("r0") to_asm(appearance) => ret,
5364        lateout("r1") _,
5365        lateout("r2") _,
5366        lateout("r3") _,
5367        lateout("r12") _,
5368    );
5369    ret
5370}
5371
5372#[doc = "@brief Get GAP Appearance value."]
5373#[doc = ""]
5374#[doc = " @param[out] p_appearance Pointer to appearance (16-bit) to be filled in, see @ref BLE_APPEARANCES."]
5375#[doc = ""]
5376#[doc = " @retval ::NRF_SUCCESS Appearance value retrieved successfully."]
5377#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5378#[inline(always)]
5379pub unsafe fn sd_ble_gap_appearance_get(p_appearance: *mut u16) -> u32 {
5380    let ret: u32;
5381    core::arch::asm!("svc 121",
5382        inout("r0") to_asm(p_appearance) => ret,
5383        lateout("r1") _,
5384        lateout("r2") _,
5385        lateout("r3") _,
5386        lateout("r12") _,
5387    );
5388    ret
5389}
5390
5391#[doc = "@brief Set GAP Peripheral Preferred Connection Parameters."]
5392#[doc = ""]
5393#[doc = " @param[in] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure with the desired parameters."]
5394#[doc = ""]
5395#[doc = " @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters set successfully."]
5396#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5397#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5398#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED The characteristic is not included in the Attribute Table,"]
5399#[doc = "see @ref ble_gap_cfg_ppcp_incl_cfg_t."]
5400#[inline(always)]
5401pub unsafe fn sd_ble_gap_ppcp_set(p_conn_params: *const ble_gap_conn_params_t) -> u32 {
5402    let ret: u32;
5403    core::arch::asm!("svc 122",
5404        inout("r0") to_asm(p_conn_params) => ret,
5405        lateout("r1") _,
5406        lateout("r2") _,
5407        lateout("r3") _,
5408        lateout("r12") _,
5409    );
5410    ret
5411}
5412
5413#[doc = "@brief Get GAP Peripheral Preferred Connection Parameters."]
5414#[doc = ""]
5415#[doc = " @param[out] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure where the parameters will be stored."]
5416#[doc = ""]
5417#[doc = " @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters retrieved successfully."]
5418#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5419#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED The characteristic is not included in the Attribute Table,"]
5420#[doc = "see @ref ble_gap_cfg_ppcp_incl_cfg_t."]
5421#[inline(always)]
5422pub unsafe fn sd_ble_gap_ppcp_get(p_conn_params: *mut ble_gap_conn_params_t) -> u32 {
5423    let ret: u32;
5424    core::arch::asm!("svc 123",
5425        inout("r0") to_asm(p_conn_params) => ret,
5426        lateout("r1") _,
5427        lateout("r2") _,
5428        lateout("r3") _,
5429        lateout("r12") _,
5430    );
5431    ret
5432}
5433
5434#[doc = "@brief Set GAP device name."]
5435#[doc = ""]
5436#[doc = " @note  If the device name is located in application flash memory (see @ref ble_gap_cfg_device_name_t),"]
5437#[doc = "        it cannot be changed. Then @ref NRF_ERROR_FORBIDDEN will be returned."]
5438#[doc = ""]
5439#[doc = " @param[in] p_write_perm Write permissions for the Device Name characteristic, see @ref ble_gap_conn_sec_mode_t."]
5440#[doc = " @param[in] p_dev_name Pointer to a UTF-8 encoded, <b>non NULL-terminated</b> string."]
5441#[doc = " @param[in] len Length of the UTF-8, <b>non NULL-terminated</b> string pointed to by p_dev_name in octets (must be smaller or equal than @ref BLE_GAP_DEVNAME_MAX_LEN)."]
5442#[doc = ""]
5443#[doc = " @retval ::NRF_SUCCESS GAP device name and permissions set successfully."]
5444#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5445#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5446#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied."]
5447#[doc = " @retval ::NRF_ERROR_FORBIDDEN Device name is not writable."]
5448#[inline(always)]
5449pub unsafe fn sd_ble_gap_device_name_set(
5450    p_write_perm: *const ble_gap_conn_sec_mode_t,
5451    p_dev_name: *const u8,
5452    len: u16,
5453) -> u32 {
5454    let ret: u32;
5455    core::arch::asm!("svc 124",
5456        inout("r0") to_asm(p_write_perm) => ret,
5457        inout("r1") to_asm(p_dev_name) => _,
5458        inout("r2") to_asm(len) => _,
5459        lateout("r3") _,
5460        lateout("r12") _,
5461    );
5462    ret
5463}
5464
5465#[doc = "@brief Get GAP device name."]
5466#[doc = ""]
5467#[doc = " @note  If the device name is longer than the size of the supplied buffer,"]
5468#[doc = "        p_len will return the complete device name length,"]
5469#[doc = "        and not the number of bytes actually returned in p_dev_name."]
5470#[doc = "        The application may use this information to allocate a suitable buffer size."]
5471#[doc = ""]
5472#[doc = " @param[out]    p_dev_name Pointer to an empty buffer where the UTF-8 <b>non NULL-terminated</b> string will be placed. Set to NULL to obtain the complete device name length."]
5473#[doc = " @param[in,out] p_len      Length of the buffer pointed by p_dev_name, complete device name length on output."]
5474#[doc = ""]
5475#[doc = " @retval ::NRF_SUCCESS GAP device name retrieved successfully."]
5476#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5477#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied."]
5478#[inline(always)]
5479pub unsafe fn sd_ble_gap_device_name_get(p_dev_name: *mut u8, p_len: *mut u16) -> u32 {
5480    let ret: u32;
5481    core::arch::asm!("svc 125",
5482        inout("r0") to_asm(p_dev_name) => ret,
5483        inout("r1") to_asm(p_len) => _,
5484        lateout("r2") _,
5485        lateout("r3") _,
5486        lateout("r12") _,
5487    );
5488    ret
5489}
5490
5491#[doc = "@brief Initiate the GAP Authentication procedure."]
5492#[doc = ""]
5493#[doc = " @details In the peripheral role, this function will send an SMP Security Request."]
5494#[doc = ""]
5495#[doc = " @events"]
5496#[doc = " @event{Depending on the security parameters set and the packet exchanges with the peer\\, the following events may be generated:}"]
5497#[doc = " @event{@ref BLE_GAP_EVT_SEC_PARAMS_REQUEST}"]
5498#[doc = " @event{@ref BLE_GAP_EVT_SEC_INFO_REQUEST}"]
5499#[doc = " @event{@ref BLE_GAP_EVT_PASSKEY_DISPLAY}"]
5500#[doc = " @event{@ref BLE_GAP_EVT_KEY_PRESSED}"]
5501#[doc = " @event{@ref BLE_GAP_EVT_AUTH_KEY_REQUEST}"]
5502#[doc = " @event{@ref BLE_GAP_EVT_LESC_DHKEY_REQUEST}"]
5503#[doc = " @event{@ref BLE_GAP_EVT_CONN_SEC_UPDATE}"]
5504#[doc = " @event{@ref BLE_GAP_EVT_AUTH_STATUS}"]
5505#[doc = " @event{@ref BLE_GAP_EVT_TIMEOUT}"]
5506#[doc = " @endevents"]
5507#[doc = ""]
5508#[doc = " @mscs"]
5509#[doc = " @mmsc{@ref BLE_GAP_PERIPH_SEC_REQ_MSC}"]
5510#[doc = " @endmscs"]
5511#[doc = ""]
5512#[doc = " @param[in] conn_handle Connection handle."]
5513#[doc = " @param[in] p_sec_params Pointer to the @ref ble_gap_sec_params_t structure with the security parameters to be used during the pairing or bonding procedure."]
5514#[doc = "                         In the peripheral role, only the bond, mitm, lesc and keypress fields of this structure are used."]
5515#[doc = ""]
5516#[doc = " @retval ::NRF_SUCCESS Successfully initiated authentication procedure."]
5517#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5518#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5519#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
5520#[doc = "                                   - No link has been established."]
5521#[doc = "                                   - An encryption is already executing or queued."]
5522#[doc = " @retval ::NRF_ERROR_NO_MEM The maximum number of authentication procedures that can run in parallel for the given role is reached."]
5523#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5524#[inline(always)]
5525pub unsafe fn sd_ble_gap_authenticate(conn_handle: u16, p_sec_params: *const ble_gap_sec_params_t) -> u32 {
5526    let ret: u32;
5527    core::arch::asm!("svc 126",
5528        inout("r0") to_asm(conn_handle) => ret,
5529        inout("r1") to_asm(p_sec_params) => _,
5530        lateout("r2") _,
5531        lateout("r3") _,
5532        lateout("r12") _,
5533    );
5534    ret
5535}
5536
5537#[doc = "@brief Reply with GAP security parameters."]
5538#[doc = ""]
5539#[doc = " @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE."]
5540#[doc = " @note    If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters."]
5541#[doc = ""]
5542#[doc = " @events"]
5543#[doc = " @event{This function is used during authentication procedures, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}"]
5544#[doc = " @endevents"]
5545#[doc = ""]
5546#[doc = " @mscs"]
5547#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_JW_MSC}"]
5548#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_JW_MSC}"]
5549#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_PERIPH_MSC}"]
5550#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC}"]
5551#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC}"]
5552#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_CONFIRM_FAIL_MSC}"]
5553#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC}"]
5554#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC}"]
5555#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC}"]
5556#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}"]
5557#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}"]
5558#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_KS_TOO_SMALL_MSC}"]
5559#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_APP_ERROR_MSC}"]
5560#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_REMOTE_PAIRING_FAIL_MSC}"]
5561#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_TIMEOUT_MSC}"]
5562#[doc = " @endmscs"]
5563#[doc = ""]
5564#[doc = " @param[in] conn_handle Connection handle."]
5565#[doc = " @param[in] sec_status Security status, see @ref BLE_GAP_SEC_STATUS."]
5566#[doc = " @param[in] p_sec_params Pointer to a @ref ble_gap_sec_params_t security parameters structure."]
5567#[doc = " @param[in,out] p_sec_keyset Pointer to a @ref ble_gap_sec_keyset_t security keyset structure. Any keys generated and/or distributed as a result of the ongoing security procedure"]
5568#[doc = "                         will be stored into the memory referenced by the pointers inside this structure. The keys will be stored and available to the application"]
5569#[doc = "                         upon reception of a @ref BLE_GAP_EVT_AUTH_STATUS event."]
5570#[doc = "                         Note that the SoftDevice expects the application to provide memory for storing the"]
5571#[doc = "                         peer's keys. So it must be ensured that the relevant pointers inside this structure are not NULL. The pointers to the local key"]
5572#[doc = "                         can, however, be NULL, in which case, the local key data will not be available to the application upon reception of the"]
5573#[doc = "                         @ref BLE_GAP_EVT_AUTH_STATUS event."]
5574#[doc = ""]
5575#[doc = " @retval ::NRF_SUCCESS Successfully accepted security parameter from the application."]
5576#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5577#[doc = " @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry."]
5578#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5579#[doc = " @retval ::NRF_ERROR_INVALID_STATE Security parameters has not been requested."]
5580#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5581#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Setting of sign or link fields in @ref ble_gap_sec_kdist_t not supported."]
5582#[inline(always)]
5583pub unsafe fn sd_ble_gap_sec_params_reply(
5584    conn_handle: u16,
5585    sec_status: u8,
5586    p_sec_params: *const ble_gap_sec_params_t,
5587    p_sec_keyset: *const ble_gap_sec_keyset_t,
5588) -> u32 {
5589    let ret: u32;
5590    core::arch::asm!("svc 127",
5591        inout("r0") to_asm(conn_handle) => ret,
5592        inout("r1") to_asm(sec_status) => _,
5593        inout("r2") to_asm(p_sec_params) => _,
5594        inout("r3") to_asm(p_sec_keyset) => _,
5595        lateout("r12") _,
5596    );
5597    ret
5598}
5599
5600#[doc = "@brief Reply with an authentication key."]
5601#[doc = ""]
5602#[doc = " @details This function is only used to reply to a @ref BLE_GAP_EVT_AUTH_KEY_REQUEST or a @ref BLE_GAP_EVT_PASSKEY_DISPLAY, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE."]
5603#[doc = " @note    If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters."]
5604#[doc = ""]
5605#[doc = " @events"]
5606#[doc = " @event{This function is used during authentication procedures\\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}"]
5607#[doc = " @endevents"]
5608#[doc = ""]
5609#[doc = " @mscs"]
5610#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC}"]
5611#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC}"]
5612#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}"]
5613#[doc = " @endmscs"]
5614#[doc = ""]
5615#[doc = " @param[in] conn_handle Connection handle."]
5616#[doc = " @param[in] key_type See @ref BLE_GAP_AUTH_KEY_TYPES."]
5617#[doc = " @param[in] p_key If key type is @ref BLE_GAP_AUTH_KEY_TYPE_NONE, then NULL."]
5618#[doc = "                  If key type is @ref BLE_GAP_AUTH_KEY_TYPE_PASSKEY, then a 6-byte ASCII string (digit 0..9 only, no NULL termination)"]
5619#[doc = "                     or NULL when confirming LE Secure Connections Numeric Comparison."]
5620#[doc = "                  If key type is @ref BLE_GAP_AUTH_KEY_TYPE_OOB, then a 16-byte OOB key value in little-endian format."]
5621#[doc = ""]
5622#[doc = " @retval ::NRF_SUCCESS Authentication key successfully set."]
5623#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5624#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5625#[doc = " @retval ::NRF_ERROR_INVALID_STATE Authentication key has not been requested."]
5626#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5627#[inline(always)]
5628pub unsafe fn sd_ble_gap_auth_key_reply(conn_handle: u16, key_type: u8, p_key: *const u8) -> u32 {
5629    let ret: u32;
5630    core::arch::asm!("svc 128",
5631        inout("r0") to_asm(conn_handle) => ret,
5632        inout("r1") to_asm(key_type) => _,
5633        inout("r2") to_asm(p_key) => _,
5634        lateout("r3") _,
5635        lateout("r12") _,
5636    );
5637    ret
5638}
5639
5640#[doc = "@brief Reply with an LE Secure connections DHKey."]
5641#[doc = ""]
5642#[doc = " @details This function is only used to reply to a @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE."]
5643#[doc = " @note    If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters."]
5644#[doc = ""]
5645#[doc = " @events"]
5646#[doc = " @event{This function is used during authentication procedures\\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}"]
5647#[doc = " @endevents"]
5648#[doc = ""]
5649#[doc = " @mscs"]
5650#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC}"]
5651#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC}"]
5652#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC}"]
5653#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}"]
5654#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}"]
5655#[doc = " @endmscs"]
5656#[doc = ""]
5657#[doc = " @param[in] conn_handle Connection handle."]
5658#[doc = " @param[in] p_dhkey LE Secure Connections DHKey."]
5659#[doc = ""]
5660#[doc = " @retval ::NRF_SUCCESS DHKey successfully set."]
5661#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5662#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5663#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
5664#[doc = "                                   - The peer is not authenticated."]
5665#[doc = "                                   - The application has not pulled a @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST event."]
5666#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5667#[inline(always)]
5668pub unsafe fn sd_ble_gap_lesc_dhkey_reply(conn_handle: u16, p_dhkey: *const ble_gap_lesc_dhkey_t) -> u32 {
5669    let ret: u32;
5670    core::arch::asm!("svc 129",
5671        inout("r0") to_asm(conn_handle) => ret,
5672        inout("r1") to_asm(p_dhkey) => _,
5673        lateout("r2") _,
5674        lateout("r3") _,
5675        lateout("r12") _,
5676    );
5677    ret
5678}
5679
5680#[doc = "@brief Notify the peer of a local keypress."]
5681#[doc = ""]
5682#[doc = " @mscs"]
5683#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}"]
5684#[doc = " @endmscs"]
5685#[doc = ""]
5686#[doc = " @param[in] conn_handle Connection handle."]
5687#[doc = " @param[in] kp_not See @ref BLE_GAP_KP_NOT_TYPES."]
5688#[doc = ""]
5689#[doc = " @retval ::NRF_SUCCESS Keypress notification successfully queued for transmission."]
5690#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5691#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
5692#[doc = "                                   - Authentication key not requested."]
5693#[doc = "                                   - Passkey has not been entered."]
5694#[doc = "                                   - Keypresses have not been enabled by both peers."]
5695#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5696#[doc = " @retval ::NRF_ERROR_BUSY The BLE stack is busy. Retry at later time."]
5697#[inline(always)]
5698pub unsafe fn sd_ble_gap_keypress_notify(conn_handle: u16, kp_not: u8) -> u32 {
5699    let ret: u32;
5700    core::arch::asm!("svc 130",
5701        inout("r0") to_asm(conn_handle) => ret,
5702        inout("r1") to_asm(kp_not) => _,
5703        lateout("r2") _,
5704        lateout("r3") _,
5705        lateout("r12") _,
5706    );
5707    ret
5708}
5709
5710#[doc = "@brief Generate a set of OOB data to send to a peer out of band."]
5711#[doc = ""]
5712#[doc = " @note  The @ref ble_gap_addr_t included in the OOB data returned will be the currently active one (or, if a connection has already been established,"]
5713#[doc = "        the one used during connection setup). The application may manually overwrite it with an updated value."]
5714#[doc = ""]
5715#[doc = " @mscs"]
5716#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}"]
5717#[doc = " @endmscs"]
5718#[doc = ""]
5719#[doc = " @param[in] conn_handle Connection handle. Can be @ref BLE_CONN_HANDLE_INVALID if a BLE connection has not been established yet."]
5720#[doc = " @param[in] p_pk_own LE Secure Connections local P-256 Public Key."]
5721#[doc = " @param[out] p_oobd_own The OOB data to be sent out of band to a peer."]
5722#[doc = ""]
5723#[doc = " @retval ::NRF_SUCCESS OOB data successfully generated."]
5724#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5725#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5726#[inline(always)]
5727pub unsafe fn sd_ble_gap_lesc_oob_data_get(
5728    conn_handle: u16,
5729    p_pk_own: *const ble_gap_lesc_p256_pk_t,
5730    p_oobd_own: *mut ble_gap_lesc_oob_data_t,
5731) -> u32 {
5732    let ret: u32;
5733    core::arch::asm!("svc 131",
5734        inout("r0") to_asm(conn_handle) => ret,
5735        inout("r1") to_asm(p_pk_own) => _,
5736        inout("r2") to_asm(p_oobd_own) => _,
5737        lateout("r3") _,
5738        lateout("r12") _,
5739    );
5740    ret
5741}
5742
5743#[doc = "@brief Provide the OOB data sent/received out of band."]
5744#[doc = ""]
5745#[doc = " @note  An authentication procedure with OOB selected as an algorithm must be in progress when calling this function."]
5746#[doc = " @note  A @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST event with the oobd_req set to 1 must have been received prior to calling this function."]
5747#[doc = ""]
5748#[doc = " @events"]
5749#[doc = " @event{This function is used during authentication procedures\\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}"]
5750#[doc = " @endevents"]
5751#[doc = ""]
5752#[doc = " @mscs"]
5753#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}"]
5754#[doc = " @endmscs"]
5755#[doc = ""]
5756#[doc = " @param[in] conn_handle Connection handle."]
5757#[doc = " @param[in] p_oobd_own The OOB data sent out of band to a peer or NULL if the peer has not received OOB data."]
5758#[doc = "                       Must correspond to @ref ble_gap_sec_params_t::oob flag in @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST."]
5759#[doc = " @param[in] p_oobd_peer The OOB data received out of band from a peer or NULL if none received."]
5760#[doc = "                        Must correspond to @ref ble_gap_sec_params_t::oob flag"]
5761#[doc = "                        in @ref sd_ble_gap_sec_params_reply in the peripheral role."]
5762#[doc = ""]
5763#[doc = " @retval ::NRF_SUCCESS OOB data accepted."]
5764#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5765#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
5766#[doc = "                                   - Authentication key not requested"]
5767#[doc = "                                   - Not expecting LESC OOB data"]
5768#[doc = "                                   - Have not actually exchanged passkeys."]
5769#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5770#[inline(always)]
5771pub unsafe fn sd_ble_gap_lesc_oob_data_set(
5772    conn_handle: u16,
5773    p_oobd_own: *const ble_gap_lesc_oob_data_t,
5774    p_oobd_peer: *const ble_gap_lesc_oob_data_t,
5775) -> u32 {
5776    let ret: u32;
5777    core::arch::asm!("svc 132",
5778        inout("r0") to_asm(conn_handle) => ret,
5779        inout("r1") to_asm(p_oobd_own) => _,
5780        inout("r2") to_asm(p_oobd_peer) => _,
5781        lateout("r3") _,
5782        lateout("r12") _,
5783    );
5784    ret
5785}
5786
5787#[doc = "@brief Reply with GAP security information."]
5788#[doc = ""]
5789#[doc = " @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_INFO_REQUEST, calling it at other times will result in @ref NRF_ERROR_INVALID_STATE."]
5790#[doc = " @note    If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters."]
5791#[doc = " @note    Data signing is not yet supported, and p_sign_info must therefore be NULL."]
5792#[doc = ""]
5793#[doc = " @mscs"]
5794#[doc = " @mmsc{@ref BLE_GAP_PERIPH_ENC_MSC}"]
5795#[doc = " @endmscs"]
5796#[doc = ""]
5797#[doc = " @param[in] conn_handle Connection handle."]
5798#[doc = " @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure. May be NULL to signal none is available."]
5799#[doc = " @param[in] p_id_info Pointer to a @ref ble_gap_irk_t identity information structure. May be NULL to signal none is available."]
5800#[doc = " @param[in] p_sign_info Pointer to a @ref ble_gap_sign_info_t signing information structure. May be NULL to signal none is available."]
5801#[doc = ""]
5802#[doc = " @retval ::NRF_SUCCESS Successfully accepted security information."]
5803#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5804#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
5805#[doc = "                                   - No link has been established."]
5806#[doc = "                                   - No @ref BLE_GAP_EVT_SEC_REQUEST pending."]
5807#[doc = "                                   - Encryption information provided by the app without being requested. See @ref ble_gap_evt_sec_info_request_t::enc_info."]
5808#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5809#[inline(always)]
5810pub unsafe fn sd_ble_gap_sec_info_reply(
5811    conn_handle: u16,
5812    p_enc_info: *const ble_gap_enc_info_t,
5813    p_id_info: *const ble_gap_irk_t,
5814    p_sign_info: *const ble_gap_sign_info_t,
5815) -> u32 {
5816    let ret: u32;
5817    core::arch::asm!("svc 134",
5818        inout("r0") to_asm(conn_handle) => ret,
5819        inout("r1") to_asm(p_enc_info) => _,
5820        inout("r2") to_asm(p_id_info) => _,
5821        inout("r3") to_asm(p_sign_info) => _,
5822        lateout("r12") _,
5823    );
5824    ret
5825}
5826
5827#[doc = "@brief Get the current connection security."]
5828#[doc = ""]
5829#[doc = " @param[in]  conn_handle Connection handle."]
5830#[doc = " @param[out] p_conn_sec  Pointer to a @ref ble_gap_conn_sec_t structure to be filled in."]
5831#[doc = ""]
5832#[doc = " @retval ::NRF_SUCCESS Current connection security successfully retrieved."]
5833#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5834#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5835#[inline(always)]
5836pub unsafe fn sd_ble_gap_conn_sec_get(conn_handle: u16, p_conn_sec: *mut ble_gap_conn_sec_t) -> u32 {
5837    let ret: u32;
5838    core::arch::asm!("svc 135",
5839        inout("r0") to_asm(conn_handle) => ret,
5840        inout("r1") to_asm(p_conn_sec) => _,
5841        lateout("r2") _,
5842        lateout("r3") _,
5843        lateout("r12") _,
5844    );
5845    ret
5846}
5847
5848#[doc = "@brief Start reporting the received signal strength to the application."]
5849#[doc = ""]
5850#[doc = "        A new event is reported whenever the RSSI value changes, until @ref sd_ble_gap_rssi_stop is called."]
5851#[doc = ""]
5852#[doc = " @events"]
5853#[doc = " @event{@ref BLE_GAP_EVT_RSSI_CHANGED, New RSSI data available. How often the event is generated is"]
5854#[doc = "                                       dependent on the settings of the <code>threshold_dbm</code>"]
5855#[doc = "                                       and <code>skip_count</code> input parameters.}"]
5856#[doc = " @endevents"]
5857#[doc = ""]
5858#[doc = " @mscs"]
5859#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}"]
5860#[doc = " @mmsc{@ref BLE_GAP_RSSI_FILT_MSC}"]
5861#[doc = " @endmscs"]
5862#[doc = ""]
5863#[doc = " @param[in] conn_handle        Connection handle."]
5864#[doc = " @param[in] threshold_dbm      Minimum change in dBm before triggering the @ref BLE_GAP_EVT_RSSI_CHANGED event. Events are disabled if threshold_dbm equals @ref BLE_GAP_RSSI_THRESHOLD_INVALID."]
5865#[doc = " @param[in] skip_count         Number of RSSI samples with a change of threshold_dbm or more before sending a new @ref BLE_GAP_EVT_RSSI_CHANGED event."]
5866#[doc = ""]
5867#[doc = " @retval ::NRF_SUCCESS                   Successfully activated RSSI reporting."]
5868#[doc = " @retval ::NRF_ERROR_INVALID_STATE       RSSI reporting is already ongoing."]
5869#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5870#[inline(always)]
5871pub unsafe fn sd_ble_gap_rssi_start(conn_handle: u16, threshold_dbm: u8, skip_count: u8) -> u32 {
5872    let ret: u32;
5873    core::arch::asm!("svc 136",
5874        inout("r0") to_asm(conn_handle) => ret,
5875        inout("r1") to_asm(threshold_dbm) => _,
5876        inout("r2") to_asm(skip_count) => _,
5877        lateout("r3") _,
5878        lateout("r12") _,
5879    );
5880    ret
5881}
5882
5883#[doc = "@brief Stop reporting the received signal strength."]
5884#[doc = ""]
5885#[doc = " @note  An RSSI change detected before the call but not yet received by the application"]
5886#[doc = "        may be reported after @ref sd_ble_gap_rssi_stop has been called."]
5887#[doc = ""]
5888#[doc = " @mscs"]
5889#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}"]
5890#[doc = " @mmsc{@ref BLE_GAP_RSSI_FILT_MSC}"]
5891#[doc = " @endmscs"]
5892#[doc = ""]
5893#[doc = " @param[in] conn_handle Connection handle."]
5894#[doc = ""]
5895#[doc = " @retval ::NRF_SUCCESS                   Successfully deactivated RSSI reporting."]
5896#[doc = " @retval ::NRF_ERROR_INVALID_STATE       RSSI reporting is not ongoing."]
5897#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5898#[inline(always)]
5899pub unsafe fn sd_ble_gap_rssi_stop(conn_handle: u16) -> u32 {
5900    let ret: u32;
5901    core::arch::asm!("svc 137",
5902        inout("r0") to_asm(conn_handle) => ret,
5903        lateout("r1") _,
5904        lateout("r2") _,
5905        lateout("r3") _,
5906        lateout("r12") _,
5907    );
5908    ret
5909}
5910
5911#[doc = "@brief Get the received signal strength for the last connection event."]
5912#[doc = ""]
5913#[doc = "        @ref sd_ble_gap_rssi_start must be called to start reporting RSSI before using this function. @ref NRF_ERROR_NOT_FOUND"]
5914#[doc = "        will be returned until RSSI was sampled for the first time after calling @ref sd_ble_gap_rssi_start."]
5915#[doc = " @mscs"]
5916#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}"]
5917#[doc = " @endmscs"]
5918#[doc = ""]
5919#[doc = " @param[in]  conn_handle Connection handle."]
5920#[doc = " @param[out] p_rssi      Pointer to the location where the RSSI measurement shall be stored."]
5921#[doc = " @param[out] p_ch_index  Pointer to the location where Channel Index for the RSSI measurement shall be stored."]
5922#[doc = ""]
5923#[doc = " @retval ::NRF_SUCCESS                   Successfully read the RSSI."]
5924#[doc = " @retval ::NRF_ERROR_NOT_FOUND           No sample is available."]
5925#[doc = " @retval ::NRF_ERROR_INVALID_ADDR        Invalid pointer supplied."]
5926#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5927#[doc = " @retval ::NRF_ERROR_INVALID_STATE       RSSI reporting is not ongoing."]
5928#[inline(always)]
5929pub unsafe fn sd_ble_gap_rssi_get(conn_handle: u16, p_rssi: *mut i8, p_ch_index: *mut u8) -> u32 {
5930    let ret: u32;
5931    core::arch::asm!("svc 142",
5932        inout("r0") to_asm(conn_handle) => ret,
5933        inout("r1") to_asm(p_rssi) => _,
5934        inout("r2") to_asm(p_ch_index) => _,
5935        lateout("r3") _,
5936        lateout("r12") _,
5937    );
5938    ret
5939}
5940
5941#[doc = "@brief Initiate or respond to a PHY Update Procedure"]
5942#[doc = ""]
5943#[doc = " @details   This function is used to initiate or respond to a PHY Update Procedure. It will always"]
5944#[doc = "            generate a @ref BLE_GAP_EVT_PHY_UPDATE event if successfully executed."]
5945#[doc = "            If this function is used to initiate a PHY Update procedure and the only option"]
5946#[doc = "            provided in @ref ble_gap_phys_t::tx_phys and @ref ble_gap_phys_t::rx_phys is the"]
5947#[doc = "            currently active PHYs in the respective directions, the SoftDevice will generate a"]
5948#[doc = "            @ref BLE_GAP_EVT_PHY_UPDATE with the current PHYs set and will not initiate the"]
5949#[doc = "            procedure in the Link Layer."]
5950#[doc = ""]
5951#[doc = "            If @ref ble_gap_phys_t::tx_phys or @ref ble_gap_phys_t::rx_phys is @ref BLE_GAP_PHY_AUTO,"]
5952#[doc = "            then the stack will select PHYs based on the peer's PHY preferences and the local link"]
5953#[doc = "            configuration. The PHY Update procedure will for this case result in a PHY combination"]
5954#[doc = "            that respects the time constraints configured with @ref sd_ble_cfg_set and the current"]
5955#[doc = "            link layer data length."]
5956#[doc = ""]
5957#[doc = "            If the peer does not support the PHY Update Procedure, then the resulting"]
5958#[doc = "            @ref BLE_GAP_EVT_PHY_UPDATE event will have a status set to"]
5959#[doc = "            @ref BLE_HCI_UNSUPPORTED_REMOTE_FEATURE."]
5960#[doc = ""]
5961#[doc = "            If the PHY Update procedure was rejected by the peer due to a procedure collision, the status"]
5962#[doc = "            will be @ref BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION or"]
5963#[doc = "            @ref BLE_HCI_DIFFERENT_TRANSACTION_COLLISION."]
5964#[doc = "            If the peer responds to the PHY Update procedure with invalid parameters, the status"]
5965#[doc = "            will be @ref BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS."]
5966#[doc = "            If the PHY Update procedure was rejected by the peer for a different reason, the status will"]
5967#[doc = "            contain the reason as specified by the peer."]
5968#[doc = ""]
5969#[doc = " @events"]
5970#[doc = " @event{@ref BLE_GAP_EVT_PHY_UPDATE, Result of the PHY Update Procedure.}"]
5971#[doc = " @endevents"]
5972#[doc = ""]
5973#[doc = " @mscs"]
5974#[doc = " @mmsc{@ref BLE_GAP_PERIPHERAL_PHY_UPDATE}"]
5975#[doc = " @endmscs"]
5976#[doc = ""]
5977#[doc = " @param[in] conn_handle   Connection handle to indicate the connection for which the PHY Update is requested."]
5978#[doc = " @param[in] p_gap_phys    Pointer to PHY structure."]
5979#[doc = ""]
5980#[doc = " @retval ::NRF_SUCCESS Successfully requested a PHY Update."]
5981#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5982#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
5983#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
5984#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported PHYs supplied to the call."]
5985#[doc = " @retval ::NRF_ERROR_INVALID_STATE No link has been established."]
5986#[doc = " @retval ::NRF_ERROR_BUSY Procedure is already in progress or not allowed at this time. Process pending events and wait for the pending procedure to complete and retry."]
5987#[doc = ""]
5988#[inline(always)]
5989pub unsafe fn sd_ble_gap_phy_update(conn_handle: u16, p_gap_phys: *const ble_gap_phys_t) -> u32 {
5990    let ret: u32;
5991    core::arch::asm!("svc 143",
5992        inout("r0") to_asm(conn_handle) => ret,
5993        inout("r1") to_asm(p_gap_phys) => _,
5994        lateout("r2") _,
5995        lateout("r3") _,
5996        lateout("r12") _,
5997    );
5998    ret
5999}
6000
6001#[doc = "@brief Initiate or respond to a Data Length Update Procedure."]
6002#[doc = ""]
6003#[doc = " @note If the application uses @ref BLE_GAP_DATA_LENGTH_AUTO for one or more members of"]
6004#[doc = "       p_dl_params, the SoftDevice will choose the highest value supported in current"]
6005#[doc = "       configuration and connection parameters."]
6006#[doc = ""]
6007#[doc = " @param[in]   conn_handle       Connection handle."]
6008#[doc = " @param[in]   p_dl_params       Pointer to local parameters to be used in Data Length Update"]
6009#[doc = "                                Procedure. Set any member to @ref BLE_GAP_DATA_LENGTH_AUTO to let"]
6010#[doc = "                                the SoftDevice automatically decide the value for that member."]
6011#[doc = "                                Set to NULL to use automatic values for all members."]
6012#[doc = " @param[out]  p_dl_limitation   Pointer to limitation to be written when local device does not"]
6013#[doc = "                                have enough resources or does not support the requested Data Length"]
6014#[doc = "                                Update parameters. Ignored if NULL."]
6015#[doc = ""]
6016#[doc = " @mscs"]
6017#[doc = " @mmsc{@ref BLE_GAP_DATA_LENGTH_UPDATE_PROCEDURE_MSC}"]
6018#[doc = " @endmscs"]
6019#[doc = ""]
6020#[doc = " @retval ::NRF_SUCCESS Successfully set Data Length Extension initiation/response parameters."]
6021#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6022#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter supplied."]
6023#[doc = " @retval ::NRF_ERROR_INVALID_STATE No link has been established."]
6024#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters supplied."]
6025#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED The requested parameters are not supported by the SoftDevice. Inspect"]
6026#[doc = "                                   p_dl_limitation to see which parameter is not supported."]
6027#[doc = " @retval ::NRF_ERROR_RESOURCES The connection event length configured for this link is not sufficient for the requested parameters."]
6028#[doc = "                               Use @ref sd_ble_cfg_set with @ref BLE_CONN_CFG_GAP to increase the connection event length."]
6029#[doc = "                               Inspect p_dl_limitation to see where the limitation is."]
6030#[doc = " @retval ::NRF_ERROR_BUSY Peer has already initiated a Data Length Update Procedure. Process the"]
6031#[doc = "                          pending @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST event to respond."]
6032#[inline(always)]
6033pub unsafe fn sd_ble_gap_data_length_update(
6034    conn_handle: u16,
6035    p_dl_params: *const ble_gap_data_length_params_t,
6036    p_dl_limitation: *mut ble_gap_data_length_limitation_t,
6037) -> u32 {
6038    let ret: u32;
6039    core::arch::asm!("svc 144",
6040        inout("r0") to_asm(conn_handle) => ret,
6041        inout("r1") to_asm(p_dl_params) => _,
6042        inout("r2") to_asm(p_dl_limitation) => _,
6043        lateout("r3") _,
6044        lateout("r12") _,
6045    );
6046    ret
6047}
6048
6049#[doc = "@brief   Obtain the next connection event counter value."]
6050#[doc = ""]
6051#[doc = " @details The connection event counter is initialized to zero on the first connection event. The value is incremented"]
6052#[doc = "          by one for each connection event. For more information see Bluetooth Core Specification v5.0, Vol 6, Part B,"]
6053#[doc = "          Section 4.5.1."]
6054#[doc = ""]
6055#[doc = " @note    The connection event counter obtained through this API will be outdated if this API is called"]
6056#[doc = "          at the same time as the connection event counter is incremented."]
6057#[doc = ""]
6058#[doc = " @note    This API will always return the last connection event counter + 1."]
6059#[doc = "          The actual connection event may be multiple connection events later if:"]
6060#[doc = "           - Slave latency is enabled and there is no data to transmit or receive."]
6061#[doc = "           - Another role is scheduled with a higher priority at the same time as the next connection event."]
6062#[doc = ""]
6063#[doc = " @param[in]   conn_handle       Connection handle."]
6064#[doc = " @param[out]  p_counter         Pointer to the variable where the next connection event counter will be written."]
6065#[doc = ""]
6066#[doc = " @retval ::NRF_SUCCESS                   The connection event counter was successfully retrieved."]
6067#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter supplied."]
6068#[doc = " @retval ::NRF_ERROR_INVALID_ADDR        Invalid pointer supplied."]
6069#[inline(always)]
6070pub unsafe fn sd_ble_gap_next_conn_evt_counter_get(conn_handle: u16, p_counter: *mut u16) -> u32 {
6071    let ret: u32;
6072    core::arch::asm!("svc 148",
6073        inout("r0") to_asm(conn_handle) => ret,
6074        inout("r1") to_asm(p_counter) => _,
6075        lateout("r2") _,
6076        lateout("r3") _,
6077        lateout("r12") _,
6078    );
6079    ret
6080}
6081
6082#[doc = "@brief   Start triggering a given task on connection event start."]
6083#[doc = ""]
6084#[doc = " @details When enabled, this feature will trigger a PPI task at the start of connection events."]
6085#[doc = "          The application can configure the SoftDevice to trigger every N connection events starting from"]
6086#[doc = "          a given connection event counter. See also @ref ble_gap_conn_event_trigger_t."]
6087#[doc = ""]
6088#[doc = " @param[in]   conn_handle   Connection handle."]
6089#[doc = " @param[in]   p_params      Connection event trigger parameters."]
6090#[doc = ""]
6091#[doc = " @retval ::NRF_SUCCESS                   Success."]
6092#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6093#[doc = " @retval ::NRF_ERROR_INVALID_ADDR        Invalid pointer supplied."]
6094#[doc = " @retval ::NRF_ERROR_INVALID_PARAM       Invalid parameter supplied. See @ref ble_gap_conn_event_trigger_t."]
6095#[doc = " @retval ::NRF_ERROR_INVALID_STATE       Either:"]
6096#[doc = "                                         - Trying to start connection event triggering when it is already ongoing."]
6097#[doc = "                                         - @ref ble_gap_conn_event_trigger_t::conn_evt_counter_start is in the past."]
6098#[doc = "                                           Use @ref sd_ble_gap_next_conn_evt_counter_get to find a new value"]
6099#[doc = "to be used as ble_gap_conn_event_trigger_t::conn_evt_counter_start."]
6100#[inline(always)]
6101pub unsafe fn sd_ble_gap_conn_evt_trigger_start(
6102    conn_handle: u16,
6103    p_params: *const ble_gap_conn_event_trigger_t,
6104) -> u32 {
6105    let ret: u32;
6106    core::arch::asm!("svc 149",
6107        inout("r0") to_asm(conn_handle) => ret,
6108        inout("r1") to_asm(p_params) => _,
6109        lateout("r2") _,
6110        lateout("r3") _,
6111        lateout("r12") _,
6112    );
6113    ret
6114}
6115
6116#[doc = "@brief   Stop triggering the task configured using @ref sd_ble_gap_conn_evt_trigger_start."]
6117#[doc = ""]
6118#[doc = " @param[in]   conn_handle   Connection handle."]
6119#[doc = ""]
6120#[doc = " @retval ::NRF_SUCCESS                   Success."]
6121#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6122#[doc = " @retval ::NRF_ERROR_INVALID_STATE       Trying to stop connection event triggering when it is not enabled."]
6123#[inline(always)]
6124pub unsafe fn sd_ble_gap_conn_evt_trigger_stop(conn_handle: u16) -> u32 {
6125    let ret: u32;
6126    core::arch::asm!("svc 150",
6127        inout("r0") to_asm(conn_handle) => ret,
6128        lateout("r1") _,
6129        lateout("r2") _,
6130        lateout("r3") _,
6131        lateout("r12") _,
6132    );
6133    ret
6134}
6135
6136#[doc = "< Set up an L2CAP channel."]
6137pub const BLE_L2CAP_SVCS_SD_BLE_L2CAP_CH_SETUP: BLE_L2CAP_SVCS = 184;
6138#[doc = "< Release an L2CAP channel."]
6139pub const BLE_L2CAP_SVCS_SD_BLE_L2CAP_CH_RELEASE: BLE_L2CAP_SVCS = 185;
6140#[doc = "< Receive an SDU on an L2CAP channel."]
6141pub const BLE_L2CAP_SVCS_SD_BLE_L2CAP_CH_RX: BLE_L2CAP_SVCS = 186;
6142#[doc = "< Transmit an SDU on an L2CAP channel."]
6143pub const BLE_L2CAP_SVCS_SD_BLE_L2CAP_CH_TX: BLE_L2CAP_SVCS = 187;
6144#[doc = "< Advanced SDU reception flow control."]
6145pub const BLE_L2CAP_SVCS_SD_BLE_L2CAP_CH_FLOW_CONTROL: BLE_L2CAP_SVCS = 188;
6146#[doc = "@brief L2CAP API SVC numbers."]
6147pub type BLE_L2CAP_SVCS = self::c_uint;
6148#[doc = "< L2CAP Channel Setup Request event."]
6149#[doc = "\\n See @ref ble_l2cap_evt_ch_setup_request_t."]
6150pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_SETUP_REQUEST: BLE_L2CAP_EVTS = 112;
6151#[doc = "< L2CAP Channel Setup Refused event."]
6152#[doc = "\\n See @ref ble_l2cap_evt_ch_setup_refused_t."]
6153pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_SETUP_REFUSED: BLE_L2CAP_EVTS = 113;
6154#[doc = "< L2CAP Channel Setup Completed event."]
6155#[doc = "\\n See @ref ble_l2cap_evt_ch_setup_t."]
6156pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_SETUP: BLE_L2CAP_EVTS = 114;
6157#[doc = "< L2CAP Channel Released event."]
6158#[doc = "\\n No additional event structure applies."]
6159pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_RELEASED: BLE_L2CAP_EVTS = 115;
6160#[doc = "< L2CAP Channel SDU data buffer released event."]
6161#[doc = "\\n See @ref ble_l2cap_evt_ch_sdu_buf_released_t."]
6162pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED: BLE_L2CAP_EVTS = 116;
6163#[doc = "< L2CAP Channel Credit received."]
6164#[doc = "\\n See @ref ble_l2cap_evt_ch_credit_t."]
6165pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_CREDIT: BLE_L2CAP_EVTS = 117;
6166#[doc = "< L2CAP Channel SDU received."]
6167#[doc = "\\n See @ref ble_l2cap_evt_ch_rx_t."]
6168pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_RX: BLE_L2CAP_EVTS = 118;
6169#[doc = "< L2CAP Channel SDU transmitted."]
6170#[doc = "\\n See @ref ble_l2cap_evt_ch_tx_t."]
6171pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_TX: BLE_L2CAP_EVTS = 119;
6172#[doc = "@brief L2CAP Event IDs."]
6173pub type BLE_L2CAP_EVTS = self::c_uint;
6174#[doc = " @brief BLE L2CAP connection configuration parameters, set with @ref sd_ble_cfg_set."]
6175#[doc = ""]
6176#[doc = " @note  These parameters are set per connection, so all L2CAP channels created on this connection"]
6177#[doc = "        will have the same parameters."]
6178#[doc = ""]
6179#[doc = " @retval ::NRF_ERROR_INVALID_PARAM  One or more of the following is true:"]
6180#[doc = "                                    - rx_mps is smaller than @ref BLE_L2CAP_MPS_MIN."]
6181#[doc = "                                    - tx_mps is smaller than @ref BLE_L2CAP_MPS_MIN."]
6182#[doc = "                                    - ch_count is greater than @ref BLE_L2CAP_CH_COUNT_MAX."]
6183#[doc = " @retval ::NRF_ERROR_NO_MEM         rx_mps or tx_mps is set too high."]
6184#[repr(C)]
6185#[derive(Debug, Copy, Clone)]
6186pub struct ble_l2cap_conn_cfg_t {
6187    #[doc = "< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall"]
6188    #[doc = "be able to receive on L2CAP channels on connections with this"]
6189    #[doc = "configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN."]
6190    pub rx_mps: u16,
6191    #[doc = "< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall"]
6192    #[doc = "be able to transmit on L2CAP channels on connections with this"]
6193    #[doc = "configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN."]
6194    pub tx_mps: u16,
6195    #[doc = "< Number of SDU data buffers that can be queued for reception per"]
6196    #[doc = "L2CAP channel. The minimum value is one."]
6197    pub rx_queue_size: u8,
6198    #[doc = "< Number of SDU data buffers that can be queued for transmission"]
6199    #[doc = "per L2CAP channel. The minimum value is one."]
6200    pub tx_queue_size: u8,
6201    #[doc = "< Number of L2CAP channels the application can create per connection"]
6202    #[doc = "with this configuration. The default value is zero, the maximum"]
6203    #[doc = "value is @ref BLE_L2CAP_CH_COUNT_MAX."]
6204    #[doc = "@note if this parameter is set to zero, all other parameters in"]
6205    #[doc = "@ref ble_l2cap_conn_cfg_t are ignored."]
6206    pub ch_count: u8,
6207}
6208#[test]
6209fn bindgen_test_layout_ble_l2cap_conn_cfg_t() {
6210    assert_eq!(
6211        ::core::mem::size_of::<ble_l2cap_conn_cfg_t>(),
6212        8usize,
6213        concat!("Size of: ", stringify!(ble_l2cap_conn_cfg_t))
6214    );
6215    assert_eq!(
6216        ::core::mem::align_of::<ble_l2cap_conn_cfg_t>(),
6217        2usize,
6218        concat!("Alignment of ", stringify!(ble_l2cap_conn_cfg_t))
6219    );
6220    assert_eq!(
6221        unsafe { &(*(::core::ptr::null::<ble_l2cap_conn_cfg_t>())).rx_mps as *const _ as usize },
6222        0usize,
6223        concat!(
6224            "Offset of field: ",
6225            stringify!(ble_l2cap_conn_cfg_t),
6226            "::",
6227            stringify!(rx_mps)
6228        )
6229    );
6230    assert_eq!(
6231        unsafe { &(*(::core::ptr::null::<ble_l2cap_conn_cfg_t>())).tx_mps as *const _ as usize },
6232        2usize,
6233        concat!(
6234            "Offset of field: ",
6235            stringify!(ble_l2cap_conn_cfg_t),
6236            "::",
6237            stringify!(tx_mps)
6238        )
6239    );
6240    assert_eq!(
6241        unsafe { &(*(::core::ptr::null::<ble_l2cap_conn_cfg_t>())).rx_queue_size as *const _ as usize },
6242        4usize,
6243        concat!(
6244            "Offset of field: ",
6245            stringify!(ble_l2cap_conn_cfg_t),
6246            "::",
6247            stringify!(rx_queue_size)
6248        )
6249    );
6250    assert_eq!(
6251        unsafe { &(*(::core::ptr::null::<ble_l2cap_conn_cfg_t>())).tx_queue_size as *const _ as usize },
6252        5usize,
6253        concat!(
6254            "Offset of field: ",
6255            stringify!(ble_l2cap_conn_cfg_t),
6256            "::",
6257            stringify!(tx_queue_size)
6258        )
6259    );
6260    assert_eq!(
6261        unsafe { &(*(::core::ptr::null::<ble_l2cap_conn_cfg_t>())).ch_count as *const _ as usize },
6262        6usize,
6263        concat!(
6264            "Offset of field: ",
6265            stringify!(ble_l2cap_conn_cfg_t),
6266            "::",
6267            stringify!(ch_count)
6268        )
6269    );
6270}
6271#[doc = "@brief L2CAP channel RX parameters."]
6272#[repr(C)]
6273#[derive(Debug, Copy, Clone)]
6274pub struct ble_l2cap_ch_rx_params_t {
6275    #[doc = "< The maximum L2CAP SDU size, in bytes, that L2CAP shall be able to"]
6276    #[doc = "receive on this L2CAP channel."]
6277    #[doc = "- Must be equal to or greater than @ref BLE_L2CAP_MTU_MIN."]
6278    pub rx_mtu: u16,
6279    #[doc = "< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall be"]
6280    #[doc = "able to receive on this L2CAP channel."]
6281    #[doc = "- Must be equal to or greater than @ref BLE_L2CAP_MPS_MIN."]
6282    #[doc = "- Must be equal to or less than @ref ble_l2cap_conn_cfg_t::rx_mps."]
6283    pub rx_mps: u16,
6284    #[doc = "< SDU data buffer for reception."]
6285    #[doc = "- If @ref ble_data_t::p_data is non-NULL, initial credits are"]
6286    #[doc = "issued to the peer."]
6287    #[doc = "- If @ref ble_data_t::p_data is NULL, no initial credits are"]
6288    #[doc = "issued to the peer."]
6289    pub sdu_buf: ble_data_t,
6290}
6291#[test]
6292fn bindgen_test_layout_ble_l2cap_ch_rx_params_t() {
6293    assert_eq!(
6294        ::core::mem::size_of::<ble_l2cap_ch_rx_params_t>(),
6295        12usize,
6296        concat!("Size of: ", stringify!(ble_l2cap_ch_rx_params_t))
6297    );
6298    assert_eq!(
6299        ::core::mem::align_of::<ble_l2cap_ch_rx_params_t>(),
6300        4usize,
6301        concat!("Alignment of ", stringify!(ble_l2cap_ch_rx_params_t))
6302    );
6303    assert_eq!(
6304        unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_rx_params_t>())).rx_mtu as *const _ as usize },
6305        0usize,
6306        concat!(
6307            "Offset of field: ",
6308            stringify!(ble_l2cap_ch_rx_params_t),
6309            "::",
6310            stringify!(rx_mtu)
6311        )
6312    );
6313    assert_eq!(
6314        unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_rx_params_t>())).rx_mps as *const _ as usize },
6315        2usize,
6316        concat!(
6317            "Offset of field: ",
6318            stringify!(ble_l2cap_ch_rx_params_t),
6319            "::",
6320            stringify!(rx_mps)
6321        )
6322    );
6323    assert_eq!(
6324        unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_rx_params_t>())).sdu_buf as *const _ as usize },
6325        4usize,
6326        concat!(
6327            "Offset of field: ",
6328            stringify!(ble_l2cap_ch_rx_params_t),
6329            "::",
6330            stringify!(sdu_buf)
6331        )
6332    );
6333}
6334#[doc = "@brief L2CAP channel setup parameters."]
6335#[repr(C)]
6336#[derive(Debug, Copy, Clone)]
6337pub struct ble_l2cap_ch_setup_params_t {
6338    #[doc = "< L2CAP channel RX parameters."]
6339    pub rx_params: ble_l2cap_ch_rx_params_t,
6340    #[doc = "< LE Protocol/Service Multiplexer. Used when requesting"]
6341    #[doc = "setup of an L2CAP channel, ignored otherwise."]
6342    pub le_psm: u16,
6343    #[doc = "< Status code, see @ref BLE_L2CAP_CH_STATUS_CODES."]
6344    #[doc = "Used when replying to a setup request of an L2CAP"]
6345    #[doc = "channel, ignored otherwise."]
6346    pub status: u16,
6347}
6348#[test]
6349fn bindgen_test_layout_ble_l2cap_ch_setup_params_t() {
6350    assert_eq!(
6351        ::core::mem::size_of::<ble_l2cap_ch_setup_params_t>(),
6352        16usize,
6353        concat!("Size of: ", stringify!(ble_l2cap_ch_setup_params_t))
6354    );
6355    assert_eq!(
6356        ::core::mem::align_of::<ble_l2cap_ch_setup_params_t>(),
6357        4usize,
6358        concat!("Alignment of ", stringify!(ble_l2cap_ch_setup_params_t))
6359    );
6360    assert_eq!(
6361        unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_setup_params_t>())).rx_params as *const _ as usize },
6362        0usize,
6363        concat!(
6364            "Offset of field: ",
6365            stringify!(ble_l2cap_ch_setup_params_t),
6366            "::",
6367            stringify!(rx_params)
6368        )
6369    );
6370    assert_eq!(
6371        unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_setup_params_t>())).le_psm as *const _ as usize },
6372        12usize,
6373        concat!(
6374            "Offset of field: ",
6375            stringify!(ble_l2cap_ch_setup_params_t),
6376            "::",
6377            stringify!(le_psm)
6378        )
6379    );
6380    assert_eq!(
6381        unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_setup_params_t>())).status as *const _ as usize },
6382        14usize,
6383        concat!(
6384            "Offset of field: ",
6385            stringify!(ble_l2cap_ch_setup_params_t),
6386            "::",
6387            stringify!(status)
6388        )
6389    );
6390}
6391#[doc = "@brief L2CAP channel TX parameters."]
6392#[repr(C)]
6393#[derive(Debug, Copy, Clone)]
6394pub struct ble_l2cap_ch_tx_params_t {
6395    #[doc = "< The maximum L2CAP SDU size, in bytes, that L2CAP is able to"]
6396    #[doc = "transmit on this L2CAP channel."]
6397    pub tx_mtu: u16,
6398    #[doc = "< The maximum L2CAP PDU payload size, in bytes, that the peer is"]
6399    #[doc = "able to receive on this L2CAP channel."]
6400    pub peer_mps: u16,
6401    #[doc = "< The maximum L2CAP PDU payload size, in bytes, that L2CAP is able"]
6402    #[doc = "to transmit on this L2CAP channel. This is effective tx_mps,"]
6403    #[doc = "selected by the SoftDevice as"]
6404    #[doc = "MIN( @ref ble_l2cap_ch_tx_params_t::peer_mps, @ref ble_l2cap_conn_cfg_t::tx_mps )"]
6405    pub tx_mps: u16,
6406    #[doc = "< Initial credits given by the peer."]
6407    pub credits: u16,
6408}
6409#[test]
6410fn bindgen_test_layout_ble_l2cap_ch_tx_params_t() {
6411    assert_eq!(
6412        ::core::mem::size_of::<ble_l2cap_ch_tx_params_t>(),
6413        8usize,
6414        concat!("Size of: ", stringify!(ble_l2cap_ch_tx_params_t))
6415    );
6416    assert_eq!(
6417        ::core::mem::align_of::<ble_l2cap_ch_tx_params_t>(),
6418        2usize,
6419        concat!("Alignment of ", stringify!(ble_l2cap_ch_tx_params_t))
6420    );
6421    assert_eq!(
6422        unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_tx_params_t>())).tx_mtu as *const _ as usize },
6423        0usize,
6424        concat!(
6425            "Offset of field: ",
6426            stringify!(ble_l2cap_ch_tx_params_t),
6427            "::",
6428            stringify!(tx_mtu)
6429        )
6430    );
6431    assert_eq!(
6432        unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_tx_params_t>())).peer_mps as *const _ as usize },
6433        2usize,
6434        concat!(
6435            "Offset of field: ",
6436            stringify!(ble_l2cap_ch_tx_params_t),
6437            "::",
6438            stringify!(peer_mps)
6439        )
6440    );
6441    assert_eq!(
6442        unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_tx_params_t>())).tx_mps as *const _ as usize },
6443        4usize,
6444        concat!(
6445            "Offset of field: ",
6446            stringify!(ble_l2cap_ch_tx_params_t),
6447            "::",
6448            stringify!(tx_mps)
6449        )
6450    );
6451    assert_eq!(
6452        unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_tx_params_t>())).credits as *const _ as usize },
6453        6usize,
6454        concat!(
6455            "Offset of field: ",
6456            stringify!(ble_l2cap_ch_tx_params_t),
6457            "::",
6458            stringify!(credits)
6459        )
6460    );
6461}
6462#[doc = "@brief L2CAP Channel Setup Request event."]
6463#[repr(C)]
6464#[derive(Debug, Copy, Clone)]
6465pub struct ble_l2cap_evt_ch_setup_request_t {
6466    #[doc = "< L2CAP channel TX parameters."]
6467    pub tx_params: ble_l2cap_ch_tx_params_t,
6468    #[doc = "< LE Protocol/Service Multiplexer."]
6469    pub le_psm: u16,
6470}
6471#[test]
6472fn bindgen_test_layout_ble_l2cap_evt_ch_setup_request_t() {
6473    assert_eq!(
6474        ::core::mem::size_of::<ble_l2cap_evt_ch_setup_request_t>(),
6475        10usize,
6476        concat!("Size of: ", stringify!(ble_l2cap_evt_ch_setup_request_t))
6477    );
6478    assert_eq!(
6479        ::core::mem::align_of::<ble_l2cap_evt_ch_setup_request_t>(),
6480        2usize,
6481        concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_setup_request_t))
6482    );
6483    assert_eq!(
6484        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_setup_request_t>())).tx_params as *const _ as usize },
6485        0usize,
6486        concat!(
6487            "Offset of field: ",
6488            stringify!(ble_l2cap_evt_ch_setup_request_t),
6489            "::",
6490            stringify!(tx_params)
6491        )
6492    );
6493    assert_eq!(
6494        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_setup_request_t>())).le_psm as *const _ as usize },
6495        8usize,
6496        concat!(
6497            "Offset of field: ",
6498            stringify!(ble_l2cap_evt_ch_setup_request_t),
6499            "::",
6500            stringify!(le_psm)
6501        )
6502    );
6503}
6504#[doc = "@brief L2CAP Channel Setup Refused event."]
6505#[repr(C)]
6506#[derive(Debug, Copy, Clone)]
6507pub struct ble_l2cap_evt_ch_setup_refused_t {
6508    #[doc = "< Source, see @ref BLE_L2CAP_CH_SETUP_REFUSED_SRCS"]
6509    pub source: u8,
6510    #[doc = "< Status code, see @ref BLE_L2CAP_CH_STATUS_CODES"]
6511    pub status: u16,
6512}
6513#[test]
6514fn bindgen_test_layout_ble_l2cap_evt_ch_setup_refused_t() {
6515    assert_eq!(
6516        ::core::mem::size_of::<ble_l2cap_evt_ch_setup_refused_t>(),
6517        4usize,
6518        concat!("Size of: ", stringify!(ble_l2cap_evt_ch_setup_refused_t))
6519    );
6520    assert_eq!(
6521        ::core::mem::align_of::<ble_l2cap_evt_ch_setup_refused_t>(),
6522        2usize,
6523        concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_setup_refused_t))
6524    );
6525    assert_eq!(
6526        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_setup_refused_t>())).source as *const _ as usize },
6527        0usize,
6528        concat!(
6529            "Offset of field: ",
6530            stringify!(ble_l2cap_evt_ch_setup_refused_t),
6531            "::",
6532            stringify!(source)
6533        )
6534    );
6535    assert_eq!(
6536        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_setup_refused_t>())).status as *const _ as usize },
6537        2usize,
6538        concat!(
6539            "Offset of field: ",
6540            stringify!(ble_l2cap_evt_ch_setup_refused_t),
6541            "::",
6542            stringify!(status)
6543        )
6544    );
6545}
6546#[doc = "@brief L2CAP Channel Setup Completed event."]
6547#[repr(C)]
6548#[derive(Debug, Copy, Clone)]
6549pub struct ble_l2cap_evt_ch_setup_t {
6550    #[doc = "< L2CAP channel TX parameters."]
6551    pub tx_params: ble_l2cap_ch_tx_params_t,
6552}
6553#[test]
6554fn bindgen_test_layout_ble_l2cap_evt_ch_setup_t() {
6555    assert_eq!(
6556        ::core::mem::size_of::<ble_l2cap_evt_ch_setup_t>(),
6557        8usize,
6558        concat!("Size of: ", stringify!(ble_l2cap_evt_ch_setup_t))
6559    );
6560    assert_eq!(
6561        ::core::mem::align_of::<ble_l2cap_evt_ch_setup_t>(),
6562        2usize,
6563        concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_setup_t))
6564    );
6565    assert_eq!(
6566        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_setup_t>())).tx_params as *const _ as usize },
6567        0usize,
6568        concat!(
6569            "Offset of field: ",
6570            stringify!(ble_l2cap_evt_ch_setup_t),
6571            "::",
6572            stringify!(tx_params)
6573        )
6574    );
6575}
6576#[doc = "@brief L2CAP Channel SDU Data Buffer Released event."]
6577#[repr(C)]
6578#[derive(Debug, Copy, Clone)]
6579pub struct ble_l2cap_evt_ch_sdu_buf_released_t {
6580    #[doc = "< Returned reception or transmission SDU data buffer. The SoftDevice"]
6581    #[doc = "returns SDU data buffers supplied by the application, which have"]
6582    #[doc = "not yet been returned previously via a @ref BLE_L2CAP_EVT_CH_RX or"]
6583    #[doc = "@ref BLE_L2CAP_EVT_CH_TX event."]
6584    pub sdu_buf: ble_data_t,
6585}
6586#[test]
6587fn bindgen_test_layout_ble_l2cap_evt_ch_sdu_buf_released_t() {
6588    assert_eq!(
6589        ::core::mem::size_of::<ble_l2cap_evt_ch_sdu_buf_released_t>(),
6590        8usize,
6591        concat!("Size of: ", stringify!(ble_l2cap_evt_ch_sdu_buf_released_t))
6592    );
6593    assert_eq!(
6594        ::core::mem::align_of::<ble_l2cap_evt_ch_sdu_buf_released_t>(),
6595        4usize,
6596        concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_sdu_buf_released_t))
6597    );
6598    assert_eq!(
6599        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_sdu_buf_released_t>())).sdu_buf as *const _ as usize },
6600        0usize,
6601        concat!(
6602            "Offset of field: ",
6603            stringify!(ble_l2cap_evt_ch_sdu_buf_released_t),
6604            "::",
6605            stringify!(sdu_buf)
6606        )
6607    );
6608}
6609#[doc = "@brief L2CAP Channel Credit received event."]
6610#[repr(C)]
6611#[derive(Debug, Copy, Clone)]
6612pub struct ble_l2cap_evt_ch_credit_t {
6613    #[doc = "< Additional credits given by the peer."]
6614    pub credits: u16,
6615}
6616#[test]
6617fn bindgen_test_layout_ble_l2cap_evt_ch_credit_t() {
6618    assert_eq!(
6619        ::core::mem::size_of::<ble_l2cap_evt_ch_credit_t>(),
6620        2usize,
6621        concat!("Size of: ", stringify!(ble_l2cap_evt_ch_credit_t))
6622    );
6623    assert_eq!(
6624        ::core::mem::align_of::<ble_l2cap_evt_ch_credit_t>(),
6625        2usize,
6626        concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_credit_t))
6627    );
6628    assert_eq!(
6629        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_credit_t>())).credits as *const _ as usize },
6630        0usize,
6631        concat!(
6632            "Offset of field: ",
6633            stringify!(ble_l2cap_evt_ch_credit_t),
6634            "::",
6635            stringify!(credits)
6636        )
6637    );
6638}
6639#[doc = "@brief L2CAP Channel received SDU event."]
6640#[repr(C)]
6641#[derive(Debug, Copy, Clone)]
6642pub struct ble_l2cap_evt_ch_rx_t {
6643    #[doc = "< Total SDU length, in bytes."]
6644    pub sdu_len: u16,
6645    #[doc = "< SDU data buffer."]
6646    #[doc = "@note If there is not enough space in the buffer"]
6647    #[doc = "(sdu_buf.len < sdu_len) then the rest of the SDU will be"]
6648    #[doc = "silently discarded by the SoftDevice."]
6649    pub sdu_buf: ble_data_t,
6650}
6651#[test]
6652fn bindgen_test_layout_ble_l2cap_evt_ch_rx_t() {
6653    assert_eq!(
6654        ::core::mem::size_of::<ble_l2cap_evt_ch_rx_t>(),
6655        12usize,
6656        concat!("Size of: ", stringify!(ble_l2cap_evt_ch_rx_t))
6657    );
6658    assert_eq!(
6659        ::core::mem::align_of::<ble_l2cap_evt_ch_rx_t>(),
6660        4usize,
6661        concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_rx_t))
6662    );
6663    assert_eq!(
6664        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_rx_t>())).sdu_len as *const _ as usize },
6665        0usize,
6666        concat!(
6667            "Offset of field: ",
6668            stringify!(ble_l2cap_evt_ch_rx_t),
6669            "::",
6670            stringify!(sdu_len)
6671        )
6672    );
6673    assert_eq!(
6674        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_rx_t>())).sdu_buf as *const _ as usize },
6675        4usize,
6676        concat!(
6677            "Offset of field: ",
6678            stringify!(ble_l2cap_evt_ch_rx_t),
6679            "::",
6680            stringify!(sdu_buf)
6681        )
6682    );
6683}
6684#[doc = "@brief L2CAP Channel transmitted SDU event."]
6685#[repr(C)]
6686#[derive(Debug, Copy, Clone)]
6687pub struct ble_l2cap_evt_ch_tx_t {
6688    #[doc = "< SDU data buffer."]
6689    pub sdu_buf: ble_data_t,
6690}
6691#[test]
6692fn bindgen_test_layout_ble_l2cap_evt_ch_tx_t() {
6693    assert_eq!(
6694        ::core::mem::size_of::<ble_l2cap_evt_ch_tx_t>(),
6695        8usize,
6696        concat!("Size of: ", stringify!(ble_l2cap_evt_ch_tx_t))
6697    );
6698    assert_eq!(
6699        ::core::mem::align_of::<ble_l2cap_evt_ch_tx_t>(),
6700        4usize,
6701        concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_tx_t))
6702    );
6703    assert_eq!(
6704        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_tx_t>())).sdu_buf as *const _ as usize },
6705        0usize,
6706        concat!(
6707            "Offset of field: ",
6708            stringify!(ble_l2cap_evt_ch_tx_t),
6709            "::",
6710            stringify!(sdu_buf)
6711        )
6712    );
6713}
6714#[doc = "@brief L2CAP event structure."]
6715#[repr(C)]
6716#[derive(Copy, Clone)]
6717pub struct ble_l2cap_evt_t {
6718    #[doc = "< Connection Handle on which the event occured."]
6719    pub conn_handle: u16,
6720    #[doc = "< Local Channel ID of the L2CAP channel, or"]
6721    #[doc = "@ref BLE_L2CAP_CID_INVALID if not present."]
6722    pub local_cid: u16,
6723    #[doc = "< Event Parameters."]
6724    pub params: ble_l2cap_evt_t__bindgen_ty_1,
6725}
6726#[repr(C)]
6727#[derive(Copy, Clone)]
6728pub union ble_l2cap_evt_t__bindgen_ty_1 {
6729    #[doc = "< L2CAP Channel Setup Request Event Parameters."]
6730    pub ch_setup_request: ble_l2cap_evt_ch_setup_request_t,
6731    #[doc = "< L2CAP Channel Setup Refused Event Parameters."]
6732    pub ch_setup_refused: ble_l2cap_evt_ch_setup_refused_t,
6733    #[doc = "< L2CAP Channel Setup Completed Event Parameters."]
6734    pub ch_setup: ble_l2cap_evt_ch_setup_t,
6735    #[doc = "< L2CAP Channel SDU Data Buffer Released Event Parameters."]
6736    pub ch_sdu_buf_released: ble_l2cap_evt_ch_sdu_buf_released_t,
6737    #[doc = "< L2CAP Channel Credit Received Event Parameters."]
6738    pub credit: ble_l2cap_evt_ch_credit_t,
6739    #[doc = "< L2CAP Channel SDU Received Event Parameters."]
6740    pub rx: ble_l2cap_evt_ch_rx_t,
6741    #[doc = "< L2CAP Channel SDU Transmitted Event Parameters."]
6742    pub tx: ble_l2cap_evt_ch_tx_t,
6743    _bindgen_union_align: [u32; 3usize],
6744}
6745#[test]
6746fn bindgen_test_layout_ble_l2cap_evt_t__bindgen_ty_1() {
6747    assert_eq!(
6748        ::core::mem::size_of::<ble_l2cap_evt_t__bindgen_ty_1>(),
6749        12usize,
6750        concat!("Size of: ", stringify!(ble_l2cap_evt_t__bindgen_ty_1))
6751    );
6752    assert_eq!(
6753        ::core::mem::align_of::<ble_l2cap_evt_t__bindgen_ty_1>(),
6754        4usize,
6755        concat!("Alignment of ", stringify!(ble_l2cap_evt_t__bindgen_ty_1))
6756    );
6757    assert_eq!(
6758        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).ch_setup_request as *const _ as usize },
6759        0usize,
6760        concat!(
6761            "Offset of field: ",
6762            stringify!(ble_l2cap_evt_t__bindgen_ty_1),
6763            "::",
6764            stringify!(ch_setup_request)
6765        )
6766    );
6767    assert_eq!(
6768        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).ch_setup_refused as *const _ as usize },
6769        0usize,
6770        concat!(
6771            "Offset of field: ",
6772            stringify!(ble_l2cap_evt_t__bindgen_ty_1),
6773            "::",
6774            stringify!(ch_setup_refused)
6775        )
6776    );
6777    assert_eq!(
6778        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).ch_setup as *const _ as usize },
6779        0usize,
6780        concat!(
6781            "Offset of field: ",
6782            stringify!(ble_l2cap_evt_t__bindgen_ty_1),
6783            "::",
6784            stringify!(ch_setup)
6785        )
6786    );
6787    assert_eq!(
6788        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).ch_sdu_buf_released as *const _ as usize },
6789        0usize,
6790        concat!(
6791            "Offset of field: ",
6792            stringify!(ble_l2cap_evt_t__bindgen_ty_1),
6793            "::",
6794            stringify!(ch_sdu_buf_released)
6795        )
6796    );
6797    assert_eq!(
6798        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).credit as *const _ as usize },
6799        0usize,
6800        concat!(
6801            "Offset of field: ",
6802            stringify!(ble_l2cap_evt_t__bindgen_ty_1),
6803            "::",
6804            stringify!(credit)
6805        )
6806    );
6807    assert_eq!(
6808        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).rx as *const _ as usize },
6809        0usize,
6810        concat!(
6811            "Offset of field: ",
6812            stringify!(ble_l2cap_evt_t__bindgen_ty_1),
6813            "::",
6814            stringify!(rx)
6815        )
6816    );
6817    assert_eq!(
6818        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).tx as *const _ as usize },
6819        0usize,
6820        concat!(
6821            "Offset of field: ",
6822            stringify!(ble_l2cap_evt_t__bindgen_ty_1),
6823            "::",
6824            stringify!(tx)
6825        )
6826    );
6827}
6828#[test]
6829fn bindgen_test_layout_ble_l2cap_evt_t() {
6830    assert_eq!(
6831        ::core::mem::size_of::<ble_l2cap_evt_t>(),
6832        16usize,
6833        concat!("Size of: ", stringify!(ble_l2cap_evt_t))
6834    );
6835    assert_eq!(
6836        ::core::mem::align_of::<ble_l2cap_evt_t>(),
6837        4usize,
6838        concat!("Alignment of ", stringify!(ble_l2cap_evt_t))
6839    );
6840    assert_eq!(
6841        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t>())).conn_handle as *const _ as usize },
6842        0usize,
6843        concat!(
6844            "Offset of field: ",
6845            stringify!(ble_l2cap_evt_t),
6846            "::",
6847            stringify!(conn_handle)
6848        )
6849    );
6850    assert_eq!(
6851        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t>())).local_cid as *const _ as usize },
6852        2usize,
6853        concat!(
6854            "Offset of field: ",
6855            stringify!(ble_l2cap_evt_t),
6856            "::",
6857            stringify!(local_cid)
6858        )
6859    );
6860    assert_eq!(
6861        unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t>())).params as *const _ as usize },
6862        4usize,
6863        concat!(
6864            "Offset of field: ",
6865            stringify!(ble_l2cap_evt_t),
6866            "::",
6867            stringify!(params)
6868        )
6869    );
6870}
6871
6872#[doc = "@brief Set up an L2CAP channel."]
6873#[doc = ""]
6874#[doc = " @details This function is used to:"]
6875#[doc = "          - Request setup of an L2CAP channel: sends an LE Credit Based Connection Request packet to a peer."]
6876#[doc = "          - Reply to a setup request of an L2CAP channel (if called in response to a"]
6877#[doc = "            @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST event): sends an LE Credit Based Connection"]
6878#[doc = "            Response packet to a peer."]
6879#[doc = ""]
6880#[doc = " @note    A call to this function will require the application to keep the SDU data buffer alive"]
6881#[doc = "          until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX or"]
6882#[doc = "          @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event."]
6883#[doc = ""]
6884#[doc = " @events"]
6885#[doc = " @event{@ref BLE_L2CAP_EVT_CH_SETUP, Setup successful.}"]
6886#[doc = " @event{@ref BLE_L2CAP_EVT_CH_SETUP_REFUSED, Setup failed.}"]
6887#[doc = " @endevents"]
6888#[doc = ""]
6889#[doc = " @mscs"]
6890#[doc = " @mmsc{@ref BLE_L2CAP_CH_SETUP_MSC}"]
6891#[doc = " @endmscs"]
6892#[doc = ""]
6893#[doc = " @param[in] conn_handle      Connection Handle."]
6894#[doc = " @param[in,out] p_local_cid  Pointer to a uint16_t containing Local Channel ID of the L2CAP channel:"]
6895#[doc = "                             - As input: @ref BLE_L2CAP_CID_INVALID when requesting setup of an L2CAP"]
6896#[doc = "                               channel or local_cid provided in the @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST"]
6897#[doc = "                               event when replying to a setup request of an L2CAP channel."]
6898#[doc = "                             - As output: local_cid for this channel."]
6899#[doc = " @param[in] p_params         L2CAP channel parameters."]
6900#[doc = ""]
6901#[doc = " @retval ::NRF_SUCCESS                    Successfully queued request or response for transmission."]
6902#[doc = " @retval ::NRF_ERROR_BUSY                 The stack is busy, process pending events and retry."]
6903#[doc = " @retval ::NRF_ERROR_INVALID_ADDR         Invalid pointer supplied."]
6904#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE  Invalid Connection Handle."]
6905#[doc = " @retval ::NRF_ERROR_INVALID_PARAM        Invalid parameter(s) supplied."]
6906#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH       Supplied higher rx_mps than has been configured on this link."]
6907#[doc = " @retval ::NRF_ERROR_INVALID_STATE        Invalid State to perform operation (L2CAP channel already set up)."]
6908#[doc = " @retval ::NRF_ERROR_NOT_FOUND            CID not found."]
6909#[doc = " @retval ::NRF_ERROR_RESOURCES            The limit has been reached for available L2CAP channels,"]
6910#[doc = "                                          see @ref ble_l2cap_conn_cfg_t::ch_count."]
6911#[inline(always)]
6912pub unsafe fn sd_ble_l2cap_ch_setup(
6913    conn_handle: u16,
6914    p_local_cid: *mut u16,
6915    p_params: *const ble_l2cap_ch_setup_params_t,
6916) -> u32 {
6917    let ret: u32;
6918    core::arch::asm!("svc 184",
6919        inout("r0") to_asm(conn_handle) => ret,
6920        inout("r1") to_asm(p_local_cid) => _,
6921        inout("r2") to_asm(p_params) => _,
6922        lateout("r3") _,
6923        lateout("r12") _,
6924    );
6925    ret
6926}
6927
6928#[doc = "@brief Release an L2CAP channel."]
6929#[doc = ""]
6930#[doc = " @details This sends a Disconnection Request packet to a peer."]
6931#[doc = ""]
6932#[doc = " @events"]
6933#[doc = " @event{@ref BLE_L2CAP_EVT_CH_RELEASED, Release complete.}"]
6934#[doc = " @endevents"]
6935#[doc = ""]
6936#[doc = " @mscs"]
6937#[doc = " @mmsc{@ref BLE_L2CAP_CH_RELEASE_MSC}"]
6938#[doc = " @endmscs"]
6939#[doc = ""]
6940#[doc = " @param[in] conn_handle   Connection Handle."]
6941#[doc = " @param[in] local_cid     Local Channel ID of the L2CAP channel."]
6942#[doc = ""]
6943#[doc = " @retval ::NRF_SUCCESS                    Successfully queued request for transmission."]
6944#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE  Invalid Connection Handle."]
6945#[doc = " @retval ::NRF_ERROR_INVALID_STATE        Invalid State to perform operation (Setup or release is"]
6946#[doc = "                                          in progress for the L2CAP channel)."]
6947#[doc = " @retval ::NRF_ERROR_NOT_FOUND            CID not found."]
6948#[inline(always)]
6949pub unsafe fn sd_ble_l2cap_ch_release(conn_handle: u16, local_cid: u16) -> u32 {
6950    let ret: u32;
6951    core::arch::asm!("svc 185",
6952        inout("r0") to_asm(conn_handle) => ret,
6953        inout("r1") to_asm(local_cid) => _,
6954        lateout("r2") _,
6955        lateout("r3") _,
6956        lateout("r12") _,
6957    );
6958    ret
6959}
6960
6961#[doc = "@brief Receive an SDU on an L2CAP channel."]
6962#[doc = ""]
6963#[doc = " @details This may issue additional credits to the peer using an LE Flow Control Credit packet."]
6964#[doc = ""]
6965#[doc = " @note    A call to this function will require the application to keep the memory pointed by"]
6966#[doc = "          @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX"]
6967#[doc = "          or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event."]
6968#[doc = ""]
6969#[doc = " @note    The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::rx_queue_size SDU data buffers"]
6970#[doc = "          for reception per L2CAP channel."]
6971#[doc = ""]
6972#[doc = " @events"]
6973#[doc = " @event{@ref BLE_L2CAP_EVT_CH_RX, The SDU is received.}"]
6974#[doc = " @endevents"]
6975#[doc = ""]
6976#[doc = " @mscs"]
6977#[doc = " @mmsc{@ref BLE_L2CAP_CH_RX_MSC}"]
6978#[doc = " @endmscs"]
6979#[doc = ""]
6980#[doc = " @param[in] conn_handle Connection Handle."]
6981#[doc = " @param[in] local_cid   Local Channel ID of the L2CAP channel."]
6982#[doc = " @param[in] p_sdu_buf   Pointer to the SDU data buffer."]
6983#[doc = ""]
6984#[doc = " @retval ::NRF_SUCCESS                    Buffer accepted."]
6985#[doc = " @retval ::NRF_ERROR_INVALID_ADDR         Invalid pointer supplied."]
6986#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE  Invalid Connection Handle."]
6987#[doc = " @retval ::NRF_ERROR_INVALID_STATE        Invalid State to perform operation (Setup or release is"]
6988#[doc = "                                          in progress for an L2CAP channel)."]
6989#[doc = " @retval ::NRF_ERROR_NOT_FOUND            CID not found."]
6990#[doc = " @retval ::NRF_ERROR_RESOURCES            Too many SDU data buffers supplied. Wait for a"]
6991#[doc = "                                          @ref BLE_L2CAP_EVT_CH_RX event and retry."]
6992#[inline(always)]
6993pub unsafe fn sd_ble_l2cap_ch_rx(conn_handle: u16, local_cid: u16, p_sdu_buf: *const ble_data_t) -> u32 {
6994    let ret: u32;
6995    core::arch::asm!("svc 186",
6996        inout("r0") to_asm(conn_handle) => ret,
6997        inout("r1") to_asm(local_cid) => _,
6998        inout("r2") to_asm(p_sdu_buf) => _,
6999        lateout("r3") _,
7000        lateout("r12") _,
7001    );
7002    ret
7003}
7004
7005#[doc = "@brief Transmit an SDU on an L2CAP channel."]
7006#[doc = ""]
7007#[doc = " @note    A call to this function will require the application to keep the memory pointed by"]
7008#[doc = "          @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_TX"]
7009#[doc = "          or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event."]
7010#[doc = ""]
7011#[doc = " @note    The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::tx_queue_size SDUs for"]
7012#[doc = "          transmission per L2CAP channel."]
7013#[doc = ""]
7014#[doc = " @note    The application can keep track of the available credits for transmission by following"]
7015#[doc = "          the procedure below:"]
7016#[doc = "          - Store initial credits given by the peer in a variable."]
7017#[doc = "            (Initial credits are provided in a @ref BLE_L2CAP_EVT_CH_SETUP event.)"]
7018#[doc = "          - Decrement the variable, which stores the currently available credits, by"]
7019#[doc = "            ceiling((@ref ble_data_t::len + 2) / tx_mps) when a call to this function returns"]
7020#[doc = "            @ref NRF_SUCCESS. (tx_mps is provided in a @ref BLE_L2CAP_EVT_CH_SETUP event.)"]
7021#[doc = "          - Increment the variable, which stores the currently available credits, by additional"]
7022#[doc = "            credits given by the peer in a @ref BLE_L2CAP_EVT_CH_CREDIT event."]
7023#[doc = ""]
7024#[doc = " @events"]
7025#[doc = " @event{@ref BLE_L2CAP_EVT_CH_TX, The SDU is transmitted.}"]
7026#[doc = " @endevents"]
7027#[doc = ""]
7028#[doc = " @mscs"]
7029#[doc = " @mmsc{@ref BLE_L2CAP_CH_TX_MSC}"]
7030#[doc = " @endmscs"]
7031#[doc = ""]
7032#[doc = " @param[in] conn_handle Connection Handle."]
7033#[doc = " @param[in] local_cid   Local Channel ID of the L2CAP channel."]
7034#[doc = " @param[in] p_sdu_buf   Pointer to the SDU data buffer."]
7035#[doc = ""]
7036#[doc = " @retval ::NRF_SUCCESS                    Successfully queued L2CAP SDU for transmission."]
7037#[doc = " @retval ::NRF_ERROR_INVALID_ADDR         Invalid pointer supplied."]
7038#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE  Invalid Connection Handle."]
7039#[doc = " @retval ::NRF_ERROR_INVALID_STATE        Invalid State to perform operation (Setup or release is"]
7040#[doc = "                                          in progress for the L2CAP channel)."]
7041#[doc = " @retval ::NRF_ERROR_NOT_FOUND            CID not found."]
7042#[doc = " @retval ::NRF_ERROR_DATA_SIZE            Invalid SDU length supplied, must not be more than"]
7043#[doc = "                                          @ref ble_l2cap_ch_tx_params_t::tx_mtu provided in"]
7044#[doc = "                                          @ref BLE_L2CAP_EVT_CH_SETUP event."]
7045#[doc = " @retval ::NRF_ERROR_RESOURCES            Too many SDUs queued for transmission. Wait for a"]
7046#[doc = "                                          @ref BLE_L2CAP_EVT_CH_TX event and retry."]
7047#[inline(always)]
7048pub unsafe fn sd_ble_l2cap_ch_tx(conn_handle: u16, local_cid: u16, p_sdu_buf: *const ble_data_t) -> u32 {
7049    let ret: u32;
7050    core::arch::asm!("svc 187",
7051        inout("r0") to_asm(conn_handle) => ret,
7052        inout("r1") to_asm(local_cid) => _,
7053        inout("r2") to_asm(p_sdu_buf) => _,
7054        lateout("r3") _,
7055        lateout("r12") _,
7056    );
7057    ret
7058}
7059
7060#[doc = "@brief Advanced SDU reception flow control."]
7061#[doc = ""]
7062#[doc = " @details Adjust the way the SoftDevice issues credits to the peer."]
7063#[doc = "          This may issue additional credits to the peer using an LE Flow Control Credit packet."]
7064#[doc = ""]
7065#[doc = " @mscs"]
7066#[doc = " @mmsc{@ref BLE_L2CAP_CH_FLOW_CONTROL_MSC}"]
7067#[doc = " @endmscs"]
7068#[doc = ""]
7069#[doc = " @param[in] conn_handle Connection Handle."]
7070#[doc = " @param[in] local_cid   Local Channel ID of the L2CAP channel or @ref BLE_L2CAP_CID_INVALID to set"]
7071#[doc = "                        the value that will be used for newly created channels."]
7072#[doc = " @param[in] credits     Number of credits that the SoftDevice will make sure the peer has every"]
7073#[doc = "                        time it starts using a new reception buffer."]
7074#[doc = "                        - @ref BLE_L2CAP_CREDITS_DEFAULT is the default value the SoftDevice will"]
7075#[doc = "                          use if this function is not called."]
7076#[doc = "                        - If set to zero, the SoftDevice will stop issuing credits for new reception"]
7077#[doc = "                          buffers the application provides or has provided. SDU reception that is"]
7078#[doc = "                          currently ongoing will be allowed to complete."]
7079#[doc = " @param[out] p_credits  NULL or pointer to a uint16_t. If a valid pointer is provided, it will be"]
7080#[doc = "                        written by the SoftDevice with the number of credits that is or will be"]
7081#[doc = "                        available to the peer. If the value written by the SoftDevice is 0 when"]
7082#[doc = "                        credits parameter was set to 0, the peer will not be able to send more"]
7083#[doc = "                        data until more credits are provided by calling this function again with"]
7084#[doc = "                        credits > 0. This parameter is ignored when local_cid is set to"]
7085#[doc = "                        @ref BLE_L2CAP_CID_INVALID."]
7086#[doc = ""]
7087#[doc = " @note Application should take care when setting number of credits higher than default value. In"]
7088#[doc = "       this case the application must make sure that the SoftDevice always has reception buffers"]
7089#[doc = "       available (see @ref sd_ble_l2cap_ch_rx) for that channel. If the SoftDevice does not have"]
7090#[doc = "       such buffers available, packets may be NACKed on the Link Layer and all Bluetooth traffic"]
7091#[doc = "       on the connection handle may be stalled until the SoftDevice again has an available"]
7092#[doc = "       reception buffer. This applies even if the application has used this call to set the"]
7093#[doc = "       credits back to default, or zero."]
7094#[doc = ""]
7095#[doc = " @retval ::NRF_SUCCESS                    Flow control parameters accepted."]
7096#[doc = " @retval ::NRF_ERROR_INVALID_ADDR         Invalid pointer supplied."]
7097#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE  Invalid Connection Handle."]
7098#[doc = " @retval ::NRF_ERROR_INVALID_STATE        Invalid State to perform operation (Setup or release is"]
7099#[doc = "                                          in progress for an L2CAP channel)."]
7100#[doc = " @retval ::NRF_ERROR_NOT_FOUND            CID not found."]
7101#[inline(always)]
7102pub unsafe fn sd_ble_l2cap_ch_flow_control(conn_handle: u16, local_cid: u16, credits: u16, p_credits: *mut u16) -> u32 {
7103    let ret: u32;
7104    core::arch::asm!("svc 188",
7105        inout("r0") to_asm(conn_handle) => ret,
7106        inout("r1") to_asm(local_cid) => _,
7107        inout("r2") to_asm(credits) => _,
7108        inout("r3") to_asm(p_credits) => _,
7109        lateout("r12") _,
7110    );
7111    ret
7112}
7113
7114#[doc = " @brief BLE GATT connection configuration parameters, set with @ref sd_ble_cfg_set."]
7115#[doc = ""]
7116#[doc = " @retval ::NRF_ERROR_INVALID_PARAM att_mtu is smaller than @ref BLE_GATT_ATT_MTU_DEFAULT."]
7117#[repr(C)]
7118#[derive(Debug, Copy, Clone)]
7119pub struct ble_gatt_conn_cfg_t {
7120    #[doc = "< Maximum size of ATT packet the SoftDevice can send or receive."]
7121    #[doc = "The default and minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT."]
7122    #[doc = "@mscs"]
7123    #[doc = "@mmsc{@ref BLE_GATTC_MTU_EXCHANGE}"]
7124    #[doc = "@mmsc{@ref BLE_GATTS_MTU_EXCHANGE}"]
7125    #[doc = "@endmscs"]
7126    pub att_mtu: u16,
7127}
7128#[test]
7129fn bindgen_test_layout_ble_gatt_conn_cfg_t() {
7130    assert_eq!(
7131        ::core::mem::size_of::<ble_gatt_conn_cfg_t>(),
7132        2usize,
7133        concat!("Size of: ", stringify!(ble_gatt_conn_cfg_t))
7134    );
7135    assert_eq!(
7136        ::core::mem::align_of::<ble_gatt_conn_cfg_t>(),
7137        2usize,
7138        concat!("Alignment of ", stringify!(ble_gatt_conn_cfg_t))
7139    );
7140    assert_eq!(
7141        unsafe { &(*(::core::ptr::null::<ble_gatt_conn_cfg_t>())).att_mtu as *const _ as usize },
7142        0usize,
7143        concat!(
7144            "Offset of field: ",
7145            stringify!(ble_gatt_conn_cfg_t),
7146            "::",
7147            stringify!(att_mtu)
7148        )
7149    );
7150}
7151#[doc = "@brief GATT Characteristic Properties."]
7152#[repr(C, packed)]
7153#[derive(Debug, Copy, Clone)]
7154pub struct ble_gatt_char_props_t {
7155    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
7156}
7157#[test]
7158fn bindgen_test_layout_ble_gatt_char_props_t() {
7159    assert_eq!(
7160        ::core::mem::size_of::<ble_gatt_char_props_t>(),
7161        1usize,
7162        concat!("Size of: ", stringify!(ble_gatt_char_props_t))
7163    );
7164    assert_eq!(
7165        ::core::mem::align_of::<ble_gatt_char_props_t>(),
7166        1usize,
7167        concat!("Alignment of ", stringify!(ble_gatt_char_props_t))
7168    );
7169}
7170impl ble_gatt_char_props_t {
7171    #[inline]
7172    pub fn broadcast(&self) -> u8 {
7173        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
7174    }
7175    #[inline]
7176    pub fn set_broadcast(&mut self, val: u8) {
7177        unsafe {
7178            let val: u8 = ::core::mem::transmute(val);
7179            self._bitfield_1.set(0usize, 1u8, val as u64)
7180        }
7181    }
7182    #[inline]
7183    pub fn read(&self) -> u8 {
7184        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
7185    }
7186    #[inline]
7187    pub fn set_read(&mut self, val: u8) {
7188        unsafe {
7189            let val: u8 = ::core::mem::transmute(val);
7190            self._bitfield_1.set(1usize, 1u8, val as u64)
7191        }
7192    }
7193    #[inline]
7194    pub fn write_wo_resp(&self) -> u8 {
7195        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
7196    }
7197    #[inline]
7198    pub fn set_write_wo_resp(&mut self, val: u8) {
7199        unsafe {
7200            let val: u8 = ::core::mem::transmute(val);
7201            self._bitfield_1.set(2usize, 1u8, val as u64)
7202        }
7203    }
7204    #[inline]
7205    pub fn write(&self) -> u8 {
7206        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
7207    }
7208    #[inline]
7209    pub fn set_write(&mut self, val: u8) {
7210        unsafe {
7211            let val: u8 = ::core::mem::transmute(val);
7212            self._bitfield_1.set(3usize, 1u8, val as u64)
7213        }
7214    }
7215    #[inline]
7216    pub fn notify(&self) -> u8 {
7217        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
7218    }
7219    #[inline]
7220    pub fn set_notify(&mut self, val: u8) {
7221        unsafe {
7222            let val: u8 = ::core::mem::transmute(val);
7223            self._bitfield_1.set(4usize, 1u8, val as u64)
7224        }
7225    }
7226    #[inline]
7227    pub fn indicate(&self) -> u8 {
7228        unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u8) }
7229    }
7230    #[inline]
7231    pub fn set_indicate(&mut self, val: u8) {
7232        unsafe {
7233            let val: u8 = ::core::mem::transmute(val);
7234            self._bitfield_1.set(5usize, 1u8, val as u64)
7235        }
7236    }
7237    #[inline]
7238    pub fn auth_signed_wr(&self) -> u8 {
7239        unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u8) }
7240    }
7241    #[inline]
7242    pub fn set_auth_signed_wr(&mut self, val: u8) {
7243        unsafe {
7244            let val: u8 = ::core::mem::transmute(val);
7245            self._bitfield_1.set(6usize, 1u8, val as u64)
7246        }
7247    }
7248    #[inline]
7249    pub fn new_bitfield_1(
7250        broadcast: u8,
7251        read: u8,
7252        write_wo_resp: u8,
7253        write: u8,
7254        notify: u8,
7255        indicate: u8,
7256        auth_signed_wr: u8,
7257    ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
7258        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
7259        __bindgen_bitfield_unit.set(0usize, 1u8, {
7260            let broadcast: u8 = unsafe { ::core::mem::transmute(broadcast) };
7261            broadcast as u64
7262        });
7263        __bindgen_bitfield_unit.set(1usize, 1u8, {
7264            let read: u8 = unsafe { ::core::mem::transmute(read) };
7265            read as u64
7266        });
7267        __bindgen_bitfield_unit.set(2usize, 1u8, {
7268            let write_wo_resp: u8 = unsafe { ::core::mem::transmute(write_wo_resp) };
7269            write_wo_resp as u64
7270        });
7271        __bindgen_bitfield_unit.set(3usize, 1u8, {
7272            let write: u8 = unsafe { ::core::mem::transmute(write) };
7273            write as u64
7274        });
7275        __bindgen_bitfield_unit.set(4usize, 1u8, {
7276            let notify: u8 = unsafe { ::core::mem::transmute(notify) };
7277            notify as u64
7278        });
7279        __bindgen_bitfield_unit.set(5usize, 1u8, {
7280            let indicate: u8 = unsafe { ::core::mem::transmute(indicate) };
7281            indicate as u64
7282        });
7283        __bindgen_bitfield_unit.set(6usize, 1u8, {
7284            let auth_signed_wr: u8 = unsafe { ::core::mem::transmute(auth_signed_wr) };
7285            auth_signed_wr as u64
7286        });
7287        __bindgen_bitfield_unit
7288    }
7289}
7290#[doc = "@brief GATT Characteristic Extended Properties."]
7291#[repr(C, packed)]
7292#[derive(Debug, Copy, Clone)]
7293pub struct ble_gatt_char_ext_props_t {
7294    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
7295}
7296#[test]
7297fn bindgen_test_layout_ble_gatt_char_ext_props_t() {
7298    assert_eq!(
7299        ::core::mem::size_of::<ble_gatt_char_ext_props_t>(),
7300        1usize,
7301        concat!("Size of: ", stringify!(ble_gatt_char_ext_props_t))
7302    );
7303    assert_eq!(
7304        ::core::mem::align_of::<ble_gatt_char_ext_props_t>(),
7305        1usize,
7306        concat!("Alignment of ", stringify!(ble_gatt_char_ext_props_t))
7307    );
7308}
7309impl ble_gatt_char_ext_props_t {
7310    #[inline]
7311    pub fn reliable_wr(&self) -> u8 {
7312        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
7313    }
7314    #[inline]
7315    pub fn set_reliable_wr(&mut self, val: u8) {
7316        unsafe {
7317            let val: u8 = ::core::mem::transmute(val);
7318            self._bitfield_1.set(0usize, 1u8, val as u64)
7319        }
7320    }
7321    #[inline]
7322    pub fn wr_aux(&self) -> u8 {
7323        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
7324    }
7325    #[inline]
7326    pub fn set_wr_aux(&mut self, val: u8) {
7327        unsafe {
7328            let val: u8 = ::core::mem::transmute(val);
7329            self._bitfield_1.set(1usize, 1u8, val as u64)
7330        }
7331    }
7332    #[inline]
7333    pub fn new_bitfield_1(reliable_wr: u8, wr_aux: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
7334        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
7335        __bindgen_bitfield_unit.set(0usize, 1u8, {
7336            let reliable_wr: u8 = unsafe { ::core::mem::transmute(reliable_wr) };
7337            reliable_wr as u64
7338        });
7339        __bindgen_bitfield_unit.set(1usize, 1u8, {
7340            let wr_aux: u8 = unsafe { ::core::mem::transmute(wr_aux) };
7341            wr_aux as u64
7342        });
7343        __bindgen_bitfield_unit
7344    }
7345}
7346#[doc = "< Primary Service Discovery."]
7347pub const BLE_GATTC_SVCS_SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER: BLE_GATTC_SVCS = 155;
7348#[doc = "< Relationship Discovery."]
7349pub const BLE_GATTC_SVCS_SD_BLE_GATTC_RELATIONSHIPS_DISCOVER: BLE_GATTC_SVCS = 156;
7350#[doc = "< Characteristic Discovery."]
7351pub const BLE_GATTC_SVCS_SD_BLE_GATTC_CHARACTERISTICS_DISCOVER: BLE_GATTC_SVCS = 157;
7352#[doc = "< Characteristic Descriptor Discovery."]
7353pub const BLE_GATTC_SVCS_SD_BLE_GATTC_DESCRIPTORS_DISCOVER: BLE_GATTC_SVCS = 158;
7354#[doc = "< Attribute Information Discovery."]
7355pub const BLE_GATTC_SVCS_SD_BLE_GATTC_ATTR_INFO_DISCOVER: BLE_GATTC_SVCS = 159;
7356#[doc = "< Read Characteristic Value by UUID."]
7357pub const BLE_GATTC_SVCS_SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ: BLE_GATTC_SVCS = 160;
7358#[doc = "< Generic read."]
7359pub const BLE_GATTC_SVCS_SD_BLE_GATTC_READ: BLE_GATTC_SVCS = 161;
7360#[doc = "< Read multiple Characteristic Values."]
7361pub const BLE_GATTC_SVCS_SD_BLE_GATTC_CHAR_VALUES_READ: BLE_GATTC_SVCS = 162;
7362#[doc = "< Generic write."]
7363pub const BLE_GATTC_SVCS_SD_BLE_GATTC_WRITE: BLE_GATTC_SVCS = 163;
7364#[doc = "< Handle Value Confirmation."]
7365pub const BLE_GATTC_SVCS_SD_BLE_GATTC_HV_CONFIRM: BLE_GATTC_SVCS = 164;
7366#[doc = "< Exchange MTU Request."]
7367pub const BLE_GATTC_SVCS_SD_BLE_GATTC_EXCHANGE_MTU_REQUEST: BLE_GATTC_SVCS = 165;
7368#[doc = "@brief GATTC API SVC numbers."]
7369pub type BLE_GATTC_SVCS = self::c_uint;
7370#[doc = "< Primary Service Discovery Response event.          \\n See @ref ble_gattc_evt_prim_srvc_disc_rsp_t."]
7371pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP: BLE_GATTC_EVTS = 48;
7372#[doc = "< Relationship Discovery Response event.             \\n See @ref ble_gattc_evt_rel_disc_rsp_t."]
7373pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_REL_DISC_RSP: BLE_GATTC_EVTS = 49;
7374#[doc = "< Characteristic Discovery Response event.           \\n See @ref ble_gattc_evt_char_disc_rsp_t."]
7375pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_CHAR_DISC_RSP: BLE_GATTC_EVTS = 50;
7376#[doc = "< Descriptor Discovery Response event.               \\n See @ref ble_gattc_evt_desc_disc_rsp_t."]
7377pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_DESC_DISC_RSP: BLE_GATTC_EVTS = 51;
7378#[doc = "< Attribute Information Response event.              \\n See @ref ble_gattc_evt_attr_info_disc_rsp_t."]
7379pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_ATTR_INFO_DISC_RSP: BLE_GATTC_EVTS = 52;
7380#[doc = "< Read By UUID Response event.                       \\n See @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t."]
7381pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP: BLE_GATTC_EVTS = 53;
7382#[doc = "< Read Response event.                               \\n See @ref ble_gattc_evt_read_rsp_t."]
7383pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_READ_RSP: BLE_GATTC_EVTS = 54;
7384#[doc = "< Read multiple Response event.                      \\n See @ref ble_gattc_evt_char_vals_read_rsp_t."]
7385pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_CHAR_VALS_READ_RSP: BLE_GATTC_EVTS = 55;
7386#[doc = "< Write Response event.                              \\n See @ref ble_gattc_evt_write_rsp_t."]
7387pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_WRITE_RSP: BLE_GATTC_EVTS = 56;
7388#[doc = "< Handle Value Notification or Indication event.     \\n Confirm indication with @ref sd_ble_gattc_hv_confirm.  \\n See @ref ble_gattc_evt_hvx_t."]
7389pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_HVX: BLE_GATTC_EVTS = 57;
7390#[doc = "< Exchange MTU Response event.                       \\n See @ref ble_gattc_evt_exchange_mtu_rsp_t."]
7391pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_EXCHANGE_MTU_RSP: BLE_GATTC_EVTS = 58;
7392#[doc = "< Timeout event.                                     \\n See @ref ble_gattc_evt_timeout_t."]
7393pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_TIMEOUT: BLE_GATTC_EVTS = 59;
7394#[doc = "< Write without Response transmission complete.      \\n See @ref ble_gattc_evt_write_cmd_tx_complete_t."]
7395pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE: BLE_GATTC_EVTS = 60;
7396#[doc = " @brief GATT Client Event IDs."]
7397pub type BLE_GATTC_EVTS = self::c_uint;
7398#[doc = " @brief BLE GATTC connection configuration parameters, set with @ref sd_ble_cfg_set."]
7399#[repr(C)]
7400#[derive(Debug, Copy, Clone)]
7401pub struct ble_gattc_conn_cfg_t {
7402    #[doc = "< The guaranteed minimum number of Write without Response that can be queued for transmission."]
7403    #[doc = "The default value is @ref BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT"]
7404    pub write_cmd_tx_queue_size: u8,
7405}
7406#[test]
7407fn bindgen_test_layout_ble_gattc_conn_cfg_t() {
7408    assert_eq!(
7409        ::core::mem::size_of::<ble_gattc_conn_cfg_t>(),
7410        1usize,
7411        concat!("Size of: ", stringify!(ble_gattc_conn_cfg_t))
7412    );
7413    assert_eq!(
7414        ::core::mem::align_of::<ble_gattc_conn_cfg_t>(),
7415        1usize,
7416        concat!("Alignment of ", stringify!(ble_gattc_conn_cfg_t))
7417    );
7418    assert_eq!(
7419        unsafe { &(*(::core::ptr::null::<ble_gattc_conn_cfg_t>())).write_cmd_tx_queue_size as *const _ as usize },
7420        0usize,
7421        concat!(
7422            "Offset of field: ",
7423            stringify!(ble_gattc_conn_cfg_t),
7424            "::",
7425            stringify!(write_cmd_tx_queue_size)
7426        )
7427    );
7428}
7429#[doc = "@brief Operation Handle Range."]
7430#[repr(C)]
7431#[derive(Debug, Copy, Clone)]
7432pub struct ble_gattc_handle_range_t {
7433    #[doc = "< Start Handle."]
7434    pub start_handle: u16,
7435    #[doc = "< End Handle."]
7436    pub end_handle: u16,
7437}
7438#[test]
7439fn bindgen_test_layout_ble_gattc_handle_range_t() {
7440    assert_eq!(
7441        ::core::mem::size_of::<ble_gattc_handle_range_t>(),
7442        4usize,
7443        concat!("Size of: ", stringify!(ble_gattc_handle_range_t))
7444    );
7445    assert_eq!(
7446        ::core::mem::align_of::<ble_gattc_handle_range_t>(),
7447        2usize,
7448        concat!("Alignment of ", stringify!(ble_gattc_handle_range_t))
7449    );
7450    assert_eq!(
7451        unsafe { &(*(::core::ptr::null::<ble_gattc_handle_range_t>())).start_handle as *const _ as usize },
7452        0usize,
7453        concat!(
7454            "Offset of field: ",
7455            stringify!(ble_gattc_handle_range_t),
7456            "::",
7457            stringify!(start_handle)
7458        )
7459    );
7460    assert_eq!(
7461        unsafe { &(*(::core::ptr::null::<ble_gattc_handle_range_t>())).end_handle as *const _ as usize },
7462        2usize,
7463        concat!(
7464            "Offset of field: ",
7465            stringify!(ble_gattc_handle_range_t),
7466            "::",
7467            stringify!(end_handle)
7468        )
7469    );
7470}
7471#[doc = "@brief GATT service."]
7472#[repr(C)]
7473#[derive(Debug, Copy, Clone)]
7474pub struct ble_gattc_service_t {
7475    #[doc = "< Service UUID."]
7476    pub uuid: ble_uuid_t,
7477    #[doc = "< Service Handle Range."]
7478    pub handle_range: ble_gattc_handle_range_t,
7479}
7480#[test]
7481fn bindgen_test_layout_ble_gattc_service_t() {
7482    assert_eq!(
7483        ::core::mem::size_of::<ble_gattc_service_t>(),
7484        8usize,
7485        concat!("Size of: ", stringify!(ble_gattc_service_t))
7486    );
7487    assert_eq!(
7488        ::core::mem::align_of::<ble_gattc_service_t>(),
7489        2usize,
7490        concat!("Alignment of ", stringify!(ble_gattc_service_t))
7491    );
7492    assert_eq!(
7493        unsafe { &(*(::core::ptr::null::<ble_gattc_service_t>())).uuid as *const _ as usize },
7494        0usize,
7495        concat!(
7496            "Offset of field: ",
7497            stringify!(ble_gattc_service_t),
7498            "::",
7499            stringify!(uuid)
7500        )
7501    );
7502    assert_eq!(
7503        unsafe { &(*(::core::ptr::null::<ble_gattc_service_t>())).handle_range as *const _ as usize },
7504        4usize,
7505        concat!(
7506            "Offset of field: ",
7507            stringify!(ble_gattc_service_t),
7508            "::",
7509            stringify!(handle_range)
7510        )
7511    );
7512}
7513#[doc = "@brief  GATT include."]
7514#[repr(C)]
7515#[derive(Debug, Copy, Clone)]
7516pub struct ble_gattc_include_t {
7517    #[doc = "< Include Handle."]
7518    pub handle: u16,
7519    #[doc = "< Handle of the included service."]
7520    pub included_srvc: ble_gattc_service_t,
7521}
7522#[test]
7523fn bindgen_test_layout_ble_gattc_include_t() {
7524    assert_eq!(
7525        ::core::mem::size_of::<ble_gattc_include_t>(),
7526        10usize,
7527        concat!("Size of: ", stringify!(ble_gattc_include_t))
7528    );
7529    assert_eq!(
7530        ::core::mem::align_of::<ble_gattc_include_t>(),
7531        2usize,
7532        concat!("Alignment of ", stringify!(ble_gattc_include_t))
7533    );
7534    assert_eq!(
7535        unsafe { &(*(::core::ptr::null::<ble_gattc_include_t>())).handle as *const _ as usize },
7536        0usize,
7537        concat!(
7538            "Offset of field: ",
7539            stringify!(ble_gattc_include_t),
7540            "::",
7541            stringify!(handle)
7542        )
7543    );
7544    assert_eq!(
7545        unsafe { &(*(::core::ptr::null::<ble_gattc_include_t>())).included_srvc as *const _ as usize },
7546        2usize,
7547        concat!(
7548            "Offset of field: ",
7549            stringify!(ble_gattc_include_t),
7550            "::",
7551            stringify!(included_srvc)
7552        )
7553    );
7554}
7555#[doc = "@brief GATT characteristic."]
7556#[repr(C)]
7557#[derive(Debug, Copy, Clone)]
7558pub struct ble_gattc_char_t {
7559    #[doc = "< Characteristic UUID."]
7560    pub uuid: ble_uuid_t,
7561    #[doc = "< Characteristic Properties."]
7562    pub char_props: ble_gatt_char_props_t,
7563    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
7564    #[doc = "< Handle of the Characteristic Declaration."]
7565    pub handle_decl: u16,
7566    #[doc = "< Handle of the Characteristic Value."]
7567    pub handle_value: u16,
7568}
7569#[test]
7570fn bindgen_test_layout_ble_gattc_char_t() {
7571    assert_eq!(
7572        ::core::mem::size_of::<ble_gattc_char_t>(),
7573        10usize,
7574        concat!("Size of: ", stringify!(ble_gattc_char_t))
7575    );
7576    assert_eq!(
7577        ::core::mem::align_of::<ble_gattc_char_t>(),
7578        2usize,
7579        concat!("Alignment of ", stringify!(ble_gattc_char_t))
7580    );
7581    assert_eq!(
7582        unsafe { &(*(::core::ptr::null::<ble_gattc_char_t>())).uuid as *const _ as usize },
7583        0usize,
7584        concat!(
7585            "Offset of field: ",
7586            stringify!(ble_gattc_char_t),
7587            "::",
7588            stringify!(uuid)
7589        )
7590    );
7591    assert_eq!(
7592        unsafe { &(*(::core::ptr::null::<ble_gattc_char_t>())).char_props as *const _ as usize },
7593        4usize,
7594        concat!(
7595            "Offset of field: ",
7596            stringify!(ble_gattc_char_t),
7597            "::",
7598            stringify!(char_props)
7599        )
7600    );
7601    assert_eq!(
7602        unsafe { &(*(::core::ptr::null::<ble_gattc_char_t>())).handle_decl as *const _ as usize },
7603        6usize,
7604        concat!(
7605            "Offset of field: ",
7606            stringify!(ble_gattc_char_t),
7607            "::",
7608            stringify!(handle_decl)
7609        )
7610    );
7611    assert_eq!(
7612        unsafe { &(*(::core::ptr::null::<ble_gattc_char_t>())).handle_value as *const _ as usize },
7613        8usize,
7614        concat!(
7615            "Offset of field: ",
7616            stringify!(ble_gattc_char_t),
7617            "::",
7618            stringify!(handle_value)
7619        )
7620    );
7621}
7622impl ble_gattc_char_t {
7623    #[inline]
7624    pub fn char_ext_props(&self) -> u8 {
7625        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
7626    }
7627    #[inline]
7628    pub fn set_char_ext_props(&mut self, val: u8) {
7629        unsafe {
7630            let val: u8 = ::core::mem::transmute(val);
7631            self._bitfield_1.set(0usize, 1u8, val as u64)
7632        }
7633    }
7634    #[inline]
7635    pub fn new_bitfield_1(char_ext_props: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
7636        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
7637        __bindgen_bitfield_unit.set(0usize, 1u8, {
7638            let char_ext_props: u8 = unsafe { ::core::mem::transmute(char_ext_props) };
7639            char_ext_props as u64
7640        });
7641        __bindgen_bitfield_unit
7642    }
7643}
7644#[doc = "@brief GATT descriptor."]
7645#[repr(C)]
7646#[derive(Debug, Copy, Clone)]
7647pub struct ble_gattc_desc_t {
7648    #[doc = "< Descriptor Handle."]
7649    pub handle: u16,
7650    #[doc = "< Descriptor UUID."]
7651    pub uuid: ble_uuid_t,
7652}
7653#[test]
7654fn bindgen_test_layout_ble_gattc_desc_t() {
7655    assert_eq!(
7656        ::core::mem::size_of::<ble_gattc_desc_t>(),
7657        6usize,
7658        concat!("Size of: ", stringify!(ble_gattc_desc_t))
7659    );
7660    assert_eq!(
7661        ::core::mem::align_of::<ble_gattc_desc_t>(),
7662        2usize,
7663        concat!("Alignment of ", stringify!(ble_gattc_desc_t))
7664    );
7665    assert_eq!(
7666        unsafe { &(*(::core::ptr::null::<ble_gattc_desc_t>())).handle as *const _ as usize },
7667        0usize,
7668        concat!(
7669            "Offset of field: ",
7670            stringify!(ble_gattc_desc_t),
7671            "::",
7672            stringify!(handle)
7673        )
7674    );
7675    assert_eq!(
7676        unsafe { &(*(::core::ptr::null::<ble_gattc_desc_t>())).uuid as *const _ as usize },
7677        2usize,
7678        concat!(
7679            "Offset of field: ",
7680            stringify!(ble_gattc_desc_t),
7681            "::",
7682            stringify!(uuid)
7683        )
7684    );
7685}
7686#[doc = "@brief Write Parameters."]
7687#[repr(C)]
7688#[derive(Debug, Copy, Clone)]
7689pub struct ble_gattc_write_params_t {
7690    #[doc = "< Write Operation to be performed, see @ref BLE_GATT_WRITE_OPS."]
7691    pub write_op: u8,
7692    #[doc = "< Flags, see @ref BLE_GATT_EXEC_WRITE_FLAGS."]
7693    pub flags: u8,
7694    #[doc = "< Handle to the attribute to be written."]
7695    pub handle: u16,
7696    #[doc = "< Offset in bytes. @note For WRITE_CMD and WRITE_REQ, offset must be 0."]
7697    pub offset: u16,
7698    #[doc = "< Length of data in bytes."]
7699    pub len: u16,
7700    #[doc = "< Pointer to the value data."]
7701    pub p_value: *const u8,
7702}
7703#[test]
7704fn bindgen_test_layout_ble_gattc_write_params_t() {
7705    assert_eq!(
7706        ::core::mem::size_of::<ble_gattc_write_params_t>(),
7707        12usize,
7708        concat!("Size of: ", stringify!(ble_gattc_write_params_t))
7709    );
7710    assert_eq!(
7711        ::core::mem::align_of::<ble_gattc_write_params_t>(),
7712        4usize,
7713        concat!("Alignment of ", stringify!(ble_gattc_write_params_t))
7714    );
7715    assert_eq!(
7716        unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).write_op as *const _ as usize },
7717        0usize,
7718        concat!(
7719            "Offset of field: ",
7720            stringify!(ble_gattc_write_params_t),
7721            "::",
7722            stringify!(write_op)
7723        )
7724    );
7725    assert_eq!(
7726        unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).flags as *const _ as usize },
7727        1usize,
7728        concat!(
7729            "Offset of field: ",
7730            stringify!(ble_gattc_write_params_t),
7731            "::",
7732            stringify!(flags)
7733        )
7734    );
7735    assert_eq!(
7736        unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).handle as *const _ as usize },
7737        2usize,
7738        concat!(
7739            "Offset of field: ",
7740            stringify!(ble_gattc_write_params_t),
7741            "::",
7742            stringify!(handle)
7743        )
7744    );
7745    assert_eq!(
7746        unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).offset as *const _ as usize },
7747        4usize,
7748        concat!(
7749            "Offset of field: ",
7750            stringify!(ble_gattc_write_params_t),
7751            "::",
7752            stringify!(offset)
7753        )
7754    );
7755    assert_eq!(
7756        unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).len as *const _ as usize },
7757        6usize,
7758        concat!(
7759            "Offset of field: ",
7760            stringify!(ble_gattc_write_params_t),
7761            "::",
7762            stringify!(len)
7763        )
7764    );
7765    assert_eq!(
7766        unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).p_value as *const _ as usize },
7767        8usize,
7768        concat!(
7769            "Offset of field: ",
7770            stringify!(ble_gattc_write_params_t),
7771            "::",
7772            stringify!(p_value)
7773        )
7774    );
7775}
7776#[doc = "@brief Attribute Information for 16-bit Attribute UUID."]
7777#[repr(C)]
7778#[derive(Debug, Copy, Clone)]
7779pub struct ble_gattc_attr_info16_t {
7780    #[doc = "< Attribute handle."]
7781    pub handle: u16,
7782    #[doc = "< 16-bit Attribute UUID."]
7783    pub uuid: ble_uuid_t,
7784}
7785#[test]
7786fn bindgen_test_layout_ble_gattc_attr_info16_t() {
7787    assert_eq!(
7788        ::core::mem::size_of::<ble_gattc_attr_info16_t>(),
7789        6usize,
7790        concat!("Size of: ", stringify!(ble_gattc_attr_info16_t))
7791    );
7792    assert_eq!(
7793        ::core::mem::align_of::<ble_gattc_attr_info16_t>(),
7794        2usize,
7795        concat!("Alignment of ", stringify!(ble_gattc_attr_info16_t))
7796    );
7797    assert_eq!(
7798        unsafe { &(*(::core::ptr::null::<ble_gattc_attr_info16_t>())).handle as *const _ as usize },
7799        0usize,
7800        concat!(
7801            "Offset of field: ",
7802            stringify!(ble_gattc_attr_info16_t),
7803            "::",
7804            stringify!(handle)
7805        )
7806    );
7807    assert_eq!(
7808        unsafe { &(*(::core::ptr::null::<ble_gattc_attr_info16_t>())).uuid as *const _ as usize },
7809        2usize,
7810        concat!(
7811            "Offset of field: ",
7812            stringify!(ble_gattc_attr_info16_t),
7813            "::",
7814            stringify!(uuid)
7815        )
7816    );
7817}
7818#[doc = "@brief Attribute Information for 128-bit Attribute UUID."]
7819#[repr(C)]
7820#[derive(Debug, Copy, Clone)]
7821pub struct ble_gattc_attr_info128_t {
7822    #[doc = "< Attribute handle."]
7823    pub handle: u16,
7824    #[doc = "< 128-bit Attribute UUID."]
7825    pub uuid: ble_uuid128_t,
7826}
7827#[test]
7828fn bindgen_test_layout_ble_gattc_attr_info128_t() {
7829    assert_eq!(
7830        ::core::mem::size_of::<ble_gattc_attr_info128_t>(),
7831        18usize,
7832        concat!("Size of: ", stringify!(ble_gattc_attr_info128_t))
7833    );
7834    assert_eq!(
7835        ::core::mem::align_of::<ble_gattc_attr_info128_t>(),
7836        2usize,
7837        concat!("Alignment of ", stringify!(ble_gattc_attr_info128_t))
7838    );
7839    assert_eq!(
7840        unsafe { &(*(::core::ptr::null::<ble_gattc_attr_info128_t>())).handle as *const _ as usize },
7841        0usize,
7842        concat!(
7843            "Offset of field: ",
7844            stringify!(ble_gattc_attr_info128_t),
7845            "::",
7846            stringify!(handle)
7847        )
7848    );
7849    assert_eq!(
7850        unsafe { &(*(::core::ptr::null::<ble_gattc_attr_info128_t>())).uuid as *const _ as usize },
7851        2usize,
7852        concat!(
7853            "Offset of field: ",
7854            stringify!(ble_gattc_attr_info128_t),
7855            "::",
7856            stringify!(uuid)
7857        )
7858    );
7859}
7860#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP."]
7861#[repr(C)]
7862#[derive(Debug)]
7863pub struct ble_gattc_evt_prim_srvc_disc_rsp_t {
7864    #[doc = "< Service count."]
7865    pub count: u16,
7866    #[doc = "< Service data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
7867    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
7868    pub services: __IncompleteArrayField<ble_gattc_service_t>,
7869}
7870#[test]
7871fn bindgen_test_layout_ble_gattc_evt_prim_srvc_disc_rsp_t() {
7872    assert_eq!(
7873        ::core::mem::size_of::<ble_gattc_evt_prim_srvc_disc_rsp_t>(),
7874        2usize,
7875        concat!("Size of: ", stringify!(ble_gattc_evt_prim_srvc_disc_rsp_t))
7876    );
7877    assert_eq!(
7878        ::core::mem::align_of::<ble_gattc_evt_prim_srvc_disc_rsp_t>(),
7879        2usize,
7880        concat!("Alignment of ", stringify!(ble_gattc_evt_prim_srvc_disc_rsp_t))
7881    );
7882    assert_eq!(
7883        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_prim_srvc_disc_rsp_t>())).count as *const _ as usize },
7884        0usize,
7885        concat!(
7886            "Offset of field: ",
7887            stringify!(ble_gattc_evt_prim_srvc_disc_rsp_t),
7888            "::",
7889            stringify!(count)
7890        )
7891    );
7892    assert_eq!(
7893        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_prim_srvc_disc_rsp_t>())).services as *const _ as usize },
7894        2usize,
7895        concat!(
7896            "Offset of field: ",
7897            stringify!(ble_gattc_evt_prim_srvc_disc_rsp_t),
7898            "::",
7899            stringify!(services)
7900        )
7901    );
7902}
7903#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_REL_DISC_RSP."]
7904#[repr(C)]
7905#[derive(Debug)]
7906pub struct ble_gattc_evt_rel_disc_rsp_t {
7907    #[doc = "< Include count."]
7908    pub count: u16,
7909    #[doc = "< Include data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
7910    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
7911    pub includes: __IncompleteArrayField<ble_gattc_include_t>,
7912}
7913#[test]
7914fn bindgen_test_layout_ble_gattc_evt_rel_disc_rsp_t() {
7915    assert_eq!(
7916        ::core::mem::size_of::<ble_gattc_evt_rel_disc_rsp_t>(),
7917        2usize,
7918        concat!("Size of: ", stringify!(ble_gattc_evt_rel_disc_rsp_t))
7919    );
7920    assert_eq!(
7921        ::core::mem::align_of::<ble_gattc_evt_rel_disc_rsp_t>(),
7922        2usize,
7923        concat!("Alignment of ", stringify!(ble_gattc_evt_rel_disc_rsp_t))
7924    );
7925    assert_eq!(
7926        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_rel_disc_rsp_t>())).count as *const _ as usize },
7927        0usize,
7928        concat!(
7929            "Offset of field: ",
7930            stringify!(ble_gattc_evt_rel_disc_rsp_t),
7931            "::",
7932            stringify!(count)
7933        )
7934    );
7935    assert_eq!(
7936        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_rel_disc_rsp_t>())).includes as *const _ as usize },
7937        2usize,
7938        concat!(
7939            "Offset of field: ",
7940            stringify!(ble_gattc_evt_rel_disc_rsp_t),
7941            "::",
7942            stringify!(includes)
7943        )
7944    );
7945}
7946#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_CHAR_DISC_RSP."]
7947#[repr(C)]
7948#[derive(Debug)]
7949pub struct ble_gattc_evt_char_disc_rsp_t {
7950    #[doc = "< Characteristic count."]
7951    pub count: u16,
7952    #[doc = "< Characteristic data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
7953    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
7954    pub chars: __IncompleteArrayField<ble_gattc_char_t>,
7955}
7956#[test]
7957fn bindgen_test_layout_ble_gattc_evt_char_disc_rsp_t() {
7958    assert_eq!(
7959        ::core::mem::size_of::<ble_gattc_evt_char_disc_rsp_t>(),
7960        2usize,
7961        concat!("Size of: ", stringify!(ble_gattc_evt_char_disc_rsp_t))
7962    );
7963    assert_eq!(
7964        ::core::mem::align_of::<ble_gattc_evt_char_disc_rsp_t>(),
7965        2usize,
7966        concat!("Alignment of ", stringify!(ble_gattc_evt_char_disc_rsp_t))
7967    );
7968    assert_eq!(
7969        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_char_disc_rsp_t>())).count as *const _ as usize },
7970        0usize,
7971        concat!(
7972            "Offset of field: ",
7973            stringify!(ble_gattc_evt_char_disc_rsp_t),
7974            "::",
7975            stringify!(count)
7976        )
7977    );
7978    assert_eq!(
7979        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_char_disc_rsp_t>())).chars as *const _ as usize },
7980        2usize,
7981        concat!(
7982            "Offset of field: ",
7983            stringify!(ble_gattc_evt_char_disc_rsp_t),
7984            "::",
7985            stringify!(chars)
7986        )
7987    );
7988}
7989#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_DESC_DISC_RSP."]
7990#[repr(C)]
7991#[derive(Debug)]
7992pub struct ble_gattc_evt_desc_disc_rsp_t {
7993    #[doc = "< Descriptor count."]
7994    pub count: u16,
7995    #[doc = "< Descriptor data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
7996    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
7997    pub descs: __IncompleteArrayField<ble_gattc_desc_t>,
7998}
7999#[test]
8000fn bindgen_test_layout_ble_gattc_evt_desc_disc_rsp_t() {
8001    assert_eq!(
8002        ::core::mem::size_of::<ble_gattc_evt_desc_disc_rsp_t>(),
8003        2usize,
8004        concat!("Size of: ", stringify!(ble_gattc_evt_desc_disc_rsp_t))
8005    );
8006    assert_eq!(
8007        ::core::mem::align_of::<ble_gattc_evt_desc_disc_rsp_t>(),
8008        2usize,
8009        concat!("Alignment of ", stringify!(ble_gattc_evt_desc_disc_rsp_t))
8010    );
8011    assert_eq!(
8012        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_desc_disc_rsp_t>())).count as *const _ as usize },
8013        0usize,
8014        concat!(
8015            "Offset of field: ",
8016            stringify!(ble_gattc_evt_desc_disc_rsp_t),
8017            "::",
8018            stringify!(count)
8019        )
8020    );
8021    assert_eq!(
8022        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_desc_disc_rsp_t>())).descs as *const _ as usize },
8023        2usize,
8024        concat!(
8025            "Offset of field: ",
8026            stringify!(ble_gattc_evt_desc_disc_rsp_t),
8027            "::",
8028            stringify!(descs)
8029        )
8030    );
8031}
8032#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP."]
8033#[repr(C)]
8034pub struct ble_gattc_evt_attr_info_disc_rsp_t {
8035    #[doc = "< Attribute count."]
8036    pub count: u16,
8037    #[doc = "< Attribute information format, see @ref BLE_GATTC_ATTR_INFO_FORMAT."]
8038    pub format: u8,
8039    #[doc = "< Attribute information union."]
8040    pub info: ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1,
8041}
8042#[repr(C)]
8043pub struct ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1 {
8044    #[doc = "< Attribute information for 16-bit Attribute UUID."]
8045    #[doc = "@note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
8046    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
8047    pub attr_info16: __BindgenUnionField<[ble_gattc_attr_info16_t; 0usize]>,
8048    #[doc = "< Attribute information for 128-bit Attribute UUID."]
8049    #[doc = "@note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
8050    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
8051    pub attr_info128: __BindgenUnionField<[ble_gattc_attr_info128_t; 0usize]>,
8052    pub bindgen_union_field: [u16; 0usize],
8053}
8054#[test]
8055fn bindgen_test_layout_ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1() {
8056    assert_eq!(
8057        ::core::mem::size_of::<ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1>(),
8058        0usize,
8059        concat!(
8060            "Size of: ",
8061            stringify!(ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1)
8062        )
8063    );
8064    assert_eq!(
8065        ::core::mem::align_of::<ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1>(),
8066        2usize,
8067        concat!(
8068            "Alignment of ",
8069            stringify!(ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1)
8070        )
8071    );
8072    assert_eq!(
8073        unsafe {
8074            &(*(::core::ptr::null::<ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1>())).attr_info16 as *const _
8075                as usize
8076        },
8077        0usize,
8078        concat!(
8079            "Offset of field: ",
8080            stringify!(ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1),
8081            "::",
8082            stringify!(attr_info16)
8083        )
8084    );
8085    assert_eq!(
8086        unsafe {
8087            &(*(::core::ptr::null::<ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1>())).attr_info128 as *const _
8088                as usize
8089        },
8090        0usize,
8091        concat!(
8092            "Offset of field: ",
8093            stringify!(ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1),
8094            "::",
8095            stringify!(attr_info128)
8096        )
8097    );
8098}
8099#[test]
8100fn bindgen_test_layout_ble_gattc_evt_attr_info_disc_rsp_t() {
8101    assert_eq!(
8102        ::core::mem::size_of::<ble_gattc_evt_attr_info_disc_rsp_t>(),
8103        4usize,
8104        concat!("Size of: ", stringify!(ble_gattc_evt_attr_info_disc_rsp_t))
8105    );
8106    assert_eq!(
8107        ::core::mem::align_of::<ble_gattc_evt_attr_info_disc_rsp_t>(),
8108        2usize,
8109        concat!("Alignment of ", stringify!(ble_gattc_evt_attr_info_disc_rsp_t))
8110    );
8111    assert_eq!(
8112        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_attr_info_disc_rsp_t>())).count as *const _ as usize },
8113        0usize,
8114        concat!(
8115            "Offset of field: ",
8116            stringify!(ble_gattc_evt_attr_info_disc_rsp_t),
8117            "::",
8118            stringify!(count)
8119        )
8120    );
8121    assert_eq!(
8122        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_attr_info_disc_rsp_t>())).format as *const _ as usize },
8123        2usize,
8124        concat!(
8125            "Offset of field: ",
8126            stringify!(ble_gattc_evt_attr_info_disc_rsp_t),
8127            "::",
8128            stringify!(format)
8129        )
8130    );
8131    assert_eq!(
8132        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_attr_info_disc_rsp_t>())).info as *const _ as usize },
8133        4usize,
8134        concat!(
8135            "Offset of field: ",
8136            stringify!(ble_gattc_evt_attr_info_disc_rsp_t),
8137            "::",
8138            stringify!(info)
8139        )
8140    );
8141}
8142#[doc = "@brief GATT read by UUID handle value pair."]
8143#[repr(C)]
8144#[derive(Debug, Copy, Clone)]
8145pub struct ble_gattc_handle_value_t {
8146    #[doc = "< Attribute Handle."]
8147    pub handle: u16,
8148    #[doc = "< Pointer to the Attribute Value, length is available in @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t::value_len."]
8149    pub p_value: *mut u8,
8150}
8151#[test]
8152fn bindgen_test_layout_ble_gattc_handle_value_t() {
8153    assert_eq!(
8154        ::core::mem::size_of::<ble_gattc_handle_value_t>(),
8155        8usize,
8156        concat!("Size of: ", stringify!(ble_gattc_handle_value_t))
8157    );
8158    assert_eq!(
8159        ::core::mem::align_of::<ble_gattc_handle_value_t>(),
8160        4usize,
8161        concat!("Alignment of ", stringify!(ble_gattc_handle_value_t))
8162    );
8163    assert_eq!(
8164        unsafe { &(*(::core::ptr::null::<ble_gattc_handle_value_t>())).handle as *const _ as usize },
8165        0usize,
8166        concat!(
8167            "Offset of field: ",
8168            stringify!(ble_gattc_handle_value_t),
8169            "::",
8170            stringify!(handle)
8171        )
8172    );
8173    assert_eq!(
8174        unsafe { &(*(::core::ptr::null::<ble_gattc_handle_value_t>())).p_value as *const _ as usize },
8175        4usize,
8176        concat!(
8177            "Offset of field: ",
8178            stringify!(ble_gattc_handle_value_t),
8179            "::",
8180            stringify!(p_value)
8181        )
8182    );
8183}
8184#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP."]
8185#[repr(C)]
8186#[derive(Debug)]
8187pub struct ble_gattc_evt_char_val_by_uuid_read_rsp_t {
8188    #[doc = "< Handle-Value Pair Count."]
8189    pub count: u16,
8190    #[doc = "< Length of the value in Handle-Value(s) list."]
8191    pub value_len: u16,
8192    #[doc = "< Handle-Value(s) list. To iterate through the list use @ref sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter."]
8193    #[doc = "@note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
8194    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
8195    pub handle_value: __IncompleteArrayField<u8>,
8196}
8197#[test]
8198fn bindgen_test_layout_ble_gattc_evt_char_val_by_uuid_read_rsp_t() {
8199    assert_eq!(
8200        ::core::mem::size_of::<ble_gattc_evt_char_val_by_uuid_read_rsp_t>(),
8201        4usize,
8202        concat!("Size of: ", stringify!(ble_gattc_evt_char_val_by_uuid_read_rsp_t))
8203    );
8204    assert_eq!(
8205        ::core::mem::align_of::<ble_gattc_evt_char_val_by_uuid_read_rsp_t>(),
8206        2usize,
8207        concat!("Alignment of ", stringify!(ble_gattc_evt_char_val_by_uuid_read_rsp_t))
8208    );
8209    assert_eq!(
8210        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_char_val_by_uuid_read_rsp_t>())).count as *const _ as usize },
8211        0usize,
8212        concat!(
8213            "Offset of field: ",
8214            stringify!(ble_gattc_evt_char_val_by_uuid_read_rsp_t),
8215            "::",
8216            stringify!(count)
8217        )
8218    );
8219    assert_eq!(
8220        unsafe {
8221            &(*(::core::ptr::null::<ble_gattc_evt_char_val_by_uuid_read_rsp_t>())).value_len as *const _ as usize
8222        },
8223        2usize,
8224        concat!(
8225            "Offset of field: ",
8226            stringify!(ble_gattc_evt_char_val_by_uuid_read_rsp_t),
8227            "::",
8228            stringify!(value_len)
8229        )
8230    );
8231    assert_eq!(
8232        unsafe {
8233            &(*(::core::ptr::null::<ble_gattc_evt_char_val_by_uuid_read_rsp_t>())).handle_value as *const _ as usize
8234        },
8235        4usize,
8236        concat!(
8237            "Offset of field: ",
8238            stringify!(ble_gattc_evt_char_val_by_uuid_read_rsp_t),
8239            "::",
8240            stringify!(handle_value)
8241        )
8242    );
8243}
8244#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_READ_RSP."]
8245#[repr(C)]
8246#[derive(Debug)]
8247pub struct ble_gattc_evt_read_rsp_t {
8248    #[doc = "< Attribute Handle."]
8249    pub handle: u16,
8250    #[doc = "< Offset of the attribute data."]
8251    pub offset: u16,
8252    #[doc = "< Attribute data length."]
8253    pub len: u16,
8254    #[doc = "< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
8255    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
8256    pub data: __IncompleteArrayField<u8>,
8257}
8258#[test]
8259fn bindgen_test_layout_ble_gattc_evt_read_rsp_t() {
8260    assert_eq!(
8261        ::core::mem::size_of::<ble_gattc_evt_read_rsp_t>(),
8262        6usize,
8263        concat!("Size of: ", stringify!(ble_gattc_evt_read_rsp_t))
8264    );
8265    assert_eq!(
8266        ::core::mem::align_of::<ble_gattc_evt_read_rsp_t>(),
8267        2usize,
8268        concat!("Alignment of ", stringify!(ble_gattc_evt_read_rsp_t))
8269    );
8270    assert_eq!(
8271        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_read_rsp_t>())).handle as *const _ as usize },
8272        0usize,
8273        concat!(
8274            "Offset of field: ",
8275            stringify!(ble_gattc_evt_read_rsp_t),
8276            "::",
8277            stringify!(handle)
8278        )
8279    );
8280    assert_eq!(
8281        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_read_rsp_t>())).offset as *const _ as usize },
8282        2usize,
8283        concat!(
8284            "Offset of field: ",
8285            stringify!(ble_gattc_evt_read_rsp_t),
8286            "::",
8287            stringify!(offset)
8288        )
8289    );
8290    assert_eq!(
8291        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_read_rsp_t>())).len as *const _ as usize },
8292        4usize,
8293        concat!(
8294            "Offset of field: ",
8295            stringify!(ble_gattc_evt_read_rsp_t),
8296            "::",
8297            stringify!(len)
8298        )
8299    );
8300    assert_eq!(
8301        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_read_rsp_t>())).data as *const _ as usize },
8302        6usize,
8303        concat!(
8304            "Offset of field: ",
8305            stringify!(ble_gattc_evt_read_rsp_t),
8306            "::",
8307            stringify!(data)
8308        )
8309    );
8310}
8311#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP."]
8312#[repr(C)]
8313#[derive(Debug)]
8314pub struct ble_gattc_evt_char_vals_read_rsp_t {
8315    #[doc = "< Concatenated Attribute values length."]
8316    pub len: u16,
8317    #[doc = "< Attribute values. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
8318    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
8319    pub values: __IncompleteArrayField<u8>,
8320}
8321#[test]
8322fn bindgen_test_layout_ble_gattc_evt_char_vals_read_rsp_t() {
8323    assert_eq!(
8324        ::core::mem::size_of::<ble_gattc_evt_char_vals_read_rsp_t>(),
8325        2usize,
8326        concat!("Size of: ", stringify!(ble_gattc_evt_char_vals_read_rsp_t))
8327    );
8328    assert_eq!(
8329        ::core::mem::align_of::<ble_gattc_evt_char_vals_read_rsp_t>(),
8330        2usize,
8331        concat!("Alignment of ", stringify!(ble_gattc_evt_char_vals_read_rsp_t))
8332    );
8333    assert_eq!(
8334        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_char_vals_read_rsp_t>())).len as *const _ as usize },
8335        0usize,
8336        concat!(
8337            "Offset of field: ",
8338            stringify!(ble_gattc_evt_char_vals_read_rsp_t),
8339            "::",
8340            stringify!(len)
8341        )
8342    );
8343    assert_eq!(
8344        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_char_vals_read_rsp_t>())).values as *const _ as usize },
8345        2usize,
8346        concat!(
8347            "Offset of field: ",
8348            stringify!(ble_gattc_evt_char_vals_read_rsp_t),
8349            "::",
8350            stringify!(values)
8351        )
8352    );
8353}
8354#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_WRITE_RSP."]
8355#[repr(C)]
8356#[derive(Debug)]
8357pub struct ble_gattc_evt_write_rsp_t {
8358    #[doc = "< Attribute Handle."]
8359    pub handle: u16,
8360    #[doc = "< Type of write operation, see @ref BLE_GATT_WRITE_OPS."]
8361    pub write_op: u8,
8362    #[doc = "< Data offset."]
8363    pub offset: u16,
8364    #[doc = "< Data length."]
8365    pub len: u16,
8366    #[doc = "< Data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
8367    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
8368    pub data: __IncompleteArrayField<u8>,
8369}
8370#[test]
8371fn bindgen_test_layout_ble_gattc_evt_write_rsp_t() {
8372    assert_eq!(
8373        ::core::mem::size_of::<ble_gattc_evt_write_rsp_t>(),
8374        8usize,
8375        concat!("Size of: ", stringify!(ble_gattc_evt_write_rsp_t))
8376    );
8377    assert_eq!(
8378        ::core::mem::align_of::<ble_gattc_evt_write_rsp_t>(),
8379        2usize,
8380        concat!("Alignment of ", stringify!(ble_gattc_evt_write_rsp_t))
8381    );
8382    assert_eq!(
8383        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_rsp_t>())).handle as *const _ as usize },
8384        0usize,
8385        concat!(
8386            "Offset of field: ",
8387            stringify!(ble_gattc_evt_write_rsp_t),
8388            "::",
8389            stringify!(handle)
8390        )
8391    );
8392    assert_eq!(
8393        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_rsp_t>())).write_op as *const _ as usize },
8394        2usize,
8395        concat!(
8396            "Offset of field: ",
8397            stringify!(ble_gattc_evt_write_rsp_t),
8398            "::",
8399            stringify!(write_op)
8400        )
8401    );
8402    assert_eq!(
8403        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_rsp_t>())).offset as *const _ as usize },
8404        4usize,
8405        concat!(
8406            "Offset of field: ",
8407            stringify!(ble_gattc_evt_write_rsp_t),
8408            "::",
8409            stringify!(offset)
8410        )
8411    );
8412    assert_eq!(
8413        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_rsp_t>())).len as *const _ as usize },
8414        6usize,
8415        concat!(
8416            "Offset of field: ",
8417            stringify!(ble_gattc_evt_write_rsp_t),
8418            "::",
8419            stringify!(len)
8420        )
8421    );
8422    assert_eq!(
8423        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_rsp_t>())).data as *const _ as usize },
8424        8usize,
8425        concat!(
8426            "Offset of field: ",
8427            stringify!(ble_gattc_evt_write_rsp_t),
8428            "::",
8429            stringify!(data)
8430        )
8431    );
8432}
8433#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_HVX."]
8434#[repr(C)]
8435#[derive(Debug)]
8436pub struct ble_gattc_evt_hvx_t {
8437    #[doc = "< Handle to which the HVx operation applies."]
8438    pub handle: u16,
8439    #[doc = "< Indication or Notification, see @ref BLE_GATT_HVX_TYPES."]
8440    pub type_: u8,
8441    #[doc = "< Attribute data length."]
8442    pub len: u16,
8443    #[doc = "< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
8444    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
8445    pub data: __IncompleteArrayField<u8>,
8446}
8447#[test]
8448fn bindgen_test_layout_ble_gattc_evt_hvx_t() {
8449    assert_eq!(
8450        ::core::mem::size_of::<ble_gattc_evt_hvx_t>(),
8451        6usize,
8452        concat!("Size of: ", stringify!(ble_gattc_evt_hvx_t))
8453    );
8454    assert_eq!(
8455        ::core::mem::align_of::<ble_gattc_evt_hvx_t>(),
8456        2usize,
8457        concat!("Alignment of ", stringify!(ble_gattc_evt_hvx_t))
8458    );
8459    assert_eq!(
8460        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_hvx_t>())).handle as *const _ as usize },
8461        0usize,
8462        concat!(
8463            "Offset of field: ",
8464            stringify!(ble_gattc_evt_hvx_t),
8465            "::",
8466            stringify!(handle)
8467        )
8468    );
8469    assert_eq!(
8470        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_hvx_t>())).type_ as *const _ as usize },
8471        2usize,
8472        concat!(
8473            "Offset of field: ",
8474            stringify!(ble_gattc_evt_hvx_t),
8475            "::",
8476            stringify!(type_)
8477        )
8478    );
8479    assert_eq!(
8480        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_hvx_t>())).len as *const _ as usize },
8481        4usize,
8482        concat!(
8483            "Offset of field: ",
8484            stringify!(ble_gattc_evt_hvx_t),
8485            "::",
8486            stringify!(len)
8487        )
8488    );
8489    assert_eq!(
8490        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_hvx_t>())).data as *const _ as usize },
8491        6usize,
8492        concat!(
8493            "Offset of field: ",
8494            stringify!(ble_gattc_evt_hvx_t),
8495            "::",
8496            stringify!(data)
8497        )
8498    );
8499}
8500#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP."]
8501#[repr(C)]
8502#[derive(Debug, Copy, Clone)]
8503pub struct ble_gattc_evt_exchange_mtu_rsp_t {
8504    #[doc = "< Server RX MTU size."]
8505    pub server_rx_mtu: u16,
8506}
8507#[test]
8508fn bindgen_test_layout_ble_gattc_evt_exchange_mtu_rsp_t() {
8509    assert_eq!(
8510        ::core::mem::size_of::<ble_gattc_evt_exchange_mtu_rsp_t>(),
8511        2usize,
8512        concat!("Size of: ", stringify!(ble_gattc_evt_exchange_mtu_rsp_t))
8513    );
8514    assert_eq!(
8515        ::core::mem::align_of::<ble_gattc_evt_exchange_mtu_rsp_t>(),
8516        2usize,
8517        concat!("Alignment of ", stringify!(ble_gattc_evt_exchange_mtu_rsp_t))
8518    );
8519    assert_eq!(
8520        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_exchange_mtu_rsp_t>())).server_rx_mtu as *const _ as usize },
8521        0usize,
8522        concat!(
8523            "Offset of field: ",
8524            stringify!(ble_gattc_evt_exchange_mtu_rsp_t),
8525            "::",
8526            stringify!(server_rx_mtu)
8527        )
8528    );
8529}
8530#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_TIMEOUT."]
8531#[repr(C)]
8532#[derive(Debug, Copy, Clone)]
8533pub struct ble_gattc_evt_timeout_t {
8534    #[doc = "< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES."]
8535    pub src: u8,
8536}
8537#[test]
8538fn bindgen_test_layout_ble_gattc_evt_timeout_t() {
8539    assert_eq!(
8540        ::core::mem::size_of::<ble_gattc_evt_timeout_t>(),
8541        1usize,
8542        concat!("Size of: ", stringify!(ble_gattc_evt_timeout_t))
8543    );
8544    assert_eq!(
8545        ::core::mem::align_of::<ble_gattc_evt_timeout_t>(),
8546        1usize,
8547        concat!("Alignment of ", stringify!(ble_gattc_evt_timeout_t))
8548    );
8549    assert_eq!(
8550        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_timeout_t>())).src as *const _ as usize },
8551        0usize,
8552        concat!(
8553            "Offset of field: ",
8554            stringify!(ble_gattc_evt_timeout_t),
8555            "::",
8556            stringify!(src)
8557        )
8558    );
8559}
8560#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE."]
8561#[repr(C)]
8562#[derive(Debug, Copy, Clone)]
8563pub struct ble_gattc_evt_write_cmd_tx_complete_t {
8564    #[doc = "< Number of write without response transmissions completed."]
8565    pub count: u8,
8566}
8567#[test]
8568fn bindgen_test_layout_ble_gattc_evt_write_cmd_tx_complete_t() {
8569    assert_eq!(
8570        ::core::mem::size_of::<ble_gattc_evt_write_cmd_tx_complete_t>(),
8571        1usize,
8572        concat!("Size of: ", stringify!(ble_gattc_evt_write_cmd_tx_complete_t))
8573    );
8574    assert_eq!(
8575        ::core::mem::align_of::<ble_gattc_evt_write_cmd_tx_complete_t>(),
8576        1usize,
8577        concat!("Alignment of ", stringify!(ble_gattc_evt_write_cmd_tx_complete_t))
8578    );
8579    assert_eq!(
8580        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_cmd_tx_complete_t>())).count as *const _ as usize },
8581        0usize,
8582        concat!(
8583            "Offset of field: ",
8584            stringify!(ble_gattc_evt_write_cmd_tx_complete_t),
8585            "::",
8586            stringify!(count)
8587        )
8588    );
8589}
8590#[doc = "@brief GATTC event structure."]
8591#[repr(C)]
8592pub struct ble_gattc_evt_t {
8593    #[doc = "< Connection Handle on which event occurred."]
8594    pub conn_handle: u16,
8595    #[doc = "< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES."]
8596    pub gatt_status: u16,
8597    #[doc = "< In case of error: The handle causing the error. In all other cases @ref BLE_GATT_HANDLE_INVALID."]
8598    pub error_handle: u16,
8599    #[doc = "< Event Parameters. @note Only valid if @ref gatt_status == @ref BLE_GATT_STATUS_SUCCESS."]
8600    pub params: ble_gattc_evt_t__bindgen_ty_1,
8601}
8602#[repr(C)]
8603pub struct ble_gattc_evt_t__bindgen_ty_1 {
8604    #[doc = "< Primary Service Discovery Response Event Parameters."]
8605    pub prim_srvc_disc_rsp: __BindgenUnionField<ble_gattc_evt_prim_srvc_disc_rsp_t>,
8606    #[doc = "< Relationship Discovery Response Event Parameters."]
8607    pub rel_disc_rsp: __BindgenUnionField<ble_gattc_evt_rel_disc_rsp_t>,
8608    #[doc = "< Characteristic Discovery Response Event Parameters."]
8609    pub char_disc_rsp: __BindgenUnionField<ble_gattc_evt_char_disc_rsp_t>,
8610    #[doc = "< Descriptor Discovery Response Event Parameters."]
8611    pub desc_disc_rsp: __BindgenUnionField<ble_gattc_evt_desc_disc_rsp_t>,
8612    #[doc = "< Characteristic Value Read by UUID Response Event Parameters."]
8613    pub char_val_by_uuid_read_rsp: __BindgenUnionField<ble_gattc_evt_char_val_by_uuid_read_rsp_t>,
8614    #[doc = "< Read Response Event Parameters."]
8615    pub read_rsp: __BindgenUnionField<ble_gattc_evt_read_rsp_t>,
8616    #[doc = "< Characteristic Values Read Response Event Parameters."]
8617    pub char_vals_read_rsp: __BindgenUnionField<ble_gattc_evt_char_vals_read_rsp_t>,
8618    #[doc = "< Write Response Event Parameters."]
8619    pub write_rsp: __BindgenUnionField<ble_gattc_evt_write_rsp_t>,
8620    #[doc = "< Handle Value Notification/Indication Event Parameters."]
8621    pub hvx: __BindgenUnionField<ble_gattc_evt_hvx_t>,
8622    #[doc = "< Exchange MTU Response Event Parameters."]
8623    pub exchange_mtu_rsp: __BindgenUnionField<ble_gattc_evt_exchange_mtu_rsp_t>,
8624    #[doc = "< Timeout Event Parameters."]
8625    pub timeout: __BindgenUnionField<ble_gattc_evt_timeout_t>,
8626    #[doc = "< Attribute Information Discovery Event Parameters."]
8627    pub attr_info_disc_rsp: __BindgenUnionField<ble_gattc_evt_attr_info_disc_rsp_t>,
8628    #[doc = "< Write without Response transmission complete Event Parameters."]
8629    pub write_cmd_tx_complete: __BindgenUnionField<ble_gattc_evt_write_cmd_tx_complete_t>,
8630    pub bindgen_union_field: [u16; 4usize],
8631}
8632#[test]
8633fn bindgen_test_layout_ble_gattc_evt_t__bindgen_ty_1() {
8634    assert_eq!(
8635        ::core::mem::size_of::<ble_gattc_evt_t__bindgen_ty_1>(),
8636        8usize,
8637        concat!("Size of: ", stringify!(ble_gattc_evt_t__bindgen_ty_1))
8638    );
8639    assert_eq!(
8640        ::core::mem::align_of::<ble_gattc_evt_t__bindgen_ty_1>(),
8641        2usize,
8642        concat!("Alignment of ", stringify!(ble_gattc_evt_t__bindgen_ty_1))
8643    );
8644    assert_eq!(
8645        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).prim_srvc_disc_rsp as *const _ as usize },
8646        0usize,
8647        concat!(
8648            "Offset of field: ",
8649            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8650            "::",
8651            stringify!(prim_srvc_disc_rsp)
8652        )
8653    );
8654    assert_eq!(
8655        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).rel_disc_rsp as *const _ as usize },
8656        0usize,
8657        concat!(
8658            "Offset of field: ",
8659            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8660            "::",
8661            stringify!(rel_disc_rsp)
8662        )
8663    );
8664    assert_eq!(
8665        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).char_disc_rsp as *const _ as usize },
8666        0usize,
8667        concat!(
8668            "Offset of field: ",
8669            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8670            "::",
8671            stringify!(char_disc_rsp)
8672        )
8673    );
8674    assert_eq!(
8675        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).desc_disc_rsp as *const _ as usize },
8676        0usize,
8677        concat!(
8678            "Offset of field: ",
8679            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8680            "::",
8681            stringify!(desc_disc_rsp)
8682        )
8683    );
8684    assert_eq!(
8685        unsafe {
8686            &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).char_val_by_uuid_read_rsp as *const _ as usize
8687        },
8688        0usize,
8689        concat!(
8690            "Offset of field: ",
8691            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8692            "::",
8693            stringify!(char_val_by_uuid_read_rsp)
8694        )
8695    );
8696    assert_eq!(
8697        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).read_rsp as *const _ as usize },
8698        0usize,
8699        concat!(
8700            "Offset of field: ",
8701            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8702            "::",
8703            stringify!(read_rsp)
8704        )
8705    );
8706    assert_eq!(
8707        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).char_vals_read_rsp as *const _ as usize },
8708        0usize,
8709        concat!(
8710            "Offset of field: ",
8711            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8712            "::",
8713            stringify!(char_vals_read_rsp)
8714        )
8715    );
8716    assert_eq!(
8717        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).write_rsp as *const _ as usize },
8718        0usize,
8719        concat!(
8720            "Offset of field: ",
8721            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8722            "::",
8723            stringify!(write_rsp)
8724        )
8725    );
8726    assert_eq!(
8727        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).hvx as *const _ as usize },
8728        0usize,
8729        concat!(
8730            "Offset of field: ",
8731            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8732            "::",
8733            stringify!(hvx)
8734        )
8735    );
8736    assert_eq!(
8737        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).exchange_mtu_rsp as *const _ as usize },
8738        0usize,
8739        concat!(
8740            "Offset of field: ",
8741            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8742            "::",
8743            stringify!(exchange_mtu_rsp)
8744        )
8745    );
8746    assert_eq!(
8747        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).timeout as *const _ as usize },
8748        0usize,
8749        concat!(
8750            "Offset of field: ",
8751            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8752            "::",
8753            stringify!(timeout)
8754        )
8755    );
8756    assert_eq!(
8757        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).attr_info_disc_rsp as *const _ as usize },
8758        0usize,
8759        concat!(
8760            "Offset of field: ",
8761            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8762            "::",
8763            stringify!(attr_info_disc_rsp)
8764        )
8765    );
8766    assert_eq!(
8767        unsafe {
8768            &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).write_cmd_tx_complete as *const _ as usize
8769        },
8770        0usize,
8771        concat!(
8772            "Offset of field: ",
8773            stringify!(ble_gattc_evt_t__bindgen_ty_1),
8774            "::",
8775            stringify!(write_cmd_tx_complete)
8776        )
8777    );
8778}
8779#[test]
8780fn bindgen_test_layout_ble_gattc_evt_t() {
8781    assert_eq!(
8782        ::core::mem::size_of::<ble_gattc_evt_t>(),
8783        14usize,
8784        concat!("Size of: ", stringify!(ble_gattc_evt_t))
8785    );
8786    assert_eq!(
8787        ::core::mem::align_of::<ble_gattc_evt_t>(),
8788        2usize,
8789        concat!("Alignment of ", stringify!(ble_gattc_evt_t))
8790    );
8791    assert_eq!(
8792        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t>())).conn_handle as *const _ as usize },
8793        0usize,
8794        concat!(
8795            "Offset of field: ",
8796            stringify!(ble_gattc_evt_t),
8797            "::",
8798            stringify!(conn_handle)
8799        )
8800    );
8801    assert_eq!(
8802        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t>())).gatt_status as *const _ as usize },
8803        2usize,
8804        concat!(
8805            "Offset of field: ",
8806            stringify!(ble_gattc_evt_t),
8807            "::",
8808            stringify!(gatt_status)
8809        )
8810    );
8811    assert_eq!(
8812        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t>())).error_handle as *const _ as usize },
8813        4usize,
8814        concat!(
8815            "Offset of field: ",
8816            stringify!(ble_gattc_evt_t),
8817            "::",
8818            stringify!(error_handle)
8819        )
8820    );
8821    assert_eq!(
8822        unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t>())).params as *const _ as usize },
8823        6usize,
8824        concat!(
8825            "Offset of field: ",
8826            stringify!(ble_gattc_evt_t),
8827            "::",
8828            stringify!(params)
8829        )
8830    );
8831}
8832
8833#[doc = "@brief Initiate or continue a GATT Primary Service Discovery procedure."]
8834#[doc = ""]
8835#[doc = " @details This function initiates or resumes a Primary Service discovery procedure, starting from the supplied handle."]
8836#[doc = "          If the last service has not been reached, this function must be called again with an updated start handle value to continue the search."]
8837#[doc = ""]
8838#[doc = " @note If any of the discovered services have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with"]
8839#[doc = "       type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event."]
8840#[doc = ""]
8841#[doc = " @events"]
8842#[doc = " @event{@ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP}"]
8843#[doc = " @endevents"]
8844#[doc = ""]
8845#[doc = " @mscs"]
8846#[doc = " @mmsc{@ref BLE_GATTC_PRIM_SRVC_DISC_MSC}"]
8847#[doc = " @endmscs"]
8848#[doc = ""]
8849#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
8850#[doc = " @param[in] start_handle Handle to start searching from."]
8851#[doc = " @param[in] p_srvc_uuid Pointer to the service UUID to be found. If it is NULL, all primary services will be returned."]
8852#[doc = ""]
8853#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Primary Service Discovery procedure."]
8854#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
8855#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
8856#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
8857#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
8858#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
8859#[inline(always)]
8860pub unsafe fn sd_ble_gattc_primary_services_discover(
8861    conn_handle: u16,
8862    start_handle: u16,
8863    p_srvc_uuid: *const ble_uuid_t,
8864) -> u32 {
8865    let ret: u32;
8866    core::arch::asm!("svc 155",
8867        inout("r0") to_asm(conn_handle) => ret,
8868        inout("r1") to_asm(start_handle) => _,
8869        inout("r2") to_asm(p_srvc_uuid) => _,
8870        lateout("r3") _,
8871        lateout("r12") _,
8872    );
8873    ret
8874}
8875
8876#[doc = "@brief Initiate or continue a GATT Relationship Discovery procedure."]
8877#[doc = ""]
8878#[doc = " @details This function initiates or resumes the Find Included Services sub-procedure. If the last included service has not been reached,"]
8879#[doc = "          this must be called again with an updated handle range to continue the search."]
8880#[doc = ""]
8881#[doc = " @events"]
8882#[doc = " @event{@ref BLE_GATTC_EVT_REL_DISC_RSP}"]
8883#[doc = " @endevents"]
8884#[doc = ""]
8885#[doc = " @mscs"]
8886#[doc = " @mmsc{@ref BLE_GATTC_REL_DISC_MSC}"]
8887#[doc = " @endmscs"]
8888#[doc = ""]
8889#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
8890#[doc = " @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on."]
8891#[doc = ""]
8892#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Relationship Discovery procedure."]
8893#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
8894#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
8895#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
8896#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
8897#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
8898#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
8899#[inline(always)]
8900pub unsafe fn sd_ble_gattc_relationships_discover(
8901    conn_handle: u16,
8902    p_handle_range: *const ble_gattc_handle_range_t,
8903) -> u32 {
8904    let ret: u32;
8905    core::arch::asm!("svc 156",
8906        inout("r0") to_asm(conn_handle) => ret,
8907        inout("r1") to_asm(p_handle_range) => _,
8908        lateout("r2") _,
8909        lateout("r3") _,
8910        lateout("r12") _,
8911    );
8912    ret
8913}
8914
8915#[doc = "@brief Initiate or continue a GATT Characteristic Discovery procedure."]
8916#[doc = ""]
8917#[doc = " @details This function initiates or resumes a Characteristic discovery procedure. If the last Characteristic has not been reached,"]
8918#[doc = "          this must be called again with an updated handle range to continue the discovery."]
8919#[doc = ""]
8920#[doc = " @note If any of the discovered characteristics have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with"]
8921#[doc = "       type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event."]
8922#[doc = ""]
8923#[doc = " @events"]
8924#[doc = " @event{@ref BLE_GATTC_EVT_CHAR_DISC_RSP}"]
8925#[doc = " @endevents"]
8926#[doc = ""]
8927#[doc = " @mscs"]
8928#[doc = " @mmsc{@ref BLE_GATTC_CHAR_DISC_MSC}"]
8929#[doc = " @endmscs"]
8930#[doc = ""]
8931#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
8932#[doc = " @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on."]
8933#[doc = ""]
8934#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Characteristic Discovery procedure."]
8935#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
8936#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
8937#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
8938#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
8939#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
8940#[inline(always)]
8941pub unsafe fn sd_ble_gattc_characteristics_discover(
8942    conn_handle: u16,
8943    p_handle_range: *const ble_gattc_handle_range_t,
8944) -> u32 {
8945    let ret: u32;
8946    core::arch::asm!("svc 157",
8947        inout("r0") to_asm(conn_handle) => ret,
8948        inout("r1") to_asm(p_handle_range) => _,
8949        lateout("r2") _,
8950        lateout("r3") _,
8951        lateout("r12") _,
8952    );
8953    ret
8954}
8955
8956#[doc = "@brief Initiate or continue a GATT Characteristic Descriptor Discovery procedure."]
8957#[doc = ""]
8958#[doc = " @details This function initiates or resumes a Characteristic Descriptor discovery procedure. If the last Descriptor has not been reached,"]
8959#[doc = "          this must be called again with an updated handle range to continue the discovery."]
8960#[doc = ""]
8961#[doc = " @events"]
8962#[doc = " @event{@ref BLE_GATTC_EVT_DESC_DISC_RSP}"]
8963#[doc = " @endevents"]
8964#[doc = ""]
8965#[doc = " @mscs"]
8966#[doc = " @mmsc{@ref BLE_GATTC_DESC_DISC_MSC}"]
8967#[doc = " @endmscs"]
8968#[doc = ""]
8969#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
8970#[doc = " @param[in] p_handle_range A pointer to the range of handles of the Characteristic to perform this procedure on."]
8971#[doc = ""]
8972#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Descriptor Discovery procedure."]
8973#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
8974#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
8975#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
8976#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
8977#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
8978#[inline(always)]
8979pub unsafe fn sd_ble_gattc_descriptors_discover(
8980    conn_handle: u16,
8981    p_handle_range: *const ble_gattc_handle_range_t,
8982) -> u32 {
8983    let ret: u32;
8984    core::arch::asm!("svc 158",
8985        inout("r0") to_asm(conn_handle) => ret,
8986        inout("r1") to_asm(p_handle_range) => _,
8987        lateout("r2") _,
8988        lateout("r3") _,
8989        lateout("r12") _,
8990    );
8991    ret
8992}
8993
8994#[doc = "@brief Initiate or continue a GATT Read using Characteristic UUID procedure."]
8995#[doc = ""]
8996#[doc = " @details This function initiates or resumes a Read using Characteristic UUID procedure. If the last Characteristic has not been reached,"]
8997#[doc = "          this must be called again with an updated handle range to continue the discovery."]
8998#[doc = ""]
8999#[doc = " @events"]
9000#[doc = " @event{@ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP}"]
9001#[doc = " @endevents"]
9002#[doc = ""]
9003#[doc = " @mscs"]
9004#[doc = " @mmsc{@ref BLE_GATTC_READ_UUID_MSC}"]
9005#[doc = " @endmscs"]
9006#[doc = ""]
9007#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
9008#[doc = " @param[in] p_uuid Pointer to a Characteristic value UUID to read."]
9009#[doc = " @param[in] p_handle_range A pointer to the range of handles to perform this procedure on."]
9010#[doc = ""]
9011#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Read using Characteristic UUID procedure."]
9012#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
9013#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
9014#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
9015#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
9016#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
9017#[inline(always)]
9018pub unsafe fn sd_ble_gattc_char_value_by_uuid_read(
9019    conn_handle: u16,
9020    p_uuid: *const ble_uuid_t,
9021    p_handle_range: *const ble_gattc_handle_range_t,
9022) -> u32 {
9023    let ret: u32;
9024    core::arch::asm!("svc 160",
9025        inout("r0") to_asm(conn_handle) => ret,
9026        inout("r1") to_asm(p_uuid) => _,
9027        inout("r2") to_asm(p_handle_range) => _,
9028        lateout("r3") _,
9029        lateout("r12") _,
9030    );
9031    ret
9032}
9033
9034#[doc = "@brief Initiate or continue a GATT Read (Long) Characteristic or Descriptor procedure."]
9035#[doc = ""]
9036#[doc = " @details This function initiates or resumes a GATT Read (Long) Characteristic or Descriptor procedure. If the Characteristic or Descriptor"]
9037#[doc = "          to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the"]
9038#[doc = "          complete value."]
9039#[doc = ""]
9040#[doc = " @events"]
9041#[doc = " @event{@ref BLE_GATTC_EVT_READ_RSP}"]
9042#[doc = " @endevents"]
9043#[doc = ""]
9044#[doc = " @mscs"]
9045#[doc = " @mmsc{@ref BLE_GATTC_VALUE_READ_MSC}"]
9046#[doc = " @endmscs"]
9047#[doc = ""]
9048#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
9049#[doc = " @param[in] handle The handle of the attribute to be read."]
9050#[doc = " @param[in] offset Offset into the attribute value to be read."]
9051#[doc = ""]
9052#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Read (Long) procedure."]
9053#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
9054#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
9055#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
9056#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
9057#[inline(always)]
9058pub unsafe fn sd_ble_gattc_read(conn_handle: u16, handle: u16, offset: u16) -> u32 {
9059    let ret: u32;
9060    core::arch::asm!("svc 161",
9061        inout("r0") to_asm(conn_handle) => ret,
9062        inout("r1") to_asm(handle) => _,
9063        inout("r2") to_asm(offset) => _,
9064        lateout("r3") _,
9065        lateout("r12") _,
9066    );
9067    ret
9068}
9069
9070#[doc = "@brief Initiate a GATT Read Multiple Characteristic Values procedure."]
9071#[doc = ""]
9072#[doc = " @details This function initiates a GATT Read Multiple Characteristic Values procedure."]
9073#[doc = ""]
9074#[doc = " @events"]
9075#[doc = " @event{@ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP}"]
9076#[doc = " @endevents"]
9077#[doc = ""]
9078#[doc = " @mscs"]
9079#[doc = " @mmsc{@ref BLE_GATTC_READ_MULT_MSC}"]
9080#[doc = " @endmscs"]
9081#[doc = ""]
9082#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
9083#[doc = " @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read."]
9084#[doc = " @param[in] handle_count The number of handles in p_handles."]
9085#[doc = ""]
9086#[doc = " @retval ::NRF_SUCCESS Successfully started the Read Multiple Characteristic Values procedure."]
9087#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
9088#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
9089#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
9090#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
9091#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
9092#[inline(always)]
9093pub unsafe fn sd_ble_gattc_char_values_read(conn_handle: u16, p_handles: *const u16, handle_count: u16) -> u32 {
9094    let ret: u32;
9095    core::arch::asm!("svc 162",
9096        inout("r0") to_asm(conn_handle) => ret,
9097        inout("r1") to_asm(p_handles) => _,
9098        inout("r2") to_asm(handle_count) => _,
9099        lateout("r3") _,
9100        lateout("r12") _,
9101    );
9102    ret
9103}
9104
9105#[doc = "@brief Perform a Write (Characteristic Value or Descriptor, with or without response, signed or not, long or reliable) procedure."]
9106#[doc = ""]
9107#[doc = " @details This function can perform all write procedures described in GATT."]
9108#[doc = ""]
9109#[doc = " @note    Only one write with response procedure can be ongoing per connection at a time."]
9110#[doc = "          If the application tries to write with response while another write with response procedure is ongoing,"]
9111#[doc = "          the function call will return @ref NRF_ERROR_BUSY."]
9112#[doc = "          A @ref BLE_GATTC_EVT_WRITE_RSP event will be issued as soon as the write response arrives from the peer."]
9113#[doc = ""]
9114#[doc = " @note    The number of Write without Response that can be queued is configured by @ref ble_gattc_conn_cfg_t::write_cmd_tx_queue_size"]
9115#[doc = "          When the queue is full, the function call will return @ref NRF_ERROR_RESOURCES."]
9116#[doc = "          A @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event will be issued as soon as the transmission of the write without response is complete."]
9117#[doc = ""]
9118#[doc = " @note    The application can keep track of the available queue element count for writes without responses by following the procedure below:"]
9119#[doc = "          - Store initial queue element count in a variable."]
9120#[doc = "          - Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns @ref NRF_SUCCESS."]
9121#[doc = "          - Increment the variable, which stores the current available queue element count, by the count variable in @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event."]
9122#[doc = ""]
9123#[doc = " @events"]
9124#[doc = " @event{@ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE, Write without response transmission complete.}"]
9125#[doc = " @event{@ref BLE_GATTC_EVT_WRITE_RSP, Write response received from the peer.}"]
9126#[doc = " @endevents"]
9127#[doc = ""]
9128#[doc = " @mscs"]
9129#[doc = " @mmsc{@ref BLE_GATTC_VALUE_WRITE_WITHOUT_RESP_MSC}"]
9130#[doc = " @mmsc{@ref BLE_GATTC_VALUE_WRITE_MSC}"]
9131#[doc = " @mmsc{@ref BLE_GATTC_VALUE_LONG_WRITE_MSC}"]
9132#[doc = " @mmsc{@ref BLE_GATTC_VALUE_RELIABLE_WRITE_MSC}"]
9133#[doc = " @endmscs"]
9134#[doc = ""]
9135#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
9136#[doc = " @param[in] p_write_params A pointer to a write parameters structure."]
9137#[doc = ""]
9138#[doc = " @retval ::NRF_SUCCESS Successfully started the Write procedure."]
9139#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
9140#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
9141#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
9142#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
9143#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied."]
9144#[doc = " @retval ::NRF_ERROR_BUSY For write with response, procedure already in progress. Wait for a @ref BLE_GATTC_EVT_WRITE_RSP event and retry."]
9145#[doc = " @retval ::NRF_ERROR_RESOURCES Too many writes without responses queued."]
9146#[doc = "                               Wait for a @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event and retry."]
9147#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
9148#[inline(always)]
9149pub unsafe fn sd_ble_gattc_write(conn_handle: u16, p_write_params: *const ble_gattc_write_params_t) -> u32 {
9150    let ret: u32;
9151    core::arch::asm!("svc 163",
9152        inout("r0") to_asm(conn_handle) => ret,
9153        inout("r1") to_asm(p_write_params) => _,
9154        lateout("r2") _,
9155        lateout("r3") _,
9156        lateout("r12") _,
9157    );
9158    ret
9159}
9160
9161#[doc = "@brief Send a Handle Value Confirmation to the GATT Server."]
9162#[doc = ""]
9163#[doc = " @mscs"]
9164#[doc = " @mmsc{@ref BLE_GATTC_HVI_MSC}"]
9165#[doc = " @endmscs"]
9166#[doc = ""]
9167#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
9168#[doc = " @param[in] handle The handle of the attribute in the indication."]
9169#[doc = ""]
9170#[doc = " @retval ::NRF_SUCCESS Successfully queued the Handle Value Confirmation for transmission."]
9171#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
9172#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no Indication pending to be confirmed."]
9173#[doc = " @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle."]
9174#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
9175#[inline(always)]
9176pub unsafe fn sd_ble_gattc_hv_confirm(conn_handle: u16, handle: u16) -> u32 {
9177    let ret: u32;
9178    core::arch::asm!("svc 164",
9179        inout("r0") to_asm(conn_handle) => ret,
9180        inout("r1") to_asm(handle) => _,
9181        lateout("r2") _,
9182        lateout("r3") _,
9183        lateout("r12") _,
9184    );
9185    ret
9186}
9187
9188#[doc = "@brief Discovers information about a range of attributes on a GATT server."]
9189#[doc = ""]
9190#[doc = " @events"]
9191#[doc = " @event{@ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, Generated when information about a range of attributes has been received.}"]
9192#[doc = " @endevents"]
9193#[doc = ""]
9194#[doc = " @param[in] conn_handle    The connection handle identifying the connection to perform this procedure on."]
9195#[doc = " @param[in] p_handle_range The range of handles to request information about."]
9196#[doc = ""]
9197#[doc = " @retval ::NRF_SUCCESS Successfully started an attribute information discovery procedure."]
9198#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle."]
9199#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid connection state"]
9200#[doc = " @retval ::NRF_ERROR_INVALID_ADDR  Invalid pointer supplied."]
9201#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
9202#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
9203#[inline(always)]
9204pub unsafe fn sd_ble_gattc_attr_info_discover(
9205    conn_handle: u16,
9206    p_handle_range: *const ble_gattc_handle_range_t,
9207) -> u32 {
9208    let ret: u32;
9209    core::arch::asm!("svc 159",
9210        inout("r0") to_asm(conn_handle) => ret,
9211        inout("r1") to_asm(p_handle_range) => _,
9212        lateout("r2") _,
9213        lateout("r3") _,
9214        lateout("r12") _,
9215    );
9216    ret
9217}
9218
9219#[doc = "@brief Start an ATT_MTU exchange by sending an Exchange MTU Request to the server."]
9220#[doc = ""]
9221#[doc = " @details The SoftDevice sets ATT_MTU to the minimum of:"]
9222#[doc = "          - The Client RX MTU value, and"]
9223#[doc = "          - The Server RX MTU value from @ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP."]
9224#[doc = ""]
9225#[doc = "          However, the SoftDevice never sets ATT_MTU lower than @ref BLE_GATT_ATT_MTU_DEFAULT."]
9226#[doc = ""]
9227#[doc = " @events"]
9228#[doc = " @event{@ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP}"]
9229#[doc = " @endevents"]
9230#[doc = ""]
9231#[doc = " @mscs"]
9232#[doc = " @mmsc{@ref BLE_GATTC_MTU_EXCHANGE}"]
9233#[doc = " @endmscs"]
9234#[doc = ""]
9235#[doc = " @param[in] conn_handle    The connection handle identifying the connection to perform this procedure on."]
9236#[doc = " @param[in] client_rx_mtu  Client RX MTU size."]
9237#[doc = "                           - The minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT."]
9238#[doc = "                           - The maximum value is @ref ble_gatt_conn_cfg_t::att_mtu in the connection configuration"]
9239#[doc = "used for this connection."]
9240#[doc = "                           - The value must be equal to Server RX MTU size given in @ref sd_ble_gatts_exchange_mtu_reply"]
9241#[doc = "                             if an ATT_MTU exchange has already been performed in the other direction."]
9242#[doc = ""]
9243#[doc = " @retval ::NRF_SUCCESS Successfully sent request to the server."]
9244#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle."]
9245#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid connection state or an ATT_MTU exchange was already requested once."]
9246#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid Client RX MTU size supplied."]
9247#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
9248#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
9249#[inline(always)]
9250pub unsafe fn sd_ble_gattc_exchange_mtu_request(conn_handle: u16, client_rx_mtu: u16) -> u32 {
9251    let ret: u32;
9252    core::arch::asm!("svc 165",
9253        inout("r0") to_asm(conn_handle) => ret,
9254        inout("r1") to_asm(client_rx_mtu) => _,
9255        lateout("r2") _,
9256        lateout("r3") _,
9257        lateout("r12") _,
9258    );
9259    ret
9260}
9261
9262#[doc = "< Add a service."]
9263pub const BLE_GATTS_SVCS_SD_BLE_GATTS_SERVICE_ADD: BLE_GATTS_SVCS = 168;
9264#[doc = "< Add an included service."]
9265pub const BLE_GATTS_SVCS_SD_BLE_GATTS_INCLUDE_ADD: BLE_GATTS_SVCS = 169;
9266#[doc = "< Add a characteristic."]
9267pub const BLE_GATTS_SVCS_SD_BLE_GATTS_CHARACTERISTIC_ADD: BLE_GATTS_SVCS = 170;
9268#[doc = "< Add a generic attribute."]
9269pub const BLE_GATTS_SVCS_SD_BLE_GATTS_DESCRIPTOR_ADD: BLE_GATTS_SVCS = 171;
9270#[doc = "< Set an attribute value."]
9271pub const BLE_GATTS_SVCS_SD_BLE_GATTS_VALUE_SET: BLE_GATTS_SVCS = 172;
9272#[doc = "< Get an attribute value."]
9273pub const BLE_GATTS_SVCS_SD_BLE_GATTS_VALUE_GET: BLE_GATTS_SVCS = 173;
9274#[doc = "< Handle Value Notification or Indication."]
9275pub const BLE_GATTS_SVCS_SD_BLE_GATTS_HVX: BLE_GATTS_SVCS = 174;
9276#[doc = "< Perform a Service Changed Indication to one or more peers."]
9277pub const BLE_GATTS_SVCS_SD_BLE_GATTS_SERVICE_CHANGED: BLE_GATTS_SVCS = 175;
9278#[doc = "< Reply to an authorization request for a read or write operation on one or more attributes."]
9279pub const BLE_GATTS_SVCS_SD_BLE_GATTS_RW_AUTHORIZE_REPLY: BLE_GATTS_SVCS = 176;
9280#[doc = "< Set the persistent system attributes for a connection."]
9281pub const BLE_GATTS_SVCS_SD_BLE_GATTS_SYS_ATTR_SET: BLE_GATTS_SVCS = 177;
9282#[doc = "< Retrieve the persistent system attributes."]
9283pub const BLE_GATTS_SVCS_SD_BLE_GATTS_SYS_ATTR_GET: BLE_GATTS_SVCS = 178;
9284#[doc = "< Retrieve the first valid user handle."]
9285pub const BLE_GATTS_SVCS_SD_BLE_GATTS_INITIAL_USER_HANDLE_GET: BLE_GATTS_SVCS = 179;
9286#[doc = "< Retrieve the UUID and/or metadata of an attribute."]
9287pub const BLE_GATTS_SVCS_SD_BLE_GATTS_ATTR_GET: BLE_GATTS_SVCS = 180;
9288#[doc = "< Reply to Exchange MTU Request."]
9289pub const BLE_GATTS_SVCS_SD_BLE_GATTS_EXCHANGE_MTU_REPLY: BLE_GATTS_SVCS = 181;
9290#[doc = " @brief GATTS API SVC numbers."]
9291pub type BLE_GATTS_SVCS = self::c_uint;
9292#[doc = "< Write operation performed.                                           \\n See @ref ble_gatts_evt_write_t."]
9293pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_WRITE: BLE_GATTS_EVTS = 80;
9294#[doc = "< Read/Write Authorization request.                                    \\n Reply with @ref sd_ble_gatts_rw_authorize_reply. \\n See @ref ble_gatts_evt_rw_authorize_request_t."]
9295pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST: BLE_GATTS_EVTS = 81;
9296#[doc = "< A persistent system attribute access is pending.                     \\n Respond with @ref sd_ble_gatts_sys_attr_set.     \\n See @ref ble_gatts_evt_sys_attr_missing_t."]
9297pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_SYS_ATTR_MISSING: BLE_GATTS_EVTS = 82;
9298#[doc = "< Handle Value Confirmation.                                           \\n See @ref ble_gatts_evt_hvc_t."]
9299pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_HVC: BLE_GATTS_EVTS = 83;
9300#[doc = "< Service Changed Confirmation.                                        \\n No additional event structure applies."]
9301pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_SC_CONFIRM: BLE_GATTS_EVTS = 84;
9302#[doc = "< Exchange MTU Request.                                                \\n Reply with @ref sd_ble_gatts_exchange_mtu_reply. \\n See @ref ble_gatts_evt_exchange_mtu_request_t."]
9303pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST: BLE_GATTS_EVTS = 85;
9304#[doc = "< Peer failed to respond to an ATT request in time.                    \\n See @ref ble_gatts_evt_timeout_t."]
9305pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_TIMEOUT: BLE_GATTS_EVTS = 86;
9306#[doc = "< Handle Value Notification transmission complete.                     \\n See @ref ble_gatts_evt_hvn_tx_complete_t."]
9307pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_HVN_TX_COMPLETE: BLE_GATTS_EVTS = 87;
9308#[doc = " @brief GATT Server Event IDs."]
9309pub type BLE_GATTS_EVTS = self::c_uint;
9310#[doc = "< Service changed configuration."]
9311pub const BLE_GATTS_CFGS_BLE_GATTS_CFG_SERVICE_CHANGED: BLE_GATTS_CFGS = 160;
9312#[doc = "< Attribute table size configuration."]
9313pub const BLE_GATTS_CFGS_BLE_GATTS_CFG_ATTR_TAB_SIZE: BLE_GATTS_CFGS = 161;
9314#[doc = "@brief GATTS Configuration IDs."]
9315#[doc = ""]
9316#[doc = " IDs that uniquely identify a GATTS configuration."]
9317pub type BLE_GATTS_CFGS = self::c_uint;
9318#[doc = " @brief BLE GATTS connection configuration parameters, set with @ref sd_ble_cfg_set."]
9319#[repr(C)]
9320#[derive(Debug, Copy, Clone)]
9321pub struct ble_gatts_conn_cfg_t {
9322    #[doc = "< Minimum guaranteed number of Handle Value Notifications that can be queued for transmission."]
9323    #[doc = "The default value is @ref BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT"]
9324    pub hvn_tx_queue_size: u8,
9325}
9326#[test]
9327fn bindgen_test_layout_ble_gatts_conn_cfg_t() {
9328    assert_eq!(
9329        ::core::mem::size_of::<ble_gatts_conn_cfg_t>(),
9330        1usize,
9331        concat!("Size of: ", stringify!(ble_gatts_conn_cfg_t))
9332    );
9333    assert_eq!(
9334        ::core::mem::align_of::<ble_gatts_conn_cfg_t>(),
9335        1usize,
9336        concat!("Alignment of ", stringify!(ble_gatts_conn_cfg_t))
9337    );
9338    assert_eq!(
9339        unsafe { &(*(::core::ptr::null::<ble_gatts_conn_cfg_t>())).hvn_tx_queue_size as *const _ as usize },
9340        0usize,
9341        concat!(
9342            "Offset of field: ",
9343            stringify!(ble_gatts_conn_cfg_t),
9344            "::",
9345            stringify!(hvn_tx_queue_size)
9346        )
9347    );
9348}
9349#[doc = "@brief Attribute metadata."]
9350#[repr(C)]
9351#[derive(Debug, Copy, Clone)]
9352pub struct ble_gatts_attr_md_t {
9353    #[doc = "< Read permissions."]
9354    pub read_perm: ble_gap_conn_sec_mode_t,
9355    #[doc = "< Write permissions."]
9356    pub write_perm: ble_gap_conn_sec_mode_t,
9357    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
9358}
9359#[test]
9360fn bindgen_test_layout_ble_gatts_attr_md_t() {
9361    assert_eq!(
9362        ::core::mem::size_of::<ble_gatts_attr_md_t>(),
9363        3usize,
9364        concat!("Size of: ", stringify!(ble_gatts_attr_md_t))
9365    );
9366    assert_eq!(
9367        ::core::mem::align_of::<ble_gatts_attr_md_t>(),
9368        1usize,
9369        concat!("Alignment of ", stringify!(ble_gatts_attr_md_t))
9370    );
9371    assert_eq!(
9372        unsafe { &(*(::core::ptr::null::<ble_gatts_attr_md_t>())).read_perm as *const _ as usize },
9373        0usize,
9374        concat!(
9375            "Offset of field: ",
9376            stringify!(ble_gatts_attr_md_t),
9377            "::",
9378            stringify!(read_perm)
9379        )
9380    );
9381    assert_eq!(
9382        unsafe { &(*(::core::ptr::null::<ble_gatts_attr_md_t>())).write_perm as *const _ as usize },
9383        1usize,
9384        concat!(
9385            "Offset of field: ",
9386            stringify!(ble_gatts_attr_md_t),
9387            "::",
9388            stringify!(write_perm)
9389        )
9390    );
9391}
9392impl ble_gatts_attr_md_t {
9393    #[inline]
9394    pub fn vlen(&self) -> u8 {
9395        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
9396    }
9397    #[inline]
9398    pub fn set_vlen(&mut self, val: u8) {
9399        unsafe {
9400            let val: u8 = ::core::mem::transmute(val);
9401            self._bitfield_1.set(0usize, 1u8, val as u64)
9402        }
9403    }
9404    #[inline]
9405    pub fn vloc(&self) -> u8 {
9406        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 2u8) as u8) }
9407    }
9408    #[inline]
9409    pub fn set_vloc(&mut self, val: u8) {
9410        unsafe {
9411            let val: u8 = ::core::mem::transmute(val);
9412            self._bitfield_1.set(1usize, 2u8, val as u64)
9413        }
9414    }
9415    #[inline]
9416    pub fn rd_auth(&self) -> u8 {
9417        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
9418    }
9419    #[inline]
9420    pub fn set_rd_auth(&mut self, val: u8) {
9421        unsafe {
9422            let val: u8 = ::core::mem::transmute(val);
9423            self._bitfield_1.set(3usize, 1u8, val as u64)
9424        }
9425    }
9426    #[inline]
9427    pub fn wr_auth(&self) -> u8 {
9428        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
9429    }
9430    #[inline]
9431    pub fn set_wr_auth(&mut self, val: u8) {
9432        unsafe {
9433            let val: u8 = ::core::mem::transmute(val);
9434            self._bitfield_1.set(4usize, 1u8, val as u64)
9435        }
9436    }
9437    #[inline]
9438    pub fn new_bitfield_1(vlen: u8, vloc: u8, rd_auth: u8, wr_auth: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
9439        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
9440        __bindgen_bitfield_unit.set(0usize, 1u8, {
9441            let vlen: u8 = unsafe { ::core::mem::transmute(vlen) };
9442            vlen as u64
9443        });
9444        __bindgen_bitfield_unit.set(1usize, 2u8, {
9445            let vloc: u8 = unsafe { ::core::mem::transmute(vloc) };
9446            vloc as u64
9447        });
9448        __bindgen_bitfield_unit.set(3usize, 1u8, {
9449            let rd_auth: u8 = unsafe { ::core::mem::transmute(rd_auth) };
9450            rd_auth as u64
9451        });
9452        __bindgen_bitfield_unit.set(4usize, 1u8, {
9453            let wr_auth: u8 = unsafe { ::core::mem::transmute(wr_auth) };
9454            wr_auth as u64
9455        });
9456        __bindgen_bitfield_unit
9457    }
9458}
9459#[doc = "@brief GATT Attribute."]
9460#[repr(C)]
9461#[derive(Debug, Copy, Clone)]
9462pub struct ble_gatts_attr_t {
9463    #[doc = "< Pointer to the attribute UUID."]
9464    pub p_uuid: *const ble_uuid_t,
9465    #[doc = "< Pointer to the attribute metadata structure."]
9466    pub p_attr_md: *const ble_gatts_attr_md_t,
9467    #[doc = "< Initial attribute value length in bytes."]
9468    pub init_len: u16,
9469    #[doc = "< Initial attribute value offset in bytes. If different from zero, the first init_offs bytes of the attribute value will be left uninitialized."]
9470    pub init_offs: u16,
9471    #[doc = "< Maximum attribute value length in bytes, see @ref BLE_GATTS_ATTR_LENS_MAX for maximum values."]
9472    pub max_len: u16,
9473    #[doc = "< Pointer to the attribute data. Please note that if the @ref BLE_GATTS_VLOC_USER value location is selected in the attribute metadata, this will have to point to a buffer"]
9474    #[doc = "that remains valid through the lifetime of the attribute. This excludes usage of automatic variables that may go out of scope or any other temporary location."]
9475    #[doc = "The stack may access that memory directly without the application's knowledge. For writable characteristics, this value must not be a location in flash memory."]
9476    pub p_value: *mut u8,
9477}
9478#[test]
9479fn bindgen_test_layout_ble_gatts_attr_t() {
9480    assert_eq!(
9481        ::core::mem::size_of::<ble_gatts_attr_t>(),
9482        20usize,
9483        concat!("Size of: ", stringify!(ble_gatts_attr_t))
9484    );
9485    assert_eq!(
9486        ::core::mem::align_of::<ble_gatts_attr_t>(),
9487        4usize,
9488        concat!("Alignment of ", stringify!(ble_gatts_attr_t))
9489    );
9490    assert_eq!(
9491        unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).p_uuid as *const _ as usize },
9492        0usize,
9493        concat!(
9494            "Offset of field: ",
9495            stringify!(ble_gatts_attr_t),
9496            "::",
9497            stringify!(p_uuid)
9498        )
9499    );
9500    assert_eq!(
9501        unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).p_attr_md as *const _ as usize },
9502        4usize,
9503        concat!(
9504            "Offset of field: ",
9505            stringify!(ble_gatts_attr_t),
9506            "::",
9507            stringify!(p_attr_md)
9508        )
9509    );
9510    assert_eq!(
9511        unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).init_len as *const _ as usize },
9512        8usize,
9513        concat!(
9514            "Offset of field: ",
9515            stringify!(ble_gatts_attr_t),
9516            "::",
9517            stringify!(init_len)
9518        )
9519    );
9520    assert_eq!(
9521        unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).init_offs as *const _ as usize },
9522        10usize,
9523        concat!(
9524            "Offset of field: ",
9525            stringify!(ble_gatts_attr_t),
9526            "::",
9527            stringify!(init_offs)
9528        )
9529    );
9530    assert_eq!(
9531        unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).max_len as *const _ as usize },
9532        12usize,
9533        concat!(
9534            "Offset of field: ",
9535            stringify!(ble_gatts_attr_t),
9536            "::",
9537            stringify!(max_len)
9538        )
9539    );
9540    assert_eq!(
9541        unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).p_value as *const _ as usize },
9542        16usize,
9543        concat!(
9544            "Offset of field: ",
9545            stringify!(ble_gatts_attr_t),
9546            "::",
9547            stringify!(p_value)
9548        )
9549    );
9550}
9551#[doc = "@brief GATT Attribute Value."]
9552#[repr(C)]
9553#[derive(Debug, Copy, Clone)]
9554pub struct ble_gatts_value_t {
9555    #[doc = "< Length in bytes to be written or read. Length in bytes written or read after successful return."]
9556    pub len: u16,
9557    #[doc = "< Attribute value offset."]
9558    pub offset: u16,
9559    #[doc = "< Pointer to where value is stored or will be stored."]
9560    #[doc = "If value is stored in user memory, only the attribute length is updated when p_value == NULL."]
9561    #[doc = "Set to NULL when reading to obtain the complete length of the attribute value"]
9562    pub p_value: *mut u8,
9563}
9564#[test]
9565fn bindgen_test_layout_ble_gatts_value_t() {
9566    assert_eq!(
9567        ::core::mem::size_of::<ble_gatts_value_t>(),
9568        8usize,
9569        concat!("Size of: ", stringify!(ble_gatts_value_t))
9570    );
9571    assert_eq!(
9572        ::core::mem::align_of::<ble_gatts_value_t>(),
9573        4usize,
9574        concat!("Alignment of ", stringify!(ble_gatts_value_t))
9575    );
9576    assert_eq!(
9577        unsafe { &(*(::core::ptr::null::<ble_gatts_value_t>())).len as *const _ as usize },
9578        0usize,
9579        concat!(
9580            "Offset of field: ",
9581            stringify!(ble_gatts_value_t),
9582            "::",
9583            stringify!(len)
9584        )
9585    );
9586    assert_eq!(
9587        unsafe { &(*(::core::ptr::null::<ble_gatts_value_t>())).offset as *const _ as usize },
9588        2usize,
9589        concat!(
9590            "Offset of field: ",
9591            stringify!(ble_gatts_value_t),
9592            "::",
9593            stringify!(offset)
9594        )
9595    );
9596    assert_eq!(
9597        unsafe { &(*(::core::ptr::null::<ble_gatts_value_t>())).p_value as *const _ as usize },
9598        4usize,
9599        concat!(
9600            "Offset of field: ",
9601            stringify!(ble_gatts_value_t),
9602            "::",
9603            stringify!(p_value)
9604        )
9605    );
9606}
9607#[doc = "@brief GATT Characteristic Presentation Format."]
9608#[repr(C)]
9609#[derive(Debug, Copy, Clone)]
9610pub struct ble_gatts_char_pf_t {
9611    #[doc = "< Format of the value, see @ref BLE_GATT_CPF_FORMATS."]
9612    pub format: u8,
9613    #[doc = "< Exponent for integer data types."]
9614    pub exponent: i8,
9615    #[doc = "< Unit from Bluetooth Assigned Numbers."]
9616    pub unit: u16,
9617    #[doc = "< Namespace from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES."]
9618    pub name_space: u8,
9619    #[doc = "< Namespace description from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES."]
9620    pub desc: u16,
9621}
9622#[test]
9623fn bindgen_test_layout_ble_gatts_char_pf_t() {
9624    assert_eq!(
9625        ::core::mem::size_of::<ble_gatts_char_pf_t>(),
9626        8usize,
9627        concat!("Size of: ", stringify!(ble_gatts_char_pf_t))
9628    );
9629    assert_eq!(
9630        ::core::mem::align_of::<ble_gatts_char_pf_t>(),
9631        2usize,
9632        concat!("Alignment of ", stringify!(ble_gatts_char_pf_t))
9633    );
9634    assert_eq!(
9635        unsafe { &(*(::core::ptr::null::<ble_gatts_char_pf_t>())).format as *const _ as usize },
9636        0usize,
9637        concat!(
9638            "Offset of field: ",
9639            stringify!(ble_gatts_char_pf_t),
9640            "::",
9641            stringify!(format)
9642        )
9643    );
9644    assert_eq!(
9645        unsafe { &(*(::core::ptr::null::<ble_gatts_char_pf_t>())).exponent as *const _ as usize },
9646        1usize,
9647        concat!(
9648            "Offset of field: ",
9649            stringify!(ble_gatts_char_pf_t),
9650            "::",
9651            stringify!(exponent)
9652        )
9653    );
9654    assert_eq!(
9655        unsafe { &(*(::core::ptr::null::<ble_gatts_char_pf_t>())).unit as *const _ as usize },
9656        2usize,
9657        concat!(
9658            "Offset of field: ",
9659            stringify!(ble_gatts_char_pf_t),
9660            "::",
9661            stringify!(unit)
9662        )
9663    );
9664    assert_eq!(
9665        unsafe { &(*(::core::ptr::null::<ble_gatts_char_pf_t>())).name_space as *const _ as usize },
9666        4usize,
9667        concat!(
9668            "Offset of field: ",
9669            stringify!(ble_gatts_char_pf_t),
9670            "::",
9671            stringify!(name_space)
9672        )
9673    );
9674    assert_eq!(
9675        unsafe { &(*(::core::ptr::null::<ble_gatts_char_pf_t>())).desc as *const _ as usize },
9676        6usize,
9677        concat!(
9678            "Offset of field: ",
9679            stringify!(ble_gatts_char_pf_t),
9680            "::",
9681            stringify!(desc)
9682        )
9683    );
9684}
9685#[doc = "@brief GATT Characteristic metadata."]
9686#[repr(C)]
9687#[derive(Debug, Copy, Clone)]
9688pub struct ble_gatts_char_md_t {
9689    #[doc = "< Characteristic Properties."]
9690    pub char_props: ble_gatt_char_props_t,
9691    #[doc = "< Characteristic Extended Properties."]
9692    pub char_ext_props: ble_gatt_char_ext_props_t,
9693    #[doc = "< Pointer to a UTF-8 encoded string (non-NULL terminated), NULL if the descriptor is not required."]
9694    pub p_char_user_desc: *const u8,
9695    #[doc = "< The maximum size in bytes of the user description descriptor."]
9696    pub char_user_desc_max_size: u16,
9697    #[doc = "< The size of the user description, must be smaller or equal to char_user_desc_max_size."]
9698    pub char_user_desc_size: u16,
9699    #[doc = "< Pointer to a presentation format structure or NULL if the CPF descriptor is not required."]
9700    pub p_char_pf: *const ble_gatts_char_pf_t,
9701    #[doc = "< Attribute metadata for the User Description descriptor, or NULL for default values."]
9702    pub p_user_desc_md: *const ble_gatts_attr_md_t,
9703    #[doc = "< Attribute metadata for the Client Characteristic Configuration Descriptor, or NULL for default values."]
9704    pub p_cccd_md: *const ble_gatts_attr_md_t,
9705    #[doc = "< Attribute metadata for the Server Characteristic Configuration Descriptor, or NULL for default values."]
9706    pub p_sccd_md: *const ble_gatts_attr_md_t,
9707}
9708#[test]
9709fn bindgen_test_layout_ble_gatts_char_md_t() {
9710    assert_eq!(
9711        ::core::mem::size_of::<ble_gatts_char_md_t>(),
9712        28usize,
9713        concat!("Size of: ", stringify!(ble_gatts_char_md_t))
9714    );
9715    assert_eq!(
9716        ::core::mem::align_of::<ble_gatts_char_md_t>(),
9717        4usize,
9718        concat!("Alignment of ", stringify!(ble_gatts_char_md_t))
9719    );
9720    assert_eq!(
9721        unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).char_props as *const _ as usize },
9722        0usize,
9723        concat!(
9724            "Offset of field: ",
9725            stringify!(ble_gatts_char_md_t),
9726            "::",
9727            stringify!(char_props)
9728        )
9729    );
9730    assert_eq!(
9731        unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).char_ext_props as *const _ as usize },
9732        1usize,
9733        concat!(
9734            "Offset of field: ",
9735            stringify!(ble_gatts_char_md_t),
9736            "::",
9737            stringify!(char_ext_props)
9738        )
9739    );
9740    assert_eq!(
9741        unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).p_char_user_desc as *const _ as usize },
9742        4usize,
9743        concat!(
9744            "Offset of field: ",
9745            stringify!(ble_gatts_char_md_t),
9746            "::",
9747            stringify!(p_char_user_desc)
9748        )
9749    );
9750    assert_eq!(
9751        unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).char_user_desc_max_size as *const _ as usize },
9752        8usize,
9753        concat!(
9754            "Offset of field: ",
9755            stringify!(ble_gatts_char_md_t),
9756            "::",
9757            stringify!(char_user_desc_max_size)
9758        )
9759    );
9760    assert_eq!(
9761        unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).char_user_desc_size as *const _ as usize },
9762        10usize,
9763        concat!(
9764            "Offset of field: ",
9765            stringify!(ble_gatts_char_md_t),
9766            "::",
9767            stringify!(char_user_desc_size)
9768        )
9769    );
9770    assert_eq!(
9771        unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).p_char_pf as *const _ as usize },
9772        12usize,
9773        concat!(
9774            "Offset of field: ",
9775            stringify!(ble_gatts_char_md_t),
9776            "::",
9777            stringify!(p_char_pf)
9778        )
9779    );
9780    assert_eq!(
9781        unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).p_user_desc_md as *const _ as usize },
9782        16usize,
9783        concat!(
9784            "Offset of field: ",
9785            stringify!(ble_gatts_char_md_t),
9786            "::",
9787            stringify!(p_user_desc_md)
9788        )
9789    );
9790    assert_eq!(
9791        unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).p_cccd_md as *const _ as usize },
9792        20usize,
9793        concat!(
9794            "Offset of field: ",
9795            stringify!(ble_gatts_char_md_t),
9796            "::",
9797            stringify!(p_cccd_md)
9798        )
9799    );
9800    assert_eq!(
9801        unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).p_sccd_md as *const _ as usize },
9802        24usize,
9803        concat!(
9804            "Offset of field: ",
9805            stringify!(ble_gatts_char_md_t),
9806            "::",
9807            stringify!(p_sccd_md)
9808        )
9809    );
9810}
9811#[doc = "@brief GATT Characteristic Definition Handles."]
9812#[repr(C)]
9813#[derive(Debug, Copy, Clone)]
9814pub struct ble_gatts_char_handles_t {
9815    #[doc = "< Handle to the characteristic value."]
9816    pub value_handle: u16,
9817    #[doc = "< Handle to the User Description descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present."]
9818    pub user_desc_handle: u16,
9819    #[doc = "< Handle to the Client Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present."]
9820    pub cccd_handle: u16,
9821    #[doc = "< Handle to the Server Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present."]
9822    pub sccd_handle: u16,
9823}
9824#[test]
9825fn bindgen_test_layout_ble_gatts_char_handles_t() {
9826    assert_eq!(
9827        ::core::mem::size_of::<ble_gatts_char_handles_t>(),
9828        8usize,
9829        concat!("Size of: ", stringify!(ble_gatts_char_handles_t))
9830    );
9831    assert_eq!(
9832        ::core::mem::align_of::<ble_gatts_char_handles_t>(),
9833        2usize,
9834        concat!("Alignment of ", stringify!(ble_gatts_char_handles_t))
9835    );
9836    assert_eq!(
9837        unsafe { &(*(::core::ptr::null::<ble_gatts_char_handles_t>())).value_handle as *const _ as usize },
9838        0usize,
9839        concat!(
9840            "Offset of field: ",
9841            stringify!(ble_gatts_char_handles_t),
9842            "::",
9843            stringify!(value_handle)
9844        )
9845    );
9846    assert_eq!(
9847        unsafe { &(*(::core::ptr::null::<ble_gatts_char_handles_t>())).user_desc_handle as *const _ as usize },
9848        2usize,
9849        concat!(
9850            "Offset of field: ",
9851            stringify!(ble_gatts_char_handles_t),
9852            "::",
9853            stringify!(user_desc_handle)
9854        )
9855    );
9856    assert_eq!(
9857        unsafe { &(*(::core::ptr::null::<ble_gatts_char_handles_t>())).cccd_handle as *const _ as usize },
9858        4usize,
9859        concat!(
9860            "Offset of field: ",
9861            stringify!(ble_gatts_char_handles_t),
9862            "::",
9863            stringify!(cccd_handle)
9864        )
9865    );
9866    assert_eq!(
9867        unsafe { &(*(::core::ptr::null::<ble_gatts_char_handles_t>())).sccd_handle as *const _ as usize },
9868        6usize,
9869        concat!(
9870            "Offset of field: ",
9871            stringify!(ble_gatts_char_handles_t),
9872            "::",
9873            stringify!(sccd_handle)
9874        )
9875    );
9876}
9877#[doc = "@brief GATT HVx parameters."]
9878#[repr(C)]
9879#[derive(Debug, Copy, Clone)]
9880pub struct ble_gatts_hvx_params_t {
9881    #[doc = "< Characteristic Value Handle."]
9882    pub handle: u16,
9883    #[doc = "< Indication or Notification, see @ref BLE_GATT_HVX_TYPES."]
9884    pub type_: u8,
9885    #[doc = "< Offset within the attribute value."]
9886    pub offset: u16,
9887    #[doc = "< Length in bytes to be written, length in bytes written after return."]
9888    pub p_len: *mut u16,
9889    #[doc = "< Actual data content, use NULL to use the current attribute value."]
9890    pub p_data: *const u8,
9891}
9892#[test]
9893fn bindgen_test_layout_ble_gatts_hvx_params_t() {
9894    assert_eq!(
9895        ::core::mem::size_of::<ble_gatts_hvx_params_t>(),
9896        16usize,
9897        concat!("Size of: ", stringify!(ble_gatts_hvx_params_t))
9898    );
9899    assert_eq!(
9900        ::core::mem::align_of::<ble_gatts_hvx_params_t>(),
9901        4usize,
9902        concat!("Alignment of ", stringify!(ble_gatts_hvx_params_t))
9903    );
9904    assert_eq!(
9905        unsafe { &(*(::core::ptr::null::<ble_gatts_hvx_params_t>())).handle as *const _ as usize },
9906        0usize,
9907        concat!(
9908            "Offset of field: ",
9909            stringify!(ble_gatts_hvx_params_t),
9910            "::",
9911            stringify!(handle)
9912        )
9913    );
9914    assert_eq!(
9915        unsafe { &(*(::core::ptr::null::<ble_gatts_hvx_params_t>())).type_ as *const _ as usize },
9916        2usize,
9917        concat!(
9918            "Offset of field: ",
9919            stringify!(ble_gatts_hvx_params_t),
9920            "::",
9921            stringify!(type_)
9922        )
9923    );
9924    assert_eq!(
9925        unsafe { &(*(::core::ptr::null::<ble_gatts_hvx_params_t>())).offset as *const _ as usize },
9926        4usize,
9927        concat!(
9928            "Offset of field: ",
9929            stringify!(ble_gatts_hvx_params_t),
9930            "::",
9931            stringify!(offset)
9932        )
9933    );
9934    assert_eq!(
9935        unsafe { &(*(::core::ptr::null::<ble_gatts_hvx_params_t>())).p_len as *const _ as usize },
9936        8usize,
9937        concat!(
9938            "Offset of field: ",
9939            stringify!(ble_gatts_hvx_params_t),
9940            "::",
9941            stringify!(p_len)
9942        )
9943    );
9944    assert_eq!(
9945        unsafe { &(*(::core::ptr::null::<ble_gatts_hvx_params_t>())).p_data as *const _ as usize },
9946        12usize,
9947        concat!(
9948            "Offset of field: ",
9949            stringify!(ble_gatts_hvx_params_t),
9950            "::",
9951            stringify!(p_data)
9952        )
9953    );
9954}
9955#[doc = "@brief GATT Authorization parameters."]
9956#[repr(C)]
9957#[derive(Debug, Copy, Clone)]
9958pub struct ble_gatts_authorize_params_t {
9959    #[doc = "< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES."]
9960    pub gatt_status: u16,
9961    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
9962    #[doc = "< Offset of the attribute value being updated."]
9963    pub offset: u16,
9964    #[doc = "< Length in bytes of the value in p_data pointer, see @ref BLE_GATTS_ATTR_LENS_MAX."]
9965    pub len: u16,
9966    #[doc = "< Pointer to new value used to update the attribute value."]
9967    pub p_data: *const u8,
9968}
9969#[test]
9970fn bindgen_test_layout_ble_gatts_authorize_params_t() {
9971    assert_eq!(
9972        ::core::mem::size_of::<ble_gatts_authorize_params_t>(),
9973        12usize,
9974        concat!("Size of: ", stringify!(ble_gatts_authorize_params_t))
9975    );
9976    assert_eq!(
9977        ::core::mem::align_of::<ble_gatts_authorize_params_t>(),
9978        4usize,
9979        concat!("Alignment of ", stringify!(ble_gatts_authorize_params_t))
9980    );
9981    assert_eq!(
9982        unsafe { &(*(::core::ptr::null::<ble_gatts_authorize_params_t>())).gatt_status as *const _ as usize },
9983        0usize,
9984        concat!(
9985            "Offset of field: ",
9986            stringify!(ble_gatts_authorize_params_t),
9987            "::",
9988            stringify!(gatt_status)
9989        )
9990    );
9991    assert_eq!(
9992        unsafe { &(*(::core::ptr::null::<ble_gatts_authorize_params_t>())).offset as *const _ as usize },
9993        4usize,
9994        concat!(
9995            "Offset of field: ",
9996            stringify!(ble_gatts_authorize_params_t),
9997            "::",
9998            stringify!(offset)
9999        )
10000    );
10001    assert_eq!(
10002        unsafe { &(*(::core::ptr::null::<ble_gatts_authorize_params_t>())).len as *const _ as usize },
10003        6usize,
10004        concat!(
10005            "Offset of field: ",
10006            stringify!(ble_gatts_authorize_params_t),
10007            "::",
10008            stringify!(len)
10009        )
10010    );
10011    assert_eq!(
10012        unsafe { &(*(::core::ptr::null::<ble_gatts_authorize_params_t>())).p_data as *const _ as usize },
10013        8usize,
10014        concat!(
10015            "Offset of field: ",
10016            stringify!(ble_gatts_authorize_params_t),
10017            "::",
10018            stringify!(p_data)
10019        )
10020    );
10021}
10022impl ble_gatts_authorize_params_t {
10023    #[inline]
10024    pub fn update(&self) -> u8 {
10025        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
10026    }
10027    #[inline]
10028    pub fn set_update(&mut self, val: u8) {
10029        unsafe {
10030            let val: u8 = ::core::mem::transmute(val);
10031            self._bitfield_1.set(0usize, 1u8, val as u64)
10032        }
10033    }
10034    #[inline]
10035    pub fn new_bitfield_1(update: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
10036        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
10037        __bindgen_bitfield_unit.set(0usize, 1u8, {
10038            let update: u8 = unsafe { ::core::mem::transmute(update) };
10039            update as u64
10040        });
10041        __bindgen_bitfield_unit
10042    }
10043}
10044#[doc = "@brief GATT Read or Write Authorize Reply parameters."]
10045#[repr(C)]
10046#[derive(Copy, Clone)]
10047pub struct ble_gatts_rw_authorize_reply_params_t {
10048    #[doc = "< Type of authorize operation, see @ref BLE_GATTS_AUTHORIZE_TYPES."]
10049    pub type_: u8,
10050    #[doc = "< Reply Parameters."]
10051    pub params: ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1,
10052}
10053#[repr(C)]
10054#[derive(Copy, Clone)]
10055pub union ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1 {
10056    #[doc = "< Read authorization parameters."]
10057    pub read: ble_gatts_authorize_params_t,
10058    #[doc = "< Write authorization parameters."]
10059    pub write: ble_gatts_authorize_params_t,
10060    _bindgen_union_align: [u32; 3usize],
10061}
10062#[test]
10063fn bindgen_test_layout_ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1() {
10064    assert_eq!(
10065        ::core::mem::size_of::<ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1>(),
10066        12usize,
10067        concat!(
10068            "Size of: ",
10069            stringify!(ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1)
10070        )
10071    );
10072    assert_eq!(
10073        ::core::mem::align_of::<ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1>(),
10074        4usize,
10075        concat!(
10076            "Alignment of ",
10077            stringify!(ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1)
10078        )
10079    );
10080    assert_eq!(
10081        unsafe {
10082            &(*(::core::ptr::null::<ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1>())).read as *const _ as usize
10083        },
10084        0usize,
10085        concat!(
10086            "Offset of field: ",
10087            stringify!(ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1),
10088            "::",
10089            stringify!(read)
10090        )
10091    );
10092    assert_eq!(
10093        unsafe {
10094            &(*(::core::ptr::null::<ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1>())).write as *const _ as usize
10095        },
10096        0usize,
10097        concat!(
10098            "Offset of field: ",
10099            stringify!(ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1),
10100            "::",
10101            stringify!(write)
10102        )
10103    );
10104}
10105#[test]
10106fn bindgen_test_layout_ble_gatts_rw_authorize_reply_params_t() {
10107    assert_eq!(
10108        ::core::mem::size_of::<ble_gatts_rw_authorize_reply_params_t>(),
10109        16usize,
10110        concat!("Size of: ", stringify!(ble_gatts_rw_authorize_reply_params_t))
10111    );
10112    assert_eq!(
10113        ::core::mem::align_of::<ble_gatts_rw_authorize_reply_params_t>(),
10114        4usize,
10115        concat!("Alignment of ", stringify!(ble_gatts_rw_authorize_reply_params_t))
10116    );
10117    assert_eq!(
10118        unsafe { &(*(::core::ptr::null::<ble_gatts_rw_authorize_reply_params_t>())).type_ as *const _ as usize },
10119        0usize,
10120        concat!(
10121            "Offset of field: ",
10122            stringify!(ble_gatts_rw_authorize_reply_params_t),
10123            "::",
10124            stringify!(type_)
10125        )
10126    );
10127    assert_eq!(
10128        unsafe { &(*(::core::ptr::null::<ble_gatts_rw_authorize_reply_params_t>())).params as *const _ as usize },
10129        4usize,
10130        concat!(
10131            "Offset of field: ",
10132            stringify!(ble_gatts_rw_authorize_reply_params_t),
10133            "::",
10134            stringify!(params)
10135        )
10136    );
10137}
10138#[doc = "@brief Service Changed Inclusion configuration parameters, set with @ref sd_ble_cfg_set."]
10139#[repr(C, packed)]
10140#[derive(Debug, Copy, Clone)]
10141pub struct ble_gatts_cfg_service_changed_t {
10142    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
10143}
10144#[test]
10145fn bindgen_test_layout_ble_gatts_cfg_service_changed_t() {
10146    assert_eq!(
10147        ::core::mem::size_of::<ble_gatts_cfg_service_changed_t>(),
10148        1usize,
10149        concat!("Size of: ", stringify!(ble_gatts_cfg_service_changed_t))
10150    );
10151    assert_eq!(
10152        ::core::mem::align_of::<ble_gatts_cfg_service_changed_t>(),
10153        1usize,
10154        concat!("Alignment of ", stringify!(ble_gatts_cfg_service_changed_t))
10155    );
10156}
10157impl ble_gatts_cfg_service_changed_t {
10158    #[inline]
10159    pub fn service_changed(&self) -> u8 {
10160        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
10161    }
10162    #[inline]
10163    pub fn set_service_changed(&mut self, val: u8) {
10164        unsafe {
10165            let val: u8 = ::core::mem::transmute(val);
10166            self._bitfield_1.set(0usize, 1u8, val as u64)
10167        }
10168    }
10169    #[inline]
10170    pub fn new_bitfield_1(service_changed: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
10171        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
10172        __bindgen_bitfield_unit.set(0usize, 1u8, {
10173            let service_changed: u8 = unsafe { ::core::mem::transmute(service_changed) };
10174            service_changed as u64
10175        });
10176        __bindgen_bitfield_unit
10177    }
10178}
10179#[doc = "@brief Attribute table size configuration parameters, set with @ref sd_ble_cfg_set."]
10180#[doc = ""]
10181#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH One or more of the following is true:"]
10182#[doc = "                                    - The specified Attribute Table size is too small."]
10183#[doc = "                                      The minimum acceptable size is defined by @ref BLE_GATTS_ATTR_TAB_SIZE_MIN."]
10184#[doc = "                                    - The specified Attribute Table size is not a multiple of 4."]
10185#[repr(C)]
10186#[derive(Debug, Copy, Clone)]
10187pub struct ble_gatts_cfg_attr_tab_size_t {
10188    #[doc = "< Attribute table size. Default is @ref BLE_GATTS_ATTR_TAB_SIZE_DEFAULT, minimum is @ref BLE_GATTS_ATTR_TAB_SIZE_MIN."]
10189    pub attr_tab_size: u32,
10190}
10191#[test]
10192fn bindgen_test_layout_ble_gatts_cfg_attr_tab_size_t() {
10193    assert_eq!(
10194        ::core::mem::size_of::<ble_gatts_cfg_attr_tab_size_t>(),
10195        4usize,
10196        concat!("Size of: ", stringify!(ble_gatts_cfg_attr_tab_size_t))
10197    );
10198    assert_eq!(
10199        ::core::mem::align_of::<ble_gatts_cfg_attr_tab_size_t>(),
10200        4usize,
10201        concat!("Alignment of ", stringify!(ble_gatts_cfg_attr_tab_size_t))
10202    );
10203    assert_eq!(
10204        unsafe { &(*(::core::ptr::null::<ble_gatts_cfg_attr_tab_size_t>())).attr_tab_size as *const _ as usize },
10205        0usize,
10206        concat!(
10207            "Offset of field: ",
10208            stringify!(ble_gatts_cfg_attr_tab_size_t),
10209            "::",
10210            stringify!(attr_tab_size)
10211        )
10212    );
10213}
10214#[doc = "@brief Config structure for GATTS configurations."]
10215#[repr(C)]
10216#[derive(Copy, Clone)]
10217pub union ble_gatts_cfg_t {
10218    #[doc = "< Include service changed characteristic, cfg_id is @ref BLE_GATTS_CFG_SERVICE_CHANGED."]
10219    pub service_changed: ble_gatts_cfg_service_changed_t,
10220    #[doc = "< Attribute table size, cfg_id is @ref BLE_GATTS_CFG_ATTR_TAB_SIZE."]
10221    pub attr_tab_size: ble_gatts_cfg_attr_tab_size_t,
10222    _bindgen_union_align: u32,
10223}
10224#[test]
10225fn bindgen_test_layout_ble_gatts_cfg_t() {
10226    assert_eq!(
10227        ::core::mem::size_of::<ble_gatts_cfg_t>(),
10228        4usize,
10229        concat!("Size of: ", stringify!(ble_gatts_cfg_t))
10230    );
10231    assert_eq!(
10232        ::core::mem::align_of::<ble_gatts_cfg_t>(),
10233        4usize,
10234        concat!("Alignment of ", stringify!(ble_gatts_cfg_t))
10235    );
10236    assert_eq!(
10237        unsafe { &(*(::core::ptr::null::<ble_gatts_cfg_t>())).service_changed as *const _ as usize },
10238        0usize,
10239        concat!(
10240            "Offset of field: ",
10241            stringify!(ble_gatts_cfg_t),
10242            "::",
10243            stringify!(service_changed)
10244        )
10245    );
10246    assert_eq!(
10247        unsafe { &(*(::core::ptr::null::<ble_gatts_cfg_t>())).attr_tab_size as *const _ as usize },
10248        0usize,
10249        concat!(
10250            "Offset of field: ",
10251            stringify!(ble_gatts_cfg_t),
10252            "::",
10253            stringify!(attr_tab_size)
10254        )
10255    );
10256}
10257#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_WRITE."]
10258#[repr(C)]
10259#[derive(Debug)]
10260pub struct ble_gatts_evt_write_t {
10261    #[doc = "< Attribute Handle."]
10262    pub handle: u16,
10263    #[doc = "< Attribute UUID."]
10264    pub uuid: ble_uuid_t,
10265    #[doc = "< Type of write operation, see @ref BLE_GATTS_OPS."]
10266    pub op: u8,
10267    #[doc = "< Writing operation deferred due to authorization requirement. Application may use @ref sd_ble_gatts_value_set to finalize the writing operation."]
10268    pub auth_required: u8,
10269    #[doc = "< Offset for the write operation."]
10270    pub offset: u16,
10271    #[doc = "< Length of the received data."]
10272    pub len: u16,
10273    #[doc = "< Received data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
10274    #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
10275    pub data: __IncompleteArrayField<u8>,
10276}
10277#[test]
10278fn bindgen_test_layout_ble_gatts_evt_write_t() {
10279    assert_eq!(
10280        ::core::mem::size_of::<ble_gatts_evt_write_t>(),
10281        12usize,
10282        concat!("Size of: ", stringify!(ble_gatts_evt_write_t))
10283    );
10284    assert_eq!(
10285        ::core::mem::align_of::<ble_gatts_evt_write_t>(),
10286        2usize,
10287        concat!("Alignment of ", stringify!(ble_gatts_evt_write_t))
10288    );
10289    assert_eq!(
10290        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).handle as *const _ as usize },
10291        0usize,
10292        concat!(
10293            "Offset of field: ",
10294            stringify!(ble_gatts_evt_write_t),
10295            "::",
10296            stringify!(handle)
10297        )
10298    );
10299    assert_eq!(
10300        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).uuid as *const _ as usize },
10301        2usize,
10302        concat!(
10303            "Offset of field: ",
10304            stringify!(ble_gatts_evt_write_t),
10305            "::",
10306            stringify!(uuid)
10307        )
10308    );
10309    assert_eq!(
10310        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).op as *const _ as usize },
10311        6usize,
10312        concat!(
10313            "Offset of field: ",
10314            stringify!(ble_gatts_evt_write_t),
10315            "::",
10316            stringify!(op)
10317        )
10318    );
10319    assert_eq!(
10320        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).auth_required as *const _ as usize },
10321        7usize,
10322        concat!(
10323            "Offset of field: ",
10324            stringify!(ble_gatts_evt_write_t),
10325            "::",
10326            stringify!(auth_required)
10327        )
10328    );
10329    assert_eq!(
10330        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).offset as *const _ as usize },
10331        8usize,
10332        concat!(
10333            "Offset of field: ",
10334            stringify!(ble_gatts_evt_write_t),
10335            "::",
10336            stringify!(offset)
10337        )
10338    );
10339    assert_eq!(
10340        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).len as *const _ as usize },
10341        10usize,
10342        concat!(
10343            "Offset of field: ",
10344            stringify!(ble_gatts_evt_write_t),
10345            "::",
10346            stringify!(len)
10347        )
10348    );
10349    assert_eq!(
10350        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).data as *const _ as usize },
10351        12usize,
10352        concat!(
10353            "Offset of field: ",
10354            stringify!(ble_gatts_evt_write_t),
10355            "::",
10356            stringify!(data)
10357        )
10358    );
10359}
10360#[doc = "@brief Event substructure for authorized read requests, see @ref ble_gatts_evt_rw_authorize_request_t."]
10361#[repr(C)]
10362#[derive(Debug, Copy, Clone)]
10363pub struct ble_gatts_evt_read_t {
10364    #[doc = "< Attribute Handle."]
10365    pub handle: u16,
10366    #[doc = "< Attribute UUID."]
10367    pub uuid: ble_uuid_t,
10368    #[doc = "< Offset for the read operation."]
10369    pub offset: u16,
10370}
10371#[test]
10372fn bindgen_test_layout_ble_gatts_evt_read_t() {
10373    assert_eq!(
10374        ::core::mem::size_of::<ble_gatts_evt_read_t>(),
10375        8usize,
10376        concat!("Size of: ", stringify!(ble_gatts_evt_read_t))
10377    );
10378    assert_eq!(
10379        ::core::mem::align_of::<ble_gatts_evt_read_t>(),
10380        2usize,
10381        concat!("Alignment of ", stringify!(ble_gatts_evt_read_t))
10382    );
10383    assert_eq!(
10384        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_read_t>())).handle as *const _ as usize },
10385        0usize,
10386        concat!(
10387            "Offset of field: ",
10388            stringify!(ble_gatts_evt_read_t),
10389            "::",
10390            stringify!(handle)
10391        )
10392    );
10393    assert_eq!(
10394        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_read_t>())).uuid as *const _ as usize },
10395        2usize,
10396        concat!(
10397            "Offset of field: ",
10398            stringify!(ble_gatts_evt_read_t),
10399            "::",
10400            stringify!(uuid)
10401        )
10402    );
10403    assert_eq!(
10404        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_read_t>())).offset as *const _ as usize },
10405        6usize,
10406        concat!(
10407            "Offset of field: ",
10408            stringify!(ble_gatts_evt_read_t),
10409            "::",
10410            stringify!(offset)
10411        )
10412    );
10413}
10414#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST."]
10415#[repr(C)]
10416pub struct ble_gatts_evt_rw_authorize_request_t {
10417    #[doc = "< Type of authorize operation, see @ref BLE_GATTS_AUTHORIZE_TYPES."]
10418    pub type_: u8,
10419    #[doc = "< Request Parameters."]
10420    pub request: ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1,
10421}
10422#[repr(C)]
10423pub struct ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1 {
10424    #[doc = "< Attribute Read Parameters."]
10425    pub read: __BindgenUnionField<ble_gatts_evt_read_t>,
10426    #[doc = "< Attribute Write Parameters."]
10427    pub write: __BindgenUnionField<ble_gatts_evt_write_t>,
10428    pub bindgen_union_field: [u16; 6usize],
10429}
10430#[test]
10431fn bindgen_test_layout_ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1() {
10432    assert_eq!(
10433        ::core::mem::size_of::<ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1>(),
10434        12usize,
10435        concat!(
10436            "Size of: ",
10437            stringify!(ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1)
10438        )
10439    );
10440    assert_eq!(
10441        ::core::mem::align_of::<ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1>(),
10442        2usize,
10443        concat!(
10444            "Alignment of ",
10445            stringify!(ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1)
10446        )
10447    );
10448    assert_eq!(
10449        unsafe {
10450            &(*(::core::ptr::null::<ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1>())).read as *const _ as usize
10451        },
10452        0usize,
10453        concat!(
10454            "Offset of field: ",
10455            stringify!(ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1),
10456            "::",
10457            stringify!(read)
10458        )
10459    );
10460    assert_eq!(
10461        unsafe {
10462            &(*(::core::ptr::null::<ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1>())).write as *const _ as usize
10463        },
10464        0usize,
10465        concat!(
10466            "Offset of field: ",
10467            stringify!(ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1),
10468            "::",
10469            stringify!(write)
10470        )
10471    );
10472}
10473#[test]
10474fn bindgen_test_layout_ble_gatts_evt_rw_authorize_request_t() {
10475    assert_eq!(
10476        ::core::mem::size_of::<ble_gatts_evt_rw_authorize_request_t>(),
10477        14usize,
10478        concat!("Size of: ", stringify!(ble_gatts_evt_rw_authorize_request_t))
10479    );
10480    assert_eq!(
10481        ::core::mem::align_of::<ble_gatts_evt_rw_authorize_request_t>(),
10482        2usize,
10483        concat!("Alignment of ", stringify!(ble_gatts_evt_rw_authorize_request_t))
10484    );
10485    assert_eq!(
10486        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_rw_authorize_request_t>())).type_ as *const _ as usize },
10487        0usize,
10488        concat!(
10489            "Offset of field: ",
10490            stringify!(ble_gatts_evt_rw_authorize_request_t),
10491            "::",
10492            stringify!(type_)
10493        )
10494    );
10495    assert_eq!(
10496        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_rw_authorize_request_t>())).request as *const _ as usize },
10497        2usize,
10498        concat!(
10499            "Offset of field: ",
10500            stringify!(ble_gatts_evt_rw_authorize_request_t),
10501            "::",
10502            stringify!(request)
10503        )
10504    );
10505}
10506#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_SYS_ATTR_MISSING."]
10507#[repr(C)]
10508#[derive(Debug, Copy, Clone)]
10509pub struct ble_gatts_evt_sys_attr_missing_t {
10510    #[doc = "< Hint (currently unused)."]
10511    pub hint: u8,
10512}
10513#[test]
10514fn bindgen_test_layout_ble_gatts_evt_sys_attr_missing_t() {
10515    assert_eq!(
10516        ::core::mem::size_of::<ble_gatts_evt_sys_attr_missing_t>(),
10517        1usize,
10518        concat!("Size of: ", stringify!(ble_gatts_evt_sys_attr_missing_t))
10519    );
10520    assert_eq!(
10521        ::core::mem::align_of::<ble_gatts_evt_sys_attr_missing_t>(),
10522        1usize,
10523        concat!("Alignment of ", stringify!(ble_gatts_evt_sys_attr_missing_t))
10524    );
10525    assert_eq!(
10526        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_sys_attr_missing_t>())).hint as *const _ as usize },
10527        0usize,
10528        concat!(
10529            "Offset of field: ",
10530            stringify!(ble_gatts_evt_sys_attr_missing_t),
10531            "::",
10532            stringify!(hint)
10533        )
10534    );
10535}
10536#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_HVC."]
10537#[repr(C)]
10538#[derive(Debug, Copy, Clone)]
10539pub struct ble_gatts_evt_hvc_t {
10540    #[doc = "< Attribute Handle."]
10541    pub handle: u16,
10542}
10543#[test]
10544fn bindgen_test_layout_ble_gatts_evt_hvc_t() {
10545    assert_eq!(
10546        ::core::mem::size_of::<ble_gatts_evt_hvc_t>(),
10547        2usize,
10548        concat!("Size of: ", stringify!(ble_gatts_evt_hvc_t))
10549    );
10550    assert_eq!(
10551        ::core::mem::align_of::<ble_gatts_evt_hvc_t>(),
10552        2usize,
10553        concat!("Alignment of ", stringify!(ble_gatts_evt_hvc_t))
10554    );
10555    assert_eq!(
10556        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_hvc_t>())).handle as *const _ as usize },
10557        0usize,
10558        concat!(
10559            "Offset of field: ",
10560            stringify!(ble_gatts_evt_hvc_t),
10561            "::",
10562            stringify!(handle)
10563        )
10564    );
10565}
10566#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST."]
10567#[repr(C)]
10568#[derive(Debug, Copy, Clone)]
10569pub struct ble_gatts_evt_exchange_mtu_request_t {
10570    #[doc = "< Client RX MTU size."]
10571    pub client_rx_mtu: u16,
10572}
10573#[test]
10574fn bindgen_test_layout_ble_gatts_evt_exchange_mtu_request_t() {
10575    assert_eq!(
10576        ::core::mem::size_of::<ble_gatts_evt_exchange_mtu_request_t>(),
10577        2usize,
10578        concat!("Size of: ", stringify!(ble_gatts_evt_exchange_mtu_request_t))
10579    );
10580    assert_eq!(
10581        ::core::mem::align_of::<ble_gatts_evt_exchange_mtu_request_t>(),
10582        2usize,
10583        concat!("Alignment of ", stringify!(ble_gatts_evt_exchange_mtu_request_t))
10584    );
10585    assert_eq!(
10586        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_exchange_mtu_request_t>())).client_rx_mtu as *const _ as usize },
10587        0usize,
10588        concat!(
10589            "Offset of field: ",
10590            stringify!(ble_gatts_evt_exchange_mtu_request_t),
10591            "::",
10592            stringify!(client_rx_mtu)
10593        )
10594    );
10595}
10596#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_TIMEOUT."]
10597#[repr(C)]
10598#[derive(Debug, Copy, Clone)]
10599pub struct ble_gatts_evt_timeout_t {
10600    #[doc = "< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES."]
10601    pub src: u8,
10602}
10603#[test]
10604fn bindgen_test_layout_ble_gatts_evt_timeout_t() {
10605    assert_eq!(
10606        ::core::mem::size_of::<ble_gatts_evt_timeout_t>(),
10607        1usize,
10608        concat!("Size of: ", stringify!(ble_gatts_evt_timeout_t))
10609    );
10610    assert_eq!(
10611        ::core::mem::align_of::<ble_gatts_evt_timeout_t>(),
10612        1usize,
10613        concat!("Alignment of ", stringify!(ble_gatts_evt_timeout_t))
10614    );
10615    assert_eq!(
10616        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_timeout_t>())).src as *const _ as usize },
10617        0usize,
10618        concat!(
10619            "Offset of field: ",
10620            stringify!(ble_gatts_evt_timeout_t),
10621            "::",
10622            stringify!(src)
10623        )
10624    );
10625}
10626#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_HVN_TX_COMPLETE."]
10627#[repr(C)]
10628#[derive(Debug, Copy, Clone)]
10629pub struct ble_gatts_evt_hvn_tx_complete_t {
10630    #[doc = "< Number of notification transmissions completed."]
10631    pub count: u8,
10632}
10633#[test]
10634fn bindgen_test_layout_ble_gatts_evt_hvn_tx_complete_t() {
10635    assert_eq!(
10636        ::core::mem::size_of::<ble_gatts_evt_hvn_tx_complete_t>(),
10637        1usize,
10638        concat!("Size of: ", stringify!(ble_gatts_evt_hvn_tx_complete_t))
10639    );
10640    assert_eq!(
10641        ::core::mem::align_of::<ble_gatts_evt_hvn_tx_complete_t>(),
10642        1usize,
10643        concat!("Alignment of ", stringify!(ble_gatts_evt_hvn_tx_complete_t))
10644    );
10645    assert_eq!(
10646        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_hvn_tx_complete_t>())).count as *const _ as usize },
10647        0usize,
10648        concat!(
10649            "Offset of field: ",
10650            stringify!(ble_gatts_evt_hvn_tx_complete_t),
10651            "::",
10652            stringify!(count)
10653        )
10654    );
10655}
10656#[doc = "@brief GATTS event structure."]
10657#[repr(C)]
10658pub struct ble_gatts_evt_t {
10659    #[doc = "< Connection Handle on which the event occurred."]
10660    pub conn_handle: u16,
10661    #[doc = "< Event Parameters."]
10662    pub params: ble_gatts_evt_t__bindgen_ty_1,
10663}
10664#[repr(C)]
10665pub struct ble_gatts_evt_t__bindgen_ty_1 {
10666    #[doc = "< Write Event Parameters."]
10667    pub write: __BindgenUnionField<ble_gatts_evt_write_t>,
10668    #[doc = "< Read or Write Authorize Request Parameters."]
10669    pub authorize_request: __BindgenUnionField<ble_gatts_evt_rw_authorize_request_t>,
10670    #[doc = "< System attributes missing."]
10671    pub sys_attr_missing: __BindgenUnionField<ble_gatts_evt_sys_attr_missing_t>,
10672    #[doc = "< Handle Value Confirmation Event Parameters."]
10673    pub hvc: __BindgenUnionField<ble_gatts_evt_hvc_t>,
10674    #[doc = "< Exchange MTU Request Event Parameters."]
10675    pub exchange_mtu_request: __BindgenUnionField<ble_gatts_evt_exchange_mtu_request_t>,
10676    #[doc = "< Timeout Event."]
10677    pub timeout: __BindgenUnionField<ble_gatts_evt_timeout_t>,
10678    #[doc = "< Handle Value Notification transmission complete Event Parameters."]
10679    pub hvn_tx_complete: __BindgenUnionField<ble_gatts_evt_hvn_tx_complete_t>,
10680    pub bindgen_union_field: [u16; 7usize],
10681}
10682#[test]
10683fn bindgen_test_layout_ble_gatts_evt_t__bindgen_ty_1() {
10684    assert_eq!(
10685        ::core::mem::size_of::<ble_gatts_evt_t__bindgen_ty_1>(),
10686        14usize,
10687        concat!("Size of: ", stringify!(ble_gatts_evt_t__bindgen_ty_1))
10688    );
10689    assert_eq!(
10690        ::core::mem::align_of::<ble_gatts_evt_t__bindgen_ty_1>(),
10691        2usize,
10692        concat!("Alignment of ", stringify!(ble_gatts_evt_t__bindgen_ty_1))
10693    );
10694    assert_eq!(
10695        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).write as *const _ as usize },
10696        0usize,
10697        concat!(
10698            "Offset of field: ",
10699            stringify!(ble_gatts_evt_t__bindgen_ty_1),
10700            "::",
10701            stringify!(write)
10702        )
10703    );
10704    assert_eq!(
10705        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).authorize_request as *const _ as usize },
10706        0usize,
10707        concat!(
10708            "Offset of field: ",
10709            stringify!(ble_gatts_evt_t__bindgen_ty_1),
10710            "::",
10711            stringify!(authorize_request)
10712        )
10713    );
10714    assert_eq!(
10715        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).sys_attr_missing as *const _ as usize },
10716        0usize,
10717        concat!(
10718            "Offset of field: ",
10719            stringify!(ble_gatts_evt_t__bindgen_ty_1),
10720            "::",
10721            stringify!(sys_attr_missing)
10722        )
10723    );
10724    assert_eq!(
10725        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).hvc as *const _ as usize },
10726        0usize,
10727        concat!(
10728            "Offset of field: ",
10729            stringify!(ble_gatts_evt_t__bindgen_ty_1),
10730            "::",
10731            stringify!(hvc)
10732        )
10733    );
10734    assert_eq!(
10735        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).exchange_mtu_request as *const _ as usize },
10736        0usize,
10737        concat!(
10738            "Offset of field: ",
10739            stringify!(ble_gatts_evt_t__bindgen_ty_1),
10740            "::",
10741            stringify!(exchange_mtu_request)
10742        )
10743    );
10744    assert_eq!(
10745        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).timeout as *const _ as usize },
10746        0usize,
10747        concat!(
10748            "Offset of field: ",
10749            stringify!(ble_gatts_evt_t__bindgen_ty_1),
10750            "::",
10751            stringify!(timeout)
10752        )
10753    );
10754    assert_eq!(
10755        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).hvn_tx_complete as *const _ as usize },
10756        0usize,
10757        concat!(
10758            "Offset of field: ",
10759            stringify!(ble_gatts_evt_t__bindgen_ty_1),
10760            "::",
10761            stringify!(hvn_tx_complete)
10762        )
10763    );
10764}
10765#[test]
10766fn bindgen_test_layout_ble_gatts_evt_t() {
10767    assert_eq!(
10768        ::core::mem::size_of::<ble_gatts_evt_t>(),
10769        16usize,
10770        concat!("Size of: ", stringify!(ble_gatts_evt_t))
10771    );
10772    assert_eq!(
10773        ::core::mem::align_of::<ble_gatts_evt_t>(),
10774        2usize,
10775        concat!("Alignment of ", stringify!(ble_gatts_evt_t))
10776    );
10777    assert_eq!(
10778        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t>())).conn_handle as *const _ as usize },
10779        0usize,
10780        concat!(
10781            "Offset of field: ",
10782            stringify!(ble_gatts_evt_t),
10783            "::",
10784            stringify!(conn_handle)
10785        )
10786    );
10787    assert_eq!(
10788        unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t>())).params as *const _ as usize },
10789        2usize,
10790        concat!(
10791            "Offset of field: ",
10792            stringify!(ble_gatts_evt_t),
10793            "::",
10794            stringify!(params)
10795        )
10796    );
10797}
10798
10799#[doc = "@brief Add a service declaration to the Attribute Table."]
10800#[doc = ""]
10801#[doc = " @note Secondary Services are only relevant in the context of the entity that references them, it is therefore forbidden to"]
10802#[doc = "       add a secondary service declaration that is not referenced by another service later in the Attribute Table."]
10803#[doc = ""]
10804#[doc = " @mscs"]
10805#[doc = " @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}"]
10806#[doc = " @endmscs"]
10807#[doc = ""]
10808#[doc = " @param[in] type      Toggles between primary and secondary services, see @ref BLE_GATTS_SRVC_TYPES."]
10809#[doc = " @param[in] p_uuid    Pointer to service UUID."]
10810#[doc = " @param[out] p_handle Pointer to a 16-bit word where the assigned handle will be stored."]
10811#[doc = ""]
10812#[doc = " @retval ::NRF_SUCCESS Successfully added a service declaration."]
10813#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10814#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, Vendor Specific UUIDs need to be present in the table."]
10815#[doc = " @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack."]
10816#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
10817#[inline(always)]
10818pub unsafe fn sd_ble_gatts_service_add(type_: u8, p_uuid: *const ble_uuid_t, p_handle: *mut u16) -> u32 {
10819    let ret: u32;
10820    core::arch::asm!("svc 168",
10821        inout("r0") to_asm(type_) => ret,
10822        inout("r1") to_asm(p_uuid) => _,
10823        inout("r2") to_asm(p_handle) => _,
10824        lateout("r3") _,
10825        lateout("r12") _,
10826    );
10827    ret
10828}
10829
10830#[doc = "@brief Add an include declaration to the Attribute Table."]
10831#[doc = ""]
10832#[doc = " @note It is currently only possible to add an include declaration to the last added service (i.e. only sequential population is supported at this time)."]
10833#[doc = ""]
10834#[doc = " @note The included service must already be present in the Attribute Table prior to this call."]
10835#[doc = ""]
10836#[doc = " @mscs"]
10837#[doc = " @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}"]
10838#[doc = " @endmscs"]
10839#[doc = ""]
10840#[doc = " @param[in] service_handle    Handle of the service where the included service is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially."]
10841#[doc = " @param[in] inc_srvc_handle   Handle of the included service."]
10842#[doc = " @param[out] p_include_handle Pointer to a 16-bit word where the assigned handle will be stored."]
10843#[doc = ""]
10844#[doc = " @retval ::NRF_SUCCESS Successfully added an include declaration."]
10845#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10846#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, handle values need to match previously added services."]
10847#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required."]
10848#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Feature is not supported, service_handle must be that of the last added service."]
10849#[doc = " @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, self inclusions are not allowed."]
10850#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
10851#[doc = " @retval ::NRF_ERROR_NOT_FOUND Attribute not found."]
10852#[inline(always)]
10853pub unsafe fn sd_ble_gatts_include_add(service_handle: u16, inc_srvc_handle: u16, p_include_handle: *mut u16) -> u32 {
10854    let ret: u32;
10855    core::arch::asm!("svc 169",
10856        inout("r0") to_asm(service_handle) => ret,
10857        inout("r1") to_asm(inc_srvc_handle) => _,
10858        inout("r2") to_asm(p_include_handle) => _,
10859        lateout("r3") _,
10860        lateout("r12") _,
10861    );
10862    ret
10863}
10864
10865#[doc = "@brief Add a characteristic declaration, a characteristic value declaration and optional characteristic descriptor declarations to the Attribute Table."]
10866#[doc = ""]
10867#[doc = " @note It is currently only possible to add a characteristic to the last added service (i.e. only sequential population is supported at this time)."]
10868#[doc = ""]
10869#[doc = " @note Several restrictions apply to the parameters, such as matching permissions between the user description descriptor and the writable auxiliaries bits,"]
10870#[doc = "       readable (no security) and writable (selectable) CCCDs and SCCDs and valid presentation format values."]
10871#[doc = ""]
10872#[doc = " @note If no metadata is provided for the optional descriptors, their permissions will be derived from the characteristic permissions."]
10873#[doc = ""]
10874#[doc = " @mscs"]
10875#[doc = " @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}"]
10876#[doc = " @endmscs"]
10877#[doc = ""]
10878#[doc = " @param[in] service_handle    Handle of the service where the characteristic is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially."]
10879#[doc = " @param[in] p_char_md         Characteristic metadata."]
10880#[doc = " @param[in] p_attr_char_value Pointer to the attribute structure corresponding to the characteristic value."]
10881#[doc = " @param[out] p_handles        Pointer to the structure where the assigned handles will be stored."]
10882#[doc = ""]
10883#[doc = " @retval ::NRF_SUCCESS Successfully added a characteristic."]
10884#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10885#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, service handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints."]
10886#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required."]
10887#[doc = " @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack."]
10888#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
10889#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX."]
10890#[inline(always)]
10891pub unsafe fn sd_ble_gatts_characteristic_add(
10892    service_handle: u16,
10893    p_char_md: *const ble_gatts_char_md_t,
10894    p_attr_char_value: *const ble_gatts_attr_t,
10895    p_handles: *mut ble_gatts_char_handles_t,
10896) -> u32 {
10897    let ret: u32;
10898    core::arch::asm!("svc 170",
10899        inout("r0") to_asm(service_handle) => ret,
10900        inout("r1") to_asm(p_char_md) => _,
10901        inout("r2") to_asm(p_attr_char_value) => _,
10902        inout("r3") to_asm(p_handles) => _,
10903        lateout("r12") _,
10904    );
10905    ret
10906}
10907
10908#[doc = "@brief Add a descriptor to the Attribute Table."]
10909#[doc = ""]
10910#[doc = " @note It is currently only possible to add a descriptor to the last added characteristic (i.e. only sequential population is supported at this time)."]
10911#[doc = ""]
10912#[doc = " @mscs"]
10913#[doc = " @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}"]
10914#[doc = " @endmscs"]
10915#[doc = ""]
10916#[doc = " @param[in] char_handle   Handle of the characteristic where the descriptor is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially."]
10917#[doc = " @param[in] p_attr        Pointer to the attribute structure."]
10918#[doc = " @param[out] p_handle     Pointer to a 16-bit word where the assigned handle will be stored."]
10919#[doc = ""]
10920#[doc = " @retval ::NRF_SUCCESS Successfully added a descriptor."]
10921#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10922#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, characteristic handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints."]
10923#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a characteristic context is required."]
10924#[doc = " @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack."]
10925#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
10926#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX."]
10927#[inline(always)]
10928pub unsafe fn sd_ble_gatts_descriptor_add(
10929    char_handle: u16,
10930    p_attr: *const ble_gatts_attr_t,
10931    p_handle: *mut u16,
10932) -> u32 {
10933    let ret: u32;
10934    core::arch::asm!("svc 171",
10935        inout("r0") to_asm(char_handle) => ret,
10936        inout("r1") to_asm(p_attr) => _,
10937        inout("r2") to_asm(p_handle) => _,
10938        lateout("r3") _,
10939        lateout("r12") _,
10940    );
10941    ret
10942}
10943
10944#[doc = "@brief Set the value of a given attribute."]
10945#[doc = ""]
10946#[doc = " @note Values other than system attributes can be set at any time, regardless of whether any active connections exist."]
10947#[doc = ""]
10948#[doc = " @mscs"]
10949#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC}"]
10950#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC}"]
10951#[doc = " @endmscs"]
10952#[doc = ""]
10953#[doc = " @param[in] conn_handle  Connection handle. Ignored if the value does not belong to a system attribute."]
10954#[doc = " @param[in] handle       Attribute handle."]
10955#[doc = " @param[in,out] p_value  Attribute value information."]
10956#[doc = ""]
10957#[doc = " @retval ::NRF_SUCCESS Successfully set the value of the attribute."]
10958#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10959#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
10960#[doc = " @retval ::NRF_ERROR_NOT_FOUND Attribute not found."]
10961#[doc = " @retval ::NRF_ERROR_FORBIDDEN Forbidden handle supplied, certain attributes are not modifiable by the application."]
10962#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX."]
10963#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute."]
10964#[inline(always)]
10965pub unsafe fn sd_ble_gatts_value_set(conn_handle: u16, handle: u16, p_value: *mut ble_gatts_value_t) -> u32 {
10966    let ret: u32;
10967    core::arch::asm!("svc 172",
10968        inout("r0") to_asm(conn_handle) => ret,
10969        inout("r1") to_asm(handle) => _,
10970        inout("r2") to_asm(p_value) => _,
10971        lateout("r3") _,
10972        lateout("r12") _,
10973    );
10974    ret
10975}
10976
10977#[doc = "@brief Get the value of a given attribute."]
10978#[doc = ""]
10979#[doc = " @note                 If the attribute value is longer than the size of the supplied buffer,"]
10980#[doc = "                       @ref ble_gatts_value_t::len will return the total attribute value length (excluding offset),"]
10981#[doc = "                       and not the number of bytes actually returned in @ref ble_gatts_value_t::p_value."]
10982#[doc = "                       The application may use this information to allocate a suitable buffer size."]
10983#[doc = ""]
10984#[doc = " @note                 When retrieving system attribute values with this function, the connection handle"]
10985#[doc = "                       may refer to an already disconnected connection. Refer to the documentation of"]
10986#[doc = "                       @ref sd_ble_gatts_sys_attr_get for further information."]
10987#[doc = ""]
10988#[doc = " @param[in] conn_handle  Connection handle. Ignored if the value does not belong to a system attribute."]
10989#[doc = " @param[in] handle       Attribute handle."]
10990#[doc = " @param[in,out] p_value  Attribute value information."]
10991#[doc = ""]
10992#[doc = " @retval ::NRF_SUCCESS Successfully retrieved the value of the attribute."]
10993#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10994#[doc = " @retval ::NRF_ERROR_NOT_FOUND Attribute not found."]
10995#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid attribute offset supplied."]
10996#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute."]
10997#[doc = " @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value."]
10998#[inline(always)]
10999pub unsafe fn sd_ble_gatts_value_get(conn_handle: u16, handle: u16, p_value: *mut ble_gatts_value_t) -> u32 {
11000    let ret: u32;
11001    core::arch::asm!("svc 173",
11002        inout("r0") to_asm(conn_handle) => ret,
11003        inout("r1") to_asm(handle) => _,
11004        inout("r2") to_asm(p_value) => _,
11005        lateout("r3") _,
11006        lateout("r12") _,
11007    );
11008    ret
11009}
11010
11011#[doc = "@brief Notify or Indicate an attribute value."]
11012#[doc = ""]
11013#[doc = " @details This function checks for the relevant Client Characteristic Configuration descriptor value to verify that the relevant operation"]
11014#[doc = "          (notification or indication) has been enabled by the client. It is also able to update the attribute value before issuing the PDU, so that"]
11015#[doc = "          the application can atomically perform a value update and a server initiated transaction with a single API call."]
11016#[doc = ""]
11017#[doc = " @note    The local attribute value may be updated even if an outgoing packet is not sent to the peer due to an error during execution."]
11018#[doc = "          The Attribute Table has been updated if one of the following error codes is returned: @ref NRF_ERROR_INVALID_STATE, @ref NRF_ERROR_BUSY,"]
11019#[doc = "          @ref NRF_ERROR_FORBIDDEN, @ref BLE_ERROR_GATTS_SYS_ATTR_MISSING and @ref NRF_ERROR_RESOURCES."]
11020#[doc = "          The caller can check whether the value has been updated by looking at the contents of *(@ref ble_gatts_hvx_params_t::p_len)."]
11021#[doc = ""]
11022#[doc = " @note    Only one indication procedure can be ongoing per connection at a time."]
11023#[doc = "          If the application tries to indicate an attribute value while another indication procedure is ongoing,"]
11024#[doc = "          the function call will return @ref NRF_ERROR_BUSY."]
11025#[doc = "          A @ref BLE_GATTS_EVT_HVC event will be issued as soon as the confirmation arrives from the peer."]
11026#[doc = ""]
11027#[doc = " @note    The number of Handle Value Notifications that can be queued is configured by @ref ble_gatts_conn_cfg_t::hvn_tx_queue_size"]
11028#[doc = "          When the queue is full, the function call will return @ref NRF_ERROR_RESOURCES."]
11029#[doc = "          A @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event will be issued as soon as the transmission of the notification is complete."]
11030#[doc = ""]
11031#[doc = " @note    The application can keep track of the available queue element count for notifications by following the procedure below:"]
11032#[doc = "          - Store initial queue element count in a variable."]
11033#[doc = "          - Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns @ref NRF_SUCCESS."]
11034#[doc = "          - Increment the variable, which stores the current available queue element count, by the count variable in @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event."]
11035#[doc = ""]
11036#[doc = " @events"]
11037#[doc = " @event{@ref BLE_GATTS_EVT_HVN_TX_COMPLETE, Notification transmission complete.}"]
11038#[doc = " @event{@ref BLE_GATTS_EVT_HVC, Confirmation received from the peer.}"]
11039#[doc = " @endevents"]
11040#[doc = ""]
11041#[doc = " @mscs"]
11042#[doc = " @mmsc{@ref BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC}"]
11043#[doc = " @mmsc{@ref BLE_GATTS_HVN_MSC}"]
11044#[doc = " @mmsc{@ref BLE_GATTS_HVI_MSC}"]
11045#[doc = " @mmsc{@ref BLE_GATTS_HVX_DISABLED_MSC}"]
11046#[doc = " @endmscs"]
11047#[doc = ""]
11048#[doc = " @param[in] conn_handle      Connection handle."]
11049#[doc = " @param[in,out] p_hvx_params Pointer to an HVx parameters structure. If @ref ble_gatts_hvx_params_t::p_data"]
11050#[doc = "                             contains a non-NULL pointer the attribute value will be updated with the contents"]
11051#[doc = "                             pointed by it before sending the notification or indication. If the attribute value"]
11052#[doc = "                             is updated, @ref ble_gatts_hvx_params_t::p_len is updated by the SoftDevice to"]
11053#[doc = "                             contain the number of actual bytes written, else it will be set to 0."]
11054#[doc = ""]
11055#[doc = " @retval ::NRF_SUCCESS Successfully queued a notification or indication for transmission, and optionally updated the attribute value."]
11056#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
11057#[doc = " @retval ::NRF_ERROR_INVALID_STATE One or more of the following is true:"]
11058#[doc = "                                   - Invalid Connection State"]
11059#[doc = "                                   - Notifications and/or indications not enabled in the CCCD"]
11060#[doc = "                                   - An ATT_MTU exchange is ongoing"]
11061#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
11062#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
11063#[doc = " @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle(s) supplied. Only attributes added directly by the application are available to notify and indicate."]
11064#[doc = " @retval ::BLE_ERROR_GATTS_INVALID_ATTR_TYPE Invalid attribute type(s) supplied, only characteristic values may be notified and indicated."]
11065#[doc = " @retval ::NRF_ERROR_NOT_FOUND Attribute not found."]
11066#[doc = " @retval ::NRF_ERROR_FORBIDDEN The connection's current security level is lower than the one required by the write permissions of the CCCD associated with this characteristic."]
11067#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied."]
11068#[doc = " @retval ::NRF_ERROR_BUSY For @ref BLE_GATT_HVX_INDICATION Procedure already in progress. Wait for a @ref BLE_GATTS_EVT_HVC event and retry."]
11069#[doc = " @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value."]
11070#[doc = " @retval ::NRF_ERROR_RESOURCES Too many notifications queued."]
11071#[doc = "                               Wait for a @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event and retry."]
11072#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
11073#[inline(always)]
11074pub unsafe fn sd_ble_gatts_hvx(conn_handle: u16, p_hvx_params: *const ble_gatts_hvx_params_t) -> u32 {
11075    let ret: u32;
11076    core::arch::asm!("svc 174",
11077        inout("r0") to_asm(conn_handle) => ret,
11078        inout("r1") to_asm(p_hvx_params) => _,
11079        lateout("r2") _,
11080        lateout("r3") _,
11081        lateout("r12") _,
11082    );
11083    ret
11084}
11085
11086#[doc = "@brief Indicate the Service Changed attribute value."]
11087#[doc = ""]
11088#[doc = " @details This call will send a Handle Value Indication to one or more peers connected to inform them that the Attribute"]
11089#[doc = "          Table layout has changed. As soon as the peer has confirmed the indication, a @ref BLE_GATTS_EVT_SC_CONFIRM event will"]
11090#[doc = "          be issued."]
11091#[doc = ""]
11092#[doc = " @note    Some of the restrictions and limitations that apply to @ref sd_ble_gatts_hvx also apply here."]
11093#[doc = ""]
11094#[doc = " @events"]
11095#[doc = " @event{@ref BLE_GATTS_EVT_SC_CONFIRM, Confirmation of attribute table change received from peer.}"]
11096#[doc = " @endevents"]
11097#[doc = ""]
11098#[doc = " @mscs"]
11099#[doc = " @mmsc{@ref BLE_GATTS_SC_MSC}"]
11100#[doc = " @endmscs"]
11101#[doc = ""]
11102#[doc = " @param[in] conn_handle  Connection handle."]
11103#[doc = " @param[in] start_handle Start of affected attribute handle range."]
11104#[doc = " @param[in] end_handle   End of affected attribute handle range."]
11105#[doc = ""]
11106#[doc = " @retval ::NRF_SUCCESS Successfully queued the Service Changed indication for transmission."]
11107#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
11108#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Service Changed not enabled at initialization. See @ref"]
11109#[doc = "                                   sd_ble_cfg_set and @ref ble_gatts_cfg_service_changed_t."]
11110#[doc = " @retval ::NRF_ERROR_INVALID_STATE One or more of the following is true:"]
11111#[doc = "                                   - Invalid Connection State"]
11112#[doc = "                                   - Notifications and/or indications not enabled in the CCCD"]
11113#[doc = "                                   - An ATT_MTU exchange is ongoing"]
11114#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
11115#[doc = " @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle(s) supplied, handles must be in the range populated by the application."]
11116#[doc = " @retval ::NRF_ERROR_BUSY Procedure already in progress."]
11117#[doc = " @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value."]
11118#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
11119#[inline(always)]
11120pub unsafe fn sd_ble_gatts_service_changed(conn_handle: u16, start_handle: u16, end_handle: u16) -> u32 {
11121    let ret: u32;
11122    core::arch::asm!("svc 175",
11123        inout("r0") to_asm(conn_handle) => ret,
11124        inout("r1") to_asm(start_handle) => _,
11125        inout("r2") to_asm(end_handle) => _,
11126        lateout("r3") _,
11127        lateout("r12") _,
11128    );
11129    ret
11130}
11131
11132#[doc = "@brief Respond to a Read/Write authorization request."]
11133#[doc = ""]
11134#[doc = " @note This call should only be used as a response to a @ref BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event issued to the application."]
11135#[doc = ""]
11136#[doc = " @mscs"]
11137#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC}"]
11138#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC}"]
11139#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC}"]
11140#[doc = " @mmsc{@ref BLE_GATTS_READ_REQ_AUTH_MSC}"]
11141#[doc = " @mmsc{@ref BLE_GATTS_WRITE_REQ_AUTH_MSC}"]
11142#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC}"]
11143#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC}"]
11144#[doc = " @endmscs"]
11145#[doc = ""]
11146#[doc = " @param[in] conn_handle                 Connection handle."]
11147#[doc = " @param[in] p_rw_authorize_reply_params Pointer to a structure with the attribute provided by the application."]
11148#[doc = ""]
11149#[doc = " @note @ref ble_gatts_authorize_params_t::p_data is ignored when this function is used to respond"]
11150#[doc = "       to a @ref BLE_GATTS_AUTHORIZE_TYPE_READ event if @ref ble_gatts_authorize_params_t::update"]
11151#[doc = "       is set to 0."]
11152#[doc = ""]
11153#[doc = " @retval ::NRF_SUCCESS               Successfully queued a response to the peer, and in the case of a write operation, Attribute Table updated."]
11154#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
11155#[doc = " @retval ::NRF_ERROR_BUSY            The stack is busy, process pending events and retry."]
11156#[doc = " @retval ::NRF_ERROR_INVALID_ADDR    Invalid pointer supplied."]
11157#[doc = " @retval ::NRF_ERROR_INVALID_STATE   Invalid Connection State or no authorization request pending."]
11158#[doc = " @retval ::NRF_ERROR_INVALID_PARAM   Authorization op invalid,"]
11159#[doc = "                                         handle supplied does not match requested handle,"]
11160#[doc = "                                         or invalid data to be written provided by the application."]
11161#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
11162#[inline(always)]
11163pub unsafe fn sd_ble_gatts_rw_authorize_reply(
11164    conn_handle: u16,
11165    p_rw_authorize_reply_params: *const ble_gatts_rw_authorize_reply_params_t,
11166) -> u32 {
11167    let ret: u32;
11168    core::arch::asm!("svc 176",
11169        inout("r0") to_asm(conn_handle) => ret,
11170        inout("r1") to_asm(p_rw_authorize_reply_params) => _,
11171        lateout("r2") _,
11172        lateout("r3") _,
11173        lateout("r12") _,
11174    );
11175    ret
11176}
11177
11178#[doc = "@brief Update persistent system attribute information."]
11179#[doc = ""]
11180#[doc = " @details Supply information about persistent system attributes to the stack,"]
11181#[doc = "          previously obtained using @ref sd_ble_gatts_sys_attr_get."]
11182#[doc = "          This call is only allowed for active connections, and is usually"]
11183#[doc = "          made immediately after a connection is established with an known bonded device,"]
11184#[doc = "          often as a response to a @ref BLE_GATTS_EVT_SYS_ATTR_MISSING."]
11185#[doc = ""]
11186#[doc = "          p_sysattrs may point directly to the application's stored copy of the system attributes"]
11187#[doc = "          obtained using @ref sd_ble_gatts_sys_attr_get."]
11188#[doc = "          If the pointer is NULL, the system attribute info is initialized, assuming that"]
11189#[doc = "          the application does not have any previously saved system attribute data for this device."]
11190#[doc = ""]
11191#[doc = " @note The state of persistent system attributes is reset upon connection establishment and then remembered for its duration."]
11192#[doc = ""]
11193#[doc = " @note If this call returns with an error code different from @ref NRF_SUCCESS, the storage of persistent system attributes may have been completed only partially."]
11194#[doc = "       This means that the state of the attribute table is undefined, and the application should either provide a new set of attributes using this same call or"]
11195#[doc = "       reset the SoftDevice to return to a known state."]
11196#[doc = ""]
11197#[doc = " @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be modified."]
11198#[doc = " @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be modified."]
11199#[doc = ""]
11200#[doc = " @mscs"]
11201#[doc = " @mmsc{@ref BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC}"]
11202#[doc = " @mmsc{@ref BLE_GATTS_SYS_ATTRS_UNK_PEER_MSC}"]
11203#[doc = " @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC}"]
11204#[doc = " @endmscs"]
11205#[doc = ""]
11206#[doc = " @param[in]  conn_handle        Connection handle."]
11207#[doc = " @param[in]  p_sys_attr_data    Pointer to a saved copy of system attributes supplied to the stack, or NULL."]
11208#[doc = " @param[in]  len                Size of data pointed by p_sys_attr_data, in octets."]
11209#[doc = " @param[in]  flags              Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS"]
11210#[doc = ""]
11211#[doc = " @retval ::NRF_SUCCESS Successfully set the system attribute information."]
11212#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
11213#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
11214#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
11215#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied."]
11216#[doc = " @retval ::NRF_ERROR_INVALID_DATA Invalid data supplied, the data should be exactly the same as retrieved with @ref sd_ble_gatts_sys_attr_get."]
11217#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
11218#[inline(always)]
11219pub unsafe fn sd_ble_gatts_sys_attr_set(conn_handle: u16, p_sys_attr_data: *const u8, len: u16, flags: u32) -> u32 {
11220    let ret: u32;
11221    core::arch::asm!("svc 177",
11222        inout("r0") to_asm(conn_handle) => ret,
11223        inout("r1") to_asm(p_sys_attr_data) => _,
11224        inout("r2") to_asm(len) => _,
11225        inout("r3") to_asm(flags) => _,
11226        lateout("r12") _,
11227    );
11228    ret
11229}
11230
11231#[doc = "@brief Retrieve persistent system attribute information from the stack."]
11232#[doc = ""]
11233#[doc = " @details This call is used to retrieve information about values to be stored persistently by the application"]
11234#[doc = "          during the lifetime of a connection or after it has been terminated. When a new connection is established with the same bonded device,"]
11235#[doc = "          the system attribute information retrieved with this function should be restored using using @ref sd_ble_gatts_sys_attr_set."]
11236#[doc = "          If retrieved after disconnection, the data should be read before a new connection established. The connection handle for"]
11237#[doc = "          the previous, now disconnected, connection will remain valid until a new one is created to allow this API call to refer to it."]
11238#[doc = "          Connection handles belonging to active connections can be used as well, but care should be taken since the system attributes"]
11239#[doc = "          may be written to at any time by the peer during a connection's lifetime."]
11240#[doc = ""]
11241#[doc = " @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be returned."]
11242#[doc = " @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be returned."]
11243#[doc = ""]
11244#[doc = " @mscs"]
11245#[doc = " @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC}"]
11246#[doc = " @endmscs"]
11247#[doc = ""]
11248#[doc = " @param[in]     conn_handle       Connection handle of the recently terminated connection."]
11249#[doc = " @param[out]    p_sys_attr_data   Pointer to a buffer where updated information about system attributes will be filled in. The format of the data is described"]
11250#[doc = "                                  in @ref BLE_GATTS_SYS_ATTRS_FORMAT. NULL can be provided to obtain the length of the data."]
11251#[doc = " @param[in,out] p_len             Size of application buffer if p_sys_attr_data is not NULL. Unconditionally updated to actual length of system attribute data."]
11252#[doc = " @param[in]     flags             Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS"]
11253#[doc = ""]
11254#[doc = " @retval ::NRF_SUCCESS Successfully retrieved the system attribute information."]
11255#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
11256#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
11257#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied."]
11258#[doc = " @retval ::NRF_ERROR_DATA_SIZE The system attribute information did not fit into the provided buffer."]
11259#[doc = " @retval ::NRF_ERROR_NOT_FOUND No system attributes found."]
11260#[inline(always)]
11261pub unsafe fn sd_ble_gatts_sys_attr_get(
11262    conn_handle: u16,
11263    p_sys_attr_data: *mut u8,
11264    p_len: *mut u16,
11265    flags: u32,
11266) -> u32 {
11267    let ret: u32;
11268    core::arch::asm!("svc 178",
11269        inout("r0") to_asm(conn_handle) => ret,
11270        inout("r1") to_asm(p_sys_attr_data) => _,
11271        inout("r2") to_asm(p_len) => _,
11272        inout("r3") to_asm(flags) => _,
11273        lateout("r12") _,
11274    );
11275    ret
11276}
11277
11278#[doc = "@brief Retrieve the first valid user attribute handle."]
11279#[doc = ""]
11280#[doc = " @param[out] p_handle   Pointer to an integer where the handle will be stored."]
11281#[doc = ""]
11282#[doc = " @retval ::NRF_SUCCESS Successfully retrieved the handle."]
11283#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
11284#[inline(always)]
11285pub unsafe fn sd_ble_gatts_initial_user_handle_get(p_handle: *mut u16) -> u32 {
11286    let ret: u32;
11287    core::arch::asm!("svc 179",
11288        inout("r0") to_asm(p_handle) => ret,
11289        lateout("r1") _,
11290        lateout("r2") _,
11291        lateout("r3") _,
11292        lateout("r12") _,
11293    );
11294    ret
11295}
11296
11297#[doc = "@brief Retrieve the attribute UUID and/or metadata."]
11298#[doc = ""]
11299#[doc = " @param[in]  handle Attribute handle"]
11300#[doc = " @param[out] p_uuid UUID of the attribute. Use NULL to omit this field."]
11301#[doc = " @param[out] p_md Metadata of the attribute. Use NULL to omit this field."]
11302#[doc = ""]
11303#[doc = " @retval ::NRF_SUCCESS Successfully retrieved the attribute metadata,"]
11304#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
11305#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters supplied. Returned when both @c p_uuid and @c p_md are NULL."]
11306#[doc = " @retval ::NRF_ERROR_NOT_FOUND Attribute was not found."]
11307#[inline(always)]
11308pub unsafe fn sd_ble_gatts_attr_get(handle: u16, p_uuid: *mut ble_uuid_t, p_md: *mut ble_gatts_attr_md_t) -> u32 {
11309    let ret: u32;
11310    core::arch::asm!("svc 180",
11311        inout("r0") to_asm(handle) => ret,
11312        inout("r1") to_asm(p_uuid) => _,
11313        inout("r2") to_asm(p_md) => _,
11314        lateout("r3") _,
11315        lateout("r12") _,
11316    );
11317    ret
11318}
11319
11320#[doc = "@brief Reply to an ATT_MTU exchange request by sending an Exchange MTU Response to the client."]
11321#[doc = ""]
11322#[doc = " @details This function is only used to reply to a @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST event."]
11323#[doc = ""]
11324#[doc = " @details The SoftDevice sets ATT_MTU to the minimum of:"]
11325#[doc = "          - The Client RX MTU value from @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST, and"]
11326#[doc = "          - The Server RX MTU value."]
11327#[doc = ""]
11328#[doc = "          However, the SoftDevice never sets ATT_MTU lower than @ref BLE_GATT_ATT_MTU_DEFAULT."]
11329#[doc = ""]
11330#[doc = " @mscs"]
11331#[doc = " @mmsc{@ref BLE_GATTS_MTU_EXCHANGE}"]
11332#[doc = " @endmscs"]
11333#[doc = ""]
11334#[doc = " @param[in] conn_handle    The connection handle identifying the connection to perform this procedure on."]
11335#[doc = " @param[in] server_rx_mtu  Server RX MTU size."]
11336#[doc = "                           - The minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT."]
11337#[doc = "                           - The maximum value is @ref ble_gatt_conn_cfg_t::att_mtu in the connection configuration"]
11338#[doc = "                             used for this connection."]
11339#[doc = "                           - The value must be equal to Client RX MTU size given in @ref sd_ble_gattc_exchange_mtu_request"]
11340#[doc = "                             if an ATT_MTU exchange has already been performed in the other direction."]
11341#[doc = ""]
11342#[doc = " @retval ::NRF_SUCCESS Successfully sent response to the client."]
11343#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
11344#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no ATT_MTU exchange request pending."]
11345#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid Server RX MTU size supplied."]
11346#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
11347#[inline(always)]
11348pub unsafe fn sd_ble_gatts_exchange_mtu_reply(conn_handle: u16, server_rx_mtu: u16) -> u32 {
11349    let ret: u32;
11350    core::arch::asm!("svc 181",
11351        inout("r0") to_asm(conn_handle) => ret,
11352        inout("r1") to_asm(server_rx_mtu) => _,
11353        lateout("r2") _,
11354        lateout("r3") _,
11355        lateout("r12") _,
11356    );
11357    ret
11358}
11359
11360#[doc = "< Enable and initialize the BLE stack"]
11361pub const BLE_COMMON_SVCS_SD_BLE_ENABLE: BLE_COMMON_SVCS = 96;
11362#[doc = "< Get an event from the pending events queue."]
11363pub const BLE_COMMON_SVCS_SD_BLE_EVT_GET: BLE_COMMON_SVCS = 97;
11364#[doc = "< Add a Vendor Specific base UUID."]
11365pub const BLE_COMMON_SVCS_SD_BLE_UUID_VS_ADD: BLE_COMMON_SVCS = 98;
11366#[doc = "< Decode UUID bytes."]
11367pub const BLE_COMMON_SVCS_SD_BLE_UUID_DECODE: BLE_COMMON_SVCS = 99;
11368#[doc = "< Encode UUID bytes."]
11369pub const BLE_COMMON_SVCS_SD_BLE_UUID_ENCODE: BLE_COMMON_SVCS = 100;
11370#[doc = "< Get the local version information (company ID, Link Layer Version, Link Layer Subversion)."]
11371pub const BLE_COMMON_SVCS_SD_BLE_VERSION_GET: BLE_COMMON_SVCS = 101;
11372#[doc = "< User Memory Reply."]
11373pub const BLE_COMMON_SVCS_SD_BLE_USER_MEM_REPLY: BLE_COMMON_SVCS = 102;
11374#[doc = "< Set a BLE option."]
11375pub const BLE_COMMON_SVCS_SD_BLE_OPT_SET: BLE_COMMON_SVCS = 103;
11376#[doc = "< Get a BLE option."]
11377pub const BLE_COMMON_SVCS_SD_BLE_OPT_GET: BLE_COMMON_SVCS = 104;
11378#[doc = "< Add a configuration to the BLE stack."]
11379pub const BLE_COMMON_SVCS_SD_BLE_CFG_SET: BLE_COMMON_SVCS = 105;
11380#[doc = "< Remove a Vendor Specific base UUID."]
11381pub const BLE_COMMON_SVCS_SD_BLE_UUID_VS_REMOVE: BLE_COMMON_SVCS = 106;
11382#[doc = " @brief Common API SVC numbers."]
11383pub type BLE_COMMON_SVCS = self::c_uint;
11384#[doc = "< User Memory request. @ref ble_evt_user_mem_request_t"]
11385pub const BLE_COMMON_EVTS_BLE_EVT_USER_MEM_REQUEST: BLE_COMMON_EVTS = 1;
11386#[doc = "< User Memory release. @ref ble_evt_user_mem_release_t"]
11387pub const BLE_COMMON_EVTS_BLE_EVT_USER_MEM_RELEASE: BLE_COMMON_EVTS = 2;
11388#[doc = " @brief BLE Module Independent Event IDs."]
11389pub type BLE_COMMON_EVTS = self::c_uint;
11390#[doc = "< BLE GAP specific connection configuration."]
11391pub const BLE_CONN_CFGS_BLE_CONN_CFG_GAP: BLE_CONN_CFGS = 32;
11392#[doc = "< BLE GATTC specific connection configuration."]
11393pub const BLE_CONN_CFGS_BLE_CONN_CFG_GATTC: BLE_CONN_CFGS = 33;
11394#[doc = "< BLE GATTS specific connection configuration."]
11395pub const BLE_CONN_CFGS_BLE_CONN_CFG_GATTS: BLE_CONN_CFGS = 34;
11396#[doc = "< BLE GATT specific connection configuration."]
11397pub const BLE_CONN_CFGS_BLE_CONN_CFG_GATT: BLE_CONN_CFGS = 35;
11398#[doc = "< BLE L2CAP specific connection configuration."]
11399pub const BLE_CONN_CFGS_BLE_CONN_CFG_L2CAP: BLE_CONN_CFGS = 36;
11400#[doc = "@brief BLE Connection Configuration IDs."]
11401#[doc = ""]
11402#[doc = " IDs that uniquely identify a connection configuration."]
11403pub type BLE_CONN_CFGS = self::c_uint;
11404#[doc = "< Vendor specific base UUID configuration"]
11405pub const BLE_COMMON_CFGS_BLE_COMMON_CFG_VS_UUID: BLE_COMMON_CFGS = 1;
11406#[doc = "@brief BLE Common Configuration IDs."]
11407#[doc = ""]
11408#[doc = " IDs that uniquely identify a common configuration."]
11409pub type BLE_COMMON_CFGS = self::c_uint;
11410#[doc = "< PA and LNA options"]
11411pub const BLE_COMMON_OPTS_BLE_COMMON_OPT_PA_LNA: BLE_COMMON_OPTS = 1;
11412#[doc = "< Extended connection events option"]
11413pub const BLE_COMMON_OPTS_BLE_COMMON_OPT_CONN_EVT_EXT: BLE_COMMON_OPTS = 2;
11414#[doc = "< Extended RC calibration option"]
11415pub const BLE_COMMON_OPTS_BLE_COMMON_OPT_EXTENDED_RC_CAL: BLE_COMMON_OPTS = 3;
11416#[doc = "@brief Common Option IDs."]
11417#[doc = " IDs that uniquely identify a common option."]
11418pub type BLE_COMMON_OPTS = self::c_uint;
11419#[doc = "@brief User Memory Block."]
11420#[repr(C)]
11421#[derive(Debug, Copy, Clone)]
11422pub struct ble_user_mem_block_t {
11423    #[doc = "< Pointer to the start of the user memory block."]
11424    pub p_mem: *mut u8,
11425    #[doc = "< Length in bytes of the user memory block."]
11426    pub len: u16,
11427}
11428#[test]
11429fn bindgen_test_layout_ble_user_mem_block_t() {
11430    assert_eq!(
11431        ::core::mem::size_of::<ble_user_mem_block_t>(),
11432        8usize,
11433        concat!("Size of: ", stringify!(ble_user_mem_block_t))
11434    );
11435    assert_eq!(
11436        ::core::mem::align_of::<ble_user_mem_block_t>(),
11437        4usize,
11438        concat!("Alignment of ", stringify!(ble_user_mem_block_t))
11439    );
11440    assert_eq!(
11441        unsafe { &(*(::core::ptr::null::<ble_user_mem_block_t>())).p_mem as *const _ as usize },
11442        0usize,
11443        concat!(
11444            "Offset of field: ",
11445            stringify!(ble_user_mem_block_t),
11446            "::",
11447            stringify!(p_mem)
11448        )
11449    );
11450    assert_eq!(
11451        unsafe { &(*(::core::ptr::null::<ble_user_mem_block_t>())).len as *const _ as usize },
11452        4usize,
11453        concat!(
11454            "Offset of field: ",
11455            stringify!(ble_user_mem_block_t),
11456            "::",
11457            stringify!(len)
11458        )
11459    );
11460}
11461#[doc = "@brief Event structure for @ref BLE_EVT_USER_MEM_REQUEST."]
11462#[repr(C)]
11463#[derive(Debug, Copy, Clone)]
11464pub struct ble_evt_user_mem_request_t {
11465    #[doc = "< User memory type, see @ref BLE_USER_MEM_TYPES."]
11466    pub type_: u8,
11467}
11468#[test]
11469fn bindgen_test_layout_ble_evt_user_mem_request_t() {
11470    assert_eq!(
11471        ::core::mem::size_of::<ble_evt_user_mem_request_t>(),
11472        1usize,
11473        concat!("Size of: ", stringify!(ble_evt_user_mem_request_t))
11474    );
11475    assert_eq!(
11476        ::core::mem::align_of::<ble_evt_user_mem_request_t>(),
11477        1usize,
11478        concat!("Alignment of ", stringify!(ble_evt_user_mem_request_t))
11479    );
11480    assert_eq!(
11481        unsafe { &(*(::core::ptr::null::<ble_evt_user_mem_request_t>())).type_ as *const _ as usize },
11482        0usize,
11483        concat!(
11484            "Offset of field: ",
11485            stringify!(ble_evt_user_mem_request_t),
11486            "::",
11487            stringify!(type_)
11488        )
11489    );
11490}
11491#[doc = "@brief Event structure for @ref BLE_EVT_USER_MEM_RELEASE."]
11492#[repr(C)]
11493#[derive(Debug, Copy, Clone)]
11494pub struct ble_evt_user_mem_release_t {
11495    #[doc = "< User memory type, see @ref BLE_USER_MEM_TYPES."]
11496    pub type_: u8,
11497    #[doc = "< User memory block"]
11498    pub mem_block: ble_user_mem_block_t,
11499}
11500#[test]
11501fn bindgen_test_layout_ble_evt_user_mem_release_t() {
11502    assert_eq!(
11503        ::core::mem::size_of::<ble_evt_user_mem_release_t>(),
11504        12usize,
11505        concat!("Size of: ", stringify!(ble_evt_user_mem_release_t))
11506    );
11507    assert_eq!(
11508        ::core::mem::align_of::<ble_evt_user_mem_release_t>(),
11509        4usize,
11510        concat!("Alignment of ", stringify!(ble_evt_user_mem_release_t))
11511    );
11512    assert_eq!(
11513        unsafe { &(*(::core::ptr::null::<ble_evt_user_mem_release_t>())).type_ as *const _ as usize },
11514        0usize,
11515        concat!(
11516            "Offset of field: ",
11517            stringify!(ble_evt_user_mem_release_t),
11518            "::",
11519            stringify!(type_)
11520        )
11521    );
11522    assert_eq!(
11523        unsafe { &(*(::core::ptr::null::<ble_evt_user_mem_release_t>())).mem_block as *const _ as usize },
11524        4usize,
11525        concat!(
11526            "Offset of field: ",
11527            stringify!(ble_evt_user_mem_release_t),
11528            "::",
11529            stringify!(mem_block)
11530        )
11531    );
11532}
11533#[doc = "@brief Event structure for events not associated with a specific function module."]
11534#[repr(C)]
11535#[derive(Copy, Clone)]
11536pub struct ble_common_evt_t {
11537    #[doc = "< Connection Handle on which this event occurred."]
11538    pub conn_handle: u16,
11539    #[doc = "< Event parameter union."]
11540    pub params: ble_common_evt_t__bindgen_ty_1,
11541}
11542#[repr(C)]
11543#[derive(Copy, Clone)]
11544pub union ble_common_evt_t__bindgen_ty_1 {
11545    #[doc = "< User Memory Request Event Parameters."]
11546    pub user_mem_request: ble_evt_user_mem_request_t,
11547    #[doc = "< User Memory Release Event Parameters."]
11548    pub user_mem_release: ble_evt_user_mem_release_t,
11549    _bindgen_union_align: [u32; 3usize],
11550}
11551#[test]
11552fn bindgen_test_layout_ble_common_evt_t__bindgen_ty_1() {
11553    assert_eq!(
11554        ::core::mem::size_of::<ble_common_evt_t__bindgen_ty_1>(),
11555        12usize,
11556        concat!("Size of: ", stringify!(ble_common_evt_t__bindgen_ty_1))
11557    );
11558    assert_eq!(
11559        ::core::mem::align_of::<ble_common_evt_t__bindgen_ty_1>(),
11560        4usize,
11561        concat!("Alignment of ", stringify!(ble_common_evt_t__bindgen_ty_1))
11562    );
11563    assert_eq!(
11564        unsafe { &(*(::core::ptr::null::<ble_common_evt_t__bindgen_ty_1>())).user_mem_request as *const _ as usize },
11565        0usize,
11566        concat!(
11567            "Offset of field: ",
11568            stringify!(ble_common_evt_t__bindgen_ty_1),
11569            "::",
11570            stringify!(user_mem_request)
11571        )
11572    );
11573    assert_eq!(
11574        unsafe { &(*(::core::ptr::null::<ble_common_evt_t__bindgen_ty_1>())).user_mem_release as *const _ as usize },
11575        0usize,
11576        concat!(
11577            "Offset of field: ",
11578            stringify!(ble_common_evt_t__bindgen_ty_1),
11579            "::",
11580            stringify!(user_mem_release)
11581        )
11582    );
11583}
11584#[test]
11585fn bindgen_test_layout_ble_common_evt_t() {
11586    assert_eq!(
11587        ::core::mem::size_of::<ble_common_evt_t>(),
11588        16usize,
11589        concat!("Size of: ", stringify!(ble_common_evt_t))
11590    );
11591    assert_eq!(
11592        ::core::mem::align_of::<ble_common_evt_t>(),
11593        4usize,
11594        concat!("Alignment of ", stringify!(ble_common_evt_t))
11595    );
11596    assert_eq!(
11597        unsafe { &(*(::core::ptr::null::<ble_common_evt_t>())).conn_handle as *const _ as usize },
11598        0usize,
11599        concat!(
11600            "Offset of field: ",
11601            stringify!(ble_common_evt_t),
11602            "::",
11603            stringify!(conn_handle)
11604        )
11605    );
11606    assert_eq!(
11607        unsafe { &(*(::core::ptr::null::<ble_common_evt_t>())).params as *const _ as usize },
11608        4usize,
11609        concat!(
11610            "Offset of field: ",
11611            stringify!(ble_common_evt_t),
11612            "::",
11613            stringify!(params)
11614        )
11615    );
11616}
11617#[doc = "@brief BLE Event header."]
11618#[repr(C)]
11619#[derive(Debug, Copy, Clone)]
11620pub struct ble_evt_hdr_t {
11621    #[doc = "< Value from a BLE_<module>_EVT series."]
11622    pub evt_id: u16,
11623    #[doc = "< Length in octets including this header."]
11624    pub evt_len: u16,
11625}
11626#[test]
11627fn bindgen_test_layout_ble_evt_hdr_t() {
11628    assert_eq!(
11629        ::core::mem::size_of::<ble_evt_hdr_t>(),
11630        4usize,
11631        concat!("Size of: ", stringify!(ble_evt_hdr_t))
11632    );
11633    assert_eq!(
11634        ::core::mem::align_of::<ble_evt_hdr_t>(),
11635        2usize,
11636        concat!("Alignment of ", stringify!(ble_evt_hdr_t))
11637    );
11638    assert_eq!(
11639        unsafe { &(*(::core::ptr::null::<ble_evt_hdr_t>())).evt_id as *const _ as usize },
11640        0usize,
11641        concat!("Offset of field: ", stringify!(ble_evt_hdr_t), "::", stringify!(evt_id))
11642    );
11643    assert_eq!(
11644        unsafe { &(*(::core::ptr::null::<ble_evt_hdr_t>())).evt_len as *const _ as usize },
11645        2usize,
11646        concat!(
11647            "Offset of field: ",
11648            stringify!(ble_evt_hdr_t),
11649            "::",
11650            stringify!(evt_len)
11651        )
11652    );
11653}
11654#[doc = "@brief Common BLE Event type, wrapping the module specific event reports."]
11655#[repr(C)]
11656pub struct ble_evt_t {
11657    #[doc = "< Event header."]
11658    pub header: ble_evt_hdr_t,
11659    #[doc = "< Event union."]
11660    pub evt: ble_evt_t__bindgen_ty_1,
11661}
11662#[repr(C)]
11663pub struct ble_evt_t__bindgen_ty_1 {
11664    #[doc = "< Common Event, evt_id in BLE_EVT_* series."]
11665    pub common_evt: __BindgenUnionField<ble_common_evt_t>,
11666    #[doc = "< GAP originated event, evt_id in BLE_GAP_EVT_* series."]
11667    pub gap_evt: __BindgenUnionField<ble_gap_evt_t>,
11668    #[doc = "< GATT client originated event, evt_id in BLE_GATTC_EVT* series."]
11669    pub gattc_evt: __BindgenUnionField<ble_gattc_evt_t>,
11670    #[doc = "< GATT server originated event, evt_id in BLE_GATTS_EVT* series."]
11671    pub gatts_evt: __BindgenUnionField<ble_gatts_evt_t>,
11672    #[doc = "< L2CAP originated event, evt_id in BLE_L2CAP_EVT* series."]
11673    pub l2cap_evt: __BindgenUnionField<ble_l2cap_evt_t>,
11674    pub bindgen_union_field: [u32; 10usize],
11675}
11676#[test]
11677fn bindgen_test_layout_ble_evt_t__bindgen_ty_1() {
11678    assert_eq!(
11679        ::core::mem::size_of::<ble_evt_t__bindgen_ty_1>(),
11680        40usize,
11681        concat!("Size of: ", stringify!(ble_evt_t__bindgen_ty_1))
11682    );
11683    assert_eq!(
11684        ::core::mem::align_of::<ble_evt_t__bindgen_ty_1>(),
11685        4usize,
11686        concat!("Alignment of ", stringify!(ble_evt_t__bindgen_ty_1))
11687    );
11688    assert_eq!(
11689        unsafe { &(*(::core::ptr::null::<ble_evt_t__bindgen_ty_1>())).common_evt as *const _ as usize },
11690        0usize,
11691        concat!(
11692            "Offset of field: ",
11693            stringify!(ble_evt_t__bindgen_ty_1),
11694            "::",
11695            stringify!(common_evt)
11696        )
11697    );
11698    assert_eq!(
11699        unsafe { &(*(::core::ptr::null::<ble_evt_t__bindgen_ty_1>())).gap_evt as *const _ as usize },
11700        0usize,
11701        concat!(
11702            "Offset of field: ",
11703            stringify!(ble_evt_t__bindgen_ty_1),
11704            "::",
11705            stringify!(gap_evt)
11706        )
11707    );
11708    assert_eq!(
11709        unsafe { &(*(::core::ptr::null::<ble_evt_t__bindgen_ty_1>())).gattc_evt as *const _ as usize },
11710        0usize,
11711        concat!(
11712            "Offset of field: ",
11713            stringify!(ble_evt_t__bindgen_ty_1),
11714            "::",
11715            stringify!(gattc_evt)
11716        )
11717    );
11718    assert_eq!(
11719        unsafe { &(*(::core::ptr::null::<ble_evt_t__bindgen_ty_1>())).gatts_evt as *const _ as usize },
11720        0usize,
11721        concat!(
11722            "Offset of field: ",
11723            stringify!(ble_evt_t__bindgen_ty_1),
11724            "::",
11725            stringify!(gatts_evt)
11726        )
11727    );
11728    assert_eq!(
11729        unsafe { &(*(::core::ptr::null::<ble_evt_t__bindgen_ty_1>())).l2cap_evt as *const _ as usize },
11730        0usize,
11731        concat!(
11732            "Offset of field: ",
11733            stringify!(ble_evt_t__bindgen_ty_1),
11734            "::",
11735            stringify!(l2cap_evt)
11736        )
11737    );
11738}
11739#[test]
11740fn bindgen_test_layout_ble_evt_t() {
11741    assert_eq!(
11742        ::core::mem::size_of::<ble_evt_t>(),
11743        44usize,
11744        concat!("Size of: ", stringify!(ble_evt_t))
11745    );
11746    assert_eq!(
11747        ::core::mem::align_of::<ble_evt_t>(),
11748        4usize,
11749        concat!("Alignment of ", stringify!(ble_evt_t))
11750    );
11751    assert_eq!(
11752        unsafe { &(*(::core::ptr::null::<ble_evt_t>())).header as *const _ as usize },
11753        0usize,
11754        concat!("Offset of field: ", stringify!(ble_evt_t), "::", stringify!(header))
11755    );
11756    assert_eq!(
11757        unsafe { &(*(::core::ptr::null::<ble_evt_t>())).evt as *const _ as usize },
11758        4usize,
11759        concat!("Offset of field: ", stringify!(ble_evt_t), "::", stringify!(evt))
11760    );
11761}
11762#[doc = " @brief Version Information."]
11763#[repr(C)]
11764#[derive(Debug, Copy, Clone)]
11765pub struct ble_version_t {
11766    #[doc = "< Link Layer Version number. See https://www.bluetooth.org/en-us/specification/assigned-numbers/link-layer for assigned values."]
11767    pub version_number: u8,
11768    #[doc = "< Company ID, Nordic Semiconductor's company ID is 89 (0x0059) (https://www.bluetooth.org/apps/content/Default.aspx?doc_id=49708)."]
11769    pub company_id: u16,
11770    #[doc = "< Link Layer Sub Version number, corresponds to the SoftDevice Config ID or Firmware ID (FWID)."]
11771    pub subversion_number: u16,
11772}
11773#[test]
11774fn bindgen_test_layout_ble_version_t() {
11775    assert_eq!(
11776        ::core::mem::size_of::<ble_version_t>(),
11777        6usize,
11778        concat!("Size of: ", stringify!(ble_version_t))
11779    );
11780    assert_eq!(
11781        ::core::mem::align_of::<ble_version_t>(),
11782        2usize,
11783        concat!("Alignment of ", stringify!(ble_version_t))
11784    );
11785    assert_eq!(
11786        unsafe { &(*(::core::ptr::null::<ble_version_t>())).version_number as *const _ as usize },
11787        0usize,
11788        concat!(
11789            "Offset of field: ",
11790            stringify!(ble_version_t),
11791            "::",
11792            stringify!(version_number)
11793        )
11794    );
11795    assert_eq!(
11796        unsafe { &(*(::core::ptr::null::<ble_version_t>())).company_id as *const _ as usize },
11797        2usize,
11798        concat!(
11799            "Offset of field: ",
11800            stringify!(ble_version_t),
11801            "::",
11802            stringify!(company_id)
11803        )
11804    );
11805    assert_eq!(
11806        unsafe { &(*(::core::ptr::null::<ble_version_t>())).subversion_number as *const _ as usize },
11807        4usize,
11808        concat!(
11809            "Offset of field: ",
11810            stringify!(ble_version_t),
11811            "::",
11812            stringify!(subversion_number)
11813        )
11814    );
11815}
11816#[doc = " @brief Configuration parameters for the PA and LNA."]
11817#[repr(C, packed)]
11818#[derive(Debug, Copy, Clone)]
11819pub struct ble_pa_lna_cfg_t {
11820    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
11821}
11822#[test]
11823fn bindgen_test_layout_ble_pa_lna_cfg_t() {
11824    assert_eq!(
11825        ::core::mem::size_of::<ble_pa_lna_cfg_t>(),
11826        1usize,
11827        concat!("Size of: ", stringify!(ble_pa_lna_cfg_t))
11828    );
11829    assert_eq!(
11830        ::core::mem::align_of::<ble_pa_lna_cfg_t>(),
11831        1usize,
11832        concat!("Alignment of ", stringify!(ble_pa_lna_cfg_t))
11833    );
11834}
11835impl ble_pa_lna_cfg_t {
11836    #[inline]
11837    pub fn enable(&self) -> u8 {
11838        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
11839    }
11840    #[inline]
11841    pub fn set_enable(&mut self, val: u8) {
11842        unsafe {
11843            let val: u8 = ::core::mem::transmute(val);
11844            self._bitfield_1.set(0usize, 1u8, val as u64)
11845        }
11846    }
11847    #[inline]
11848    pub fn active_high(&self) -> u8 {
11849        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
11850    }
11851    #[inline]
11852    pub fn set_active_high(&mut self, val: u8) {
11853        unsafe {
11854            let val: u8 = ::core::mem::transmute(val);
11855            self._bitfield_1.set(1usize, 1u8, val as u64)
11856        }
11857    }
11858    #[inline]
11859    pub fn gpio_pin(&self) -> u8 {
11860        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 6u8) as u8) }
11861    }
11862    #[inline]
11863    pub fn set_gpio_pin(&mut self, val: u8) {
11864        unsafe {
11865            let val: u8 = ::core::mem::transmute(val);
11866            self._bitfield_1.set(2usize, 6u8, val as u64)
11867        }
11868    }
11869    #[inline]
11870    pub fn new_bitfield_1(enable: u8, active_high: u8, gpio_pin: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
11871        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
11872        __bindgen_bitfield_unit.set(0usize, 1u8, {
11873            let enable: u8 = unsafe { ::core::mem::transmute(enable) };
11874            enable as u64
11875        });
11876        __bindgen_bitfield_unit.set(1usize, 1u8, {
11877            let active_high: u8 = unsafe { ::core::mem::transmute(active_high) };
11878            active_high as u64
11879        });
11880        __bindgen_bitfield_unit.set(2usize, 6u8, {
11881            let gpio_pin: u8 = unsafe { ::core::mem::transmute(gpio_pin) };
11882            gpio_pin as u64
11883        });
11884        __bindgen_bitfield_unit
11885    }
11886}
11887#[doc = " @brief PA & LNA GPIO toggle configuration"]
11888#[doc = ""]
11889#[doc = " This option configures the SoftDevice to toggle pins when the radio is active for use with a power amplifier and/or"]
11890#[doc = " a low noise amplifier."]
11891#[doc = ""]
11892#[doc = " Toggling the pins is achieved by using two PPI channels and a GPIOTE channel. The hardware channel IDs are provided"]
11893#[doc = " by the application and should be regarded as reserved as long as any PA/LNA toggling is enabled."]
11894#[doc = ""]
11895#[doc = " @note  @ref sd_ble_opt_get is not supported for this option."]
11896#[doc = " @note  Setting this option while the radio is in use (i.e. any of the roles are active) may have undefined consequences"]
11897#[doc = " and must be avoided by the application."]
11898#[repr(C)]
11899#[derive(Debug, Copy, Clone)]
11900pub struct ble_common_opt_pa_lna_t {
11901    #[doc = "< Power Amplifier configuration"]
11902    pub pa_cfg: ble_pa_lna_cfg_t,
11903    #[doc = "< Low Noise Amplifier configuration"]
11904    pub lna_cfg: ble_pa_lna_cfg_t,
11905    #[doc = "< PPI channel used for radio pin setting"]
11906    pub ppi_ch_id_set: u8,
11907    #[doc = "< PPI channel used for radio pin clearing"]
11908    pub ppi_ch_id_clr: u8,
11909    #[doc = "< GPIOTE channel used for radio pin toggling"]
11910    pub gpiote_ch_id: u8,
11911}
11912#[test]
11913fn bindgen_test_layout_ble_common_opt_pa_lna_t() {
11914    assert_eq!(
11915        ::core::mem::size_of::<ble_common_opt_pa_lna_t>(),
11916        5usize,
11917        concat!("Size of: ", stringify!(ble_common_opt_pa_lna_t))
11918    );
11919    assert_eq!(
11920        ::core::mem::align_of::<ble_common_opt_pa_lna_t>(),
11921        1usize,
11922        concat!("Alignment of ", stringify!(ble_common_opt_pa_lna_t))
11923    );
11924    assert_eq!(
11925        unsafe { &(*(::core::ptr::null::<ble_common_opt_pa_lna_t>())).pa_cfg as *const _ as usize },
11926        0usize,
11927        concat!(
11928            "Offset of field: ",
11929            stringify!(ble_common_opt_pa_lna_t),
11930            "::",
11931            stringify!(pa_cfg)
11932        )
11933    );
11934    assert_eq!(
11935        unsafe { &(*(::core::ptr::null::<ble_common_opt_pa_lna_t>())).lna_cfg as *const _ as usize },
11936        1usize,
11937        concat!(
11938            "Offset of field: ",
11939            stringify!(ble_common_opt_pa_lna_t),
11940            "::",
11941            stringify!(lna_cfg)
11942        )
11943    );
11944    assert_eq!(
11945        unsafe { &(*(::core::ptr::null::<ble_common_opt_pa_lna_t>())).ppi_ch_id_set as *const _ as usize },
11946        2usize,
11947        concat!(
11948            "Offset of field: ",
11949            stringify!(ble_common_opt_pa_lna_t),
11950            "::",
11951            stringify!(ppi_ch_id_set)
11952        )
11953    );
11954    assert_eq!(
11955        unsafe { &(*(::core::ptr::null::<ble_common_opt_pa_lna_t>())).ppi_ch_id_clr as *const _ as usize },
11956        3usize,
11957        concat!(
11958            "Offset of field: ",
11959            stringify!(ble_common_opt_pa_lna_t),
11960            "::",
11961            stringify!(ppi_ch_id_clr)
11962        )
11963    );
11964    assert_eq!(
11965        unsafe { &(*(::core::ptr::null::<ble_common_opt_pa_lna_t>())).gpiote_ch_id as *const _ as usize },
11966        4usize,
11967        concat!(
11968            "Offset of field: ",
11969            stringify!(ble_common_opt_pa_lna_t),
11970            "::",
11971            stringify!(gpiote_ch_id)
11972        )
11973    );
11974}
11975#[doc = " @brief Configuration of extended BLE connection events."]
11976#[doc = ""]
11977#[doc = " When enabled the SoftDevice will dynamically extend the connection event when possible."]
11978#[doc = ""]
11979#[doc = " The connection event length is controlled by the connection configuration as set by @ref ble_gap_conn_cfg_t::event_length."]
11980#[doc = " The connection event can be extended if there is time to send another packet pair before the start of the next connection interval,"]
11981#[doc = " and if there are no conflicts with other BLE roles requesting radio time."]
11982#[doc = ""]
11983#[doc = " @note @ref sd_ble_opt_get is not supported for this option."]
11984#[repr(C, packed)]
11985#[derive(Debug, Copy, Clone)]
11986pub struct ble_common_opt_conn_evt_ext_t {
11987    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
11988}
11989#[test]
11990fn bindgen_test_layout_ble_common_opt_conn_evt_ext_t() {
11991    assert_eq!(
11992        ::core::mem::size_of::<ble_common_opt_conn_evt_ext_t>(),
11993        1usize,
11994        concat!("Size of: ", stringify!(ble_common_opt_conn_evt_ext_t))
11995    );
11996    assert_eq!(
11997        ::core::mem::align_of::<ble_common_opt_conn_evt_ext_t>(),
11998        1usize,
11999        concat!("Alignment of ", stringify!(ble_common_opt_conn_evt_ext_t))
12000    );
12001}
12002impl ble_common_opt_conn_evt_ext_t {
12003    #[inline]
12004    pub fn enable(&self) -> u8 {
12005        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
12006    }
12007    #[inline]
12008    pub fn set_enable(&mut self, val: u8) {
12009        unsafe {
12010            let val: u8 = ::core::mem::transmute(val);
12011            self._bitfield_1.set(0usize, 1u8, val as u64)
12012        }
12013    }
12014    #[inline]
12015    pub fn new_bitfield_1(enable: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
12016        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
12017        __bindgen_bitfield_unit.set(0usize, 1u8, {
12018            let enable: u8 = unsafe { ::core::mem::transmute(enable) };
12019            enable as u64
12020        });
12021        __bindgen_bitfield_unit
12022    }
12023}
12024#[doc = " @brief Enable/disable extended RC calibration."]
12025#[doc = ""]
12026#[doc = " If extended RC calibration is enabled and the internal RC oscillator (@ref NRF_CLOCK_LF_SRC_RC) is used as the SoftDevice"]
12027#[doc = " LFCLK source, the SoftDevice as a peripheral will by default try to increase the receive window if two consecutive packets"]
12028#[doc = " are not received. If it turns out that the packets were not received due to clock drift, the RC calibration is started."]
12029#[doc = " This calibration comes in addition to the periodic calibration that is configured by @ref sd_softdevice_enable(). When"]
12030#[doc = " using only peripheral connections, the periodic calibration can therefore be configured with a much longer interval as the"]
12031#[doc = " peripheral will be able to detect and adjust automatically to clock drift, and calibrate on demand."]
12032#[doc = ""]
12033#[doc = " If extended RC calibration is disabled and the internal RC oscillator is used as the SoftDevice LFCLK source, the"]
12034#[doc = " RC oscillator is calibrated periodically as configured by @ref sd_softdevice_enable()."]
12035#[doc = ""]
12036#[doc = " @note @ref sd_ble_opt_get is not supported for this option."]
12037#[repr(C, packed)]
12038#[derive(Debug, Copy, Clone)]
12039pub struct ble_common_opt_extended_rc_cal_t {
12040    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
12041}
12042#[test]
12043fn bindgen_test_layout_ble_common_opt_extended_rc_cal_t() {
12044    assert_eq!(
12045        ::core::mem::size_of::<ble_common_opt_extended_rc_cal_t>(),
12046        1usize,
12047        concat!("Size of: ", stringify!(ble_common_opt_extended_rc_cal_t))
12048    );
12049    assert_eq!(
12050        ::core::mem::align_of::<ble_common_opt_extended_rc_cal_t>(),
12051        1usize,
12052        concat!("Alignment of ", stringify!(ble_common_opt_extended_rc_cal_t))
12053    );
12054}
12055impl ble_common_opt_extended_rc_cal_t {
12056    #[inline]
12057    pub fn enable(&self) -> u8 {
12058        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
12059    }
12060    #[inline]
12061    pub fn set_enable(&mut self, val: u8) {
12062        unsafe {
12063            let val: u8 = ::core::mem::transmute(val);
12064            self._bitfield_1.set(0usize, 1u8, val as u64)
12065        }
12066    }
12067    #[inline]
12068    pub fn new_bitfield_1(enable: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
12069        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
12070        __bindgen_bitfield_unit.set(0usize, 1u8, {
12071            let enable: u8 = unsafe { ::core::mem::transmute(enable) };
12072            enable as u64
12073        });
12074        __bindgen_bitfield_unit
12075    }
12076}
12077#[doc = "@brief Option structure for common options."]
12078#[repr(C)]
12079#[derive(Copy, Clone)]
12080pub union ble_common_opt_t {
12081    #[doc = "< Parameters for controlling PA and LNA pin toggling."]
12082    pub pa_lna: ble_common_opt_pa_lna_t,
12083    #[doc = "< Parameters for enabling extended connection events."]
12084    pub conn_evt_ext: ble_common_opt_conn_evt_ext_t,
12085    #[doc = "< Parameters for enabling extended RC calibration."]
12086    pub extended_rc_cal: ble_common_opt_extended_rc_cal_t,
12087    _bindgen_union_align: [u8; 5usize],
12088}
12089#[test]
12090fn bindgen_test_layout_ble_common_opt_t() {
12091    assert_eq!(
12092        ::core::mem::size_of::<ble_common_opt_t>(),
12093        5usize,
12094        concat!("Size of: ", stringify!(ble_common_opt_t))
12095    );
12096    assert_eq!(
12097        ::core::mem::align_of::<ble_common_opt_t>(),
12098        1usize,
12099        concat!("Alignment of ", stringify!(ble_common_opt_t))
12100    );
12101    assert_eq!(
12102        unsafe { &(*(::core::ptr::null::<ble_common_opt_t>())).pa_lna as *const _ as usize },
12103        0usize,
12104        concat!(
12105            "Offset of field: ",
12106            stringify!(ble_common_opt_t),
12107            "::",
12108            stringify!(pa_lna)
12109        )
12110    );
12111    assert_eq!(
12112        unsafe { &(*(::core::ptr::null::<ble_common_opt_t>())).conn_evt_ext as *const _ as usize },
12113        0usize,
12114        concat!(
12115            "Offset of field: ",
12116            stringify!(ble_common_opt_t),
12117            "::",
12118            stringify!(conn_evt_ext)
12119        )
12120    );
12121    assert_eq!(
12122        unsafe { &(*(::core::ptr::null::<ble_common_opt_t>())).extended_rc_cal as *const _ as usize },
12123        0usize,
12124        concat!(
12125            "Offset of field: ",
12126            stringify!(ble_common_opt_t),
12127            "::",
12128            stringify!(extended_rc_cal)
12129        )
12130    );
12131}
12132#[doc = "@brief Common BLE Option type, wrapping the module specific options."]
12133#[repr(C)]
12134#[derive(Copy, Clone)]
12135pub union ble_opt_t {
12136    #[doc = "< COMMON options, opt_id in @ref BLE_COMMON_OPTS series."]
12137    pub common_opt: ble_common_opt_t,
12138    #[doc = "< GAP option, opt_id in @ref BLE_GAP_OPTS series."]
12139    pub gap_opt: ble_gap_opt_t,
12140    _bindgen_union_align: [u32; 2usize],
12141}
12142#[test]
12143fn bindgen_test_layout_ble_opt_t() {
12144    assert_eq!(
12145        ::core::mem::size_of::<ble_opt_t>(),
12146        8usize,
12147        concat!("Size of: ", stringify!(ble_opt_t))
12148    );
12149    assert_eq!(
12150        ::core::mem::align_of::<ble_opt_t>(),
12151        4usize,
12152        concat!("Alignment of ", stringify!(ble_opt_t))
12153    );
12154    assert_eq!(
12155        unsafe { &(*(::core::ptr::null::<ble_opt_t>())).common_opt as *const _ as usize },
12156        0usize,
12157        concat!("Offset of field: ", stringify!(ble_opt_t), "::", stringify!(common_opt))
12158    );
12159    assert_eq!(
12160        unsafe { &(*(::core::ptr::null::<ble_opt_t>())).gap_opt as *const _ as usize },
12161        0usize,
12162        concat!("Offset of field: ", stringify!(ble_opt_t), "::", stringify!(gap_opt))
12163    );
12164}
12165#[doc = "@brief BLE connection configuration type, wrapping the module specific configurations, set with"]
12166#[doc = " @ref sd_ble_cfg_set."]
12167#[doc = ""]
12168#[doc = " @note Connection configurations don't have to be set."]
12169#[doc = " In the case that no configurations has been set, or fewer connection configurations has been set than enabled connections,"]
12170#[doc = " the default connection configuration will be automatically added for the remaining connections."]
12171#[doc = " When creating connections with the default configuration, @ref BLE_CONN_CFG_TAG_DEFAULT should be used in"]
12172#[doc = " place of @ref ble_conn_cfg_t::conn_cfg_tag."]
12173#[doc = ""]
12174#[doc = " @sa sd_ble_gap_adv_start()"]
12175#[doc = ""]
12176#[doc = " @mscs"]
12177#[doc = " @mmsc{@ref BLE_CONN_CFG}"]
12178#[doc = " @endmscs"]
12179#[doc = ""]
12180#[repr(C)]
12181#[derive(Copy, Clone)]
12182pub struct ble_conn_cfg_t {
12183    #[doc = "< The application chosen tag it can use with the"]
12184    #[doc = "@ref sd_ble_gap_adv_start() call"]
12185    #[doc = "to select this configuration when creating a connection."]
12186    #[doc = "Must be different for all connection configurations added and not @ref BLE_CONN_CFG_TAG_DEFAULT."]
12187    pub conn_cfg_tag: u8,
12188    #[doc = "< Connection configuration union."]
12189    pub params: ble_conn_cfg_t__bindgen_ty_1,
12190}
12191#[repr(C)]
12192#[derive(Copy, Clone)]
12193pub union ble_conn_cfg_t__bindgen_ty_1 {
12194    #[doc = "< GAP connection configuration, cfg_id is @ref BLE_CONN_CFG_GAP."]
12195    pub gap_conn_cfg: ble_gap_conn_cfg_t,
12196    #[doc = "< GATTC connection configuration, cfg_id is @ref BLE_CONN_CFG_GATTC."]
12197    pub gattc_conn_cfg: ble_gattc_conn_cfg_t,
12198    #[doc = "< GATTS connection configuration, cfg_id is @ref BLE_CONN_CFG_GATTS."]
12199    pub gatts_conn_cfg: ble_gatts_conn_cfg_t,
12200    #[doc = "< GATT connection configuration, cfg_id is @ref BLE_CONN_CFG_GATT."]
12201    pub gatt_conn_cfg: ble_gatt_conn_cfg_t,
12202    #[doc = "< L2CAP connection configuration, cfg_id is @ref BLE_CONN_CFG_L2CAP."]
12203    pub l2cap_conn_cfg: ble_l2cap_conn_cfg_t,
12204    _bindgen_union_align: [u16; 4usize],
12205}
12206#[test]
12207fn bindgen_test_layout_ble_conn_cfg_t__bindgen_ty_1() {
12208    assert_eq!(
12209        ::core::mem::size_of::<ble_conn_cfg_t__bindgen_ty_1>(),
12210        8usize,
12211        concat!("Size of: ", stringify!(ble_conn_cfg_t__bindgen_ty_1))
12212    );
12213    assert_eq!(
12214        ::core::mem::align_of::<ble_conn_cfg_t__bindgen_ty_1>(),
12215        2usize,
12216        concat!("Alignment of ", stringify!(ble_conn_cfg_t__bindgen_ty_1))
12217    );
12218    assert_eq!(
12219        unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t__bindgen_ty_1>())).gap_conn_cfg as *const _ as usize },
12220        0usize,
12221        concat!(
12222            "Offset of field: ",
12223            stringify!(ble_conn_cfg_t__bindgen_ty_1),
12224            "::",
12225            stringify!(gap_conn_cfg)
12226        )
12227    );
12228    assert_eq!(
12229        unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t__bindgen_ty_1>())).gattc_conn_cfg as *const _ as usize },
12230        0usize,
12231        concat!(
12232            "Offset of field: ",
12233            stringify!(ble_conn_cfg_t__bindgen_ty_1),
12234            "::",
12235            stringify!(gattc_conn_cfg)
12236        )
12237    );
12238    assert_eq!(
12239        unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t__bindgen_ty_1>())).gatts_conn_cfg as *const _ as usize },
12240        0usize,
12241        concat!(
12242            "Offset of field: ",
12243            stringify!(ble_conn_cfg_t__bindgen_ty_1),
12244            "::",
12245            stringify!(gatts_conn_cfg)
12246        )
12247    );
12248    assert_eq!(
12249        unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t__bindgen_ty_1>())).gatt_conn_cfg as *const _ as usize },
12250        0usize,
12251        concat!(
12252            "Offset of field: ",
12253            stringify!(ble_conn_cfg_t__bindgen_ty_1),
12254            "::",
12255            stringify!(gatt_conn_cfg)
12256        )
12257    );
12258    assert_eq!(
12259        unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t__bindgen_ty_1>())).l2cap_conn_cfg as *const _ as usize },
12260        0usize,
12261        concat!(
12262            "Offset of field: ",
12263            stringify!(ble_conn_cfg_t__bindgen_ty_1),
12264            "::",
12265            stringify!(l2cap_conn_cfg)
12266        )
12267    );
12268}
12269#[test]
12270fn bindgen_test_layout_ble_conn_cfg_t() {
12271    assert_eq!(
12272        ::core::mem::size_of::<ble_conn_cfg_t>(),
12273        10usize,
12274        concat!("Size of: ", stringify!(ble_conn_cfg_t))
12275    );
12276    assert_eq!(
12277        ::core::mem::align_of::<ble_conn_cfg_t>(),
12278        2usize,
12279        concat!("Alignment of ", stringify!(ble_conn_cfg_t))
12280    );
12281    assert_eq!(
12282        unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t>())).conn_cfg_tag as *const _ as usize },
12283        0usize,
12284        concat!(
12285            "Offset of field: ",
12286            stringify!(ble_conn_cfg_t),
12287            "::",
12288            stringify!(conn_cfg_tag)
12289        )
12290    );
12291    assert_eq!(
12292        unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t>())).params as *const _ as usize },
12293        2usize,
12294        concat!(
12295            "Offset of field: ",
12296            stringify!(ble_conn_cfg_t),
12297            "::",
12298            stringify!(params)
12299        )
12300    );
12301}
12302#[doc = " @brief Configuration of Vendor Specific base UUIDs, set with @ref sd_ble_cfg_set."]
12303#[doc = ""]
12304#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Too many UUIDs configured."]
12305#[repr(C)]
12306#[derive(Debug, Copy, Clone)]
12307pub struct ble_common_cfg_vs_uuid_t {
12308    #[doc = "< Number of 128-bit Vendor Specific base UUID bases to allocate memory for."]
12309    #[doc = "Default value is @ref BLE_UUID_VS_COUNT_DEFAULT. Maximum value is"]
12310    #[doc = "@ref BLE_UUID_VS_COUNT_MAX."]
12311    pub vs_uuid_count: u8,
12312}
12313#[test]
12314fn bindgen_test_layout_ble_common_cfg_vs_uuid_t() {
12315    assert_eq!(
12316        ::core::mem::size_of::<ble_common_cfg_vs_uuid_t>(),
12317        1usize,
12318        concat!("Size of: ", stringify!(ble_common_cfg_vs_uuid_t))
12319    );
12320    assert_eq!(
12321        ::core::mem::align_of::<ble_common_cfg_vs_uuid_t>(),
12322        1usize,
12323        concat!("Alignment of ", stringify!(ble_common_cfg_vs_uuid_t))
12324    );
12325    assert_eq!(
12326        unsafe { &(*(::core::ptr::null::<ble_common_cfg_vs_uuid_t>())).vs_uuid_count as *const _ as usize },
12327        0usize,
12328        concat!(
12329            "Offset of field: ",
12330            stringify!(ble_common_cfg_vs_uuid_t),
12331            "::",
12332            stringify!(vs_uuid_count)
12333        )
12334    );
12335}
12336#[doc = "@brief Common BLE Configuration type, wrapping the common configurations."]
12337#[repr(C)]
12338#[derive(Copy, Clone)]
12339pub union ble_common_cfg_t {
12340    #[doc = "< Vendor Specific base UUID configuration, cfg_id is @ref BLE_COMMON_CFG_VS_UUID."]
12341    pub vs_uuid_cfg: ble_common_cfg_vs_uuid_t,
12342    _bindgen_union_align: u8,
12343}
12344#[test]
12345fn bindgen_test_layout_ble_common_cfg_t() {
12346    assert_eq!(
12347        ::core::mem::size_of::<ble_common_cfg_t>(),
12348        1usize,
12349        concat!("Size of: ", stringify!(ble_common_cfg_t))
12350    );
12351    assert_eq!(
12352        ::core::mem::align_of::<ble_common_cfg_t>(),
12353        1usize,
12354        concat!("Alignment of ", stringify!(ble_common_cfg_t))
12355    );
12356    assert_eq!(
12357        unsafe { &(*(::core::ptr::null::<ble_common_cfg_t>())).vs_uuid_cfg as *const _ as usize },
12358        0usize,
12359        concat!(
12360            "Offset of field: ",
12361            stringify!(ble_common_cfg_t),
12362            "::",
12363            stringify!(vs_uuid_cfg)
12364        )
12365    );
12366}
12367#[doc = "@brief BLE Configuration type, wrapping the module specific configurations."]
12368#[repr(C)]
12369#[derive(Copy, Clone)]
12370pub union ble_cfg_t {
12371    #[doc = "< Connection specific configurations, cfg_id in @ref BLE_CONN_CFGS series."]
12372    pub conn_cfg: ble_conn_cfg_t,
12373    #[doc = "< Global common configurations, cfg_id in @ref BLE_COMMON_CFGS series."]
12374    pub common_cfg: ble_common_cfg_t,
12375    #[doc = "< Global GAP configurations, cfg_id in @ref BLE_GAP_CFGS series."]
12376    pub gap_cfg: ble_gap_cfg_t,
12377    #[doc = "< Global GATTS configuration, cfg_id in @ref BLE_GATTS_CFGS series."]
12378    pub gatts_cfg: ble_gatts_cfg_t,
12379    _bindgen_union_align: [u32; 3usize],
12380}
12381#[test]
12382fn bindgen_test_layout_ble_cfg_t() {
12383    assert_eq!(
12384        ::core::mem::size_of::<ble_cfg_t>(),
12385        12usize,
12386        concat!("Size of: ", stringify!(ble_cfg_t))
12387    );
12388    assert_eq!(
12389        ::core::mem::align_of::<ble_cfg_t>(),
12390        4usize,
12391        concat!("Alignment of ", stringify!(ble_cfg_t))
12392    );
12393    assert_eq!(
12394        unsafe { &(*(::core::ptr::null::<ble_cfg_t>())).conn_cfg as *const _ as usize },
12395        0usize,
12396        concat!("Offset of field: ", stringify!(ble_cfg_t), "::", stringify!(conn_cfg))
12397    );
12398    assert_eq!(
12399        unsafe { &(*(::core::ptr::null::<ble_cfg_t>())).common_cfg as *const _ as usize },
12400        0usize,
12401        concat!("Offset of field: ", stringify!(ble_cfg_t), "::", stringify!(common_cfg))
12402    );
12403    assert_eq!(
12404        unsafe { &(*(::core::ptr::null::<ble_cfg_t>())).gap_cfg as *const _ as usize },
12405        0usize,
12406        concat!("Offset of field: ", stringify!(ble_cfg_t), "::", stringify!(gap_cfg))
12407    );
12408    assert_eq!(
12409        unsafe { &(*(::core::ptr::null::<ble_cfg_t>())).gatts_cfg as *const _ as usize },
12410        0usize,
12411        concat!("Offset of field: ", stringify!(ble_cfg_t), "::", stringify!(gatts_cfg))
12412    );
12413}
12414
12415#[doc = "@brief Enable the BLE stack"]
12416#[doc = ""]
12417#[doc = " @param[in, out] p_app_ram_base   Pointer to a variable containing the start address of the"]
12418#[doc = "                                  application RAM region (APP_RAM_BASE). On return, this will"]
12419#[doc = "                                  contain the minimum start address of the application RAM region"]
12420#[doc = "                                  required by the SoftDevice for this configuration."]
12421#[doc = ""]
12422#[doc = " @note The memory requirement for a specific configuration will not increase between SoftDevices"]
12423#[doc = "       with the same major version number."]
12424#[doc = ""]
12425#[doc = " @note At runtime the IC's RAM is split into 2 regions: The SoftDevice RAM region is located"]
12426#[doc = "       between 0x20000000 and APP_RAM_BASE-1 and the application's RAM region is located between"]
12427#[doc = "       APP_RAM_BASE and the start of the call stack."]
12428#[doc = ""]
12429#[doc = " @details This call initializes the BLE stack, no BLE related function other than @ref"]
12430#[doc = "          sd_ble_cfg_set can be called before this one."]
12431#[doc = ""]
12432#[doc = " @mscs"]
12433#[doc = " @mmsc{@ref BLE_COMMON_ENABLE}"]
12434#[doc = " @endmscs"]
12435#[doc = ""]
12436#[doc = " @retval ::NRF_SUCCESS              The BLE stack has been initialized successfully."]
12437#[doc = " @retval ::NRF_ERROR_INVALID_STATE  The BLE stack had already been initialized and cannot be reinitialized."]
12438#[doc = " @retval ::NRF_ERROR_INVALID_ADDR   Invalid or not sufficiently aligned pointer supplied."]
12439#[doc = " @retval ::NRF_ERROR_NO_MEM         One or more of the following is true:"]
12440#[doc = "                                    - The amount of memory assigned to the SoftDevice by *p_app_ram_base is not"]
12441#[doc = "                                      large enough to fit this configuration's memory requirement. Check *p_app_ram_base"]
12442#[doc = "                                      and set the start address of the application RAM region accordingly."]
12443#[doc = "                                    - Dynamic part of the SoftDevice RAM region is larger then 64 kB which"]
12444#[doc = "                                      is currently not supported."]
12445#[doc = " @retval ::NRF_ERROR_RESOURCES      The total number of L2CAP Channels configured using @ref sd_ble_cfg_set is too large."]
12446#[inline(always)]
12447pub unsafe fn sd_ble_enable(p_app_ram_base: *mut u32) -> u32 {
12448    let ret: u32;
12449    core::arch::asm!("svc 96",
12450        inout("r0") to_asm(p_app_ram_base) => ret,
12451        lateout("r1") _,
12452        lateout("r2") _,
12453        lateout("r3") _,
12454        lateout("r12") _,
12455    );
12456    ret
12457}
12458
12459#[doc = "@brief Add configurations for the BLE stack"]
12460#[doc = ""]
12461#[doc = " @param[in] cfg_id              Config ID, see @ref BLE_CONN_CFGS, @ref BLE_COMMON_CFGS, @ref"]
12462#[doc = "                                BLE_GAP_CFGS or @ref BLE_GATTS_CFGS."]
12463#[doc = " @param[in] p_cfg               Pointer to a ble_cfg_t structure containing the configuration value."]
12464#[doc = " @param[in] app_ram_base        The start address of the application RAM region (APP_RAM_BASE)."]
12465#[doc = "                                See @ref sd_ble_enable for details about APP_RAM_BASE."]
12466#[doc = ""]
12467#[doc = " @note The memory requirement for a specific configuration will not increase between SoftDevices"]
12468#[doc = "       with the same major version number."]
12469#[doc = ""]
12470#[doc = " @note If a configuration is set more than once, the last one set is the one that takes effect on"]
12471#[doc = "       @ref sd_ble_enable."]
12472#[doc = ""]
12473#[doc = " @note Any part of the BLE stack that is NOT configured with @ref sd_ble_cfg_set will have default"]
12474#[doc = "       configuration."]
12475#[doc = ""]
12476#[doc = " @note @ref sd_ble_cfg_set may be called at any time when the SoftDevice is enabled (see @ref"]
12477#[doc = "       sd_softdevice_enable) while the BLE part of the SoftDevice is not enabled (see @ref"]
12478#[doc = "       sd_ble_enable)."]
12479#[doc = ""]
12480#[doc = " @note Error codes for the configurations are described in the configuration structs."]
12481#[doc = ""]
12482#[doc = " @mscs"]
12483#[doc = " @mmsc{@ref BLE_COMMON_ENABLE}"]
12484#[doc = " @endmscs"]
12485#[doc = ""]
12486#[doc = " @retval ::NRF_SUCCESS              The configuration has been added successfully."]
12487#[doc = " @retval ::NRF_ERROR_INVALID_STATE  The BLE stack had already been initialized."]
12488#[doc = " @retval ::NRF_ERROR_INVALID_ADDR   Invalid or not sufficiently aligned pointer supplied."]
12489#[doc = " @retval ::NRF_ERROR_INVALID_PARAM  Invalid cfg_id supplied."]
12490#[doc = " @retval ::NRF_ERROR_NO_MEM         The amount of memory assigned to the SoftDevice by app_ram_base is not"]
12491#[doc = "                                    large enough to fit this configuration's memory requirement."]
12492#[inline(always)]
12493pub unsafe fn sd_ble_cfg_set(cfg_id: u32, p_cfg: *const ble_cfg_t, app_ram_base: u32) -> u32 {
12494    let ret: u32;
12495    core::arch::asm!("svc 105",
12496        inout("r0") to_asm(cfg_id) => ret,
12497        inout("r1") to_asm(p_cfg) => _,
12498        inout("r2") to_asm(app_ram_base) => _,
12499        lateout("r3") _,
12500        lateout("r12") _,
12501    );
12502    ret
12503}
12504
12505#[doc = "@brief Get an event from the pending events queue."]
12506#[doc = ""]
12507#[doc = " @param[out] p_dest Pointer to buffer to be filled in with an event, or NULL to retrieve the event length."]
12508#[doc = "                    This buffer <b>must be aligned to the extend defined by @ref BLE_EVT_PTR_ALIGNMENT</b>."]
12509#[doc = "                    The buffer should be interpreted as a @ref ble_evt_t struct."]
12510#[doc = " @param[in, out] p_len Pointer the length of the buffer, on return it is filled with the event length."]
12511#[doc = ""]
12512#[doc = " @details This call allows the application to pull a BLE event from the BLE stack. The application is signaled that"]
12513#[doc = " an event is available from the BLE stack by the triggering of the SD_EVT_IRQn interrupt."]
12514#[doc = " The application is free to choose whether to call this function from thread mode (main context) or directly from the"]
12515#[doc = " Interrupt Service Routine that maps to SD_EVT_IRQn. In any case however, and because the BLE stack runs at a higher"]
12516#[doc = " priority than the application, this function should be called in a loop (until @ref NRF_ERROR_NOT_FOUND is returned)"]
12517#[doc = " every time SD_EVT_IRQn is raised to ensure that all available events are pulled from the BLE stack. Failure to do so"]
12518#[doc = " could potentially leave events in the internal queue without the application being aware of this fact."]
12519#[doc = ""]
12520#[doc = " Sizing the p_dest buffer is equally important, since the application needs to provide all the memory necessary for the event to"]
12521#[doc = " be copied into application memory. If the buffer provided is not large enough to fit the entire contents of the event,"]
12522#[doc = " @ref NRF_ERROR_DATA_SIZE will be returned and the application can then call again with a larger buffer size."]
12523#[doc = " The maximum possible event length is defined by @ref BLE_EVT_LEN_MAX. The application may also \"peek\" the event length"]
12524#[doc = " by providing p_dest as a NULL pointer and inspecting the value of *p_len upon return:"]
12525#[doc = ""]
12526#[doc = "     \\code"]
12527#[doc = "     uint16_t len;"]
12528#[doc = "     errcode = sd_ble_evt_get(NULL, &len);"]
12529#[doc = "     \\endcode"]
12530#[doc = ""]
12531#[doc = " @mscs"]
12532#[doc = " @mmsc{@ref BLE_COMMON_IRQ_EVT_MSC}"]
12533#[doc = " @mmsc{@ref BLE_COMMON_THREAD_EVT_MSC}"]
12534#[doc = " @endmscs"]
12535#[doc = ""]
12536#[doc = " @retval ::NRF_SUCCESS Event pulled and stored into the supplied buffer."]
12537#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied."]
12538#[doc = " @retval ::NRF_ERROR_NOT_FOUND No events ready to be pulled."]
12539#[doc = " @retval ::NRF_ERROR_DATA_SIZE Event ready but could not fit into the supplied buffer."]
12540#[inline(always)]
12541pub unsafe fn sd_ble_evt_get(p_dest: *mut u8, p_len: *mut u16) -> u32 {
12542    let ret: u32;
12543    core::arch::asm!("svc 97",
12544        inout("r0") to_asm(p_dest) => ret,
12545        inout("r1") to_asm(p_len) => _,
12546        lateout("r2") _,
12547        lateout("r3") _,
12548        lateout("r12") _,
12549    );
12550    ret
12551}
12552
12553#[doc = "@brief Add a Vendor Specific base UUID."]
12554#[doc = ""]
12555#[doc = " @details This call enables the application to add a Vendor Specific base UUID to the BLE stack's table, for later"]
12556#[doc = " use with all other modules and APIs. This then allows the application to use the shorter, 24-bit @ref ble_uuid_t"]
12557#[doc = " format when dealing with both 16-bit and 128-bit UUIDs without having to check for lengths and having split code"]
12558#[doc = " paths. This is accomplished by extending the grouping mechanism that the Bluetooth SIG standard base UUID uses"]
12559#[doc = " for all other 128-bit UUIDs. The type field in the @ref ble_uuid_t structure is an index (relative to"]
12560#[doc = " @ref BLE_UUID_TYPE_VENDOR_BEGIN) to the table populated by multiple calls to this function, and the UUID field"]
12561#[doc = " in the same structure contains the 2 bytes at indexes 12 and 13. The number of possible 128-bit UUIDs available to"]
12562#[doc = " the application is therefore the number of Vendor Specific UUIDs added with the help of this function times 65536,"]
12563#[doc = " although restricted to modifying bytes 12 and 13 for each of the entries in the supplied array."]
12564#[doc = ""]
12565#[doc = " @note Bytes 12 and 13 of the provided UUID will not be used internally, since those are always replaced by"]
12566#[doc = " the 16-bit uuid field in @ref ble_uuid_t."]
12567#[doc = ""]
12568#[doc = " @note If a UUID is already present in the BLE stack's internal table, the corresponding index will be returned in"]
12569#[doc = " p_uuid_type along with an @ref NRF_SUCCESS error code."]
12570#[doc = ""]
12571#[doc = " @param[in]  p_vs_uuid    Pointer to a 16-octet (128-bit) little endian Vendor Specific base UUID disregarding"]
12572#[doc = "                          bytes 12 and 13."]
12573#[doc = " @param[out] p_uuid_type  Pointer to a uint8_t where the type field in @ref ble_uuid_t corresponding to this UUID will be stored."]
12574#[doc = ""]
12575#[doc = " @retval ::NRF_SUCCESS Successfully added the Vendor Specific base UUID."]
12576#[doc = " @retval ::NRF_ERROR_INVALID_ADDR If p_vs_uuid or p_uuid_type is NULL or invalid."]
12577#[doc = " @retval ::NRF_ERROR_NO_MEM If there are no more free slots for VS UUIDs."]
12578#[inline(always)]
12579pub unsafe fn sd_ble_uuid_vs_add(p_vs_uuid: *const ble_uuid128_t, p_uuid_type: *mut u8) -> u32 {
12580    let ret: u32;
12581    core::arch::asm!("svc 98",
12582        inout("r0") to_asm(p_vs_uuid) => ret,
12583        inout("r1") to_asm(p_uuid_type) => _,
12584        lateout("r2") _,
12585        lateout("r3") _,
12586        lateout("r12") _,
12587    );
12588    ret
12589}
12590
12591#[doc = "@brief Remove a Vendor Specific base UUID."]
12592#[doc = ""]
12593#[doc = " @details This call removes a Vendor Specific base UUID that has been added with @ref sd_ble_uuid_vs_add. This function allows"]
12594#[doc = " the application to reuse memory allocated for Vendor Specific base UUIDs."]
12595#[doc = ""]
12596#[doc = " @note Currently this function can only be called with a p_uuid_type set to @ref BLE_UUID_TYPE_UNKNOWN or the last added UUID type."]
12597#[doc = ""]
12598#[doc = " @param[inout] p_uuid_type Pointer to a uint8_t where its value matches the UUID type in @ref ble_uuid_t::type to be removed."]
12599#[doc = "                           If the type is set to @ref BLE_UUID_TYPE_UNKNOWN, or the pointer is NULL, the last Vendor Specific"]
12600#[doc = "                           base UUID will be removed. If the function returns successfully, the UUID type that was removed will"]
12601#[doc = "                           be written back to @p p_uuid_type. If function returns with a failure, it contains the last type that"]
12602#[doc = "                           is in use by the ATT Server."]
12603#[doc = ""]
12604#[doc = " @retval ::NRF_SUCCESS Successfully removed the Vendor Specific base UUID."]
12605#[doc = " @retval ::NRF_ERROR_INVALID_ADDR If p_uuid_type is invalid."]
12606#[doc = " @retval ::NRF_ERROR_INVALID_PARAM If p_uuid_type points to a non-valid UUID type."]
12607#[doc = " @retval ::NRF_ERROR_FORBIDDEN If the Vendor Specific base UUID is in use by the ATT Server."]
12608#[inline(always)]
12609pub unsafe fn sd_ble_uuid_vs_remove(p_uuid_type: *mut u8) -> u32 {
12610    let ret: u32;
12611    core::arch::asm!("svc 106",
12612        inout("r0") to_asm(p_uuid_type) => ret,
12613        lateout("r1") _,
12614        lateout("r2") _,
12615        lateout("r3") _,
12616        lateout("r12") _,
12617    );
12618    ret
12619}
12620
12621#[doc = " @brief Decode little endian raw UUID bytes (16-bit or 128-bit) into a 24 bit @ref ble_uuid_t structure."]
12622#[doc = ""]
12623#[doc = " @details The raw UUID bytes excluding bytes 12 and 13 (i.e. bytes 0-11 and 14-15) of p_uuid_le are compared"]
12624#[doc = " to the corresponding ones in each entry of the table of Vendor Specific base UUIDs populated with @ref sd_ble_uuid_vs_add"]
12625#[doc = " to look for a match. If there is such a match, bytes 12 and 13 are returned as p_uuid->uuid and the index"]
12626#[doc = " relative to @ref BLE_UUID_TYPE_VENDOR_BEGIN as p_uuid->type."]
12627#[doc = ""]
12628#[doc = " @note If the UUID length supplied is 2, then the type set by this call will always be @ref BLE_UUID_TYPE_BLE."]
12629#[doc = ""]
12630#[doc = " @param[in]   uuid_le_len Length in bytes of the buffer pointed to by p_uuid_le (must be 2 or 16 bytes)."]
12631#[doc = " @param[in]   p_uuid_le   Pointer pointing to little endian raw UUID bytes."]
12632#[doc = " @param[out]  p_uuid      Pointer to a @ref ble_uuid_t structure to be filled in."]
12633#[doc = ""]
12634#[doc = " @retval ::NRF_SUCCESS Successfully decoded into the @ref ble_uuid_t structure."]
12635#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12636#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH Invalid UUID length."]
12637#[doc = " @retval ::NRF_ERROR_NOT_FOUND For a 128-bit UUID, no match in the populated table of UUIDs."]
12638#[inline(always)]
12639pub unsafe fn sd_ble_uuid_decode(uuid_le_len: u8, p_uuid_le: *const u8, p_uuid: *mut ble_uuid_t) -> u32 {
12640    let ret: u32;
12641    core::arch::asm!("svc 99",
12642        inout("r0") to_asm(uuid_le_len) => ret,
12643        inout("r1") to_asm(p_uuid_le) => _,
12644        inout("r2") to_asm(p_uuid) => _,
12645        lateout("r3") _,
12646        lateout("r12") _,
12647    );
12648    ret
12649}
12650
12651#[doc = " @brief Encode a @ref ble_uuid_t structure into little endian raw UUID bytes (16-bit or 128-bit)."]
12652#[doc = ""]
12653#[doc = " @note The pointer to the destination buffer p_uuid_le may be NULL, in which case only the validity and size of p_uuid is computed."]
12654#[doc = ""]
12655#[doc = " @param[in]   p_uuid        Pointer to a @ref ble_uuid_t structure that will be encoded into bytes."]
12656#[doc = " @param[out]  p_uuid_le_len Pointer to a uint8_t that will be filled with the encoded length (2 or 16 bytes)."]
12657#[doc = " @param[out]  p_uuid_le     Pointer to a buffer where the little endian raw UUID bytes (2 or 16) will be stored."]
12658#[doc = ""]
12659#[doc = " @retval ::NRF_SUCCESS Successfully encoded into the buffer."]
12660#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12661#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid UUID type."]
12662#[inline(always)]
12663pub unsafe fn sd_ble_uuid_encode(p_uuid: *const ble_uuid_t, p_uuid_le_len: *mut u8, p_uuid_le: *mut u8) -> u32 {
12664    let ret: u32;
12665    core::arch::asm!("svc 100",
12666        inout("r0") to_asm(p_uuid) => ret,
12667        inout("r1") to_asm(p_uuid_le_len) => _,
12668        inout("r2") to_asm(p_uuid_le) => _,
12669        lateout("r3") _,
12670        lateout("r12") _,
12671    );
12672    ret
12673}
12674
12675#[doc = "@brief Get Version Information."]
12676#[doc = ""]
12677#[doc = " @details This call allows the application to get the BLE stack version information."]
12678#[doc = ""]
12679#[doc = " @param[out] p_version Pointer to a ble_version_t structure to be filled in."]
12680#[doc = ""]
12681#[doc = " @retval ::NRF_SUCCESS  Version information stored successfully."]
12682#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12683#[doc = " @retval ::NRF_ERROR_BUSY The BLE stack is busy (typically doing a locally-initiated disconnection procedure)."]
12684#[inline(always)]
12685pub unsafe fn sd_ble_version_get(p_version: *mut ble_version_t) -> u32 {
12686    let ret: u32;
12687    core::arch::asm!("svc 101",
12688        inout("r0") to_asm(p_version) => ret,
12689        lateout("r1") _,
12690        lateout("r2") _,
12691        lateout("r3") _,
12692        lateout("r12") _,
12693    );
12694    ret
12695}
12696
12697#[doc = "@brief Provide a user memory block."]
12698#[doc = ""]
12699#[doc = " @note This call can only be used as a response to a @ref BLE_EVT_USER_MEM_REQUEST event issued to the application."]
12700#[doc = ""]
12701#[doc = " @param[in] conn_handle Connection handle."]
12702#[doc = " @param[in] p_block Pointer to a user memory block structure or NULL if memory is managed by the application."]
12703#[doc = ""]
12704#[doc = " @mscs"]
12705#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC}"]
12706#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC}"]
12707#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC}"]
12708#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC}"]
12709#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_NOAUTH_MSC}"]
12710#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC}"]
12711#[doc = " @endmscs"]
12712#[doc = ""]
12713#[doc = " @retval ::NRF_SUCCESS Successfully queued a response to the peer."]
12714#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12715#[doc = " @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry."]
12716#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
12717#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH Invalid user memory block length supplied."]
12718#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection state or no user memory request pending."]
12719#[inline(always)]
12720pub unsafe fn sd_ble_user_mem_reply(conn_handle: u16, p_block: *const ble_user_mem_block_t) -> u32 {
12721    let ret: u32;
12722    core::arch::asm!("svc 102",
12723        inout("r0") to_asm(conn_handle) => ret,
12724        inout("r1") to_asm(p_block) => _,
12725        lateout("r2") _,
12726        lateout("r3") _,
12727        lateout("r12") _,
12728    );
12729    ret
12730}
12731
12732#[doc = "@brief Set a BLE option."]
12733#[doc = ""]
12734#[doc = " @details This call allows the application to set the value of an option."]
12735#[doc = ""]
12736#[doc = " @param[in] opt_id Option ID, see @ref BLE_COMMON_OPTS and @ref BLE_GAP_OPTS."]
12737#[doc = " @param[in] p_opt Pointer to a ble_opt_t structure containing the option value."]
12738#[doc = ""]
12739#[doc = " @retval ::NRF_SUCCESS  Option set successfully."]
12740#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12741#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
12742#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints."]
12743#[doc = " @retval ::NRF_ERROR_INVALID_STATE Unable to set the parameter at this time."]
12744#[doc = " @retval ::NRF_ERROR_BUSY The BLE stack is busy or the previous procedure has not completed."]
12745#[inline(always)]
12746pub unsafe fn sd_ble_opt_set(opt_id: u32, p_opt: *const ble_opt_t) -> u32 {
12747    let ret: u32;
12748    core::arch::asm!("svc 103",
12749        inout("r0") to_asm(opt_id) => ret,
12750        inout("r1") to_asm(p_opt) => _,
12751        lateout("r2") _,
12752        lateout("r3") _,
12753        lateout("r12") _,
12754    );
12755    ret
12756}
12757
12758#[doc = "@brief Get a BLE option."]
12759#[doc = ""]
12760#[doc = " @details This call allows the application to retrieve the value of an option."]
12761#[doc = ""]
12762#[doc = " @param[in] opt_id Option ID, see @ref BLE_COMMON_OPTS and @ref BLE_GAP_OPTS."]
12763#[doc = " @param[out] p_opt Pointer to a ble_opt_t structure to be filled in."]
12764#[doc = ""]
12765#[doc = " @retval ::NRF_SUCCESS  Option retrieved successfully."]
12766#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12767#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
12768#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints."]
12769#[doc = " @retval ::NRF_ERROR_INVALID_STATE Unable to retrieve the parameter at this time."]
12770#[doc = " @retval ::NRF_ERROR_BUSY The BLE stack is busy or the previous procedure has not completed."]
12771#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED This option is not supported."]
12772#[doc = ""]
12773#[inline(always)]
12774pub unsafe fn sd_ble_opt_get(opt_id: u32, p_opt: *mut ble_opt_t) -> u32 {
12775    let ret: u32;
12776    core::arch::asm!("svc 104",
12777        inout("r0") to_asm(opt_id) => ret,
12778        inout("r1") to_asm(p_opt) => _,
12779        lateout("r2") _,
12780        lateout("r3") _,
12781        lateout("r12") _,
12782    );
12783    ret
12784}
12785
12786pub const NRF_SOC_SVCS_SD_PPI_CHANNEL_ENABLE_GET: NRF_SOC_SVCS = 32;
12787pub const NRF_SOC_SVCS_SD_PPI_CHANNEL_ENABLE_SET: NRF_SOC_SVCS = 33;
12788pub const NRF_SOC_SVCS_SD_PPI_CHANNEL_ENABLE_CLR: NRF_SOC_SVCS = 34;
12789pub const NRF_SOC_SVCS_SD_PPI_CHANNEL_ASSIGN: NRF_SOC_SVCS = 35;
12790pub const NRF_SOC_SVCS_SD_PPI_GROUP_TASK_ENABLE: NRF_SOC_SVCS = 36;
12791pub const NRF_SOC_SVCS_SD_PPI_GROUP_TASK_DISABLE: NRF_SOC_SVCS = 37;
12792pub const NRF_SOC_SVCS_SD_PPI_GROUP_ASSIGN: NRF_SOC_SVCS = 38;
12793pub const NRF_SOC_SVCS_SD_PPI_GROUP_GET: NRF_SOC_SVCS = 39;
12794pub const NRF_SOC_SVCS_SD_FLASH_PAGE_ERASE: NRF_SOC_SVCS = 40;
12795pub const NRF_SOC_SVCS_SD_FLASH_WRITE: NRF_SOC_SVCS = 41;
12796pub const NRF_SOC_SVCS_SD_FLASH_PROTECT: NRF_SOC_SVCS = 42;
12797pub const NRF_SOC_SVCS_SD_PROTECTED_REGISTER_WRITE: NRF_SOC_SVCS = 43;
12798pub const NRF_SOC_SVCS_SD_MUTEX_NEW: NRF_SOC_SVCS = 44;
12799pub const NRF_SOC_SVCS_SD_MUTEX_ACQUIRE: NRF_SOC_SVCS = 45;
12800pub const NRF_SOC_SVCS_SD_MUTEX_RELEASE: NRF_SOC_SVCS = 46;
12801pub const NRF_SOC_SVCS_SD_RAND_APPLICATION_POOL_CAPACITY_GET: NRF_SOC_SVCS = 47;
12802pub const NRF_SOC_SVCS_SD_RAND_APPLICATION_BYTES_AVAILABLE_GET: NRF_SOC_SVCS = 48;
12803pub const NRF_SOC_SVCS_SD_RAND_APPLICATION_VECTOR_GET: NRF_SOC_SVCS = 49;
12804pub const NRF_SOC_SVCS_SD_POWER_MODE_SET: NRF_SOC_SVCS = 50;
12805pub const NRF_SOC_SVCS_SD_POWER_SYSTEM_OFF: NRF_SOC_SVCS = 51;
12806pub const NRF_SOC_SVCS_SD_POWER_RESET_REASON_GET: NRF_SOC_SVCS = 52;
12807pub const NRF_SOC_SVCS_SD_POWER_RESET_REASON_CLR: NRF_SOC_SVCS = 53;
12808pub const NRF_SOC_SVCS_SD_POWER_POF_ENABLE: NRF_SOC_SVCS = 54;
12809pub const NRF_SOC_SVCS_SD_POWER_POF_THRESHOLD_SET: NRF_SOC_SVCS = 55;
12810pub const NRF_SOC_SVCS_SD_POWER_RAM_POWER_SET: NRF_SOC_SVCS = 57;
12811pub const NRF_SOC_SVCS_SD_POWER_RAM_POWER_CLR: NRF_SOC_SVCS = 58;
12812pub const NRF_SOC_SVCS_SD_POWER_RAM_POWER_GET: NRF_SOC_SVCS = 59;
12813pub const NRF_SOC_SVCS_SD_POWER_GPREGRET_SET: NRF_SOC_SVCS = 60;
12814pub const NRF_SOC_SVCS_SD_POWER_GPREGRET_CLR: NRF_SOC_SVCS = 61;
12815pub const NRF_SOC_SVCS_SD_POWER_GPREGRET_GET: NRF_SOC_SVCS = 62;
12816pub const NRF_SOC_SVCS_SD_POWER_DCDC_MODE_SET: NRF_SOC_SVCS = 63;
12817pub const NRF_SOC_SVCS_SD_APP_EVT_WAIT: NRF_SOC_SVCS = 65;
12818pub const NRF_SOC_SVCS_SD_CLOCK_HFCLK_REQUEST: NRF_SOC_SVCS = 66;
12819pub const NRF_SOC_SVCS_SD_CLOCK_HFCLK_RELEASE: NRF_SOC_SVCS = 67;
12820pub const NRF_SOC_SVCS_SD_CLOCK_HFCLK_IS_RUNNING: NRF_SOC_SVCS = 68;
12821pub const NRF_SOC_SVCS_SD_RADIO_NOTIFICATION_CFG_SET: NRF_SOC_SVCS = 69;
12822pub const NRF_SOC_SVCS_SD_ECB_BLOCK_ENCRYPT: NRF_SOC_SVCS = 70;
12823pub const NRF_SOC_SVCS_SD_ECB_BLOCKS_ENCRYPT: NRF_SOC_SVCS = 71;
12824pub const NRF_SOC_SVCS_SD_RADIO_SESSION_OPEN: NRF_SOC_SVCS = 72;
12825pub const NRF_SOC_SVCS_SD_RADIO_SESSION_CLOSE: NRF_SOC_SVCS = 73;
12826pub const NRF_SOC_SVCS_SD_RADIO_REQUEST: NRF_SOC_SVCS = 74;
12827pub const NRF_SOC_SVCS_SD_EVT_GET: NRF_SOC_SVCS = 75;
12828pub const NRF_SOC_SVCS_SD_TEMP_GET: NRF_SOC_SVCS = 76;
12829pub const NRF_SOC_SVCS_SD_POWER_USBPWRRDY_ENABLE: NRF_SOC_SVCS = 77;
12830pub const NRF_SOC_SVCS_SD_POWER_USBDETECTED_ENABLE: NRF_SOC_SVCS = 78;
12831pub const NRF_SOC_SVCS_SD_POWER_USBREMOVED_ENABLE: NRF_SOC_SVCS = 79;
12832pub const NRF_SOC_SVCS_SD_POWER_USBREGSTATUS_GET: NRF_SOC_SVCS = 80;
12833pub const NRF_SOC_SVCS_SVC_SOC_LAST: NRF_SOC_SVCS = 81;
12834#[doc = "@brief The SVC numbers used by the SVC functions in the SoC library."]
12835pub type NRF_SOC_SVCS = self::c_uint;
12836pub const NRF_MUTEX_VALUES_NRF_MUTEX_FREE: NRF_MUTEX_VALUES = 0;
12837pub const NRF_MUTEX_VALUES_NRF_MUTEX_TAKEN: NRF_MUTEX_VALUES = 1;
12838#[doc = "@brief Possible values of a ::nrf_mutex_t."]
12839pub type NRF_MUTEX_VALUES = self::c_uint;
12840#[doc = "< Constant latency mode. See power management in the reference manual."]
12841pub const NRF_POWER_MODES_NRF_POWER_MODE_CONSTLAT: NRF_POWER_MODES = 0;
12842#[doc = "< Low power mode. See power management in the reference manual."]
12843pub const NRF_POWER_MODES_NRF_POWER_MODE_LOWPWR: NRF_POWER_MODES = 1;
12844#[doc = "@brief Power modes."]
12845pub type NRF_POWER_MODES = self::c_uint;
12846#[doc = "< 1.7 Volts power failure threshold."]
12847pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V17: NRF_POWER_THRESHOLDS = 4;
12848#[doc = "< 1.8 Volts power failure threshold."]
12849pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V18: NRF_POWER_THRESHOLDS = 5;
12850#[doc = "< 1.9 Volts power failure threshold."]
12851pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V19: NRF_POWER_THRESHOLDS = 6;
12852#[doc = "< 2.0 Volts power failure threshold."]
12853pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V20: NRF_POWER_THRESHOLDS = 7;
12854#[doc = "< 2.1 Volts power failure threshold."]
12855pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V21: NRF_POWER_THRESHOLDS = 8;
12856#[doc = "< 2.2 Volts power failure threshold."]
12857pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V22: NRF_POWER_THRESHOLDS = 9;
12858#[doc = "< 2.3 Volts power failure threshold."]
12859pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V23: NRF_POWER_THRESHOLDS = 10;
12860#[doc = "< 2.4 Volts power failure threshold."]
12861pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V24: NRF_POWER_THRESHOLDS = 11;
12862#[doc = "< 2.5 Volts power failure threshold."]
12863pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V25: NRF_POWER_THRESHOLDS = 12;
12864#[doc = "< 2.6 Volts power failure threshold."]
12865pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V26: NRF_POWER_THRESHOLDS = 13;
12866#[doc = "< 2.7 Volts power failure threshold."]
12867pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V27: NRF_POWER_THRESHOLDS = 14;
12868#[doc = "< 2.8 Volts power failure threshold."]
12869pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V28: NRF_POWER_THRESHOLDS = 15;
12870#[doc = "@brief Power failure thresholds"]
12871pub type NRF_POWER_THRESHOLDS = self::c_uint;
12872#[doc = "< The DCDC is disabled."]
12873pub const NRF_POWER_DCDC_MODES_NRF_POWER_DCDC_DISABLE: NRF_POWER_DCDC_MODES = 0;
12874#[doc = "< The DCDC is enabled."]
12875pub const NRF_POWER_DCDC_MODES_NRF_POWER_DCDC_ENABLE: NRF_POWER_DCDC_MODES = 1;
12876#[doc = "@brief DC/DC converter modes."]
12877pub type NRF_POWER_DCDC_MODES = self::c_uint;
12878#[doc = "< The event does not have a notification."]
12879pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_NONE: NRF_RADIO_NOTIFICATION_DISTANCES = 0;
12880#[doc = "< The distance from the active notification to start of radio activity."]
12881pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_800US: NRF_RADIO_NOTIFICATION_DISTANCES = 1;
12882#[doc = "< The distance from the active notification to start of radio activity."]
12883pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_1740US: NRF_RADIO_NOTIFICATION_DISTANCES = 2;
12884#[doc = "< The distance from the active notification to start of radio activity."]
12885pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_2680US: NRF_RADIO_NOTIFICATION_DISTANCES = 3;
12886#[doc = "< The distance from the active notification to start of radio activity."]
12887pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_3620US: NRF_RADIO_NOTIFICATION_DISTANCES = 4;
12888#[doc = "< The distance from the active notification to start of radio activity."]
12889pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_4560US: NRF_RADIO_NOTIFICATION_DISTANCES = 5;
12890#[doc = "< The distance from the active notification to start of radio activity."]
12891pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_5500US: NRF_RADIO_NOTIFICATION_DISTANCES = 6;
12892#[doc = "@brief Radio notification distances."]
12893pub type NRF_RADIO_NOTIFICATION_DISTANCES = self::c_uint;
12894#[doc = "< The event does not have a radio notification signal."]
12895pub const NRF_RADIO_NOTIFICATION_TYPES_NRF_RADIO_NOTIFICATION_TYPE_NONE: NRF_RADIO_NOTIFICATION_TYPES = 0;
12896#[doc = "< Using interrupt for notification when the radio will be enabled."]
12897pub const NRF_RADIO_NOTIFICATION_TYPES_NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE: NRF_RADIO_NOTIFICATION_TYPES = 1;
12898#[doc = "< Using interrupt for notification when the radio has been disabled."]
12899pub const NRF_RADIO_NOTIFICATION_TYPES_NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE: NRF_RADIO_NOTIFICATION_TYPES = 2;
12900#[doc = "< Using interrupt for notification both when the radio will be enabled and disabled."]
12901pub const NRF_RADIO_NOTIFICATION_TYPES_NRF_RADIO_NOTIFICATION_TYPE_INT_ON_BOTH: NRF_RADIO_NOTIFICATION_TYPES = 3;
12902#[doc = "@brief Radio notification types."]
12903pub type NRF_RADIO_NOTIFICATION_TYPES = self::c_uint;
12904#[doc = "< This signal indicates the start of the radio timeslot."]
12905pub const NRF_RADIO_CALLBACK_SIGNAL_TYPE_NRF_RADIO_CALLBACK_SIGNAL_TYPE_START: NRF_RADIO_CALLBACK_SIGNAL_TYPE = 0;
12906#[doc = "< This signal indicates the NRF_TIMER0 interrupt."]
12907pub const NRF_RADIO_CALLBACK_SIGNAL_TYPE_NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0: NRF_RADIO_CALLBACK_SIGNAL_TYPE = 1;
12908#[doc = "< This signal indicates the NRF_RADIO interrupt."]
12909pub const NRF_RADIO_CALLBACK_SIGNAL_TYPE_NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO: NRF_RADIO_CALLBACK_SIGNAL_TYPE = 2;
12910#[doc = "< This signal indicates extend action failed."]
12911pub const NRF_RADIO_CALLBACK_SIGNAL_TYPE_NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED: NRF_RADIO_CALLBACK_SIGNAL_TYPE =
12912    3;
12913#[doc = "< This signal indicates extend action succeeded."]
12914pub const NRF_RADIO_CALLBACK_SIGNAL_TYPE_NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED:
12915    NRF_RADIO_CALLBACK_SIGNAL_TYPE = 4;
12916#[doc = "@brief The Radio signal callback types."]
12917pub type NRF_RADIO_CALLBACK_SIGNAL_TYPE = self::c_uint;
12918#[doc = "< Return without action."]
12919pub const NRF_RADIO_SIGNAL_CALLBACK_ACTION_NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE: NRF_RADIO_SIGNAL_CALLBACK_ACTION = 0;
12920#[doc = "< Request an extension of the current"]
12921#[doc = "timeslot. Maximum execution time for this action:"]
12922#[doc = "@ref NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US."]
12923#[doc = "This action must be started at least"]
12924#[doc = "@ref NRF_RADIO_MIN_EXTENSION_MARGIN_US before"]
12925#[doc = "the end of the timeslot."]
12926pub const NRF_RADIO_SIGNAL_CALLBACK_ACTION_NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND: NRF_RADIO_SIGNAL_CALLBACK_ACTION =
12927    1;
12928#[doc = "< End the current radio timeslot."]
12929pub const NRF_RADIO_SIGNAL_CALLBACK_ACTION_NRF_RADIO_SIGNAL_CALLBACK_ACTION_END: NRF_RADIO_SIGNAL_CALLBACK_ACTION = 2;
12930#[doc = "< Request a new radio timeslot and end the current timeslot."]
12931pub const NRF_RADIO_SIGNAL_CALLBACK_ACTION_NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END:
12932    NRF_RADIO_SIGNAL_CALLBACK_ACTION = 3;
12933#[doc = "@brief The actions requested by the signal callback."]
12934#[doc = ""]
12935#[doc = "  This code gives the SOC instructions about what action to take when the signal callback has"]
12936#[doc = "  returned."]
12937pub type NRF_RADIO_SIGNAL_CALLBACK_ACTION = self::c_uint;
12938#[doc = "< The SoftDevice will guarantee that the high frequency clock source is the"]
12939#[doc = "external crystal for the whole duration of the timeslot. This should be the"]
12940#[doc = "preferred option for events that use the radio or require high timing accuracy."]
12941#[doc = "@note The SoftDevice will automatically turn on and off the external crystal,"]
12942#[doc = "at the beginning and end of the timeslot, respectively. The crystal may also"]
12943#[doc = "intentionally be left running after the timeslot, in cases where it is needed"]
12944#[doc = "by the SoftDevice shortly after the end of the timeslot."]
12945pub const NRF_RADIO_HFCLK_CFG_NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED: NRF_RADIO_HFCLK_CFG = 0;
12946#[doc = "< This configuration allows for earlier and tighter scheduling of timeslots."]
12947#[doc = "The RC oscillator may be the clock source in part or for the whole duration of the timeslot."]
12948#[doc = "The RC oscillator's accuracy must therefore be taken into consideration."]
12949#[doc = "@note If the application will use the radio peripheral in timeslots with this configuration,"]
12950#[doc = "it must make sure that the crystal is running and stable before starting the radio."]
12951pub const NRF_RADIO_HFCLK_CFG_NRF_RADIO_HFCLK_CFG_NO_GUARANTEE: NRF_RADIO_HFCLK_CFG = 1;
12952#[doc = "@brief Radio timeslot high frequency clock source configuration."]
12953pub type NRF_RADIO_HFCLK_CFG = self::c_uint;
12954#[doc = "< High (equal priority as the normal connection priority of the SoftDevice stack(s))."]
12955pub const NRF_RADIO_PRIORITY_NRF_RADIO_PRIORITY_HIGH: NRF_RADIO_PRIORITY = 0;
12956#[doc = "< Normal (equal priority as the priority of secondary activities of the SoftDevice stack(s))."]
12957pub const NRF_RADIO_PRIORITY_NRF_RADIO_PRIORITY_NORMAL: NRF_RADIO_PRIORITY = 1;
12958#[doc = "@brief Radio timeslot priorities."]
12959pub type NRF_RADIO_PRIORITY = self::c_uint;
12960#[doc = "< Request radio timeslot as early as possible. This should always be used for the first request in a session."]
12961pub const NRF_RADIO_REQUEST_TYPE_NRF_RADIO_REQ_TYPE_EARLIEST: NRF_RADIO_REQUEST_TYPE = 0;
12962#[doc = "< Normal radio timeslot request."]
12963pub const NRF_RADIO_REQUEST_TYPE_NRF_RADIO_REQ_TYPE_NORMAL: NRF_RADIO_REQUEST_TYPE = 1;
12964#[doc = "@brief Radio timeslot request type."]
12965pub type NRF_RADIO_REQUEST_TYPE = self::c_uint;
12966#[doc = "< Event indicating that the HFCLK has started."]
12967pub const NRF_SOC_EVTS_NRF_EVT_HFCLKSTARTED: NRF_SOC_EVTS = 0;
12968#[doc = "< Event indicating that a power failure warning has occurred."]
12969pub const NRF_SOC_EVTS_NRF_EVT_POWER_FAILURE_WARNING: NRF_SOC_EVTS = 1;
12970#[doc = "< Event indicating that the ongoing flash operation has completed successfully."]
12971pub const NRF_SOC_EVTS_NRF_EVT_FLASH_OPERATION_SUCCESS: NRF_SOC_EVTS = 2;
12972#[doc = "< Event indicating that the ongoing flash operation has timed out with an error."]
12973pub const NRF_SOC_EVTS_NRF_EVT_FLASH_OPERATION_ERROR: NRF_SOC_EVTS = 3;
12974#[doc = "< Event indicating that a radio timeslot was blocked."]
12975pub const NRF_SOC_EVTS_NRF_EVT_RADIO_BLOCKED: NRF_SOC_EVTS = 4;
12976#[doc = "< Event indicating that a radio timeslot was canceled by SoftDevice."]
12977pub const NRF_SOC_EVTS_NRF_EVT_RADIO_CANCELED: NRF_SOC_EVTS = 5;
12978#[doc = "< Event indicating that a radio timeslot signal callback handler return was invalid."]
12979pub const NRF_SOC_EVTS_NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN: NRF_SOC_EVTS = 6;
12980#[doc = "< Event indicating that a radio timeslot session is idle."]
12981pub const NRF_SOC_EVTS_NRF_EVT_RADIO_SESSION_IDLE: NRF_SOC_EVTS = 7;
12982#[doc = "< Event indicating that a radio timeslot session is closed."]
12983pub const NRF_SOC_EVTS_NRF_EVT_RADIO_SESSION_CLOSED: NRF_SOC_EVTS = 8;
12984#[doc = "< Event indicating that a USB 3.3 V supply is ready."]
12985pub const NRF_SOC_EVTS_NRF_EVT_POWER_USB_POWER_READY: NRF_SOC_EVTS = 9;
12986#[doc = "< Event indicating that voltage supply is detected on VBUS."]
12987pub const NRF_SOC_EVTS_NRF_EVT_POWER_USB_DETECTED: NRF_SOC_EVTS = 10;
12988#[doc = "< Event indicating that voltage supply is removed from VBUS."]
12989pub const NRF_SOC_EVTS_NRF_EVT_POWER_USB_REMOVED: NRF_SOC_EVTS = 11;
12990pub const NRF_SOC_EVTS_NRF_EVT_NUMBER_OF_EVTS: NRF_SOC_EVTS = 12;
12991#[doc = "@brief SoC Events."]
12992pub type NRF_SOC_EVTS = self::c_uint;
12993#[doc = "@brief Represents a mutex for use with the nrf_mutex functions."]
12994#[doc = " @note Accessing the value directly is not safe, use the mutex functions!"]
12995pub type nrf_mutex_t = u8;
12996#[doc = "@brief Parameters for a request for a timeslot as early as possible."]
12997#[repr(C)]
12998#[derive(Debug, Copy, Clone)]
12999pub struct nrf_radio_request_earliest_t {
13000    #[doc = "< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG."]
13001    pub hfclk: u8,
13002    #[doc = "< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY."]
13003    pub priority: u8,
13004    #[doc = "< The radio timeslot length (in the range 100 to 100,000] microseconds)."]
13005    pub length_us: u32,
13006    #[doc = "< Longest acceptable delay until the start of the requested timeslot (up to @ref NRF_RADIO_EARLIEST_TIMEOUT_MAX_US microseconds)."]
13007    pub timeout_us: u32,
13008}
13009#[test]
13010fn bindgen_test_layout_nrf_radio_request_earliest_t() {
13011    assert_eq!(
13012        ::core::mem::size_of::<nrf_radio_request_earliest_t>(),
13013        12usize,
13014        concat!("Size of: ", stringify!(nrf_radio_request_earliest_t))
13015    );
13016    assert_eq!(
13017        ::core::mem::align_of::<nrf_radio_request_earliest_t>(),
13018        4usize,
13019        concat!("Alignment of ", stringify!(nrf_radio_request_earliest_t))
13020    );
13021    assert_eq!(
13022        unsafe { &(*(::core::ptr::null::<nrf_radio_request_earliest_t>())).hfclk as *const _ as usize },
13023        0usize,
13024        concat!(
13025            "Offset of field: ",
13026            stringify!(nrf_radio_request_earliest_t),
13027            "::",
13028            stringify!(hfclk)
13029        )
13030    );
13031    assert_eq!(
13032        unsafe { &(*(::core::ptr::null::<nrf_radio_request_earliest_t>())).priority as *const _ as usize },
13033        1usize,
13034        concat!(
13035            "Offset of field: ",
13036            stringify!(nrf_radio_request_earliest_t),
13037            "::",
13038            stringify!(priority)
13039        )
13040    );
13041    assert_eq!(
13042        unsafe { &(*(::core::ptr::null::<nrf_radio_request_earliest_t>())).length_us as *const _ as usize },
13043        4usize,
13044        concat!(
13045            "Offset of field: ",
13046            stringify!(nrf_radio_request_earliest_t),
13047            "::",
13048            stringify!(length_us)
13049        )
13050    );
13051    assert_eq!(
13052        unsafe { &(*(::core::ptr::null::<nrf_radio_request_earliest_t>())).timeout_us as *const _ as usize },
13053        8usize,
13054        concat!(
13055            "Offset of field: ",
13056            stringify!(nrf_radio_request_earliest_t),
13057            "::",
13058            stringify!(timeout_us)
13059        )
13060    );
13061}
13062#[doc = "@brief Parameters for a normal radio timeslot request."]
13063#[repr(C)]
13064#[derive(Debug, Copy, Clone)]
13065pub struct nrf_radio_request_normal_t {
13066    #[doc = "< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG."]
13067    pub hfclk: u8,
13068    #[doc = "< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY."]
13069    pub priority: u8,
13070    #[doc = "< Distance from the start of the previous radio timeslot (up to @ref NRF_RADIO_DISTANCE_MAX_US microseconds)."]
13071    pub distance_us: u32,
13072    #[doc = "< The radio timeslot length (in the range [100..100,000] microseconds)."]
13073    pub length_us: u32,
13074}
13075#[test]
13076fn bindgen_test_layout_nrf_radio_request_normal_t() {
13077    assert_eq!(
13078        ::core::mem::size_of::<nrf_radio_request_normal_t>(),
13079        12usize,
13080        concat!("Size of: ", stringify!(nrf_radio_request_normal_t))
13081    );
13082    assert_eq!(
13083        ::core::mem::align_of::<nrf_radio_request_normal_t>(),
13084        4usize,
13085        concat!("Alignment of ", stringify!(nrf_radio_request_normal_t))
13086    );
13087    assert_eq!(
13088        unsafe { &(*(::core::ptr::null::<nrf_radio_request_normal_t>())).hfclk as *const _ as usize },
13089        0usize,
13090        concat!(
13091            "Offset of field: ",
13092            stringify!(nrf_radio_request_normal_t),
13093            "::",
13094            stringify!(hfclk)
13095        )
13096    );
13097    assert_eq!(
13098        unsafe { &(*(::core::ptr::null::<nrf_radio_request_normal_t>())).priority as *const _ as usize },
13099        1usize,
13100        concat!(
13101            "Offset of field: ",
13102            stringify!(nrf_radio_request_normal_t),
13103            "::",
13104            stringify!(priority)
13105        )
13106    );
13107    assert_eq!(
13108        unsafe { &(*(::core::ptr::null::<nrf_radio_request_normal_t>())).distance_us as *const _ as usize },
13109        4usize,
13110        concat!(
13111            "Offset of field: ",
13112            stringify!(nrf_radio_request_normal_t),
13113            "::",
13114            stringify!(distance_us)
13115        )
13116    );
13117    assert_eq!(
13118        unsafe { &(*(::core::ptr::null::<nrf_radio_request_normal_t>())).length_us as *const _ as usize },
13119        8usize,
13120        concat!(
13121            "Offset of field: ",
13122            stringify!(nrf_radio_request_normal_t),
13123            "::",
13124            stringify!(length_us)
13125        )
13126    );
13127}
13128#[doc = "@brief Radio timeslot request parameters."]
13129#[repr(C)]
13130#[derive(Copy, Clone)]
13131pub struct nrf_radio_request_t {
13132    #[doc = "< Type of request, see @ref NRF_RADIO_REQUEST_TYPE."]
13133    pub request_type: u8,
13134    #[doc = "< Parameter union."]
13135    pub params: nrf_radio_request_t__bindgen_ty_1,
13136}
13137#[repr(C)]
13138#[derive(Copy, Clone)]
13139pub union nrf_radio_request_t__bindgen_ty_1 {
13140    #[doc = "< Parameters for requesting a radio timeslot as early as possible."]
13141    pub earliest: nrf_radio_request_earliest_t,
13142    #[doc = "< Parameters for requesting a normal radio timeslot."]
13143    pub normal: nrf_radio_request_normal_t,
13144    _bindgen_union_align: [u32; 3usize],
13145}
13146#[test]
13147fn bindgen_test_layout_nrf_radio_request_t__bindgen_ty_1() {
13148    assert_eq!(
13149        ::core::mem::size_of::<nrf_radio_request_t__bindgen_ty_1>(),
13150        12usize,
13151        concat!("Size of: ", stringify!(nrf_radio_request_t__bindgen_ty_1))
13152    );
13153    assert_eq!(
13154        ::core::mem::align_of::<nrf_radio_request_t__bindgen_ty_1>(),
13155        4usize,
13156        concat!("Alignment of ", stringify!(nrf_radio_request_t__bindgen_ty_1))
13157    );
13158    assert_eq!(
13159        unsafe { &(*(::core::ptr::null::<nrf_radio_request_t__bindgen_ty_1>())).earliest as *const _ as usize },
13160        0usize,
13161        concat!(
13162            "Offset of field: ",
13163            stringify!(nrf_radio_request_t__bindgen_ty_1),
13164            "::",
13165            stringify!(earliest)
13166        )
13167    );
13168    assert_eq!(
13169        unsafe { &(*(::core::ptr::null::<nrf_radio_request_t__bindgen_ty_1>())).normal as *const _ as usize },
13170        0usize,
13171        concat!(
13172            "Offset of field: ",
13173            stringify!(nrf_radio_request_t__bindgen_ty_1),
13174            "::",
13175            stringify!(normal)
13176        )
13177    );
13178}
13179#[test]
13180fn bindgen_test_layout_nrf_radio_request_t() {
13181    assert_eq!(
13182        ::core::mem::size_of::<nrf_radio_request_t>(),
13183        16usize,
13184        concat!("Size of: ", stringify!(nrf_radio_request_t))
13185    );
13186    assert_eq!(
13187        ::core::mem::align_of::<nrf_radio_request_t>(),
13188        4usize,
13189        concat!("Alignment of ", stringify!(nrf_radio_request_t))
13190    );
13191    assert_eq!(
13192        unsafe { &(*(::core::ptr::null::<nrf_radio_request_t>())).request_type as *const _ as usize },
13193        0usize,
13194        concat!(
13195            "Offset of field: ",
13196            stringify!(nrf_radio_request_t),
13197            "::",
13198            stringify!(request_type)
13199        )
13200    );
13201    assert_eq!(
13202        unsafe { &(*(::core::ptr::null::<nrf_radio_request_t>())).params as *const _ as usize },
13203        4usize,
13204        concat!(
13205            "Offset of field: ",
13206            stringify!(nrf_radio_request_t),
13207            "::",
13208            stringify!(params)
13209        )
13210    );
13211}
13212#[doc = "@brief Return parameters of the radio timeslot signal callback."]
13213#[repr(C)]
13214#[derive(Copy, Clone)]
13215pub struct nrf_radio_signal_callback_return_param_t {
13216    #[doc = "< The action requested by the application when returning from the signal callback, see @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION."]
13217    pub callback_action: u8,
13218    #[doc = "< Parameter union."]
13219    pub params: nrf_radio_signal_callback_return_param_t__bindgen_ty_1,
13220}
13221#[repr(C)]
13222#[derive(Copy, Clone)]
13223pub union nrf_radio_signal_callback_return_param_t__bindgen_ty_1 {
13224    #[doc = "< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END."]
13225    pub request: nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1,
13226    #[doc = "< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND."]
13227    pub extend: nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2,
13228    _bindgen_union_align: u32,
13229}
13230#[repr(C)]
13231#[derive(Debug, Copy, Clone)]
13232pub struct nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1 {
13233    #[doc = "< The request parameters for the next radio timeslot."]
13234    pub p_next: *mut nrf_radio_request_t,
13235}
13236#[test]
13237fn bindgen_test_layout_nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1() {
13238    assert_eq!(
13239        ::core::mem::size_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1>(),
13240        4usize,
13241        concat!(
13242            "Size of: ",
13243            stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1)
13244        )
13245    );
13246    assert_eq!(
13247        ::core::mem::align_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1>(),
13248        4usize,
13249        concat!(
13250            "Alignment of ",
13251            stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1)
13252        )
13253    );
13254    assert_eq!(
13255        unsafe {
13256            &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1>())).p_next
13257                as *const _ as usize
13258        },
13259        0usize,
13260        concat!(
13261            "Offset of field: ",
13262            stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1),
13263            "::",
13264            stringify!(p_next)
13265        )
13266    );
13267}
13268#[repr(C)]
13269#[derive(Debug, Copy, Clone)]
13270pub struct nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2 {
13271    #[doc = "< Requested extension of the radio timeslot duration (microseconds) (for minimum time see @ref NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US)."]
13272    pub length_us: u32,
13273}
13274#[test]
13275fn bindgen_test_layout_nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2() {
13276    assert_eq!(
13277        ::core::mem::size_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2>(),
13278        4usize,
13279        concat!(
13280            "Size of: ",
13281            stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2)
13282        )
13283    );
13284    assert_eq!(
13285        ::core::mem::align_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2>(),
13286        4usize,
13287        concat!(
13288            "Alignment of ",
13289            stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2)
13290        )
13291    );
13292    assert_eq!(
13293        unsafe {
13294            &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2>())).length_us
13295                as *const _ as usize
13296        },
13297        0usize,
13298        concat!(
13299            "Offset of field: ",
13300            stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2),
13301            "::",
13302            stringify!(length_us)
13303        )
13304    );
13305}
13306#[test]
13307fn bindgen_test_layout_nrf_radio_signal_callback_return_param_t__bindgen_ty_1() {
13308    assert_eq!(
13309        ::core::mem::size_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1>(),
13310        4usize,
13311        concat!(
13312            "Size of: ",
13313            stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1)
13314        )
13315    );
13316    assert_eq!(
13317        ::core::mem::align_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1>(),
13318        4usize,
13319        concat!(
13320            "Alignment of ",
13321            stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1)
13322        )
13323    );
13324    assert_eq!(
13325        unsafe {
13326            &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1>())).request as *const _
13327                as usize
13328        },
13329        0usize,
13330        concat!(
13331            "Offset of field: ",
13332            stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1),
13333            "::",
13334            stringify!(request)
13335        )
13336    );
13337    assert_eq!(
13338        unsafe {
13339            &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1>())).extend as *const _
13340                as usize
13341        },
13342        0usize,
13343        concat!(
13344            "Offset of field: ",
13345            stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1),
13346            "::",
13347            stringify!(extend)
13348        )
13349    );
13350}
13351#[test]
13352fn bindgen_test_layout_nrf_radio_signal_callback_return_param_t() {
13353    assert_eq!(
13354        ::core::mem::size_of::<nrf_radio_signal_callback_return_param_t>(),
13355        8usize,
13356        concat!("Size of: ", stringify!(nrf_radio_signal_callback_return_param_t))
13357    );
13358    assert_eq!(
13359        ::core::mem::align_of::<nrf_radio_signal_callback_return_param_t>(),
13360        4usize,
13361        concat!("Alignment of ", stringify!(nrf_radio_signal_callback_return_param_t))
13362    );
13363    assert_eq!(
13364        unsafe {
13365            &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t>())).callback_action as *const _ as usize
13366        },
13367        0usize,
13368        concat!(
13369            "Offset of field: ",
13370            stringify!(nrf_radio_signal_callback_return_param_t),
13371            "::",
13372            stringify!(callback_action)
13373        )
13374    );
13375    assert_eq!(
13376        unsafe { &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t>())).params as *const _ as usize },
13377        4usize,
13378        concat!(
13379            "Offset of field: ",
13380            stringify!(nrf_radio_signal_callback_return_param_t),
13381            "::",
13382            stringify!(params)
13383        )
13384    );
13385}
13386#[doc = "@brief The radio timeslot signal callback type."]
13387#[doc = ""]
13388#[doc = " @note In case of invalid return parameters, the radio timeslot will automatically end"]
13389#[doc = "       immediately after returning from the signal callback and the"]
13390#[doc = "       @ref NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN event will be sent."]
13391#[doc = " @note The returned struct pointer must remain valid after the signal callback"]
13392#[doc = "       function returns. For instance, this means that it must not point to a stack variable."]
13393#[doc = ""]
13394#[doc = " @param[in] signal_type Type of signal, see @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE."]
13395#[doc = ""]
13396#[doc = " @return Pointer to structure containing action requested by the application."]
13397pub type nrf_radio_signal_callback_t =
13398    ::core::option::Option<unsafe extern "C" fn(signal_type: u8) -> *mut nrf_radio_signal_callback_return_param_t>;
13399#[doc = "@brief AES ECB parameter typedefs"]
13400pub type soc_ecb_key_t = [u8; 16usize];
13401pub type soc_ecb_cleartext_t = [u8; 16usize];
13402pub type soc_ecb_ciphertext_t = [u8; 16usize];
13403#[doc = "@brief AES ECB data structure"]
13404#[repr(C)]
13405#[derive(Debug, Copy, Clone)]
13406pub struct nrf_ecb_hal_data_t {
13407    #[doc = "< Encryption key."]
13408    pub key: soc_ecb_key_t,
13409    #[doc = "< Cleartext data."]
13410    pub cleartext: soc_ecb_cleartext_t,
13411    #[doc = "< Ciphertext data."]
13412    pub ciphertext: soc_ecb_ciphertext_t,
13413}
13414#[test]
13415fn bindgen_test_layout_nrf_ecb_hal_data_t() {
13416    assert_eq!(
13417        ::core::mem::size_of::<nrf_ecb_hal_data_t>(),
13418        48usize,
13419        concat!("Size of: ", stringify!(nrf_ecb_hal_data_t))
13420    );
13421    assert_eq!(
13422        ::core::mem::align_of::<nrf_ecb_hal_data_t>(),
13423        1usize,
13424        concat!("Alignment of ", stringify!(nrf_ecb_hal_data_t))
13425    );
13426    assert_eq!(
13427        unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_t>())).key as *const _ as usize },
13428        0usize,
13429        concat!(
13430            "Offset of field: ",
13431            stringify!(nrf_ecb_hal_data_t),
13432            "::",
13433            stringify!(key)
13434        )
13435    );
13436    assert_eq!(
13437        unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_t>())).cleartext as *const _ as usize },
13438        16usize,
13439        concat!(
13440            "Offset of field: ",
13441            stringify!(nrf_ecb_hal_data_t),
13442            "::",
13443            stringify!(cleartext)
13444        )
13445    );
13446    assert_eq!(
13447        unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_t>())).ciphertext as *const _ as usize },
13448        32usize,
13449        concat!(
13450            "Offset of field: ",
13451            stringify!(nrf_ecb_hal_data_t),
13452            "::",
13453            stringify!(ciphertext)
13454        )
13455    );
13456}
13457#[doc = "@brief AES ECB block. Used to provide multiple blocks in a single call"]
13458#[doc = "to @ref sd_ecb_blocks_encrypt."]
13459#[repr(C)]
13460#[derive(Debug, Copy, Clone)]
13461pub struct nrf_ecb_hal_data_block_t {
13462    #[doc = "< Pointer to the Encryption key."]
13463    pub p_key: *const soc_ecb_key_t,
13464    #[doc = "< Pointer to the Cleartext data."]
13465    pub p_cleartext: *const soc_ecb_cleartext_t,
13466    #[doc = "< Pointer to the Ciphertext data."]
13467    pub p_ciphertext: *mut soc_ecb_ciphertext_t,
13468}
13469#[test]
13470fn bindgen_test_layout_nrf_ecb_hal_data_block_t() {
13471    assert_eq!(
13472        ::core::mem::size_of::<nrf_ecb_hal_data_block_t>(),
13473        12usize,
13474        concat!("Size of: ", stringify!(nrf_ecb_hal_data_block_t))
13475    );
13476    assert_eq!(
13477        ::core::mem::align_of::<nrf_ecb_hal_data_block_t>(),
13478        4usize,
13479        concat!("Alignment of ", stringify!(nrf_ecb_hal_data_block_t))
13480    );
13481    assert_eq!(
13482        unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_block_t>())).p_key as *const _ as usize },
13483        0usize,
13484        concat!(
13485            "Offset of field: ",
13486            stringify!(nrf_ecb_hal_data_block_t),
13487            "::",
13488            stringify!(p_key)
13489        )
13490    );
13491    assert_eq!(
13492        unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_block_t>())).p_cleartext as *const _ as usize },
13493        4usize,
13494        concat!(
13495            "Offset of field: ",
13496            stringify!(nrf_ecb_hal_data_block_t),
13497            "::",
13498            stringify!(p_cleartext)
13499        )
13500    );
13501    assert_eq!(
13502        unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_block_t>())).p_ciphertext as *const _ as usize },
13503        8usize,
13504        concat!(
13505            "Offset of field: ",
13506            stringify!(nrf_ecb_hal_data_block_t),
13507            "::",
13508            stringify!(p_ciphertext)
13509        )
13510    );
13511}
13512
13513#[doc = "@brief Initialize a mutex."]
13514#[doc = ""]
13515#[doc = " @param[in] p_mutex Pointer to the mutex to initialize."]
13516#[doc = ""]
13517#[doc = " @retval ::NRF_SUCCESS"]
13518#[inline(always)]
13519pub unsafe fn sd_mutex_new(p_mutex: *mut nrf_mutex_t) -> u32 {
13520    let ret: u32;
13521    core::arch::asm!("svc 44",
13522        inout("r0") to_asm(p_mutex) => ret,
13523        lateout("r1") _,
13524        lateout("r2") _,
13525        lateout("r3") _,
13526        lateout("r12") _,
13527    );
13528    ret
13529}
13530
13531#[doc = "@brief Attempt to acquire a mutex."]
13532#[doc = ""]
13533#[doc = " @param[in] p_mutex Pointer to the mutex to acquire."]
13534#[doc = ""]
13535#[doc = " @retval ::NRF_SUCCESS The mutex was successfully acquired."]
13536#[doc = " @retval ::NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN The mutex could not be acquired."]
13537#[inline(always)]
13538pub unsafe fn sd_mutex_acquire(p_mutex: *mut nrf_mutex_t) -> u32 {
13539    let ret: u32;
13540    core::arch::asm!("svc 45",
13541        inout("r0") to_asm(p_mutex) => ret,
13542        lateout("r1") _,
13543        lateout("r2") _,
13544        lateout("r3") _,
13545        lateout("r12") _,
13546    );
13547    ret
13548}
13549
13550#[doc = "@brief Release a mutex."]
13551#[doc = ""]
13552#[doc = " @param[in] p_mutex Pointer to the mutex to release."]
13553#[doc = ""]
13554#[doc = " @retval ::NRF_SUCCESS"]
13555#[inline(always)]
13556pub unsafe fn sd_mutex_release(p_mutex: *mut nrf_mutex_t) -> u32 {
13557    let ret: u32;
13558    core::arch::asm!("svc 46",
13559        inout("r0") to_asm(p_mutex) => ret,
13560        lateout("r1") _,
13561        lateout("r2") _,
13562        lateout("r3") _,
13563        lateout("r12") _,
13564    );
13565    ret
13566}
13567
13568#[doc = "@brief Query the capacity of the application random pool."]
13569#[doc = ""]
13570#[doc = " @param[out] p_pool_capacity The capacity of the pool."]
13571#[doc = ""]
13572#[doc = " @retval ::NRF_SUCCESS"]
13573#[inline(always)]
13574pub unsafe fn sd_rand_application_pool_capacity_get(p_pool_capacity: *mut u8) -> u32 {
13575    let ret: u32;
13576    core::arch::asm!("svc 47",
13577        inout("r0") to_asm(p_pool_capacity) => ret,
13578        lateout("r1") _,
13579        lateout("r2") _,
13580        lateout("r3") _,
13581        lateout("r12") _,
13582    );
13583    ret
13584}
13585
13586#[doc = "@brief Get number of random bytes available to the application."]
13587#[doc = ""]
13588#[doc = " @param[out] p_bytes_available The number of bytes currently available in the pool."]
13589#[doc = ""]
13590#[doc = " @retval ::NRF_SUCCESS"]
13591#[inline(always)]
13592pub unsafe fn sd_rand_application_bytes_available_get(p_bytes_available: *mut u8) -> u32 {
13593    let ret: u32;
13594    core::arch::asm!("svc 48",
13595        inout("r0") to_asm(p_bytes_available) => ret,
13596        lateout("r1") _,
13597        lateout("r2") _,
13598        lateout("r3") _,
13599        lateout("r12") _,
13600    );
13601    ret
13602}
13603
13604#[doc = "@brief Get random bytes from the application pool."]
13605#[doc = ""]
13606#[doc = " @param[out]  p_buff  Pointer to unit8_t buffer for storing the bytes."]
13607#[doc = " @param[in]   length  Number of bytes to take from pool and place in p_buff."]
13608#[doc = ""]
13609#[doc = " @retval ::NRF_SUCCESS The requested bytes were written to p_buff."]
13610#[doc = " @retval ::NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES No bytes were written to the buffer, because there were not enough bytes available."]
13611#[inline(always)]
13612pub unsafe fn sd_rand_application_vector_get(p_buff: *mut u8, length: u8) -> u32 {
13613    let ret: u32;
13614    core::arch::asm!("svc 49",
13615        inout("r0") to_asm(p_buff) => ret,
13616        inout("r1") to_asm(length) => _,
13617        lateout("r2") _,
13618        lateout("r3") _,
13619        lateout("r12") _,
13620    );
13621    ret
13622}
13623
13624#[doc = "@brief Gets the reset reason register."]
13625#[doc = ""]
13626#[doc = " @param[out]  p_reset_reason  Contents of the NRF_POWER->RESETREAS register."]
13627#[doc = ""]
13628#[doc = " @retval ::NRF_SUCCESS"]
13629#[inline(always)]
13630pub unsafe fn sd_power_reset_reason_get(p_reset_reason: *mut u32) -> u32 {
13631    let ret: u32;
13632    core::arch::asm!("svc 52",
13633        inout("r0") to_asm(p_reset_reason) => ret,
13634        lateout("r1") _,
13635        lateout("r2") _,
13636        lateout("r3") _,
13637        lateout("r12") _,
13638    );
13639    ret
13640}
13641
13642#[doc = "@brief Clears the bits of the reset reason register."]
13643#[doc = ""]
13644#[doc = " @param[in] reset_reason_clr_msk Contains the bits to clear from the reset reason register."]
13645#[doc = ""]
13646#[doc = " @retval ::NRF_SUCCESS"]
13647#[inline(always)]
13648pub unsafe fn sd_power_reset_reason_clr(reset_reason_clr_msk: u32) -> u32 {
13649    let ret: u32;
13650    core::arch::asm!("svc 53",
13651        inout("r0") to_asm(reset_reason_clr_msk) => ret,
13652        lateout("r1") _,
13653        lateout("r2") _,
13654        lateout("r3") _,
13655        lateout("r12") _,
13656    );
13657    ret
13658}
13659
13660#[doc = "@brief Sets the power mode when in CPU sleep."]
13661#[doc = ""]
13662#[doc = " @param[in] power_mode The power mode to use when in CPU sleep, see @ref NRF_POWER_MODES. @sa sd_app_evt_wait"]
13663#[doc = ""]
13664#[doc = " @retval ::NRF_SUCCESS The power mode was set."]
13665#[doc = " @retval ::NRF_ERROR_SOC_POWER_MODE_UNKNOWN The power mode was unknown."]
13666#[inline(always)]
13667pub unsafe fn sd_power_mode_set(power_mode: u8) -> u32 {
13668    let ret: u32;
13669    core::arch::asm!("svc 50",
13670        inout("r0") to_asm(power_mode) => ret,
13671        lateout("r1") _,
13672        lateout("r2") _,
13673        lateout("r3") _,
13674        lateout("r12") _,
13675    );
13676    ret
13677}
13678
13679#[doc = "@brief Puts the chip in System OFF mode."]
13680#[doc = ""]
13681#[doc = " @retval ::NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN"]
13682#[inline(always)]
13683pub unsafe fn sd_power_system_off() -> u32 {
13684    let ret: u32;
13685    core::arch::asm!("svc 51",
13686        lateout("r0") ret,
13687        lateout("r1") _,
13688        lateout("r2") _,
13689        lateout("r3") _,
13690        lateout("r12") _,
13691    );
13692    ret
13693}
13694
13695#[doc = "@brief Enables or disables the power-fail comparator."]
13696#[doc = ""]
13697#[doc = " Enabling this will give a SoftDevice event (NRF_EVT_POWER_FAILURE_WARNING) when the power failure warning occurs."]
13698#[doc = " The event can be retrieved with sd_evt_get();"]
13699#[doc = ""]
13700#[doc = " @param[in] pof_enable    True if the power-fail comparator should be enabled, false if it should be disabled."]
13701#[doc = ""]
13702#[doc = " @retval ::NRF_SUCCESS"]
13703#[inline(always)]
13704pub unsafe fn sd_power_pof_enable(pof_enable: u8) -> u32 {
13705    let ret: u32;
13706    core::arch::asm!("svc 54",
13707        inout("r0") to_asm(pof_enable) => ret,
13708        lateout("r1") _,
13709        lateout("r2") _,
13710        lateout("r3") _,
13711        lateout("r12") _,
13712    );
13713    ret
13714}
13715
13716#[doc = "@brief Enables or disables the USB power ready event."]
13717#[doc = ""]
13718#[doc = " Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_POWER_READY) when a USB 3.3 V supply is ready."]
13719#[doc = " The event can be retrieved with sd_evt_get();"]
13720#[doc = ""]
13721#[doc = " @param[in] usbpwrrdy_enable    True if the power ready event should be enabled, false if it should be disabled."]
13722#[doc = ""]
13723#[doc = " @note Calling this function on a chip without USBD peripheral will result in undefined behaviour."]
13724#[doc = ""]
13725#[doc = " @retval ::NRF_SUCCESS"]
13726#[inline(always)]
13727pub unsafe fn sd_power_usbpwrrdy_enable(usbpwrrdy_enable: u8) -> u32 {
13728    let ret: u32;
13729    core::arch::asm!("svc 77",
13730        inout("r0") to_asm(usbpwrrdy_enable) => ret,
13731        lateout("r1") _,
13732        lateout("r2") _,
13733        lateout("r3") _,
13734        lateout("r12") _,
13735    );
13736    ret
13737}
13738
13739#[doc = "@brief Enables or disables the power USB-detected event."]
13740#[doc = ""]
13741#[doc = " Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_DETECTED) when a voltage supply is detected on VBUS."]
13742#[doc = " The event can be retrieved with sd_evt_get();"]
13743#[doc = ""]
13744#[doc = " @param[in] usbdetected_enable    True if the power ready event should be enabled, false if it should be disabled."]
13745#[doc = ""]
13746#[doc = " @note Calling this function on a chip without USBD peripheral will result in undefined behaviour."]
13747#[doc = ""]
13748#[doc = " @retval ::NRF_SUCCESS"]
13749#[inline(always)]
13750pub unsafe fn sd_power_usbdetected_enable(usbdetected_enable: u8) -> u32 {
13751    let ret: u32;
13752    core::arch::asm!("svc 78",
13753        inout("r0") to_asm(usbdetected_enable) => ret,
13754        lateout("r1") _,
13755        lateout("r2") _,
13756        lateout("r3") _,
13757        lateout("r12") _,
13758    );
13759    ret
13760}
13761
13762#[doc = "@brief Enables or disables the power USB-removed event."]
13763#[doc = ""]
13764#[doc = " Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_REMOVED) when a voltage supply is removed from VBUS."]
13765#[doc = " The event can be retrieved with sd_evt_get();"]
13766#[doc = ""]
13767#[doc = " @param[in] usbremoved_enable    True if the power ready event should be enabled, false if it should be disabled."]
13768#[doc = ""]
13769#[doc = " @note Calling this function on a chip without USBD peripheral will result in undefined behaviour."]
13770#[doc = ""]
13771#[doc = " @retval ::NRF_SUCCESS"]
13772#[inline(always)]
13773pub unsafe fn sd_power_usbremoved_enable(usbremoved_enable: u8) -> u32 {
13774    let ret: u32;
13775    core::arch::asm!("svc 79",
13776        inout("r0") to_asm(usbremoved_enable) => ret,
13777        lateout("r1") _,
13778        lateout("r2") _,
13779        lateout("r3") _,
13780        lateout("r12") _,
13781    );
13782    ret
13783}
13784
13785#[doc = "@brief Get USB supply status register content."]
13786#[doc = ""]
13787#[doc = " @param[out] usbregstatus    The content of USBREGSTATUS register."]
13788#[doc = ""]
13789#[doc = " @note Calling this function on a chip without USBD peripheral will result in undefined behaviour."]
13790#[doc = ""]
13791#[doc = " @retval ::NRF_SUCCESS"]
13792#[inline(always)]
13793pub unsafe fn sd_power_usbregstatus_get(usbregstatus: *mut u32) -> u32 {
13794    let ret: u32;
13795    core::arch::asm!("svc 80",
13796        inout("r0") to_asm(usbregstatus) => ret,
13797        lateout("r1") _,
13798        lateout("r2") _,
13799        lateout("r3") _,
13800        lateout("r12") _,
13801    );
13802    ret
13803}
13804
13805#[doc = "@brief Sets the power failure comparator threshold value."]
13806#[doc = ""]
13807#[doc = ""]
13808#[doc = " @param[in] threshold The power-fail threshold value to use, see @ref NRF_POWER_THRESHOLDS."]
13809#[doc = ""]
13810#[doc = " @retval ::NRF_SUCCESS The power failure threshold was set."]
13811#[doc = " @retval ::NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN The power failure threshold is unknown."]
13812#[inline(always)]
13813pub unsafe fn sd_power_pof_threshold_set(threshold: u8) -> u32 {
13814    let ret: u32;
13815    core::arch::asm!("svc 55",
13816        inout("r0") to_asm(threshold) => ret,
13817        lateout("r1") _,
13818        lateout("r2") _,
13819        lateout("r3") _,
13820        lateout("r12") _,
13821    );
13822    ret
13823}
13824
13825#[doc = "@brief Writes the NRF_POWER->RAM[index].POWERSET register."]
13826#[doc = ""]
13827#[doc = " @param[in] index Contains the index in the NRF_POWER->RAM[index].POWERSET register to write to."]
13828#[doc = " @param[in] ram_powerset Contains the word to write to the NRF_POWER->RAM[index].POWERSET register."]
13829#[doc = ""]
13830#[doc = " @retval ::NRF_SUCCESS"]
13831#[inline(always)]
13832pub unsafe fn sd_power_ram_power_set(index: u8, ram_powerset: u32) -> u32 {
13833    let ret: u32;
13834    core::arch::asm!("svc 57",
13835        inout("r0") to_asm(index) => ret,
13836        inout("r1") to_asm(ram_powerset) => _,
13837        lateout("r2") _,
13838        lateout("r3") _,
13839        lateout("r12") _,
13840    );
13841    ret
13842}
13843
13844#[doc = "@brief Writes the NRF_POWER->RAM[index].POWERCLR register."]
13845#[doc = ""]
13846#[doc = " @param[in] index Contains the index in the NRF_POWER->RAM[index].POWERCLR register to write to."]
13847#[doc = " @param[in] ram_powerclr Contains the word to write to the NRF_POWER->RAM[index].POWERCLR register."]
13848#[doc = ""]
13849#[doc = " @retval ::NRF_SUCCESS"]
13850#[inline(always)]
13851pub unsafe fn sd_power_ram_power_clr(index: u8, ram_powerclr: u32) -> u32 {
13852    let ret: u32;
13853    core::arch::asm!("svc 58",
13854        inout("r0") to_asm(index) => ret,
13855        inout("r1") to_asm(ram_powerclr) => _,
13856        lateout("r2") _,
13857        lateout("r3") _,
13858        lateout("r12") _,
13859    );
13860    ret
13861}
13862
13863#[doc = "@brief Get contents of NRF_POWER->RAM[index].POWER register, indicates power status of RAM[index] blocks."]
13864#[doc = ""]
13865#[doc = " @param[in] index Contains the index in the NRF_POWER->RAM[index].POWER register to read from."]
13866#[doc = " @param[out] p_ram_power Content of NRF_POWER->RAM[index].POWER register."]
13867#[doc = ""]
13868#[doc = " @retval ::NRF_SUCCESS"]
13869#[inline(always)]
13870pub unsafe fn sd_power_ram_power_get(index: u8, p_ram_power: *mut u32) -> u32 {
13871    let ret: u32;
13872    core::arch::asm!("svc 59",
13873        inout("r0") to_asm(index) => ret,
13874        inout("r1") to_asm(p_ram_power) => _,
13875        lateout("r2") _,
13876        lateout("r3") _,
13877        lateout("r12") _,
13878    );
13879    ret
13880}
13881
13882#[doc = "@brief Set bits in the general purpose retention registers (NRF_POWER->GPREGRET*)."]
13883#[doc = ""]
13884#[doc = " @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2."]
13885#[doc = " @param[in] gpregret_msk Bits to be set in the GPREGRET register."]
13886#[doc = ""]
13887#[doc = " @retval ::NRF_SUCCESS"]
13888#[inline(always)]
13889pub unsafe fn sd_power_gpregret_set(gpregret_id: u32, gpregret_msk: u32) -> u32 {
13890    let ret: u32;
13891    core::arch::asm!("svc 60",
13892        inout("r0") to_asm(gpregret_id) => ret,
13893        inout("r1") to_asm(gpregret_msk) => _,
13894        lateout("r2") _,
13895        lateout("r3") _,
13896        lateout("r12") _,
13897    );
13898    ret
13899}
13900
13901#[doc = "@brief Clear bits in the general purpose retention registers (NRF_POWER->GPREGRET*)."]
13902#[doc = ""]
13903#[doc = " @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2."]
13904#[doc = " @param[in] gpregret_msk Bits to be clear in the GPREGRET register."]
13905#[doc = ""]
13906#[doc = " @retval ::NRF_SUCCESS"]
13907#[inline(always)]
13908pub unsafe fn sd_power_gpregret_clr(gpregret_id: u32, gpregret_msk: u32) -> u32 {
13909    let ret: u32;
13910    core::arch::asm!("svc 61",
13911        inout("r0") to_asm(gpregret_id) => ret,
13912        inout("r1") to_asm(gpregret_msk) => _,
13913        lateout("r2") _,
13914        lateout("r3") _,
13915        lateout("r12") _,
13916    );
13917    ret
13918}
13919
13920#[doc = "@brief Get contents of the general purpose retention registers (NRF_POWER->GPREGRET*)."]
13921#[doc = ""]
13922#[doc = " @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2."]
13923#[doc = " @param[out] p_gpregret Contents of the GPREGRET register."]
13924#[doc = ""]
13925#[doc = " @retval ::NRF_SUCCESS"]
13926#[inline(always)]
13927pub unsafe fn sd_power_gpregret_get(gpregret_id: u32, p_gpregret: *mut u32) -> u32 {
13928    let ret: u32;
13929    core::arch::asm!("svc 62",
13930        inout("r0") to_asm(gpregret_id) => ret,
13931        inout("r1") to_asm(p_gpregret) => _,
13932        lateout("r2") _,
13933        lateout("r3") _,
13934        lateout("r12") _,
13935    );
13936    ret
13937}
13938
13939#[doc = "@brief Enable or disable the DC/DC regulator."]
13940#[doc = ""]
13941#[doc = " @param[in] dcdc_mode The mode of the DCDC, see @ref NRF_POWER_DCDC_MODES."]
13942#[doc = ""]
13943#[doc = " @retval ::NRF_SUCCESS"]
13944#[doc = " @retval ::NRF_ERROR_INVALID_PARAM The DCDC mode is invalid."]
13945#[inline(always)]
13946pub unsafe fn sd_power_dcdc_mode_set(dcdc_mode: u8) -> u32 {
13947    let ret: u32;
13948    core::arch::asm!("svc 63",
13949        inout("r0") to_asm(dcdc_mode) => ret,
13950        lateout("r1") _,
13951        lateout("r2") _,
13952        lateout("r3") _,
13953        lateout("r12") _,
13954    );
13955    ret
13956}
13957
13958#[doc = "@brief Request the high frequency crystal oscillator."]
13959#[doc = ""]
13960#[doc = " Will start the high frequency crystal oscillator, the startup time of the crystal varies"]
13961#[doc = " and the ::sd_clock_hfclk_is_running function can be polled to check if it has started."]
13962#[doc = ""]
13963#[doc = " @see sd_clock_hfclk_is_running"]
13964#[doc = " @see sd_clock_hfclk_release"]
13965#[doc = ""]
13966#[doc = " @retval ::NRF_SUCCESS"]
13967#[inline(always)]
13968pub unsafe fn sd_clock_hfclk_request() -> u32 {
13969    let ret: u32;
13970    core::arch::asm!("svc 66",
13971        lateout("r0") ret,
13972        lateout("r1") _,
13973        lateout("r2") _,
13974        lateout("r3") _,
13975        lateout("r12") _,
13976    );
13977    ret
13978}
13979
13980#[doc = "@brief Releases the high frequency crystal oscillator."]
13981#[doc = ""]
13982#[doc = " Will stop the high frequency crystal oscillator, this happens immediately."]
13983#[doc = ""]
13984#[doc = " @see sd_clock_hfclk_is_running"]
13985#[doc = " @see sd_clock_hfclk_request"]
13986#[doc = ""]
13987#[doc = " @retval ::NRF_SUCCESS"]
13988#[inline(always)]
13989pub unsafe fn sd_clock_hfclk_release() -> u32 {
13990    let ret: u32;
13991    core::arch::asm!("svc 67",
13992        lateout("r0") ret,
13993        lateout("r1") _,
13994        lateout("r2") _,
13995        lateout("r3") _,
13996        lateout("r12") _,
13997    );
13998    ret
13999}
14000
14001#[doc = "@brief Checks if the high frequency crystal oscillator is running."]
14002#[doc = ""]
14003#[doc = " @see sd_clock_hfclk_request"]
14004#[doc = " @see sd_clock_hfclk_release"]
14005#[doc = ""]
14006#[doc = " @param[out] p_is_running 1 if the external crystal oscillator is running, 0 if not."]
14007#[doc = ""]
14008#[doc = " @retval ::NRF_SUCCESS"]
14009#[inline(always)]
14010pub unsafe fn sd_clock_hfclk_is_running(p_is_running: *mut u32) -> u32 {
14011    let ret: u32;
14012    core::arch::asm!("svc 68",
14013        inout("r0") to_asm(p_is_running) => ret,
14014        lateout("r1") _,
14015        lateout("r2") _,
14016        lateout("r3") _,
14017        lateout("r12") _,
14018    );
14019    ret
14020}
14021
14022#[doc = "@brief Waits for an application event."]
14023#[doc = ""]
14024#[doc = " An application event is either an application interrupt or a pended interrupt when the interrupt"]
14025#[doc = " is disabled."]
14026#[doc = ""]
14027#[doc = " When the application waits for an application event by calling this function, an interrupt that"]
14028#[doc = " is enabled will be taken immediately on pending since this function will wait in thread mode,"]
14029#[doc = " then the execution will return in the application's main thread."]
14030#[doc = ""]
14031#[doc = " In order to wake up from disabled interrupts, the SEVONPEND flag has to be set in the Cortex-M"]
14032#[doc = " MCU's System Control Register (SCR), CMSIS_SCB. In that case, when a disabled interrupt gets"]
14033#[doc = " pended, this function will return to the application's main thread."]
14034#[doc = ""]
14035#[doc = " @note The application must ensure that the pended flag is cleared using ::sd_nvic_ClearPendingIRQ"]
14036#[doc = "       in order to sleep using this function. This is only necessary for disabled interrupts, as"]
14037#[doc = "       the interrupt handler will clear the pending flag automatically for enabled interrupts."]
14038#[doc = ""]
14039#[doc = " @note If an application interrupt has happened since the last time sd_app_evt_wait was"]
14040#[doc = "       called this function will return immediately and not go to sleep. This is to avoid race"]
14041#[doc = "       conditions that can occur when a flag is updated in the interrupt handler and processed"]
14042#[doc = "       in the main loop."]
14043#[doc = ""]
14044#[doc = " @post An application interrupt has happened or a interrupt pending flag is set."]
14045#[doc = ""]
14046#[doc = " @retval ::NRF_SUCCESS"]
14047#[inline(always)]
14048pub unsafe fn sd_app_evt_wait() -> u32 {
14049    let ret: u32;
14050    core::arch::asm!("svc 65",
14051        lateout("r0") ret,
14052        lateout("r1") _,
14053        lateout("r2") _,
14054        lateout("r3") _,
14055        lateout("r12") _,
14056    );
14057    ret
14058}
14059
14060#[doc = "@brief Get PPI channel enable register contents."]
14061#[doc = ""]
14062#[doc = " @param[out] p_channel_enable The contents of the PPI CHEN register."]
14063#[doc = ""]
14064#[doc = " @retval ::NRF_SUCCESS"]
14065#[inline(always)]
14066pub unsafe fn sd_ppi_channel_enable_get(p_channel_enable: *mut u32) -> u32 {
14067    let ret: u32;
14068    core::arch::asm!("svc 32",
14069        inout("r0") to_asm(p_channel_enable) => ret,
14070        lateout("r1") _,
14071        lateout("r2") _,
14072        lateout("r3") _,
14073        lateout("r12") _,
14074    );
14075    ret
14076}
14077
14078#[doc = "@brief Set PPI channel enable register."]
14079#[doc = ""]
14080#[doc = " @param[in] channel_enable_set_msk Mask containing the bits to set in the PPI CHEN register."]
14081#[doc = ""]
14082#[doc = " @retval ::NRF_SUCCESS"]
14083#[inline(always)]
14084pub unsafe fn sd_ppi_channel_enable_set(channel_enable_set_msk: u32) -> u32 {
14085    let ret: u32;
14086    core::arch::asm!("svc 33",
14087        inout("r0") to_asm(channel_enable_set_msk) => ret,
14088        lateout("r1") _,
14089        lateout("r2") _,
14090        lateout("r3") _,
14091        lateout("r12") _,
14092    );
14093    ret
14094}
14095
14096#[doc = "@brief Clear PPI channel enable register."]
14097#[doc = ""]
14098#[doc = " @param[in] channel_enable_clr_msk Mask containing the bits to clear in the PPI CHEN register."]
14099#[doc = ""]
14100#[doc = " @retval ::NRF_SUCCESS"]
14101#[inline(always)]
14102pub unsafe fn sd_ppi_channel_enable_clr(channel_enable_clr_msk: u32) -> u32 {
14103    let ret: u32;
14104    core::arch::asm!("svc 34",
14105        inout("r0") to_asm(channel_enable_clr_msk) => ret,
14106        lateout("r1") _,
14107        lateout("r2") _,
14108        lateout("r3") _,
14109        lateout("r12") _,
14110    );
14111    ret
14112}
14113
14114#[doc = "@brief Assign endpoints to a PPI channel."]
14115#[doc = ""]
14116#[doc = " @param[in] channel_num Number of the PPI channel to assign."]
14117#[doc = " @param[in] evt_endpoint Event endpoint of the PPI channel."]
14118#[doc = " @param[in] task_endpoint Task endpoint of the PPI channel."]
14119#[doc = ""]
14120#[doc = " @retval ::NRF_ERROR_SOC_PPI_INVALID_CHANNEL The channel number is invalid."]
14121#[doc = " @retval ::NRF_SUCCESS"]
14122#[inline(always)]
14123pub unsafe fn sd_ppi_channel_assign(
14124    channel_num: u8,
14125    evt_endpoint: *const self::c_void,
14126    task_endpoint: *const self::c_void,
14127) -> u32 {
14128    let ret: u32;
14129    core::arch::asm!("svc 35",
14130        inout("r0") to_asm(channel_num) => ret,
14131        inout("r1") to_asm(evt_endpoint) => _,
14132        inout("r2") to_asm(task_endpoint) => _,
14133        lateout("r3") _,
14134        lateout("r12") _,
14135    );
14136    ret
14137}
14138
14139#[doc = "@brief Task to enable a channel group."]
14140#[doc = ""]
14141#[doc = " @param[in] group_num Number of the channel group."]
14142#[doc = ""]
14143#[doc = " @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid"]
14144#[doc = " @retval ::NRF_SUCCESS"]
14145#[inline(always)]
14146pub unsafe fn sd_ppi_group_task_enable(group_num: u8) -> u32 {
14147    let ret: u32;
14148    core::arch::asm!("svc 36",
14149        inout("r0") to_asm(group_num) => ret,
14150        lateout("r1") _,
14151        lateout("r2") _,
14152        lateout("r3") _,
14153        lateout("r12") _,
14154    );
14155    ret
14156}
14157
14158#[doc = "@brief Task to disable a channel group."]
14159#[doc = ""]
14160#[doc = " @param[in] group_num Number of the PPI group."]
14161#[doc = ""]
14162#[doc = " @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid."]
14163#[doc = " @retval ::NRF_SUCCESS"]
14164#[inline(always)]
14165pub unsafe fn sd_ppi_group_task_disable(group_num: u8) -> u32 {
14166    let ret: u32;
14167    core::arch::asm!("svc 37",
14168        inout("r0") to_asm(group_num) => ret,
14169        lateout("r1") _,
14170        lateout("r2") _,
14171        lateout("r3") _,
14172        lateout("r12") _,
14173    );
14174    ret
14175}
14176
14177#[doc = "@brief Assign PPI channels to a channel group."]
14178#[doc = ""]
14179#[doc = " @param[in] group_num Number of the channel group."]
14180#[doc = " @param[in] channel_msk Mask of the channels to assign to the group."]
14181#[doc = ""]
14182#[doc = " @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid."]
14183#[doc = " @retval ::NRF_SUCCESS"]
14184#[inline(always)]
14185pub unsafe fn sd_ppi_group_assign(group_num: u8, channel_msk: u32) -> u32 {
14186    let ret: u32;
14187    core::arch::asm!("svc 38",
14188        inout("r0") to_asm(group_num) => ret,
14189        inout("r1") to_asm(channel_msk) => _,
14190        lateout("r2") _,
14191        lateout("r3") _,
14192        lateout("r12") _,
14193    );
14194    ret
14195}
14196
14197#[doc = "@brief Gets the PPI channels of a channel group."]
14198#[doc = ""]
14199#[doc = " @param[in]   group_num Number of the channel group."]
14200#[doc = " @param[out]  p_channel_msk Mask of the channels assigned to the group."]
14201#[doc = ""]
14202#[doc = " @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid."]
14203#[doc = " @retval ::NRF_SUCCESS"]
14204#[inline(always)]
14205pub unsafe fn sd_ppi_group_get(group_num: u8, p_channel_msk: *mut u32) -> u32 {
14206    let ret: u32;
14207    core::arch::asm!("svc 39",
14208        inout("r0") to_asm(group_num) => ret,
14209        inout("r1") to_asm(p_channel_msk) => _,
14210        lateout("r2") _,
14211        lateout("r3") _,
14212        lateout("r12") _,
14213    );
14214    ret
14215}
14216
14217#[doc = "@brief Configures the Radio Notification signal."]
14218#[doc = ""]
14219#[doc = " @note"]
14220#[doc = "      - The notification signal latency depends on the interrupt priority settings of SWI used"]
14221#[doc = "        for notification signal."]
14222#[doc = "      - To ensure that the radio notification signal behaves in a consistent way, the radio"]
14223#[doc = "        notifications must be configured when there is no protocol stack or other SoftDevice"]
14224#[doc = "        activity in progress. It is recommended that the radio notification signal is"]
14225#[doc = "        configured directly after the SoftDevice has been enabled."]
14226#[doc = "      - In the period between the ACTIVE signal and the start of the Radio Event, the SoftDevice"]
14227#[doc = "        will interrupt the application to do Radio Event preparation."]
14228#[doc = "      - Using the Radio Notification feature may limit the bandwidth, as the SoftDevice may have"]
14229#[doc = "        to shorten the connection events to have time for the Radio Notification signals."]
14230#[doc = ""]
14231#[doc = " @param[in]  type      Type of notification signal, see @ref NRF_RADIO_NOTIFICATION_TYPES."]
14232#[doc = "                       @ref NRF_RADIO_NOTIFICATION_TYPE_NONE shall be used to turn off radio"]
14233#[doc = "                       notification. Using @ref NRF_RADIO_NOTIFICATION_DISTANCE_NONE is"]
14234#[doc = "                       recommended (but not required) to be used with"]
14235#[doc = "                       @ref NRF_RADIO_NOTIFICATION_TYPE_NONE."]
14236#[doc = ""]
14237#[doc = " @param[in]  distance  Distance between the notification signal and start of radio activity, see @ref NRF_RADIO_NOTIFICATION_DISTANCES."]
14238#[doc = "                       This parameter is ignored when @ref NRF_RADIO_NOTIFICATION_TYPE_NONE or"]
14239#[doc = "                       @ref NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE is used."]
14240#[doc = ""]
14241#[doc = " @retval ::NRF_ERROR_INVALID_PARAM The group number is invalid."]
14242#[doc = " @retval ::NRF_ERROR_INVALID_STATE A protocol stack or other SoftDevice is running. Stop all"]
14243#[doc = "                                   running activities and retry."]
14244#[doc = " @retval ::NRF_SUCCESS"]
14245#[inline(always)]
14246pub unsafe fn sd_radio_notification_cfg_set(type_: u8, distance: u8) -> u32 {
14247    let ret: u32;
14248    core::arch::asm!("svc 69",
14249        inout("r0") to_asm(type_) => ret,
14250        inout("r1") to_asm(distance) => _,
14251        lateout("r2") _,
14252        lateout("r3") _,
14253        lateout("r12") _,
14254    );
14255    ret
14256}
14257
14258#[doc = "@brief Encrypts a block according to the specified parameters."]
14259#[doc = ""]
14260#[doc = " 128-bit AES encryption."]
14261#[doc = ""]
14262#[doc = " @note:"]
14263#[doc = "    - The application may set the SEVONPEND bit in the SCR to 1 to make the SoftDevice sleep while"]
14264#[doc = "      the ECB is running. The SEVONPEND bit should only be cleared (set to 0) from application"]
14265#[doc = "      main or low interrupt level."]
14266#[doc = ""]
14267#[doc = " @param[in, out] p_ecb_data Pointer to the ECB parameters' struct (two input"]
14268#[doc = "                            parameters and one output parameter)."]
14269#[doc = ""]
14270#[doc = " @retval ::NRF_SUCCESS"]
14271#[inline(always)]
14272pub unsafe fn sd_ecb_block_encrypt(p_ecb_data: *mut nrf_ecb_hal_data_t) -> u32 {
14273    let ret: u32;
14274    core::arch::asm!("svc 70",
14275        inout("r0") to_asm(p_ecb_data) => ret,
14276        lateout("r1") _,
14277        lateout("r2") _,
14278        lateout("r3") _,
14279        lateout("r12") _,
14280    );
14281    ret
14282}
14283
14284#[doc = "@brief Encrypts multiple data blocks provided as an array of data block structures."]
14285#[doc = ""]
14286#[doc = " @details: Performs 128-bit AES encryption on multiple data blocks"]
14287#[doc = ""]
14288#[doc = " @note:"]
14289#[doc = "    - The application may set the SEVONPEND bit in the SCR to 1 to make the SoftDevice sleep while"]
14290#[doc = "      the ECB is running. The SEVONPEND bit should only be cleared (set to 0) from application"]
14291#[doc = "      main or low interrupt level."]
14292#[doc = ""]
14293#[doc = " @param[in]     block_count     Count of blocks in the p_data_blocks array."]
14294#[doc = " @param[in,out] p_data_blocks   Pointer to the first entry in a contiguous array of"]
14295#[doc = "                                @ref nrf_ecb_hal_data_block_t structures."]
14296#[doc = ""]
14297#[doc = " @retval ::NRF_SUCCESS"]
14298#[inline(always)]
14299pub unsafe fn sd_ecb_blocks_encrypt(block_count: u8, p_data_blocks: *mut nrf_ecb_hal_data_block_t) -> u32 {
14300    let ret: u32;
14301    core::arch::asm!("svc 71",
14302        inout("r0") to_asm(block_count) => ret,
14303        inout("r1") to_asm(p_data_blocks) => _,
14304        lateout("r2") _,
14305        lateout("r3") _,
14306        lateout("r12") _,
14307    );
14308    ret
14309}
14310
14311#[doc = "@brief Gets any pending events generated by the SoC API."]
14312#[doc = ""]
14313#[doc = " The application should keep calling this function to get events, until ::NRF_ERROR_NOT_FOUND is returned."]
14314#[doc = ""]
14315#[doc = " @param[out] p_evt_id Set to one of the values in @ref NRF_SOC_EVTS, if any events are pending."]
14316#[doc = ""]
14317#[doc = " @retval ::NRF_SUCCESS An event was pending. The event id is written in the p_evt_id parameter."]
14318#[doc = " @retval ::NRF_ERROR_NOT_FOUND No pending events."]
14319#[inline(always)]
14320pub unsafe fn sd_evt_get(p_evt_id: *mut u32) -> u32 {
14321    let ret: u32;
14322    core::arch::asm!("svc 75",
14323        inout("r0") to_asm(p_evt_id) => ret,
14324        lateout("r1") _,
14325        lateout("r2") _,
14326        lateout("r3") _,
14327        lateout("r12") _,
14328    );
14329    ret
14330}
14331
14332#[doc = "@brief Get the temperature measured on the chip"]
14333#[doc = ""]
14334#[doc = " This function will block until the temperature measurement is done."]
14335#[doc = " It takes around 50 us from call to return."]
14336#[doc = ""]
14337#[doc = " @param[out] p_temp Result of temperature measurement. Die temperature in 0.25 degrees Celsius."]
14338#[doc = ""]
14339#[doc = " @retval ::NRF_SUCCESS A temperature measurement was done, and the temperature was written to temp"]
14340#[inline(always)]
14341pub unsafe fn sd_temp_get(p_temp: *mut i32) -> u32 {
14342    let ret: u32;
14343    core::arch::asm!("svc 76",
14344        inout("r0") to_asm(p_temp) => ret,
14345        lateout("r1") _,
14346        lateout("r2") _,
14347        lateout("r3") _,
14348        lateout("r12") _,
14349    );
14350    ret
14351}
14352
14353#[doc = "@brief Flash Write"]
14354#[doc = ""]
14355#[doc = " Commands to write a buffer to flash"]
14356#[doc = ""]
14357#[doc = " If the SoftDevice is enabled:"]
14358#[doc = "  This call initiates the flash access command, and its completion will be communicated to the"]
14359#[doc = "  application with exactly one of the following events:"]
14360#[doc = "      - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed."]
14361#[doc = "      - @ref NRF_EVT_FLASH_OPERATION_ERROR   - The command could not be started."]
14362#[doc = ""]
14363#[doc = " If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the"]
14364#[doc = " write has been completed"]
14365#[doc = ""]
14366#[doc = " @note"]
14367#[doc = "      - This call takes control over the radio and the CPU during flash erase and write to make sure that"]
14368#[doc = "        they will not interfere with the flash access. This means that all interrupts will be blocked"]
14369#[doc = "        for a predictable time (depending on the NVMC specification in the device's Product Specification"]
14370#[doc = "        and the command parameters)."]
14371#[doc = "      - The data in the p_src buffer should not be modified before the @ref NRF_EVT_FLASH_OPERATION_SUCCESS"]
14372#[doc = "        or the @ref NRF_EVT_FLASH_OPERATION_ERROR have been received if the SoftDevice is enabled."]
14373#[doc = "      - This call will make the SoftDevice trigger a hardfault when the page is written, if it is"]
14374#[doc = "        protected."]
14375#[doc = ""]
14376#[doc = ""]
14377#[doc = " @param[in]  p_dst Pointer to start of flash location to be written."]
14378#[doc = " @param[in]  p_src Pointer to buffer with data to be written."]
14379#[doc = " @param[in]  size  Number of 32-bit words to write. Maximum size is the number of words in one"]
14380#[doc = "                   flash page. See the device's Product Specification for details."]
14381#[doc = ""]
14382#[doc = " @retval ::NRF_ERROR_INVALID_ADDR   Tried to write to a non existing flash address, or p_dst or p_src was unaligned."]
14383#[doc = " @retval ::NRF_ERROR_BUSY           The previous command has not yet completed."]
14384#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH Size was 0, or higher than the maximum allowed size."]
14385#[doc = " @retval ::NRF_ERROR_FORBIDDEN      Tried to write to an address outside the application flash area."]
14386#[doc = " @retval ::NRF_SUCCESS              The command was accepted."]
14387#[inline(always)]
14388pub unsafe fn sd_flash_write(p_dst: *mut u32, p_src: *const u32, size: u32) -> u32 {
14389    let ret: u32;
14390    core::arch::asm!("svc 41",
14391        inout("r0") to_asm(p_dst) => ret,
14392        inout("r1") to_asm(p_src) => _,
14393        inout("r2") to_asm(size) => _,
14394        lateout("r3") _,
14395        lateout("r12") _,
14396    );
14397    ret
14398}
14399
14400#[doc = "@brief Flash Erase page"]
14401#[doc = ""]
14402#[doc = " Commands to erase a flash page"]
14403#[doc = " If the SoftDevice is enabled:"]
14404#[doc = "  This call initiates the flash access command, and its completion will be communicated to the"]
14405#[doc = "  application with exactly one of the following events:"]
14406#[doc = "      - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed."]
14407#[doc = "      - @ref NRF_EVT_FLASH_OPERATION_ERROR   - The command could not be started."]
14408#[doc = ""]
14409#[doc = " If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the"]
14410#[doc = " erase has been completed"]
14411#[doc = ""]
14412#[doc = " @note"]
14413#[doc = "      - This call takes control over the radio and the CPU during flash erase and write to make sure that"]
14414#[doc = "        they will not interfere with the flash access. This means that all interrupts will be blocked"]
14415#[doc = "        for a predictable time (depending on the NVMC specification in the device's Product Specification"]
14416#[doc = "        and the command parameters)."]
14417#[doc = "      - This call will make the SoftDevice trigger a hardfault when the page is erased, if it is"]
14418#[doc = "        protected."]
14419#[doc = ""]
14420#[doc = ""]
14421#[doc = " @param[in]  page_number           Page number of the page to erase"]
14422#[doc = ""]
14423#[doc = " @retval ::NRF_ERROR_INTERNAL      If a new session could not be opened due to an internal error."]
14424#[doc = " @retval ::NRF_ERROR_INVALID_ADDR  Tried to erase to a non existing flash page."]
14425#[doc = " @retval ::NRF_ERROR_BUSY          The previous command has not yet completed."]
14426#[doc = " @retval ::NRF_ERROR_FORBIDDEN     Tried to erase a page outside the application flash area."]
14427#[doc = " @retval ::NRF_SUCCESS             The command was accepted."]
14428#[inline(always)]
14429pub unsafe fn sd_flash_page_erase(page_number: u32) -> u32 {
14430    let ret: u32;
14431    core::arch::asm!("svc 40",
14432        inout("r0") to_asm(page_number) => ret,
14433        lateout("r1") _,
14434        lateout("r2") _,
14435        lateout("r3") _,
14436        lateout("r12") _,
14437    );
14438    ret
14439}
14440
14441#[doc = "@brief Flash Protection set"]
14442#[doc = ""]
14443#[doc = " Commands to set the flash protection configuration registers."]
14444#[doc = "This sets the CONFIGx registers of the BPROT peripheral."]
14445#[doc = ""]
14446#[doc = " @note Not all parameters are valid for all products. Some bits in each parameter may not be"]
14447#[doc = "       valid for your product. Please refer your Product Specification for more details."]
14448#[doc = ""]
14449#[doc = " @note To read the values read them directly. They are only write-protected."]
14450#[doc = ""]
14451#[doc = " @note It is possible to use @ref sd_protected_register_write instead of this function."]
14452#[doc = ""]
14453#[doc = " @param[in]  block_cfg0 Value to be written to the configuration register."]
14454#[doc = " @param[in]  block_cfg1 Value to be written to the configuration register."]
14455#[doc = " @param[in]  block_cfg2 Value to be written to the configuration register."]
14456#[doc = " @param[in]  block_cfg3 Value to be written to the configuration register."]
14457#[doc = ""]
14458#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Non-zero value supplied to one or more of the unsupported parameters."]
14459#[doc = " @retval ::NRF_SUCCESS Values successfully written to configuration registers."]
14460#[inline(always)]
14461pub unsafe fn sd_flash_protect(block_cfg0: u32, block_cfg1: u32, block_cfg2: u32, block_cfg3: u32) -> u32 {
14462    let ret: u32;
14463    core::arch::asm!("svc 42",
14464        inout("r0") to_asm(block_cfg0) => ret,
14465        inout("r1") to_asm(block_cfg1) => _,
14466        inout("r2") to_asm(block_cfg2) => _,
14467        inout("r3") to_asm(block_cfg3) => _,
14468        lateout("r12") _,
14469    );
14470    ret
14471}
14472
14473#[doc = "@brief Opens a session for radio timeslot requests."]
14474#[doc = ""]
14475#[doc = " @note Only one session can be open at a time."]
14476#[doc = " @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) will be called when the radio timeslot"]
14477#[doc = "       starts. From this point the NRF_RADIO and NRF_TIMER0 peripherals can be freely accessed"]
14478#[doc = "       by the application."]
14479#[doc = " @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0) is called whenever the NRF_TIMER0"]
14480#[doc = "       interrupt occurs."]
14481#[doc = " @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO) is called whenever the NRF_RADIO"]
14482#[doc = "       interrupt occurs."]
14483#[doc = " @note p_radio_signal_callback() will be called at ARM interrupt priority level 0. This"]
14484#[doc = "       implies that none of the sd_* API calls can be used from p_radio_signal_callback()."]
14485#[doc = ""]
14486#[doc = " @param[in] p_radio_signal_callback The signal callback."]
14487#[doc = ""]
14488#[doc = " @retval ::NRF_ERROR_INVALID_ADDR p_radio_signal_callback is an invalid function pointer."]
14489#[doc = " @retval ::NRF_ERROR_BUSY If session cannot be opened."]
14490#[doc = " @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error."]
14491#[doc = " @retval ::NRF_SUCCESS Otherwise."]
14492#[inline(always)]
14493pub unsafe fn sd_radio_session_open(p_radio_signal_callback: nrf_radio_signal_callback_t) -> u32 {
14494    let ret: u32;
14495    core::arch::asm!("svc 72",
14496        inout("r0") to_asm(p_radio_signal_callback) => ret,
14497        lateout("r1") _,
14498        lateout("r2") _,
14499        lateout("r3") _,
14500        lateout("r12") _,
14501    );
14502    ret
14503}
14504
14505#[doc = "@brief Closes a session for radio timeslot requests."]
14506#[doc = ""]
14507#[doc = " @note Any current radio timeslot will be finished before the session is closed."]
14508#[doc = " @note If a radio timeslot is scheduled when the session is closed, it will be canceled."]
14509#[doc = " @note The application cannot consider the session closed until the @ref NRF_EVT_RADIO_SESSION_CLOSED"]
14510#[doc = "       event is received."]
14511#[doc = ""]
14512#[doc = " @retval ::NRF_ERROR_FORBIDDEN If session not opened."]
14513#[doc = " @retval ::NRF_ERROR_BUSY If session is currently being closed."]
14514#[doc = " @retval ::NRF_SUCCESS Otherwise."]
14515#[inline(always)]
14516pub unsafe fn sd_radio_session_close() -> u32 {
14517    let ret: u32;
14518    core::arch::asm!("svc 73",
14519        lateout("r0") ret,
14520        lateout("r1") _,
14521        lateout("r2") _,
14522        lateout("r3") _,
14523        lateout("r12") _,
14524    );
14525    ret
14526}
14527
14528#[doc = "@brief Requests a radio timeslot."]
14529#[doc = ""]
14530#[doc = " @note The request type is determined by p_request->request_type, and can be one of @ref NRF_RADIO_REQ_TYPE_EARLIEST"]
14531#[doc = "       and @ref NRF_RADIO_REQ_TYPE_NORMAL. The first request in a session must always be of type @ref NRF_RADIO_REQ_TYPE_EARLIEST."]
14532#[doc = " @note For a normal request (@ref NRF_RADIO_REQ_TYPE_NORMAL), the start time of a radio timeslot is specified by"]
14533#[doc = "       p_request->distance_us and is given relative to the start of the previous timeslot."]
14534#[doc = " @note A too small p_request->distance_us will lead to a @ref NRF_EVT_RADIO_BLOCKED event."]
14535#[doc = " @note Timeslots scheduled too close will lead to a @ref NRF_EVT_RADIO_BLOCKED event."]
14536#[doc = " @note See the SoftDevice Specification for more on radio timeslot scheduling, distances and lengths."]
14537#[doc = " @note If an opportunity for the first radio timeslot is not found before 100 ms after the call to this"]
14538#[doc = "       function, it is not scheduled, and instead a @ref NRF_EVT_RADIO_BLOCKED event is sent."]
14539#[doc = "       The application may then try to schedule the first radio timeslot again."]
14540#[doc = " @note Successful requests will result in nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START)."]
14541#[doc = "       Unsuccessful requests will result in a @ref NRF_EVT_RADIO_BLOCKED event, see @ref NRF_SOC_EVTS."]
14542#[doc = " @note The jitter in the start time of the radio timeslots is +/- @ref NRF_RADIO_START_JITTER_US us."]
14543#[doc = " @note The nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) call has a latency relative to the"]
14544#[doc = "       specified radio timeslot start, but this does not affect the actual start time of the timeslot."]
14545#[doc = " @note NRF_TIMER0 is reset at the start of the radio timeslot, and is clocked at 1MHz from the high frequency"]
14546#[doc = "       (16 MHz) clock source. If p_request->hfclk_force_xtal is true, the high frequency clock is"]
14547#[doc = "       guaranteed to be clocked from the external crystal."]
14548#[doc = " @note The SoftDevice will neither access the NRF_RADIO peripheral nor the NRF_TIMER0 peripheral"]
14549#[doc = "       during the radio timeslot."]
14550#[doc = ""]
14551#[doc = " @param[in] p_request Pointer to the request parameters."]
14552#[doc = ""]
14553#[doc = " @retval ::NRF_ERROR_FORBIDDEN Either:"]
14554#[doc = "                                - The session is not open."]
14555#[doc = "                                - The session is not IDLE."]
14556#[doc = "                                - This is the first request and its type is not @ref NRF_RADIO_REQ_TYPE_EARLIEST."]
14557#[doc = "                                - The request type was set to @ref NRF_RADIO_REQ_TYPE_NORMAL after a"]
14558#[doc = "                                  @ref NRF_RADIO_REQ_TYPE_EARLIEST request was blocked."]
14559#[doc = " @retval ::NRF_ERROR_INVALID_ADDR If the p_request pointer is invalid."]
14560#[doc = " @retval ::NRF_ERROR_INVALID_PARAM If the parameters of p_request are not valid."]
14561#[doc = " @retval ::NRF_SUCCESS Otherwise."]
14562#[inline(always)]
14563pub unsafe fn sd_radio_request(p_request: *const nrf_radio_request_t) -> u32 {
14564    let ret: u32;
14565    core::arch::asm!("svc 74",
14566        inout("r0") to_asm(p_request) => ret,
14567        lateout("r1") _,
14568        lateout("r2") _,
14569        lateout("r3") _,
14570        lateout("r12") _,
14571    );
14572    ret
14573}
14574
14575#[doc = "@brief Write register protected by the SoftDevice"]
14576#[doc = ""]
14577#[doc = " This function writes to a register that is write-protected by the SoftDevice. Please refer to your"]
14578#[doc = " SoftDevice Specification for more details about which registers that are protected by SoftDevice."]
14579#[doc = " This function can write to the following protected peripheral:"]
14580#[doc = "  - BPROT"]
14581#[doc = ""]
14582#[doc = " @note Protected registers may be read directly."]
14583#[doc = " @note Register that are write-once will return @ref NRF_SUCCESS on second set, even the value in"]
14584#[doc = "       the register has not changed. See the Product Specification for more details about register"]
14585#[doc = "       properties."]
14586#[doc = ""]
14587#[doc = " @param[in]  p_register Pointer to register to be written."]
14588#[doc = " @param[in]  value Value to be written to the register."]
14589#[doc = ""]
14590#[doc = " @retval ::NRF_ERROR_INVALID_ADDR This function can not write to the reguested register."]
14591#[doc = " @retval ::NRF_SUCCESS Value successfully written to register."]
14592#[doc = ""]
14593#[inline(always)]
14594pub unsafe fn sd_protected_register_write(p_register: *mut u32, value: u32) -> u32 {
14595    let ret: u32;
14596    core::arch::asm!("svc 43",
14597        inout("r0") to_asm(p_register) => ret,
14598        inout("r1") to_asm(value) => _,
14599        lateout("r2") _,
14600        lateout("r3") _,
14601        lateout("r12") _,
14602    );
14603    ret
14604}
14605
14606#[doc = "< ::sd_mbr_command"]
14607pub const NRF_MBR_SVCS_SD_MBR_COMMAND: NRF_MBR_SVCS = 24;
14608#[doc = "@brief nRF Master Boot Record API SVC numbers."]
14609pub type NRF_MBR_SVCS = self::c_uint;
14610#[doc = "< Copy a new BootLoader. @see ::sd_mbr_command_copy_bl_t"]
14611pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_COPY_BL: NRF_MBR_COMMANDS = 0;
14612#[doc = "< Copy a new SoftDevice. @see ::sd_mbr_command_copy_sd_t"]
14613pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_COPY_SD: NRF_MBR_COMMANDS = 1;
14614#[doc = "< Initialize forwarding interrupts to SD, and run reset function in SD. Does not require any parameters in ::sd_mbr_command_t params."]
14615pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_INIT_SD: NRF_MBR_COMMANDS = 2;
14616#[doc = "< This command works like memcmp. @see ::sd_mbr_command_compare_t"]
14617pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_COMPARE: NRF_MBR_COMMANDS = 3;
14618#[doc = "< Change the address the MBR starts after a reset. @see ::sd_mbr_command_vector_table_base_set_t"]
14619pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET: NRF_MBR_COMMANDS = 4;
14620pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_RESERVED: NRF_MBR_COMMANDS = 5;
14621#[doc = "< Start forwarding all interrupts to this address. @see ::sd_mbr_command_irq_forward_address_set_t"]
14622pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET: NRF_MBR_COMMANDS = 6;
14623#[doc = "@brief Possible values for ::sd_mbr_command_t.command"]
14624pub type NRF_MBR_COMMANDS = self::c_uint;
14625#[doc = "@brief This command copies part of a new SoftDevice"]
14626#[doc = ""]
14627#[doc = " The destination area is erased before copying."]
14628#[doc = " If dst is in the middle of a flash page, that whole flash page will be erased."]
14629#[doc = " If (dst+len) is in the middle of a flash page, that whole flash page will be erased."]
14630#[doc = ""]
14631#[doc = " The user of this function is responsible for setting the BPROT registers."]
14632#[doc = ""]
14633#[doc = " @retval ::NRF_SUCCESS indicates that the contents of the memory blocks where copied correctly."]
14634#[doc = " @retval ::NRF_ERROR_INTERNAL indicates that the contents of the memory blocks where not verified correctly after copying."]
14635#[repr(C)]
14636#[derive(Debug, Copy, Clone)]
14637pub struct sd_mbr_command_copy_sd_t {
14638    #[doc = "< Pointer to the source of data to be copied."]
14639    pub src: *mut u32,
14640    #[doc = "< Pointer to the destination where the content is to be copied."]
14641    pub dst: *mut u32,
14642    #[doc = "< Number of 32 bit words to copy. Must be a multiple of @ref MBR_PAGE_SIZE_IN_WORDS words."]
14643    pub len: u32,
14644}
14645#[test]
14646fn bindgen_test_layout_sd_mbr_command_copy_sd_t() {
14647    assert_eq!(
14648        ::core::mem::size_of::<sd_mbr_command_copy_sd_t>(),
14649        12usize,
14650        concat!("Size of: ", stringify!(sd_mbr_command_copy_sd_t))
14651    );
14652    assert_eq!(
14653        ::core::mem::align_of::<sd_mbr_command_copy_sd_t>(),
14654        4usize,
14655        concat!("Alignment of ", stringify!(sd_mbr_command_copy_sd_t))
14656    );
14657    assert_eq!(
14658        unsafe { &(*(::core::ptr::null::<sd_mbr_command_copy_sd_t>())).src as *const _ as usize },
14659        0usize,
14660        concat!(
14661            "Offset of field: ",
14662            stringify!(sd_mbr_command_copy_sd_t),
14663            "::",
14664            stringify!(src)
14665        )
14666    );
14667    assert_eq!(
14668        unsafe { &(*(::core::ptr::null::<sd_mbr_command_copy_sd_t>())).dst as *const _ as usize },
14669        4usize,
14670        concat!(
14671            "Offset of field: ",
14672            stringify!(sd_mbr_command_copy_sd_t),
14673            "::",
14674            stringify!(dst)
14675        )
14676    );
14677    assert_eq!(
14678        unsafe { &(*(::core::ptr::null::<sd_mbr_command_copy_sd_t>())).len as *const _ as usize },
14679        8usize,
14680        concat!(
14681            "Offset of field: ",
14682            stringify!(sd_mbr_command_copy_sd_t),
14683            "::",
14684            stringify!(len)
14685        )
14686    );
14687}
14688#[doc = "@brief This command works like memcmp, but takes the length in words."]
14689#[doc = ""]
14690#[doc = " @retval ::NRF_SUCCESS indicates that the contents of both memory blocks are equal."]
14691#[doc = " @retval ::NRF_ERROR_NULL indicates that the contents of the memory blocks are not equal."]
14692#[repr(C)]
14693#[derive(Debug, Copy, Clone)]
14694pub struct sd_mbr_command_compare_t {
14695    #[doc = "< Pointer to block of memory."]
14696    pub ptr1: *mut u32,
14697    #[doc = "< Pointer to block of memory."]
14698    pub ptr2: *mut u32,
14699    #[doc = "< Number of 32 bit words to compare."]
14700    pub len: u32,
14701}
14702#[test]
14703fn bindgen_test_layout_sd_mbr_command_compare_t() {
14704    assert_eq!(
14705        ::core::mem::size_of::<sd_mbr_command_compare_t>(),
14706        12usize,
14707        concat!("Size of: ", stringify!(sd_mbr_command_compare_t))
14708    );
14709    assert_eq!(
14710        ::core::mem::align_of::<sd_mbr_command_compare_t>(),
14711        4usize,
14712        concat!("Alignment of ", stringify!(sd_mbr_command_compare_t))
14713    );
14714    assert_eq!(
14715        unsafe { &(*(::core::ptr::null::<sd_mbr_command_compare_t>())).ptr1 as *const _ as usize },
14716        0usize,
14717        concat!(
14718            "Offset of field: ",
14719            stringify!(sd_mbr_command_compare_t),
14720            "::",
14721            stringify!(ptr1)
14722        )
14723    );
14724    assert_eq!(
14725        unsafe { &(*(::core::ptr::null::<sd_mbr_command_compare_t>())).ptr2 as *const _ as usize },
14726        4usize,
14727        concat!(
14728            "Offset of field: ",
14729            stringify!(sd_mbr_command_compare_t),
14730            "::",
14731            stringify!(ptr2)
14732        )
14733    );
14734    assert_eq!(
14735        unsafe { &(*(::core::ptr::null::<sd_mbr_command_compare_t>())).len as *const _ as usize },
14736        8usize,
14737        concat!(
14738            "Offset of field: ",
14739            stringify!(sd_mbr_command_compare_t),
14740            "::",
14741            stringify!(len)
14742        )
14743    );
14744}
14745#[doc = "@brief This command copies a new BootLoader."]
14746#[doc = ""]
14747#[doc = " The MBR assumes that either @ref MBR_BOOTLOADER_ADDR or @ref MBR_UICR_BOOTLOADER_ADDR is set to"]
14748#[doc = " the address where the bootloader will be copied. If both addresses are set, the MBR will prioritize"]
14749#[doc = " @ref MBR_BOOTLOADER_ADDR."]
14750#[doc = ""]
14751#[doc = " The bootloader destination is erased by this function."]
14752#[doc = " If (destination+bl_len) is in the middle of a flash page, that whole flash page will be erased."]
14753#[doc = ""]
14754#[doc = " This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,"]
14755#[doc = " see @ref sd_mbr_command."]
14756#[doc = ""]
14757#[doc = " This command will use the flash protect peripheral (BPROT or ACL) to protect the flash that is"]
14758#[doc = " not intended to be written."]
14759#[doc = ""]
14760#[doc = " On success, this function will not return. It will start the new bootloader from reset-vector as normal."]
14761#[doc = ""]
14762#[doc = " @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen."]
14763#[doc = " @retval ::NRF_ERROR_FORBIDDEN if the bootloader address is not set."]
14764#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH if parameters attempts to read or write outside flash area."]
14765#[doc = " @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command."]
14766#[repr(C)]
14767#[derive(Debug, Copy, Clone)]
14768pub struct sd_mbr_command_copy_bl_t {
14769    #[doc = "< Pointer to the source of the bootloader to be be copied."]
14770    pub bl_src: *mut u32,
14771    #[doc = "< Number of 32 bit words to copy for BootLoader."]
14772    pub bl_len: u32,
14773}
14774#[test]
14775fn bindgen_test_layout_sd_mbr_command_copy_bl_t() {
14776    assert_eq!(
14777        ::core::mem::size_of::<sd_mbr_command_copy_bl_t>(),
14778        8usize,
14779        concat!("Size of: ", stringify!(sd_mbr_command_copy_bl_t))
14780    );
14781    assert_eq!(
14782        ::core::mem::align_of::<sd_mbr_command_copy_bl_t>(),
14783        4usize,
14784        concat!("Alignment of ", stringify!(sd_mbr_command_copy_bl_t))
14785    );
14786    assert_eq!(
14787        unsafe { &(*(::core::ptr::null::<sd_mbr_command_copy_bl_t>())).bl_src as *const _ as usize },
14788        0usize,
14789        concat!(
14790            "Offset of field: ",
14791            stringify!(sd_mbr_command_copy_bl_t),
14792            "::",
14793            stringify!(bl_src)
14794        )
14795    );
14796    assert_eq!(
14797        unsafe { &(*(::core::ptr::null::<sd_mbr_command_copy_bl_t>())).bl_len as *const _ as usize },
14798        4usize,
14799        concat!(
14800            "Offset of field: ",
14801            stringify!(sd_mbr_command_copy_bl_t),
14802            "::",
14803            stringify!(bl_len)
14804        )
14805    );
14806}
14807#[doc = "@brief Change the address the MBR starts after a reset"]
14808#[doc = ""]
14809#[doc = " Once this function has been called, this address is where the MBR will start to forward"]
14810#[doc = " interrupts to after a reset."]
14811#[doc = ""]
14812#[doc = " To restore default forwarding, this function should be called with @ref address set to 0. If a"]
14813#[doc = " bootloader is present, interrupts will be forwarded to the bootloader. If not, interrupts will"]
14814#[doc = " be forwarded to the SoftDevice."]
14815#[doc = ""]
14816#[doc = " The location of a bootloader can be specified in @ref MBR_BOOTLOADER_ADDR or"]
14817#[doc = " @ref MBR_UICR_BOOTLOADER_ADDR. If both addresses are set, the MBR will prioritize"]
14818#[doc = " @ref MBR_BOOTLOADER_ADDR."]
14819#[doc = ""]
14820#[doc = " This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,"]
14821#[doc = " see @ref sd_mbr_command."]
14822#[doc = ""]
14823#[doc = " On success, this function will not return. It will reset the device."]
14824#[doc = ""]
14825#[doc = " @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen."]
14826#[doc = " @retval ::NRF_ERROR_INVALID_ADDR if parameter address is outside of the flash size."]
14827#[doc = " @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command."]
14828#[repr(C)]
14829#[derive(Debug, Copy, Clone)]
14830pub struct sd_mbr_command_vector_table_base_set_t {
14831    #[doc = "< The base address of the interrupt vector table for forwarded interrupts."]
14832    pub address: u32,
14833}
14834#[test]
14835fn bindgen_test_layout_sd_mbr_command_vector_table_base_set_t() {
14836    assert_eq!(
14837        ::core::mem::size_of::<sd_mbr_command_vector_table_base_set_t>(),
14838        4usize,
14839        concat!("Size of: ", stringify!(sd_mbr_command_vector_table_base_set_t))
14840    );
14841    assert_eq!(
14842        ::core::mem::align_of::<sd_mbr_command_vector_table_base_set_t>(),
14843        4usize,
14844        concat!("Alignment of ", stringify!(sd_mbr_command_vector_table_base_set_t))
14845    );
14846    assert_eq!(
14847        unsafe { &(*(::core::ptr::null::<sd_mbr_command_vector_table_base_set_t>())).address as *const _ as usize },
14848        0usize,
14849        concat!(
14850            "Offset of field: ",
14851            stringify!(sd_mbr_command_vector_table_base_set_t),
14852            "::",
14853            stringify!(address)
14854        )
14855    );
14856}
14857#[doc = "@brief Sets the base address of the interrupt vector table for interrupts forwarded from the MBR"]
14858#[doc = ""]
14859#[doc = " Unlike sd_mbr_command_vector_table_base_set_t, this function does not reset, and it does not"]
14860#[doc = " change where the MBR starts after reset."]
14861#[doc = ""]
14862#[doc = " @retval ::NRF_SUCCESS"]
14863#[repr(C)]
14864#[derive(Debug, Copy, Clone)]
14865pub struct sd_mbr_command_irq_forward_address_set_t {
14866    #[doc = "< The base address of the interrupt vector table for forwarded interrupts."]
14867    pub address: u32,
14868}
14869#[test]
14870fn bindgen_test_layout_sd_mbr_command_irq_forward_address_set_t() {
14871    assert_eq!(
14872        ::core::mem::size_of::<sd_mbr_command_irq_forward_address_set_t>(),
14873        4usize,
14874        concat!("Size of: ", stringify!(sd_mbr_command_irq_forward_address_set_t))
14875    );
14876    assert_eq!(
14877        ::core::mem::align_of::<sd_mbr_command_irq_forward_address_set_t>(),
14878        4usize,
14879        concat!("Alignment of ", stringify!(sd_mbr_command_irq_forward_address_set_t))
14880    );
14881    assert_eq!(
14882        unsafe { &(*(::core::ptr::null::<sd_mbr_command_irq_forward_address_set_t>())).address as *const _ as usize },
14883        0usize,
14884        concat!(
14885            "Offset of field: ",
14886            stringify!(sd_mbr_command_irq_forward_address_set_t),
14887            "::",
14888            stringify!(address)
14889        )
14890    );
14891}
14892#[doc = "@brief Input structure containing data used when calling ::sd_mbr_command"]
14893#[doc = ""]
14894#[doc = " Depending on what command value that is set, the corresponding params value type must also be"]
14895#[doc = " set. See @ref NRF_MBR_COMMANDS for command types and corresponding params value type. If command"]
14896#[doc = " @ref SD_MBR_COMMAND_INIT_SD is set, it is not necessary to set any values under params."]
14897#[repr(C)]
14898#[derive(Copy, Clone)]
14899pub struct sd_mbr_command_t {
14900    #[doc = "< Type of command to be issued. See @ref NRF_MBR_COMMANDS."]
14901    pub command: u32,
14902    #[doc = "< Command parameters."]
14903    pub params: sd_mbr_command_t__bindgen_ty_1,
14904}
14905#[repr(C)]
14906#[derive(Copy, Clone)]
14907pub union sd_mbr_command_t__bindgen_ty_1 {
14908    #[doc = "< Parameters for copy SoftDevice."]
14909    pub copy_sd: sd_mbr_command_copy_sd_t,
14910    #[doc = "< Parameters for verify."]
14911    pub compare: sd_mbr_command_compare_t,
14912    #[doc = "< Parameters for copy BootLoader. Requires parameter page."]
14913    pub copy_bl: sd_mbr_command_copy_bl_t,
14914    #[doc = "< Parameters for vector table base set. Requires parameter page."]
14915    pub base_set: sd_mbr_command_vector_table_base_set_t,
14916    #[doc = "< Parameters for irq forward address set"]
14917    pub irq_forward_address_set: sd_mbr_command_irq_forward_address_set_t,
14918    _bindgen_union_align: [u32; 3usize],
14919}
14920#[test]
14921fn bindgen_test_layout_sd_mbr_command_t__bindgen_ty_1() {
14922    assert_eq!(
14923        ::core::mem::size_of::<sd_mbr_command_t__bindgen_ty_1>(),
14924        12usize,
14925        concat!("Size of: ", stringify!(sd_mbr_command_t__bindgen_ty_1))
14926    );
14927    assert_eq!(
14928        ::core::mem::align_of::<sd_mbr_command_t__bindgen_ty_1>(),
14929        4usize,
14930        concat!("Alignment of ", stringify!(sd_mbr_command_t__bindgen_ty_1))
14931    );
14932    assert_eq!(
14933        unsafe { &(*(::core::ptr::null::<sd_mbr_command_t__bindgen_ty_1>())).copy_sd as *const _ as usize },
14934        0usize,
14935        concat!(
14936            "Offset of field: ",
14937            stringify!(sd_mbr_command_t__bindgen_ty_1),
14938            "::",
14939            stringify!(copy_sd)
14940        )
14941    );
14942    assert_eq!(
14943        unsafe { &(*(::core::ptr::null::<sd_mbr_command_t__bindgen_ty_1>())).compare as *const _ as usize },
14944        0usize,
14945        concat!(
14946            "Offset of field: ",
14947            stringify!(sd_mbr_command_t__bindgen_ty_1),
14948            "::",
14949            stringify!(compare)
14950        )
14951    );
14952    assert_eq!(
14953        unsafe { &(*(::core::ptr::null::<sd_mbr_command_t__bindgen_ty_1>())).copy_bl as *const _ as usize },
14954        0usize,
14955        concat!(
14956            "Offset of field: ",
14957            stringify!(sd_mbr_command_t__bindgen_ty_1),
14958            "::",
14959            stringify!(copy_bl)
14960        )
14961    );
14962    assert_eq!(
14963        unsafe { &(*(::core::ptr::null::<sd_mbr_command_t__bindgen_ty_1>())).base_set as *const _ as usize },
14964        0usize,
14965        concat!(
14966            "Offset of field: ",
14967            stringify!(sd_mbr_command_t__bindgen_ty_1),
14968            "::",
14969            stringify!(base_set)
14970        )
14971    );
14972    assert_eq!(
14973        unsafe {
14974            &(*(::core::ptr::null::<sd_mbr_command_t__bindgen_ty_1>())).irq_forward_address_set as *const _ as usize
14975        },
14976        0usize,
14977        concat!(
14978            "Offset of field: ",
14979            stringify!(sd_mbr_command_t__bindgen_ty_1),
14980            "::",
14981            stringify!(irq_forward_address_set)
14982        )
14983    );
14984}
14985#[test]
14986fn bindgen_test_layout_sd_mbr_command_t() {
14987    assert_eq!(
14988        ::core::mem::size_of::<sd_mbr_command_t>(),
14989        16usize,
14990        concat!("Size of: ", stringify!(sd_mbr_command_t))
14991    );
14992    assert_eq!(
14993        ::core::mem::align_of::<sd_mbr_command_t>(),
14994        4usize,
14995        concat!("Alignment of ", stringify!(sd_mbr_command_t))
14996    );
14997    assert_eq!(
14998        unsafe { &(*(::core::ptr::null::<sd_mbr_command_t>())).command as *const _ as usize },
14999        0usize,
15000        concat!(
15001            "Offset of field: ",
15002            stringify!(sd_mbr_command_t),
15003            "::",
15004            stringify!(command)
15005        )
15006    );
15007    assert_eq!(
15008        unsafe { &(*(::core::ptr::null::<sd_mbr_command_t>())).params as *const _ as usize },
15009        4usize,
15010        concat!(
15011            "Offset of field: ",
15012            stringify!(sd_mbr_command_t),
15013            "::",
15014            stringify!(params)
15015        )
15016    );
15017}
15018
15019#[doc = "@brief Issue Master Boot Record commands"]
15020#[doc = ""]
15021#[doc = " Commands used when updating a SoftDevice and bootloader."]
15022#[doc = ""]
15023#[doc = " The @ref SD_MBR_COMMAND_COPY_BL and @ref SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET requires"]
15024#[doc = " parameters to be retained by the MBR when resetting the IC. This is done in a separate flash"]
15025#[doc = " page. The location of the flash page should be provided by the application in either"]
15026#[doc = " @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR. If both addresses are set, the MBR"]
15027#[doc = " will prioritize @ref MBR_PARAM_PAGE_ADDR. This page will be cleared by the MBR and is used to"]
15028#[doc = " store the command before reset. When an address is specified, the page it refers to must not be"]
15029#[doc = " used by the application. If no address is provided by the application, i.e. both"]
15030#[doc = " @ref MBR_PARAM_PAGE_ADDR and @ref MBR_UICR_PARAM_PAGE_ADDR is 0xFFFFFFFF, MBR commands which use"]
15031#[doc = " flash will be unavailable and return @ref NRF_ERROR_NO_MEM."]
15032#[doc = ""]
15033#[doc = " @param[in]  param Pointer to a struct describing the command."]
15034#[doc = ""]
15035#[doc = " @note For a complete set of return values, see ::sd_mbr_command_copy_sd_t,"]
15036#[doc = "       ::sd_mbr_command_copy_bl_t, ::sd_mbr_command_compare_t,"]
15037#[doc = "       ::sd_mbr_command_vector_table_base_set_t, ::sd_mbr_command_irq_forward_address_set_t"]
15038#[doc = ""]
15039#[doc = " @retval ::NRF_ERROR_NO_MEM No MBR parameter page provided"]
15040#[doc = " @retval ::NRF_ERROR_INVALID_PARAM if an invalid command is given."]
15041#[inline(always)]
15042pub unsafe fn sd_mbr_command(param: *mut sd_mbr_command_t) -> u32 {
15043    let ret: u32;
15044    core::arch::asm!("svc 24",
15045        inout("r0") to_asm(param) => ret,
15046        lateout("r1") _,
15047        lateout("r2") _,
15048        lateout("r3") _,
15049        lateout("r12") _,
15050    );
15051    ret
15052}
15053
15054#[doc = "< ::sd_softdevice_enable"]
15055pub const NRF_SD_SVCS_SD_SOFTDEVICE_ENABLE: NRF_SD_SVCS = 16;
15056#[doc = "< ::sd_softdevice_disable"]
15057pub const NRF_SD_SVCS_SD_SOFTDEVICE_DISABLE: NRF_SD_SVCS = 17;
15058#[doc = "< ::sd_softdevice_is_enabled"]
15059pub const NRF_SD_SVCS_SD_SOFTDEVICE_IS_ENABLED: NRF_SD_SVCS = 18;
15060#[doc = "< ::sd_softdevice_vector_table_base_set"]
15061pub const NRF_SD_SVCS_SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET: NRF_SD_SVCS = 19;
15062#[doc = "< Placeholder for last SDM SVC"]
15063pub const NRF_SD_SVCS_SVC_SDM_LAST: NRF_SD_SVCS = 20;
15064#[doc = "@brief nRF SoftDevice Manager API SVC numbers."]
15065pub type NRF_SD_SVCS = self::c_uint;
15066#[doc = "@brief Type representing LFCLK oscillator source."]
15067#[repr(C)]
15068#[derive(Debug, Copy, Clone)]
15069pub struct nrf_clock_lf_cfg_t {
15070    #[doc = "< LF oscillator clock source, see @ref NRF_CLOCK_LF_SRC."]
15071    pub source: u8,
15072    #[doc = "< Only for ::NRF_CLOCK_LF_SRC_RC: Calibration timer interval in 1/4 second"]
15073    #[doc = "units (nRF52: 1-32)."]
15074    #[doc = "@note To avoid excessive clock drift, 0.5 degrees Celsius is the"]
15075    #[doc = "maximum temperature change allowed in one calibration timer"]
15076    #[doc = "interval. The interval should be selected to ensure this."]
15077    #[doc = ""]
15078    #[doc = "@note Must be 0 if source is not ::NRF_CLOCK_LF_SRC_RC."]
15079    pub rc_ctiv: u8,
15080    #[doc = "<  Only for ::NRF_CLOCK_LF_SRC_RC: How often (in number of calibration"]
15081    #[doc = "intervals) the RC oscillator shall be calibrated if the temperature"]
15082    #[doc = "hasn't changed."]
15083    #[doc = "0: Always calibrate even if the temperature hasn't changed."]
15084    #[doc = "1: Only calibrate if the temperature has changed (legacy - nRF51 only)."]
15085    #[doc = "2-33: Check the temperature and only calibrate if it has changed,"]
15086    #[doc = "however calibration will take place every rc_temp_ctiv"]
15087    #[doc = "intervals in any case."]
15088    #[doc = ""]
15089    #[doc = "@note Must be 0 if source is not ::NRF_CLOCK_LF_SRC_RC."]
15090    #[doc = ""]
15091    #[doc = "@note For nRF52, the application must ensure calibration at least once"]
15092    #[doc = "every 8 seconds to ensure +/-500 ppm clock stability. The"]
15093    #[doc = "recommended configuration for ::NRF_CLOCK_LF_SRC_RC on nRF52 is"]
15094    #[doc = "rc_ctiv=16 and rc_temp_ctiv=2. This will ensure calibration at"]
15095    #[doc = "least once every 8 seconds and for temperature changes of 0.5"]
15096    #[doc = "degrees Celsius every 4 seconds. See the Product Specification"]
15097    #[doc = "for the nRF52 device being used for more information."]
15098    pub rc_temp_ctiv: u8,
15099    #[doc = "< External clock accuracy used in the LL to compute timing"]
15100    #[doc = "windows, see @ref NRF_CLOCK_LF_ACCURACY."]
15101    pub accuracy: u8,
15102}
15103#[test]
15104fn bindgen_test_layout_nrf_clock_lf_cfg_t() {
15105    assert_eq!(
15106        ::core::mem::size_of::<nrf_clock_lf_cfg_t>(),
15107        4usize,
15108        concat!("Size of: ", stringify!(nrf_clock_lf_cfg_t))
15109    );
15110    assert_eq!(
15111        ::core::mem::align_of::<nrf_clock_lf_cfg_t>(),
15112        1usize,
15113        concat!("Alignment of ", stringify!(nrf_clock_lf_cfg_t))
15114    );
15115    assert_eq!(
15116        unsafe { &(*(::core::ptr::null::<nrf_clock_lf_cfg_t>())).source as *const _ as usize },
15117        0usize,
15118        concat!(
15119            "Offset of field: ",
15120            stringify!(nrf_clock_lf_cfg_t),
15121            "::",
15122            stringify!(source)
15123        )
15124    );
15125    assert_eq!(
15126        unsafe { &(*(::core::ptr::null::<nrf_clock_lf_cfg_t>())).rc_ctiv as *const _ as usize },
15127        1usize,
15128        concat!(
15129            "Offset of field: ",
15130            stringify!(nrf_clock_lf_cfg_t),
15131            "::",
15132            stringify!(rc_ctiv)
15133        )
15134    );
15135    assert_eq!(
15136        unsafe { &(*(::core::ptr::null::<nrf_clock_lf_cfg_t>())).rc_temp_ctiv as *const _ as usize },
15137        2usize,
15138        concat!(
15139            "Offset of field: ",
15140            stringify!(nrf_clock_lf_cfg_t),
15141            "::",
15142            stringify!(rc_temp_ctiv)
15143        )
15144    );
15145    assert_eq!(
15146        unsafe { &(*(::core::ptr::null::<nrf_clock_lf_cfg_t>())).accuracy as *const _ as usize },
15147        3usize,
15148        concat!(
15149            "Offset of field: ",
15150            stringify!(nrf_clock_lf_cfg_t),
15151            "::",
15152            stringify!(accuracy)
15153        )
15154    );
15155}
15156#[doc = "@brief Fault Handler type."]
15157#[doc = ""]
15158#[doc = " When certain unrecoverable errors occur within the application or SoftDevice the fault handler will be called back."]
15159#[doc = " The protocol stack will be in an undefined state when this happens and the only way to recover will be to"]
15160#[doc = " perform a reset, using e.g. CMSIS NVIC_SystemReset()."]
15161#[doc = " If the application returns from the fault handler the SoftDevice will call NVIC_SystemReset()."]
15162#[doc = ""]
15163#[doc = " @note It is recommended to either perform a reset in the fault handler or to let the SoftDevice reset the device."]
15164#[doc = "       Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripherial may"]
15165#[doc = "       continously transmit packets."]
15166#[doc = ""]
15167#[doc = " @note This callback is executed in HardFault context, thus SVC functions cannot be called from the fault callback."]
15168#[doc = ""]
15169#[doc = " @param[in] id Fault identifier. See @ref NRF_FAULT_IDS."]
15170#[doc = " @param[in] pc The program counter of the instruction that triggered the fault."]
15171#[doc = " @param[in] info Optional additional information regarding the fault. Refer to each Fault identifier for details."]
15172#[doc = ""]
15173#[doc = " @note When id is set to @ref NRF_FAULT_ID_APP_MEMACC, pc will contain the address of the instruction being executed at the time when"]
15174#[doc = " the fault is detected by the CPU. The CPU program counter may have advanced up to 2 instructions (no branching) after the one that triggered the fault."]
15175pub type nrf_fault_handler_t = ::core::option::Option<unsafe extern "C" fn(id: u32, pc: u32, info: u32)>;
15176
15177#[doc = "@brief Enables the SoftDevice and by extension the protocol stack."]
15178#[doc = ""]
15179#[doc = " @note Some care must be taken if a low frequency clock source is already running when calling this function:"]
15180#[doc = "       If the LF clock has a different source then the one currently running, it will be stopped. Then, the new"]
15181#[doc = "       clock source will be started."]
15182#[doc = ""]
15183#[doc = " @note This function has no effect when returning with an error."]
15184#[doc = ""]
15185#[doc = " @post If return code is ::NRF_SUCCESS"]
15186#[doc = "       - SoC library and protocol stack APIs are made available."]
15187#[doc = "       - A portion of RAM will be unavailable (see relevant SDS documentation)."]
15188#[doc = "       - Some peripherals will be unavailable or available only through the SoC API (see relevant SDS documentation)."]
15189#[doc = "       - Interrupts will not arrive from protected peripherals or interrupts."]
15190#[doc = "       - nrf_nvic_ functions must be used instead of CMSIS NVIC_ functions for reliable usage of the SoftDevice."]
15191#[doc = "       - Interrupt latency may be affected by the SoftDevice  (see relevant SDS documentation)."]
15192#[doc = "       - Chosen low frequency clock source will be running."]
15193#[doc = ""]
15194#[doc = " @param p_clock_lf_cfg Low frequency clock source and accuracy."]
15195#[doc = "If NULL the clock will be configured as an RC source with rc_ctiv = 16 and .rc_temp_ctiv = 2"]
15196#[doc = "In the case of XTAL source, the PPM accuracy of the chosen clock source must be greater than or equal to the actual characteristics of your XTAL clock."]
15197#[doc = " @param fault_handler Callback to be invoked in case of fault, cannot be NULL."]
15198#[doc = ""]
15199#[doc = " @retval ::NRF_SUCCESS"]
15200#[doc = " @retval ::NRF_ERROR_INVALID_ADDR  Invalid or NULL pointer supplied."]
15201#[doc = " @retval ::NRF_ERROR_INVALID_STATE SoftDevice is already enabled, and the clock source and fault handler cannot be updated."]
15202#[doc = " @retval ::NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION SoftDevice interrupt is already enabled, or an enabled interrupt has an illegal priority level."]
15203#[doc = " @retval ::NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN Unknown low frequency clock source selected."]
15204#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid clock source configuration supplied in p_clock_lf_cfg."]
15205#[inline(always)]
15206pub unsafe fn sd_softdevice_enable(
15207    p_clock_lf_cfg: *const nrf_clock_lf_cfg_t,
15208    fault_handler: nrf_fault_handler_t,
15209) -> u32 {
15210    let ret: u32;
15211    core::arch::asm!("svc 16",
15212        inout("r0") to_asm(p_clock_lf_cfg) => ret,
15213        inout("r1") to_asm(fault_handler) => _,
15214        lateout("r2") _,
15215        lateout("r3") _,
15216        lateout("r12") _,
15217    );
15218    ret
15219}
15220
15221#[doc = "@brief Disables the SoftDevice and by extension the protocol stack."]
15222#[doc = ""]
15223#[doc = " Idempotent function to disable the SoftDevice."]
15224#[doc = ""]
15225#[doc = " @post SoC library and protocol stack APIs are made unavailable."]
15226#[doc = " @post All interrupts that was protected by the SoftDevice will be disabled and initialized to priority 0 (highest)."]
15227#[doc = " @post All peripherals used by the SoftDevice will be reset to default values."]
15228#[doc = " @post All of RAM become available."]
15229#[doc = " @post All interrupts are forwarded to the application."]
15230#[doc = " @post LFCLK source chosen in ::sd_softdevice_enable will be left running."]
15231#[doc = ""]
15232#[doc = " @retval ::NRF_SUCCESS"]
15233#[inline(always)]
15234pub unsafe fn sd_softdevice_disable() -> u32 {
15235    let ret: u32;
15236    core::arch::asm!("svc 17",
15237        lateout("r0") ret,
15238        lateout("r1") _,
15239        lateout("r2") _,
15240        lateout("r3") _,
15241        lateout("r12") _,
15242    );
15243    ret
15244}
15245
15246#[doc = "@brief Check if the SoftDevice is enabled."]
15247#[doc = ""]
15248#[doc = " @param[out]  p_softdevice_enabled If the SoftDevice is enabled: 1 else 0."]
15249#[doc = ""]
15250#[doc = " @retval ::NRF_SUCCESS"]
15251#[inline(always)]
15252pub unsafe fn sd_softdevice_is_enabled(p_softdevice_enabled: *mut u8) -> u32 {
15253    let ret: u32;
15254    core::arch::asm!("svc 18",
15255        inout("r0") to_asm(p_softdevice_enabled) => ret,
15256        lateout("r1") _,
15257        lateout("r2") _,
15258        lateout("r3") _,
15259        lateout("r12") _,
15260    );
15261    ret
15262}
15263
15264#[doc = "@brief Sets the base address of the interrupt vector table for interrupts forwarded from the SoftDevice"]
15265#[doc = ""]
15266#[doc = " This function is only intended to be called when a bootloader is enabled."]
15267#[doc = ""]
15268#[doc = " @param[in] address The base address of the interrupt vector table for forwarded interrupts."]
15269#[doc = ""]
15270#[doc = " @retval ::NRF_SUCCESS"]
15271#[inline(always)]
15272pub unsafe fn sd_softdevice_vector_table_base_set(address: u32) -> u32 {
15273    let ret: u32;
15274    core::arch::asm!("svc 19",
15275        inout("r0") to_asm(address) => ret,
15276        lateout("r1") _,
15277        lateout("r2") _,
15278        lateout("r3") _,
15279        lateout("r12") _,
15280    );
15281    ret
15282}