@@ -5,7 +5,7 @@ use crate::pac;
55use crate :: sysctl:: { self , APB0 } ;
66use crate :: fpioa:: { IoPin , Pull , Mode } ;
77use crate :: bit_utils:: { u32_set_bit, u32_toggle_bit, u32_bit_is_set, u32_bit_is_clear} ;
8- use embedded_hal:: digital:: v2 :: { OutputPin , StatefulOutputPin , InputPin , ToggleableOutputPin } ;
8+ use embedded_hal:: digital:: { OutputPin , StatefulOutputPin , InputPin , ToggleableOutputPin } ;
99
1010/// Extension trait to split a GPIO peripheral into independent pins
1111pub trait GpioExt {
@@ -169,14 +169,14 @@ impl<GPIO: GpioIndex, PIN: IoPin, MODE: Active> Gpio<GPIO, PIN, MODE> {
169169impl < GPIO : GpioIndex , PIN , MODE > InputPin for Gpio < GPIO , PIN , Input < MODE > > {
170170 type Error = core:: convert:: Infallible ;
171171
172- fn is_high ( & self ) -> Result < bool , Self :: Error > {
172+ fn try_is_high ( & self ) -> Result < bool , Self :: Error > {
173173 Ok ( unsafe {
174174 let p = & ( * pac:: GPIO :: ptr ( ) ) . data_input as * const _ as * const _ ;
175175 u32_bit_is_set ( p, GPIO :: INDEX as usize )
176176 } )
177177 }
178178
179- fn is_low ( & self ) -> Result < bool , Self :: Error > {
179+ fn try_is_low ( & self ) -> Result < bool , Self :: Error > {
180180 Ok ( unsafe {
181181 let p = & ( * pac:: GPIO :: ptr ( ) ) . data_input as * const _ as * const _ ;
182182 u32_bit_is_clear ( p, GPIO :: INDEX as usize )
@@ -187,15 +187,15 @@ impl<GPIO: GpioIndex, PIN, MODE> InputPin for Gpio<GPIO, PIN, Input<MODE>> {
187187impl < GPIO : GpioIndex , PIN > OutputPin for Gpio < GPIO , PIN , Output > {
188188 type Error = core:: convert:: Infallible ;
189189
190- fn set_high ( & mut self ) -> Result < ( ) , Self :: Error > {
190+ fn try_set_high ( & mut self ) -> Result < ( ) , Self :: Error > {
191191 unsafe {
192192 let p = & ( * pac:: GPIO :: ptr ( ) ) . data_output as * const _ as * mut _ ;
193193 u32_set_bit ( p, true , GPIO :: INDEX as usize ) ;
194194 }
195195 Ok ( ( ) )
196196 }
197197
198- fn set_low ( & mut self ) -> Result < ( ) , Self :: Error > {
198+ fn try_set_low ( & mut self ) -> Result < ( ) , Self :: Error > {
199199 unsafe {
200200 let p = & ( * pac:: GPIO :: ptr ( ) ) . data_output as * const _ as * mut _ ;
201201 u32_set_bit ( p, false , GPIO :: INDEX as usize ) ;
@@ -205,14 +205,14 @@ impl<GPIO: GpioIndex, PIN> OutputPin for Gpio<GPIO, PIN, Output> {
205205}
206206
207207impl < GPIO : GpioIndex , PIN > StatefulOutputPin for Gpio < GPIO , PIN , Output > {
208- fn is_set_high ( & self ) -> Result < bool , Self :: Error > {
208+ fn try_is_set_high ( & self ) -> Result < bool , Self :: Error > {
209209 Ok ( unsafe {
210210 let p = & ( * pac:: GPIO :: ptr ( ) ) . data_output as * const _ as * const _ ;
211211 u32_bit_is_set ( p, GPIO :: INDEX as usize )
212212 } )
213213 }
214214
215- fn is_set_low ( & self ) -> Result < bool , Self :: Error > {
215+ fn try_is_set_low ( & self ) -> Result < bool , Self :: Error > {
216216 Ok ( unsafe {
217217 let p = & ( * pac:: GPIO :: ptr ( ) ) . data_output as * const _ as * const _ ;
218218 u32_bit_is_clear ( p, GPIO :: INDEX as usize )
@@ -223,7 +223,7 @@ impl<GPIO: GpioIndex, PIN> StatefulOutputPin for Gpio<GPIO, PIN, Output> {
223223impl < GPIO : GpioIndex , PIN > ToggleableOutputPin for Gpio < GPIO , PIN , Output > {
224224 type Error = core:: convert:: Infallible ;
225225
226- fn toggle ( & mut self ) -> Result < ( ) , Self :: Error > {
226+ fn try_toggle ( & mut self ) -> Result < ( ) , Self :: Error > {
227227 unsafe {
228228 let p = & ( * pac:: GPIO :: ptr ( ) ) . data_output as * const _ as * mut _ ;
229229 u32_toggle_bit ( p, GPIO :: INDEX as usize ) ;
0 commit comments