File tree Expand file tree Collapse file tree 5 files changed +33
-2
lines changed Expand file tree Collapse file tree 5 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 35
35
value : gpios
36
36
device : crate::device::gpio::GpioPin
37
37
38
+ # Hook up the gpio-keys as gpio pins as well
39
+ - name : gpio-keys
40
+ rules :
41
+ - type : compatible
42
+ value :
43
+ names :
44
+ - gpio-keys
45
+ level : 1
46
+ actions :
47
+ - type : instance
48
+ value :
49
+ raw :
50
+ type : phandle
51
+ value : gpios
52
+ device : crate::device::gpio::GpioPin
53
+
38
54
# Flash controllers don't have any particular property to identify them, so we need a list of
39
55
# compatible values that should match.
40
56
- name : flash-controller
46
62
- " nordic,nrf51-flash-controller"
47
63
- " raspberrypi,pico-flash-controller"
48
64
- " st,stm32g4-flash-controller"
65
+ - " st,stm32l5-flash-controller"
49
66
- " zephyr,sim-flash"
50
67
level : 0
51
68
actions :
Original file line number Diff line number Diff line change @@ -8,3 +8,7 @@ CONFIG_MAIN_STACK_SIZE=8192
8
8
9
9
# Verify that userspace builds work.
10
10
# CONFIG_USERSPACE=y
11
+
12
+ CONFIG_UART_CONSOLE=n
13
+ CONFIG_RTT_CONSOLE=y
14
+ CONFIG_USE_SEGGER_RTT=y
Original file line number Diff line number Diff line change @@ -13,4 +13,8 @@ CONFIG_RUST_ALLOC=y
13
13
CONFIG_GPIO=y
14
14
CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT=y
15
15
16
- CONFIG_LOG_BACKEND_RTT=n
16
+ # CONFIG_LOG_BACKEND_RTT=n
17
+
18
+ CONFIG_UART_CONSOLE=n
19
+ CONFIG_RTT_CONSOLE=y
20
+ CONFIG_USE_SEGGER_RTT=y
Original file line number Diff line number Diff line change @@ -35,13 +35,18 @@ async fn main(spawner: Spawner) {
35
35
info ! ( "Hello world" ) ;
36
36
let _ = spawner;
37
37
38
+ /*
38
39
let mut col0 = zephyr::devicetree::labels::col0::get_instance().unwrap();
39
40
let mut row0 = zephyr::devicetree::labels::row0::get_instance().unwrap();
41
+ */
42
+ let mut row0 = zephyr:: devicetree:: aliases:: sw0:: get_instance ( ) . unwrap ( ) ;
40
43
let mut gpio_token = unsafe { zephyr:: device:: gpio:: GpioToken :: get_instance ( ) . unwrap ( ) } ;
41
44
42
45
unsafe {
46
+ /*
43
47
col0.configure(&mut gpio_token, GPIO_OUTPUT_ACTIVE);
44
48
col0.set(&mut gpio_token, true);
49
+ */
45
50
row0. configure ( & mut gpio_token, GPIO_INPUT | GPIO_PULL_DOWN ) ;
46
51
}
47
52
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ mod async_io {
35
35
ZR_GPIO_INT_MODE_DISABLE_ONLY ,
36
36
} ;
37
37
38
- use crate :: sync:: atomic:: { AtomicBool , AtomicU32 } ;
38
+ use crate :: { printkln , sync:: atomic:: { AtomicBool , AtomicU32 } } ;
39
39
40
40
use super :: { GpioPin , GpioToken } ;
41
41
@@ -112,6 +112,7 @@ mod async_io {
112
112
cb : * mut gpio_callback ,
113
113
mut pins : gpio_port_pins_t ,
114
114
) {
115
+ printkln ! ( "GPIO callback: {}" , pins) ;
115
116
let data = unsafe {
116
117
cb. cast :: < u8 > ( )
117
118
. sub ( mem:: offset_of!( Self , callback) )
You can’t perform that action at this time.
0 commit comments