Skip to content

novelda/x4-occupancy-driver-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

X4F103 Presence Detection Sensor — SDK

This repository is the foundation for an Android/Linux kernel driver for the Novelda X4F103 UWB radar presence-detection sensor. It provides a high-level C interface that abstracts all sensor communication, firmware upload, configuration, and detection logic — so that a kernel driver or other host application only needs to implement a thin platform chipinterface and call the SDK API to obtain presence-detection results.

Using the sensor requires a proprietary firmware blob that is loaded into the X4F103 at startup. The blob is not included in this repository; see the Firmware blobs section below for how to obtain it.


Version

Component Version
Occupancy_X4F103 1.1.2 (build 81780)

What is included and what you need to implement

This repository provides the sensor SDK only. To build a working kernel driver, two additional pieces must be implemented by the customer:

Missing piece Description
Kernel thread A kernel thread that calls x4sensor_initialize_i2c, starts the sensor via x4sensor_start_normal_mode or x4sensor_start_event_mode, and loops reading detection results with x4sensor_get_sensor_data / x4sensor_get_detection_state.
Chipinterface The low-level I²C hardware abstraction. Every function declared in x4sensor/novelda_chipinterface.h must be implemented for the target platform, covering I²C transfers, GPIO control (enable pin, presence indicator), interrupt handling, and timing.

The SDK calls both of these through well-defined interfaces, so the provided code does not need to be modified.


Architecture

Path Description
x4f103/x4sensor/ Core SDK: sensor lifecycle, configuration, event and normal mode drivers
x4f103/algorithms/ Algorithm-specific configuration headers

The SDK has no kernel or OS dependencies. It relies on a thin chipinterface abstraction (defined in x4sensor/novelda_chipinterface.h) that the integrator implements for their platform.


Licensing

All files in this package are distributed under the MIT License. Copyright (c) 2026 Vital Things UWB AS.

Per-file SPDX-License-Identifier: MIT tags are authoritative. The full license text is in LICENSES/MIT.txt. The script scripts/apply-license-header.sh --check can be used in CI to verify that every file carries the correct header.


Integration

Implementing the chipinterface

Copy the file list below into your project and provide a platform-specific implementation of every function declared in novelda_chipinterface.h:

Function Purpose
chipinterface_create_i2c / chipinterface_delete_i2c Set up / tear down the I²C bus and GPIOs
chipinterface_read_i2c / chipinterface_write_i2c Raw I²C transfers
chipinterface_set_chip_enabled Toggle the hardware enable pin
chipinterface_set_presence_indication Drive an output pin when presence is detected
chipinterface_wait_for_interrupt / chipinterface_wait_for_interrupt_asserted Block until the sensor IRQ fires
chipinterface_get_interrupt_state Read the current IRQ line level
chipinterface_wait_us / chipinterface_get_time_microseconds Timing primitives

Typical usage sequence

// 1. Initialise (loads the configuration blob into the sensor)
x4sensor_initialize_i2c(i2c_dev, blob, blob_size);

// 2. Configure
x4sensor_set_range_cm(450);
x4sensor_set_sensitivity_level(3);

// 3. Run
x4sensor_start_normal_mode();   // or x4sensor_start_event_mode(...)

// 4. Poll / interrupt-driven read (event mode)
x4sensor_get_sensor_data(buffer, sizeof(buffer));
bool present = x4sensor_get_detection_state(buffer);

// 5. Stop and deinitialise
x4sensor_stop();
x4sensor_deinitialize_i2c();

Firmware blobs

The sensor firmware is passed as a binary blob to x4sensor_initialize_i2c at startup. The blobs are distributed separately and are not included in this repository. They can be obtained and licensed from Vital Things UWB AS (Norway) — contact: dev@novelda.com.


Disclaimer of warranty

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. USE AT YOUR OWN RISK.


Attribution

Vital Things UWB AS (Norway) is the legal successor of Novelda AS and holds the rights to publish this SDK under the MIT License.

About

X4Sensor-based Occupancy Driver Layer for the Android Open Source Project Kernel

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages