Skip to content

Commit 6fb9387

Browse files
committed
zig: (wip) gpio_zig
1 parent dba09a9 commit 6fb9387

File tree

5 files changed

+451
-8
lines changed

5 files changed

+451
-8
lines changed

examples/gpio_zig/Kconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# For a description of the syntax of this configuration file,
3+
# see the file kconfig-language.txt in the NuttX tools repository.
4+
#
5+
6+
config EXAMPLES_GPIO_ZIG
7+
tristate "GPIO driver example"
8+
default n
9+
depends on DEV_GPIO
10+
---help---
11+
Enable the GPIO in Zig driver example
12+
13+
if EXAMPLES_GPIO_ZIG
14+
15+
config EXAMPLES_GPIO_ZIG_PROGNAME
16+
string "Program name"
17+
default "gpio_zig"
18+
---help---
19+
This is the name of the program that will be used when the NSH ELF
20+
program is installed.
21+
22+
config EXAMPLES_GPIO_ZIG_PRIORITY
23+
int "GPIO task priority"
24+
default 100
25+
26+
config EXAMPLES_GPIO_ZIG_STACKSIZE
27+
int "GPIO stack size"
28+
default DEFAULT_TASK_STACKSIZE
29+
30+
endif

examples/gpio_zig/Make.defs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
############################################################################
2+
# apps/examples/hello_zig/Make.defs
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership. The
7+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance with the
9+
# License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
############################################################################
20+
21+
ifneq ($(CONFIG_EXAMPLES_GPIO_ZIG),)
22+
CONFIGURED_APPS += $(APPDIR)/examples/gpio_zig
23+
endif

examples/gpio_zig/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
############################################################################
2+
# apps/examples/GPIO_zig/Makefile
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership. The
7+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance with the
9+
# License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
############################################################################
20+
21+
include $(APPDIR)/Make.defs
22+
23+
# GPIO in Zig Example
24+
25+
MAINSRC = gpio_zig.zig
26+
27+
ZIG := /home/kassane/Downloads/zig-linux-x86_64-0.13.0/zig
28+
# GPIO_zig built-in application info
29+
ZIGFLAGS += -fPIE -O ReleaseSmall -lc -I$(TOPDIR)/include
30+
PROGNAME = $(CONFIG_EXAMPLES_GPIO_ZIG_PROGNAME)
31+
PRIORITY = $(CONFIG_EXAMPLES_GPIO_ZIG_PRIORITY)
32+
STACKSIZE = $(CONFIG_EXAMPLES_GPIO_ZIG_STACKSIZE)
33+
MODULE = $(CONFIG_EXAMPLES_GPIO_ZIG)
34+
35+
include $(APPDIR)/Application.mk

0 commit comments

Comments
 (0)