1
1
//! General Purpose Input / Output
2
2
3
+ use core:: convert:: Infallible ;
3
4
use core:: marker:: PhantomData ;
4
5
5
6
#[ cfg( feature = "unproven" ) ]
@@ -142,7 +143,7 @@ macro_rules! gpio {
142
143
}
143
144
144
145
impl <MODE > OutputPin for PXx <Output <MODE >> {
145
- type Error = ( ) ;
146
+ type Error = Infallible ;
146
147
147
148
fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
148
149
// NOTE(unsafe, write) atomic write to a stateless register
@@ -181,7 +182,7 @@ macro_rules! gpio {
181
182
182
183
#[ cfg( feature = "unproven" ) ]
183
184
impl <MODE > InputPin for PXx <Input <MODE >> {
184
- type Error = ( ) ;
185
+ type Error = Infallible ;
185
186
186
187
fn is_high( & self ) -> Result <bool , Self :: Error > {
187
188
Ok ( !self . is_low( ) ?)
@@ -239,6 +240,7 @@ macro_rules! gpio {
239
240
) ) ) ) ]
240
241
pub mod $gpiox {
241
242
use core:: marker:: PhantomData ;
243
+ use core:: convert:: Infallible ;
242
244
243
245
use crate :: hal:: digital:: v2:: OutputPin ;
244
246
#[ cfg( feature = "unproven" ) ]
@@ -380,7 +382,7 @@ macro_rules! gpio {
380
382
}
381
383
382
384
impl <MODE > OutputPin for $PXx<Output <MODE >> {
383
- type Error = ( ) ;
385
+ type Error = Infallible ;
384
386
385
387
fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
386
388
// NOTE(unsafe, write) atomic write to a stateless register
@@ -397,7 +399,7 @@ macro_rules! gpio {
397
399
398
400
#[ cfg( feature = "unproven" ) ]
399
401
impl <MODE > InputPin for $PXx<Input <MODE >> {
400
- type Error = ( ) ;
402
+ type Error = Infallible ;
401
403
402
404
fn is_high( & self ) -> Result <bool , Self :: Error > {
403
405
Ok ( !self . is_low( ) ?)
@@ -656,7 +658,7 @@ macro_rules! gpio {
656
658
}
657
659
658
660
impl <MODE > OutputPin for $PXi<Output <MODE >> {
659
- type Error = ( ) ;
661
+ type Error = Infallible ;
660
662
661
663
fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
662
664
// NOTE(unsafe, write) atomic write to a stateless register
@@ -673,7 +675,7 @@ macro_rules! gpio {
673
675
674
676
#[ cfg( feature = "unproven" ) ]
675
677
impl <MODE > InputPin for $PXi<Input <MODE >> {
676
- type Error = ( ) ;
678
+ type Error = Infallible ;
677
679
678
680
fn is_high( & self ) -> Result <bool , Self :: Error > {
679
681
Ok ( !self . is_low( ) ?)
0 commit comments