Try adding w5500-test, though it doesn't fit
This commit is contained in:
parent
3b63f9d5e5
commit
bd27ddf9ec
|
@ -10,11 +10,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1699827895,
|
"lastModified": 1699858083,
|
||||||
"narHash": "sha256-Fzjd9h3TDPXORNl6pek+e79eFjbmSaU4Hi/MUpjSRz4=",
|
"narHash": "sha256-EXmVoYDYszdWlaxRzedQ3Q7ehbqIGfbe9EaHSBD4cgQ=",
|
||||||
"ref": "refs/heads/canon",
|
"ref": "refs/heads/canon",
|
||||||
"rev": "763d83f15705ab6c6b033e445f96d40bc4f10eb4",
|
"rev": "453af715eebd7102131d2cc6846dd23d49f853ac",
|
||||||
"revCount": 9,
|
"revCount": 12,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.mildlyfunctional.gay/artemist/packages.git"
|
"url": "https://git.mildlyfunctional.gay/artemist/packages.git"
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,12 +19,8 @@
|
||||||
arm-zephyr-eabi
|
arm-zephyr-eabi
|
||||||
riscv64-zephyr-elf
|
riscv64-zephyr-elf
|
||||||
];
|
];
|
||||||
zephyrSrc = pkgs.fetchFromGitHub {
|
modules = with artemist-packages.packages.${system}.zephyr.modules;
|
||||||
owner = "zephyrproject-rtos";
|
[ mbedtls ];
|
||||||
repo = "zephyr";
|
|
||||||
rev = "v3.5.0";
|
|
||||||
hash = "sha256-72QFsKOWkF6BiP4XgZAXXSBcN4t6yvhAeXCpgCYrhe8=";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
formatter = pkgs.nixfmt;
|
formatter = pkgs.nixfmt;
|
||||||
});
|
});
|
||||||
|
|
1
zephyr/.gitignore
vendored
1
zephyr/.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
build/
|
build/
|
||||||
|
.cache/
|
||||||
|
|
5
zephyr/w5500-test/CMakeLists.txt
Normal file
5
zephyr/w5500-test/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
cmake_minimum_required(VERSION 3.20.0)
|
||||||
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||||
|
|
||||||
|
project(w5500-test)
|
||||||
|
target_sources(app PRIVATE src/main.c)
|
10
zephyr/w5500-test/boards/sparkfun_red_v_things_plus.overlay
Normal file
10
zephyr/w5500-test/boards/sparkfun_red_v_things_plus.overlay
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
&spi1 {
|
||||||
|
cs-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
|
||||||
|
|
||||||
|
w5500@0 {
|
||||||
|
compatible = "wiznet,w5500";
|
||||||
|
reg = <0>;
|
||||||
|
int-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
|
||||||
|
spi-max-frequency = <10000000>;
|
||||||
|
};
|
||||||
|
};
|
11
zephyr/w5500-test/prj.conf
Normal file
11
zephyr/w5500-test/prj.conf
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
CONFIG_NET_L2_ETHERNET=y
|
||||||
|
CONFIG_ETH_DRIVER=y
|
||||||
|
CONFIG_ETH_W5500=y
|
||||||
|
|
||||||
|
CONFIG_NETWORKING=y
|
||||||
|
CONFIG_NET_IPV6=y
|
||||||
|
CONFIG_NET_TCP=y
|
||||||
|
|
||||||
|
CONFIG_NET_SOCKETS=y
|
||||||
|
CONFIG_NET_SOCKETS_POSIX_NAMES=y
|
||||||
|
CONFIG_NET_SOCKETS_POLL_MAX=4
|
44
zephyr/w5500-test/src/main.c
Normal file
44
zephyr/w5500-test/src/main.c
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <zephyr/kernel.h>
|
||||||
|
#include <zephyr/drivers/gpio.h>
|
||||||
|
|
||||||
|
/* 1000 msec = 1 sec */
|
||||||
|
#define SLEEP_TIME_MS 1000
|
||||||
|
|
||||||
|
/* The devicetree node identifier for the "led0" alias. */
|
||||||
|
#define LED0_NODE DT_ALIAS(led0)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A build error on this line means your board is unsupported.
|
||||||
|
* See the sample documentation for information on how to fix this.
|
||||||
|
*/
|
||||||
|
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!gpio_is_ready_dt(&led)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
|
||||||
|
if (ret < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
ret = gpio_pin_toggle_dt(&led);
|
||||||
|
if (ret < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
k_msleep(SLEEP_TIME_MS);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue