Skip to content

Commit 8a687b5

Browse files
committed
Initialize zephyr application
Signed-off-by: waseemR02 <[email protected]>
0 parents  commit 8a687b5

File tree

6 files changed

+52
-0
lines changed

6 files changed

+52
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cache/
2+
build/
3+
.vscode/
4+
.clangd

CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cmake_minimum_required(VERSION 3.13.1)
2+
set(BOARD blackpill_f401cc)
3+
set(DTC_OVERLAY_FILE "boards/app.overlay")
4+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5+
6+
project(CANscribe LANGUAGES C)
7+
8+
target_sources(app PRIVATE src/main.c)

Kconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
mainmenu "Controller Area Network sample application"
2+
3+
config LOOPBACK_MODE
4+
bool "Loopback LOOPBACK_MODE"
5+
default y
6+
help
7+
Set the controller to loopback mode.
8+
This allows testing without a second board.
9+
10+
source "Kconfig.zephyr"

boards/app.overlay

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/{
2+
chosen {
3+
zephyr,canbus = &mcp2515_can_bus;
4+
};
5+
};
6+
7+
&spi1 {
8+
status = "okay";
9+
cs-gpios = <&gpiob 12 GPIO_ACTIVE_LOW>;
10+
mcp2515_can_bus: can@0 {
11+
compatible = "microchip,mcp2515";
12+
spi-max-frequency = <1000000>;
13+
int-gpios = <&gpiob 9 GPIO_ACTIVE_LOW>; /* B9 */
14+
status = "okay";
15+
reg = <0x0>;
16+
osc-freq = <8000000>;
17+
bus-speed = <125000>;
18+
sjw = <1>;
19+
sample-point = <875>;
20+
21+
can-transceiver {
22+
max-bitrate = <1000000>;
23+
};
24+
};
25+
};

prj.conf

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONFIG_LOG=y
2+
3+
CONFIG_CAN=y
4+
CONFIG_CAN_INIT_PRIORITY=80
5+
CONFIG_CAN_MAX_FILTER=5

src/main.c

Whitespace-only changes.

0 commit comments

Comments
 (0)