Giter VIP home page Giter VIP logo

zephyr-dw3000-decadriver's Introduction

Zephyr Driver for Qorvo/Decawave DW3000

This is a Zephyr module with a driver for Qorvo/Decawave DW3000. It contains the official driver from Qorvo and adds the necessary Zephyr bindings for GPIO, SPI and DTS. We tried to add only the minimal code to drive the DW3000, so it can be used in different projects and keep it as clean as possible from Decawave example code, port abstractions and the general mess around there.

  • The 'master' branch uses the last release(DW3xx Device Driver Version 06.00.14) from Qorvo (DWM3001CDK-DW3_QM33_SDK-FreeRTOS_0_1_1.zip), which unfortunately is a binary-only library and only available for NRF targets.

  • There is an 'opensource' branch which contains the last open source release from Qorvo (DWS3000_Release_v1.1 / DW3000_API_C0_rev4p0 DW3000 C0 Device Driver Version 04.00.00), but this is older and not well tested any more.

The driver can be used by adding this repository as a zephyr module in west.yml, or by adding the module to CMakeLists.txt, e.g.:

list(APPEND ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/dw3000-decadriver/)

Then you only need to add a decawave,dw3000 compatible device to your .dts, e.g.:

&spi0 {
	status = "okay";
	compatible = "nordic,nrf-spim";
	sck-pin = <2>;
	mosi-pin = <20>;
	miso-pin = <3>;
	cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;

	dw3000@0 {
		compatible = "decawave,dw3000";
		label = "DW3000";
		spi-max-frequency = <1000000>;
		reg = <0>;
		reset-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
		irq-gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
		wakeup-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
		//spi-pol-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
		//spi-pha-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
	};
};

And

CONFIG_DW3000=y
CONFIG_SPI=y
CONFIG_GPIO=y

After that you can use the functions defined in dw3000.h and deca_device_api.h, which would usually be like:

#include <dw3000.h>
...
dw3000_hw_init();
dw3000_hw_reset();
dw3000_hw_init_interrupt();
dw3000_spi_speed_fast();

int ret = dwt_probe((struct dwt_probe_s*)&dw3000_probe_interf);
if (ret < 0) {
	LOG_ERR("DWT Probe failed");
	return;
}

There is a separate project which uses this driver for the Qorvo/Decawave DWS3000 examples here: https://github.com/br101/zephyr-dw3000-examples

Thanks to https://github.com/foldedtoad/dwm3000 for an earlier Zephyr version of the driver + example code.

zephyr-dw3000-decadriver's People

Contributors

br101 avatar mtfurlan avatar vdjajaj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.