mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 00:02:28 +00:00
Merge pull request #3345 from CBJamo/rp2350_clock_padiso
rp23: Disable pad isolation on clock in/out pins
This commit is contained in:
commit
cc9e2a51da
@ -847,6 +847,10 @@ impl<'d, T: GpinPin> Gpin<'d, T> {
|
|||||||
into_ref!(gpin);
|
into_ref!(gpin);
|
||||||
|
|
||||||
gpin.gpio().ctrl().write(|w| w.set_funcsel(0x08));
|
gpin.gpio().ctrl().write(|w| w.set_funcsel(0x08));
|
||||||
|
#[cfg(feature = "_rp235x")]
|
||||||
|
gpin.pad_ctrl().write(|w| {
|
||||||
|
w.set_iso(false);
|
||||||
|
});
|
||||||
|
|
||||||
Gpin {
|
Gpin {
|
||||||
gpin: gpin.map_into(),
|
gpin: gpin.map_into(),
|
||||||
@ -861,6 +865,7 @@ impl<'d, T: GpinPin> Gpin<'d, T> {
|
|||||||
|
|
||||||
impl<'d, T: GpinPin> Drop for Gpin<'d, T> {
|
impl<'d, T: GpinPin> Drop for Gpin<'d, T> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
|
self.gpin.pad_ctrl().write(|_| {});
|
||||||
self.gpin
|
self.gpin
|
||||||
.gpio()
|
.gpio()
|
||||||
.ctrl()
|
.ctrl()
|
||||||
@ -921,11 +926,15 @@ pub struct Gpout<'d, T: GpoutPin> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'d, T: GpoutPin> Gpout<'d, T> {
|
impl<'d, T: GpoutPin> Gpout<'d, T> {
|
||||||
/// Create new general purpose cloud output.
|
/// Create new general purpose clock output.
|
||||||
pub fn new(gpout: impl Peripheral<P = T> + 'd) -> Self {
|
pub fn new(gpout: impl Peripheral<P = T> + 'd) -> Self {
|
||||||
into_ref!(gpout);
|
into_ref!(gpout);
|
||||||
|
|
||||||
gpout.gpio().ctrl().write(|w| w.set_funcsel(0x08));
|
gpout.gpio().ctrl().write(|w| w.set_funcsel(0x08));
|
||||||
|
#[cfg(feature = "_rp235x")]
|
||||||
|
gpout.pad_ctrl().write(|w| {
|
||||||
|
w.set_iso(false);
|
||||||
|
});
|
||||||
|
|
||||||
Self { gpout }
|
Self { gpout }
|
||||||
}
|
}
|
||||||
@ -1005,6 +1014,7 @@ impl<'d, T: GpoutPin> Gpout<'d, T> {
|
|||||||
impl<'d, T: GpoutPin> Drop for Gpout<'d, T> {
|
impl<'d, T: GpoutPin> Drop for Gpout<'d, T> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
self.disable();
|
self.disable();
|
||||||
|
self.gpout.pad_ctrl().write(|_| {});
|
||||||
self.gpout
|
self.gpout
|
||||||
.gpio()
|
.gpio()
|
||||||
.ctrl()
|
.ctrl()
|
||||||
|
Loading…
Reference in New Issue
Block a user