stm32ral/stm32g4/instances/
gpio.rs

1#![allow(non_snake_case, non_upper_case_globals)]
2#![allow(non_camel_case_types)]
3//! General-purpose I/Os
4//!
5//! Used by: stm32g431, stm32g441, stm32g471, stm32g473, stm32g474, stm32g483, stm32g484, stm32g491, stm32g4a1
6
7#[cfg(not(feature = "nosync"))]
8pub use crate::stm32g4::peripherals::gpio::Instance;
9pub use crate::stm32g4::peripherals::gpio::{RegisterBlock, ResetValues};
10pub use crate::stm32g4::peripherals::gpio::{
11    AFRH, AFRL, BRR, BSRR, IDR, LCKR, MODER, ODR, OSPEEDR, OTYPER, PUPDR,
12};
13
14/// Access functions for the GPIOA peripheral instance
15pub mod GPIOA {
16    use super::ResetValues;
17
18    #[cfg(not(feature = "nosync"))]
19    use super::Instance;
20
21    #[cfg(not(feature = "nosync"))]
22    const INSTANCE: Instance = Instance {
23        addr: 0x48000000,
24        _marker: ::core::marker::PhantomData,
25    };
26
27    /// Reset values for each field in GPIOA
28    pub const reset: ResetValues = ResetValues {
29        MODER: 0xABFFFFFF,
30        OTYPER: 0x00000000,
31        OSPEEDR: 0x0C000000,
32        PUPDR: 0x64000000,
33        IDR: 0x00000000,
34        ODR: 0x00000000,
35        BSRR: 0x00000000,
36        LCKR: 0x00000000,
37        AFRL: 0x00000000,
38        AFRH: 0x00000000,
39        BRR: 0x00000000,
40    };
41
42    #[cfg(not(feature = "nosync"))]
43    #[allow(renamed_and_removed_lints)]
44    #[allow(private_no_mangle_statics)]
45    #[no_mangle]
46    static mut GPIOA_TAKEN: bool = false;
47
48    /// Safe access to GPIOA
49    ///
50    /// This function returns `Some(Instance)` if this instance is not
51    /// currently taken, and `None` if it is. This ensures that if you
52    /// do get `Some(Instance)`, you are ensured unique access to
53    /// the peripheral and there cannot be data races (unless other
54    /// code uses `unsafe`, of course). You can then pass the
55    /// `Instance` around to other functions as required. When you're
56    /// done with it, you can call `release(instance)` to return it.
57    ///
58    /// `Instance` itself dereferences to a `RegisterBlock`, which
59    /// provides access to the peripheral's registers.
60    #[cfg(not(feature = "nosync"))]
61    #[inline]
62    pub fn take() -> Option<Instance> {
63        external_cortex_m::interrupt::free(|_| unsafe {
64            if GPIOA_TAKEN {
65                None
66            } else {
67                GPIOA_TAKEN = true;
68                Some(INSTANCE)
69            }
70        })
71    }
72
73    /// Release exclusive access to GPIOA
74    ///
75    /// This function allows you to return an `Instance` so that it
76    /// is available to `take()` again. This function will panic if
77    /// you return a different `Instance` or if this instance is not
78    /// already taken.
79    #[cfg(not(feature = "nosync"))]
80    #[inline]
81    pub fn release(inst: Instance) {
82        external_cortex_m::interrupt::free(|_| unsafe {
83            if GPIOA_TAKEN && inst.addr == INSTANCE.addr {
84                GPIOA_TAKEN = false;
85            } else {
86                panic!("Released a peripheral which was not taken");
87            }
88        });
89    }
90
91    /// Unsafely steal GPIOA
92    ///
93    /// This function is similar to take() but forcibly takes the
94    /// Instance, marking it as taken irregardless of its previous
95    /// state.
96    #[cfg(not(feature = "nosync"))]
97    #[inline]
98    pub unsafe fn steal() -> Instance {
99        GPIOA_TAKEN = true;
100        INSTANCE
101    }
102}
103
104/// Raw pointer to GPIOA
105///
106/// Dereferencing this is unsafe because you are not ensured unique
107/// access to the peripheral, so you may encounter data races with
108/// other users of this peripheral. It is up to you to ensure you
109/// will not cause data races.
110///
111/// This constant is provided for ease of use in unsafe code: you can
112/// simply call for example `write_reg!(gpio, GPIOA, ODR, 1);`.
113pub const GPIOA: *const RegisterBlock = 0x48000000 as *const _;
114
115/// Access functions for the GPIOB peripheral instance
116pub mod GPIOB {
117    use super::ResetValues;
118
119    #[cfg(not(feature = "nosync"))]
120    use super::Instance;
121
122    #[cfg(not(feature = "nosync"))]
123    const INSTANCE: Instance = Instance {
124        addr: 0x48000400,
125        _marker: ::core::marker::PhantomData,
126    };
127
128    /// Reset values for each field in GPIOB
129    pub const reset: ResetValues = ResetValues {
130        MODER: 0xFFFFFEBF,
131        OTYPER: 0x00000000,
132        OSPEEDR: 0x000000C0,
133        PUPDR: 0x00000100,
134        IDR: 0x00000000,
135        ODR: 0x00000000,
136        BSRR: 0x00000000,
137        LCKR: 0x00000000,
138        AFRL: 0x00000000,
139        AFRH: 0x00000000,
140        BRR: 0x00000000,
141    };
142
143    #[cfg(not(feature = "nosync"))]
144    #[allow(renamed_and_removed_lints)]
145    #[allow(private_no_mangle_statics)]
146    #[no_mangle]
147    static mut GPIOB_TAKEN: bool = false;
148
149    /// Safe access to GPIOB
150    ///
151    /// This function returns `Some(Instance)` if this instance is not
152    /// currently taken, and `None` if it is. This ensures that if you
153    /// do get `Some(Instance)`, you are ensured unique access to
154    /// the peripheral and there cannot be data races (unless other
155    /// code uses `unsafe`, of course). You can then pass the
156    /// `Instance` around to other functions as required. When you're
157    /// done with it, you can call `release(instance)` to return it.
158    ///
159    /// `Instance` itself dereferences to a `RegisterBlock`, which
160    /// provides access to the peripheral's registers.
161    #[cfg(not(feature = "nosync"))]
162    #[inline]
163    pub fn take() -> Option<Instance> {
164        external_cortex_m::interrupt::free(|_| unsafe {
165            if GPIOB_TAKEN {
166                None
167            } else {
168                GPIOB_TAKEN = true;
169                Some(INSTANCE)
170            }
171        })
172    }
173
174    /// Release exclusive access to GPIOB
175    ///
176    /// This function allows you to return an `Instance` so that it
177    /// is available to `take()` again. This function will panic if
178    /// you return a different `Instance` or if this instance is not
179    /// already taken.
180    #[cfg(not(feature = "nosync"))]
181    #[inline]
182    pub fn release(inst: Instance) {
183        external_cortex_m::interrupt::free(|_| unsafe {
184            if GPIOB_TAKEN && inst.addr == INSTANCE.addr {
185                GPIOB_TAKEN = false;
186            } else {
187                panic!("Released a peripheral which was not taken");
188            }
189        });
190    }
191
192    /// Unsafely steal GPIOB
193    ///
194    /// This function is similar to take() but forcibly takes the
195    /// Instance, marking it as taken irregardless of its previous
196    /// state.
197    #[cfg(not(feature = "nosync"))]
198    #[inline]
199    pub unsafe fn steal() -> Instance {
200        GPIOB_TAKEN = true;
201        INSTANCE
202    }
203}
204
205/// Raw pointer to GPIOB
206///
207/// Dereferencing this is unsafe because you are not ensured unique
208/// access to the peripheral, so you may encounter data races with
209/// other users of this peripheral. It is up to you to ensure you
210/// will not cause data races.
211///
212/// This constant is provided for ease of use in unsafe code: you can
213/// simply call for example `write_reg!(gpio, GPIOA, ODR, 1);`.
214pub const GPIOB: *const RegisterBlock = 0x48000400 as *const _;
215
216/// Access functions for the GPIOC peripheral instance
217pub mod GPIOC {
218    use super::ResetValues;
219
220    #[cfg(not(feature = "nosync"))]
221    use super::Instance;
222
223    #[cfg(not(feature = "nosync"))]
224    const INSTANCE: Instance = Instance {
225        addr: 0x48000800,
226        _marker: ::core::marker::PhantomData,
227    };
228
229    /// Reset values for each field in GPIOC
230    pub const reset: ResetValues = ResetValues {
231        MODER: 0xFFFFFFFF,
232        OTYPER: 0x00000000,
233        OSPEEDR: 0x00000000,
234        PUPDR: 0x00000000,
235        IDR: 0x00000000,
236        ODR: 0x00000000,
237        BSRR: 0x00000000,
238        LCKR: 0x00000000,
239        AFRL: 0x00000000,
240        AFRH: 0x00000000,
241        BRR: 0x00000000,
242    };
243
244    #[cfg(not(feature = "nosync"))]
245    #[allow(renamed_and_removed_lints)]
246    #[allow(private_no_mangle_statics)]
247    #[no_mangle]
248    static mut GPIOC_TAKEN: bool = false;
249
250    /// Safe access to GPIOC
251    ///
252    /// This function returns `Some(Instance)` if this instance is not
253    /// currently taken, and `None` if it is. This ensures that if you
254    /// do get `Some(Instance)`, you are ensured unique access to
255    /// the peripheral and there cannot be data races (unless other
256    /// code uses `unsafe`, of course). You can then pass the
257    /// `Instance` around to other functions as required. When you're
258    /// done with it, you can call `release(instance)` to return it.
259    ///
260    /// `Instance` itself dereferences to a `RegisterBlock`, which
261    /// provides access to the peripheral's registers.
262    #[cfg(not(feature = "nosync"))]
263    #[inline]
264    pub fn take() -> Option<Instance> {
265        external_cortex_m::interrupt::free(|_| unsafe {
266            if GPIOC_TAKEN {
267                None
268            } else {
269                GPIOC_TAKEN = true;
270                Some(INSTANCE)
271            }
272        })
273    }
274
275    /// Release exclusive access to GPIOC
276    ///
277    /// This function allows you to return an `Instance` so that it
278    /// is available to `take()` again. This function will panic if
279    /// you return a different `Instance` or if this instance is not
280    /// already taken.
281    #[cfg(not(feature = "nosync"))]
282    #[inline]
283    pub fn release(inst: Instance) {
284        external_cortex_m::interrupt::free(|_| unsafe {
285            if GPIOC_TAKEN && inst.addr == INSTANCE.addr {
286                GPIOC_TAKEN = false;
287            } else {
288                panic!("Released a peripheral which was not taken");
289            }
290        });
291    }
292
293    /// Unsafely steal GPIOC
294    ///
295    /// This function is similar to take() but forcibly takes the
296    /// Instance, marking it as taken irregardless of its previous
297    /// state.
298    #[cfg(not(feature = "nosync"))]
299    #[inline]
300    pub unsafe fn steal() -> Instance {
301        GPIOC_TAKEN = true;
302        INSTANCE
303    }
304}
305
306/// Raw pointer to GPIOC
307///
308/// Dereferencing this is unsafe because you are not ensured unique
309/// access to the peripheral, so you may encounter data races with
310/// other users of this peripheral. It is up to you to ensure you
311/// will not cause data races.
312///
313/// This constant is provided for ease of use in unsafe code: you can
314/// simply call for example `write_reg!(gpio, GPIOA, ODR, 1);`.
315pub const GPIOC: *const RegisterBlock = 0x48000800 as *const _;
316
317/// Access functions for the GPIOD peripheral instance
318pub mod GPIOD {
319    use super::ResetValues;
320
321    #[cfg(not(feature = "nosync"))]
322    use super::Instance;
323
324    #[cfg(not(feature = "nosync"))]
325    const INSTANCE: Instance = Instance {
326        addr: 0x48000c00,
327        _marker: ::core::marker::PhantomData,
328    };
329
330    /// Reset values for each field in GPIOD
331    pub const reset: ResetValues = ResetValues {
332        MODER: 0xFFFFFFFF,
333        OTYPER: 0x00000000,
334        OSPEEDR: 0x00000000,
335        PUPDR: 0x00000000,
336        IDR: 0x00000000,
337        ODR: 0x00000000,
338        BSRR: 0x00000000,
339        LCKR: 0x00000000,
340        AFRL: 0x00000000,
341        AFRH: 0x00000000,
342        BRR: 0x00000000,
343    };
344
345    #[cfg(not(feature = "nosync"))]
346    #[allow(renamed_and_removed_lints)]
347    #[allow(private_no_mangle_statics)]
348    #[no_mangle]
349    static mut GPIOD_TAKEN: bool = false;
350
351    /// Safe access to GPIOD
352    ///
353    /// This function returns `Some(Instance)` if this instance is not
354    /// currently taken, and `None` if it is. This ensures that if you
355    /// do get `Some(Instance)`, you are ensured unique access to
356    /// the peripheral and there cannot be data races (unless other
357    /// code uses `unsafe`, of course). You can then pass the
358    /// `Instance` around to other functions as required. When you're
359    /// done with it, you can call `release(instance)` to return it.
360    ///
361    /// `Instance` itself dereferences to a `RegisterBlock`, which
362    /// provides access to the peripheral's registers.
363    #[cfg(not(feature = "nosync"))]
364    #[inline]
365    pub fn take() -> Option<Instance> {
366        external_cortex_m::interrupt::free(|_| unsafe {
367            if GPIOD_TAKEN {
368                None
369            } else {
370                GPIOD_TAKEN = true;
371                Some(INSTANCE)
372            }
373        })
374    }
375
376    /// Release exclusive access to GPIOD
377    ///
378    /// This function allows you to return an `Instance` so that it
379    /// is available to `take()` again. This function will panic if
380    /// you return a different `Instance` or if this instance is not
381    /// already taken.
382    #[cfg(not(feature = "nosync"))]
383    #[inline]
384    pub fn release(inst: Instance) {
385        external_cortex_m::interrupt::free(|_| unsafe {
386            if GPIOD_TAKEN && inst.addr == INSTANCE.addr {
387                GPIOD_TAKEN = false;
388            } else {
389                panic!("Released a peripheral which was not taken");
390            }
391        });
392    }
393
394    /// Unsafely steal GPIOD
395    ///
396    /// This function is similar to take() but forcibly takes the
397    /// Instance, marking it as taken irregardless of its previous
398    /// state.
399    #[cfg(not(feature = "nosync"))]
400    #[inline]
401    pub unsafe fn steal() -> Instance {
402        GPIOD_TAKEN = true;
403        INSTANCE
404    }
405}
406
407/// Raw pointer to GPIOD
408///
409/// Dereferencing this is unsafe because you are not ensured unique
410/// access to the peripheral, so you may encounter data races with
411/// other users of this peripheral. It is up to you to ensure you
412/// will not cause data races.
413///
414/// This constant is provided for ease of use in unsafe code: you can
415/// simply call for example `write_reg!(gpio, GPIOA, ODR, 1);`.
416pub const GPIOD: *const RegisterBlock = 0x48000c00 as *const _;
417
418/// Access functions for the GPIOE peripheral instance
419pub mod GPIOE {
420    use super::ResetValues;
421
422    #[cfg(not(feature = "nosync"))]
423    use super::Instance;
424
425    #[cfg(not(feature = "nosync"))]
426    const INSTANCE: Instance = Instance {
427        addr: 0x48001000,
428        _marker: ::core::marker::PhantomData,
429    };
430
431    /// Reset values for each field in GPIOE
432    pub const reset: ResetValues = ResetValues {
433        MODER: 0xFFFFFFFF,
434        OTYPER: 0x00000000,
435        OSPEEDR: 0x00000000,
436        PUPDR: 0x00000000,
437        IDR: 0x00000000,
438        ODR: 0x00000000,
439        BSRR: 0x00000000,
440        LCKR: 0x00000000,
441        AFRL: 0x00000000,
442        AFRH: 0x00000000,
443        BRR: 0x00000000,
444    };
445
446    #[cfg(not(feature = "nosync"))]
447    #[allow(renamed_and_removed_lints)]
448    #[allow(private_no_mangle_statics)]
449    #[no_mangle]
450    static mut GPIOE_TAKEN: bool = false;
451
452    /// Safe access to GPIOE
453    ///
454    /// This function returns `Some(Instance)` if this instance is not
455    /// currently taken, and `None` if it is. This ensures that if you
456    /// do get `Some(Instance)`, you are ensured unique access to
457    /// the peripheral and there cannot be data races (unless other
458    /// code uses `unsafe`, of course). You can then pass the
459    /// `Instance` around to other functions as required. When you're
460    /// done with it, you can call `release(instance)` to return it.
461    ///
462    /// `Instance` itself dereferences to a `RegisterBlock`, which
463    /// provides access to the peripheral's registers.
464    #[cfg(not(feature = "nosync"))]
465    #[inline]
466    pub fn take() -> Option<Instance> {
467        external_cortex_m::interrupt::free(|_| unsafe {
468            if GPIOE_TAKEN {
469                None
470            } else {
471                GPIOE_TAKEN = true;
472                Some(INSTANCE)
473            }
474        })
475    }
476
477    /// Release exclusive access to GPIOE
478    ///
479    /// This function allows you to return an `Instance` so that it
480    /// is available to `take()` again. This function will panic if
481    /// you return a different `Instance` or if this instance is not
482    /// already taken.
483    #[cfg(not(feature = "nosync"))]
484    #[inline]
485    pub fn release(inst: Instance) {
486        external_cortex_m::interrupt::free(|_| unsafe {
487            if GPIOE_TAKEN && inst.addr == INSTANCE.addr {
488                GPIOE_TAKEN = false;
489            } else {
490                panic!("Released a peripheral which was not taken");
491            }
492        });
493    }
494
495    /// Unsafely steal GPIOE
496    ///
497    /// This function is similar to take() but forcibly takes the
498    /// Instance, marking it as taken irregardless of its previous
499    /// state.
500    #[cfg(not(feature = "nosync"))]
501    #[inline]
502    pub unsafe fn steal() -> Instance {
503        GPIOE_TAKEN = true;
504        INSTANCE
505    }
506}
507
508/// Raw pointer to GPIOE
509///
510/// Dereferencing this is unsafe because you are not ensured unique
511/// access to the peripheral, so you may encounter data races with
512/// other users of this peripheral. It is up to you to ensure you
513/// will not cause data races.
514///
515/// This constant is provided for ease of use in unsafe code: you can
516/// simply call for example `write_reg!(gpio, GPIOA, ODR, 1);`.
517pub const GPIOE: *const RegisterBlock = 0x48001000 as *const _;
518
519/// Access functions for the GPIOF peripheral instance
520pub mod GPIOF {
521    use super::ResetValues;
522
523    #[cfg(not(feature = "nosync"))]
524    use super::Instance;
525
526    #[cfg(not(feature = "nosync"))]
527    const INSTANCE: Instance = Instance {
528        addr: 0x48001400,
529        _marker: ::core::marker::PhantomData,
530    };
531
532    /// Reset values for each field in GPIOF
533    pub const reset: ResetValues = ResetValues {
534        MODER: 0xFFFFFFFF,
535        OTYPER: 0x00000000,
536        OSPEEDR: 0x00000000,
537        PUPDR: 0x00000000,
538        IDR: 0x00000000,
539        ODR: 0x00000000,
540        BSRR: 0x00000000,
541        LCKR: 0x00000000,
542        AFRL: 0x00000000,
543        AFRH: 0x00000000,
544        BRR: 0x00000000,
545    };
546
547    #[cfg(not(feature = "nosync"))]
548    #[allow(renamed_and_removed_lints)]
549    #[allow(private_no_mangle_statics)]
550    #[no_mangle]
551    static mut GPIOF_TAKEN: bool = false;
552
553    /// Safe access to GPIOF
554    ///
555    /// This function returns `Some(Instance)` if this instance is not
556    /// currently taken, and `None` if it is. This ensures that if you
557    /// do get `Some(Instance)`, you are ensured unique access to
558    /// the peripheral and there cannot be data races (unless other
559    /// code uses `unsafe`, of course). You can then pass the
560    /// `Instance` around to other functions as required. When you're
561    /// done with it, you can call `release(instance)` to return it.
562    ///
563    /// `Instance` itself dereferences to a `RegisterBlock`, which
564    /// provides access to the peripheral's registers.
565    #[cfg(not(feature = "nosync"))]
566    #[inline]
567    pub fn take() -> Option<Instance> {
568        external_cortex_m::interrupt::free(|_| unsafe {
569            if GPIOF_TAKEN {
570                None
571            } else {
572                GPIOF_TAKEN = true;
573                Some(INSTANCE)
574            }
575        })
576    }
577
578    /// Release exclusive access to GPIOF
579    ///
580    /// This function allows you to return an `Instance` so that it
581    /// is available to `take()` again. This function will panic if
582    /// you return a different `Instance` or if this instance is not
583    /// already taken.
584    #[cfg(not(feature = "nosync"))]
585    #[inline]
586    pub fn release(inst: Instance) {
587        external_cortex_m::interrupt::free(|_| unsafe {
588            if GPIOF_TAKEN && inst.addr == INSTANCE.addr {
589                GPIOF_TAKEN = false;
590            } else {
591                panic!("Released a peripheral which was not taken");
592            }
593        });
594    }
595
596    /// Unsafely steal GPIOF
597    ///
598    /// This function is similar to take() but forcibly takes the
599    /// Instance, marking it as taken irregardless of its previous
600    /// state.
601    #[cfg(not(feature = "nosync"))]
602    #[inline]
603    pub unsafe fn steal() -> Instance {
604        GPIOF_TAKEN = true;
605        INSTANCE
606    }
607}
608
609/// Raw pointer to GPIOF
610///
611/// Dereferencing this is unsafe because you are not ensured unique
612/// access to the peripheral, so you may encounter data races with
613/// other users of this peripheral. It is up to you to ensure you
614/// will not cause data races.
615///
616/// This constant is provided for ease of use in unsafe code: you can
617/// simply call for example `write_reg!(gpio, GPIOA, ODR, 1);`.
618pub const GPIOF: *const RegisterBlock = 0x48001400 as *const _;
619
620/// Access functions for the GPIOG peripheral instance
621pub mod GPIOG {
622    use super::ResetValues;
623
624    #[cfg(not(feature = "nosync"))]
625    use super::Instance;
626
627    #[cfg(not(feature = "nosync"))]
628    const INSTANCE: Instance = Instance {
629        addr: 0x48001800,
630        _marker: ::core::marker::PhantomData,
631    };
632
633    /// Reset values for each field in GPIOG
634    pub const reset: ResetValues = ResetValues {
635        MODER: 0xFFFFFFFF,
636        OTYPER: 0x00000000,
637        OSPEEDR: 0x00000000,
638        PUPDR: 0x00000000,
639        IDR: 0x00000000,
640        ODR: 0x00000000,
641        BSRR: 0x00000000,
642        LCKR: 0x00000000,
643        AFRL: 0x00000000,
644        AFRH: 0x00000000,
645        BRR: 0x00000000,
646    };
647
648    #[cfg(not(feature = "nosync"))]
649    #[allow(renamed_and_removed_lints)]
650    #[allow(private_no_mangle_statics)]
651    #[no_mangle]
652    static mut GPIOG_TAKEN: bool = false;
653
654    /// Safe access to GPIOG
655    ///
656    /// This function returns `Some(Instance)` if this instance is not
657    /// currently taken, and `None` if it is. This ensures that if you
658    /// do get `Some(Instance)`, you are ensured unique access to
659    /// the peripheral and there cannot be data races (unless other
660    /// code uses `unsafe`, of course). You can then pass the
661    /// `Instance` around to other functions as required. When you're
662    /// done with it, you can call `release(instance)` to return it.
663    ///
664    /// `Instance` itself dereferences to a `RegisterBlock`, which
665    /// provides access to the peripheral's registers.
666    #[cfg(not(feature = "nosync"))]
667    #[inline]
668    pub fn take() -> Option<Instance> {
669        external_cortex_m::interrupt::free(|_| unsafe {
670            if GPIOG_TAKEN {
671                None
672            } else {
673                GPIOG_TAKEN = true;
674                Some(INSTANCE)
675            }
676        })
677    }
678
679    /// Release exclusive access to GPIOG
680    ///
681    /// This function allows you to return an `Instance` so that it
682    /// is available to `take()` again. This function will panic if
683    /// you return a different `Instance` or if this instance is not
684    /// already taken.
685    #[cfg(not(feature = "nosync"))]
686    #[inline]
687    pub fn release(inst: Instance) {
688        external_cortex_m::interrupt::free(|_| unsafe {
689            if GPIOG_TAKEN && inst.addr == INSTANCE.addr {
690                GPIOG_TAKEN = false;
691            } else {
692                panic!("Released a peripheral which was not taken");
693            }
694        });
695    }
696
697    /// Unsafely steal GPIOG
698    ///
699    /// This function is similar to take() but forcibly takes the
700    /// Instance, marking it as taken irregardless of its previous
701    /// state.
702    #[cfg(not(feature = "nosync"))]
703    #[inline]
704    pub unsafe fn steal() -> Instance {
705        GPIOG_TAKEN = true;
706        INSTANCE
707    }
708}
709
710/// Raw pointer to GPIOG
711///
712/// Dereferencing this is unsafe because you are not ensured unique
713/// access to the peripheral, so you may encounter data races with
714/// other users of this peripheral. It is up to you to ensure you
715/// will not cause data races.
716///
717/// This constant is provided for ease of use in unsafe code: you can
718/// simply call for example `write_reg!(gpio, GPIOA, ODR, 1);`.
719pub const GPIOG: *const RegisterBlock = 0x48001800 as *const _;