Commit graph

137 commits

Author SHA1 Message Date
chenzihan1
513673c11a drivers/ioexpander: add enable & disable macro for gpio SETDEBOUNCE and SETMASK
IOEXPANDER_DEBOUNCE_DISABLE (0): Disable debounce filtering
IOEXPANDER_DEBOUNCE_ENABLE (1): Enable debounce filtering
IOEXPANDER_MASK_DISABLE (0): Unmask the interrupter
IOEXPANDER_MASK_ENABLE (1): Mask the interrupter

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2026-01-13 09:27:52 -03:00
xucheng5
f989860c4a timer: add timer operation support
Add basic timer operations to the kernel, including registration,
start/stop, and callback handling. This provides a consistent timer
interface for use by kernel components and drivers.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2026-01-09 17:10:43 +08:00
zhaohaiyang1
2a60b7e747 can: strict TX priority ordering to avoid priority inversion
Introduce a single configuration option to provide strict transmit
priority ordering based on CAN ID.

The intention is to expose the user-visible behavior (strict TX
priority ordering) rather than the underlying implementation details.
Strict priority ordering is only meaningful when hardware transmit
buffer cancellation is available, so splitting this functionality into
separate configuration options was misleading and could result in
partially effective or incorrect configurations.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2026-01-06 16:03:14 +08:00
chenzihan1
1528db236a sensor_monitor: add /proc/sensor_monitor
"Sensor procfs - Dynamic sensor debugging tool\n"
  "\n"
  "Usage:\n"
  "  cat /proc/sensor_monitor - Show currently monitored topics\n"
  "  echo <level> <topic> > /proc/sensor_monitor - Add topic(s)\n"
  "  echo rm <topic> > /proc/sensor_monitor - Remove topic(s)\n"
  "  echo add <topic> <topic> > /proc/sensor_monitor"
  " - add/remove topics\n"
  "  echo clean > /proc/sensor_monitor      - Remove all topics\n"
  "\n"
  "Examples:\n"
  "  echo sensor_accel > /proc/sensor_monitor\n"
  "  echo \"sensor_accel sensor_compass\" > /proc/sensor_monitor\n"
  "  echo \"1 sensor_accel sensor_compass\" > /proc/sensor_monitor\n"
  "  echo \"2 sensor_accel sensor_compass\" > /proc/sensor_monitor\n"
  "  echo \"rm sensor_accel\" > /proc/sensor_monitor\n"
  "  echo \"rm sensor_accel sensor_compass\" > /proc/sensor_monitor\n"
  "  echo clean > /proc/sensor_monitor\n"
  "  echo \"add 1 sensor_a rm sensor_b\" > /proc/sensor_monitor\n"
  "\n"
  "Note:\n"
  "  If <level> is not specified, it defaults to 1.\n";

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2026-01-04 09:24:30 -03:00
dongjiuzhu1
5ca6581353 Documentation: update capture.rst with notification and fake driver
These documentation updates correspond to commits:
- drivers/capture: add signal notification support for edge capture events
- drivers/capture: add fake capture driver for testing and development

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-02 07:46:52 -03:00
dongjiuzhu1
db0b8c59ac Documentation: Add I2C bit-bang IO expander driver documentation
This documentation helps users understand when and how to use IO expander
pins for implementing additional I2C buses in their applications.

Related commit: 06099d492e (drivers/i2c: Add IO expander-based I2C bit-bang)

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-01 17:08:47 +08:00
Michal Lenc
56dbfe7bb3 Documentation: add pages for supported MTD devices
This moves mtd.rst from special/ directory to its own special/mtd
subdirectory and adds pages for supported devices (NOR/NAND flashes and
EEPROMS) with some basic configuration and initialization description.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-12-31 11:37:49 +08:00
dongjiuzhu1
890a7a6382 Documentation: Add PTP clock driver framework documentation
This patch adds comprehensive documentation for the PTP (Precision Time
Protocol) clock driver framework in NuttX.

The documentation covers:

1. Overview and Architecture:
   - IEEE 1588 PTP clock framework introduction
   - Upper-half and lower-half driver architecture
   - Integration with POSIX clock APIs

2. Configuration Options:
   - CONFIG_PTP_CLOCK: Main framework configuration
   - CONFIG_PTP_CLOCK_DUMMY: Dummy driver for testing
   - CONFIG_CLOCK_ADJTIME: clock_adjtime() system call support

3. Device Interface:
   - Character device interface (/dev/ptpN)
   - IOCTL commands: PTP_CLOCK_GETTIME, PTP_CLOCK_SETTIME,
     PTP_CLOCK_GETRES, PTP_CLOCK_ADJTIME, PTP_CLOCK_GETCAPS,
     PTP_SYS_OFFSET, PTP_SYS_OFFSET_PRECISE

4. POSIX Clock API (CLOCKFD):
   - Using CLOCKFD() macro to access PTP clocks
   - clock_gettime(), clock_settime(), clock_getres() examples
   - clock_adjtime() with various adjustment modes
   - ADJ_OFFSET, ADJ_FREQUENCY, ADJ_SETOFFSET support

5. Dummy PTP Clock Driver:
   - Software-based implementation for testing
   - Features and initialization details

6. Example Usage:
   - Basic time operations
   - Frequency adjustment examples
   - Time offset adjustment examples

7. Implementing Lower-Half Drivers:
   - Step-by-step guide for hardware driver implementation
   - Required operations and structures
   - Registration process

8. Integration with PTP Daemons:
   - ptp4l, timemaster, ptpd compatibility
   - Standard POSIX clock API usage

9. Performance Considerations:
   - Hardware timestamping requirements
   - Cross-timestamping support
   - Frequency adjustment resolution

10. Debugging:
    - Debug configuration options
    - Debug output examples

The documentation is added to:
- Documentation/components/drivers/special/ptp.rst (new file)
- Documentation/components/drivers/special/index.rst (updated)

This provides developers with complete reference material for using
and implementing PTP clock drivers in NuttX.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 10:22:09 -03:00
gaohedong
44bc5ed635 net/vlan: add some macro for vlan
Refer:
https://github.com/torvalds/linux/blob/v6.8/include/linux/if_vlan.h#L73-L76

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-27 11:36:39 +08:00
zhengyu9
491ce83508 drivers/mtd: add MTDIOC_ISBAD ioctl
add an ioctl item MTDIOC_ISBAD
used for flashtool command to check bad blocks

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2025-12-23 09:26:34 -03:00
yezhonghui
db7f292709 power/battery: fake gauge support for rpmsg communication
realize a fake gauge to support powermanger

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-22 09:15:56 -03:00
chenzihan1
a9df67e56b drivers/gpio: gpio driver added debounce and interrupt mask functions
Add handling for GPIOC_SETDEBOUNCE to set GPIO pin debounce duration.
Add handling for GPIOC_SETMASK to enable/disable GPIO interrupt mask.

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-12-18 14:52:37 +01:00
Antoine Juckler
d5633f75a8 mtd/at25ee: Use eeprom/spi_xx25xx internally
In order to reduce code duplication, use the eeprom/spi_xx25xx
driver within mtd/at25ee.

The eeprom/xxx.h includes have been merged into eeprom/eeprom.h, to
provide a common include file like mtd/mtd.h.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-12-17 19:03:54 +01:00
wangjinjing1
8c92be874f net/can: add write buffer to support nonblock send
The sending of can socket can support more scenarios

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2025-12-15 10:19:15 +08:00
Jiri Vlasak
f93a1b34e5 eeprom/spi_xx25xx: Add IOCTL to set Block Protect
Add IOCTL to set Block Protect, because we need a way to set Block
Protect of an EEPROM.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2025-12-13 13:33:48 +08:00
Zhe Weng
242c253178 net: Add VLAN device support
Inspired by Linux's way, we also create VLAN devices for managing VLAN,
which will become interfaces like `eth0.58`.

QinQ is also supported, we can create VLAN devices above another VLAN
devices, like `eth0.100.101` (or even `eth0.1.2.3.4`, also supported on
Linux).

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-12-09 07:56:20 -03:00
Antoine Juckler
4863564d48 drivers/eeprom: Support PE/SE/CE commands
Add support for the page erase (PE), sector erase (SE) and chip erase
(CE) dedicated commands on supported devices.
They can be triggered using the corresponding IOCTL commands
EEPIOC_PAGEERASE, EEPIOC_SECTORERASE and
EEPIOC_CHIPERASE.

On unsupported devices, this is equivalent to writing a full page,
sector, or the entire EEPROM to 0xFF.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-12-03 22:05:44 +08:00
Huang Qi
3a6865aef5 drivers/sensors: Add QST QMI8658 6-axis IMU sensor support
Add complete driver support for the QST QMI8658 6-axis IMU sensor featuring
3-axis accelerometer and 3-axis gyroscope with I2C interface and uORB
integration.

Key features implemented:
* Full I2C communication with configurable frequency (default 400kHz)
* Multiple accelerometer ranges (±2g, ±4g, ±8g, ±16g) and ODR settings
* Multiple gyroscope ranges (±16 to ±1024 dps) with high ODR support
* Low-pass filter configuration for both sensors
* Temperature sensing with 16-bit resolution
* Self-test capability for both accelerometer and gyroscope
* Calibration-on-demand support with offset registers
* FIFO buffer management (framework ready)
* Interrupt-driven and polling mode support
* Complete uORB integration with sensor_accel and sensor_gyro topics

Driver components added:
* Core driver implementation (qmi8658_uorb.c) with register operations
* Header file with register definitions and scale factors (qmi8658.h)
* Kconfig options for driver configuration and polling mode
* Build system integration (CMakeLists.txt, Make.defs)
* Comprehensive documentation with API reference and usage examples

The driver follows NuttX sensor framework conventions and provides
robust error handling, mutex protection, and comprehensive debugging
support through CONFIG_DEBUG_SENSORS.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-11-30 09:44:43 -03:00
Antoine Juckler
02db473e97 drivers/eeprom: Set the bus frequency
Add EEPIOC_SETSPEED ioctl acting like the MTDIOC_SETSPEED ioctl. The
default frequency is settable in the Kconfig.

Add xx25xx SPI delay control configurations.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-11-25 09:49:26 +08:00
ouyangxiangzhen
6689a408f3 Documentation/drivers/timers: Add information about timers.
This commit added additional informantion about the timer driver
abstraction.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
Karel Kočí
c61d7c7e8d nuttx/can: add message alignment
This adds ability for read and write operations to work with messages
aligned to configured number of bytes. This has few different use
cases.

The alignment is specified as unsigned integer and can be changed with
ioctl command CANIOC_SET_MSGALIGN. The current value can be queried by
CANIOC_GET_MSGALIGN command.

The default value for the message alignment is 1. This will provide
behavior consistent with current one. Thus messages are placed to the
buffer right after data of the previous one. The same applies for
writes.

The special alignment value 0 disables read and write of multiple frames. Thus
read will always return at most one message and write will always write
only one message even if larger buffer size is provided.

Another use case is if message alignment is set to exactly message
representation size (`sizeof(struct can_msg_s)`). This allows writing
and reading arrays of messages.

Other values provide even more advanced and specialized use cases, such
as optimizations if architecture has to emulate some non-aligned
accesses, there alignment of for example 4 bytes could provide
performance boost.

The original motivation behind this is was compatibility with socket
CAN. It is easier to port applications to NuttX's CAN driver if only one
frame is provided at the time. This solution was suggested by Pavel Pisa
<pisa@fel.cvut.cz> as a more versatile variant of plain boolean
disabling the multiple frame retrieval.

Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
2025-11-24 14:11:41 +08:00
Michal Lenc
cb5f47e56e documentation: add GPIO character device driver entry
This page describes GPIO character device driver and its API.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-11-22 14:12:19 -05:00
ouyangxiangzhen
3b52763385 Documentation/componensts: Add doc for timers/oneshot.
This commit added doc for timers/oneshot.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-19 12:24:56 +08:00
Antoine Juckler
934dfdf645 drivers/eeprom: Retrieve the geometry
Add EEPIOC_GEOMETRY IOCTL command to retrieve the
EEPROM geometry.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-11-13 08:57:52 -03:00
wangchengdong
76dcec8f4b Documentation: Add description for early_syslog()
Add documentation describing the purpose and behavior of early_syslog(),
   which provides a minimal logging facility available during early system
   initialization or system down.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-10-31 08:29:17 -03:00
Stepan Pressl
4f7fc3dd04 1wire DS2XXX: add 1wire and DS2XXX documentation
Also fix some minor issues in the DS2XXX header file.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-10-11 07:39:01 -03:00
Côme VINCENT
bebcfa0f46 docs(h743zi/capture): add capture driver docs
Add documentation for changes made in #16809.
Add an example defconfig for a nsh build with the capture example.
Replace the STM32H7_CAP option with just CAPTURE as the guard for the
lower half driver.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-14 20:46:37 +08:00
Matteo Golin
ddd8d81874 docs/gnss_lowerhalf: Documentation for the lower-half GNSS uORB driver
The GNSS lower-half driver for facilitating the implementation of uORB
GPS/GNSS device drivers was lacking documentation. Contributors cannot
be expected to implement their drivers correctly with this framework if
it is undocumented. This change adds documentation for how to use the
lower-half GNSS driver, provides an example and also adds a notice for
users to use this framework if implementing their own GNSS driver.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-06 16:28:57 +02:00
jingfei
4a765b557f Docs/drviers/mtd:Add description for MTD Device Registration and FTL Control
Documentation:
1. Updates the registration process description and flag usage guidelines
2. Includes the MTD open sequence diagram (mtd_open_flow.png)
2025-07-16 14:11:41 +08:00
Alan Carvalho de Assis
54b2381c42 drivers/input: Create Single Button Multi Actions
This commit creates a sbutton device that uses a single button to
create a keyboard driver that returns TAB or ENTER depending how
long the user keeps the button pressed.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-07-15 18:39:59 -03:00
Matteo Golin
953ab4e287 docs/ads1115: Add trigger commands to documentation
Updates the ADS1115 documentation with information about the two new
commands for triggering conversion and reading the result.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-14 10:22:33 -04:00
Matteo Golin
6ae3cc9082 drivers/sensors/l86xxx: Make some dependency patches and update documentation
This commit removes the termios dependency of the command to set fix
rate. It makes the MINMEA dependency present in the Kconfig options for
the driver, and it also adds a retry limit to the boot message
verification of 3 times. The documentation has been updated to reflect
the correct signature for the registration function and fix some
formatting.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-09 09:45:21 +02:00
p-szafonimateusz
880c8e5d26 drivers/net: add IGB network card support
Add support for Intel IGB type of network cards.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-08 10:02:15 +02:00
Elias Hawa
0ce9e82d73 drivers/sensors: add Quectel L86-XXX GNSS uORB sensor driver 2025-07-07 21:18:15 -03:00
Joshua Lange
d5eda10cad drivers/leds: Add support for KTD2052
This commit adds support for the KTD2052 LED driver chip.

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
2025-07-07 09:49:51 -03:00
Pressl, Stepan
55bef681e1 arch/arm/src/stm32/stm32_i2cslave_v2.c: add STM32 I2C Slave support for the v2 ip core
This commit adds the lowerhalf driver support for the I2C Slave.
While not currently ideal, it is compatible with the upperhalf i2c slave driver.
A workqueue can be used to delegate the isr work to the upperhalf driver.
But keep in mind wq introduces a lot of delay and in certain scenarios,
it is better to write your own better upperhalf driver.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-07-02 01:59:46 +08:00
Matteo Golin
a5f43aa8e8 docs/syslog: Add documentation for RFC 5424 support
Introduces two documentation additions. First, the RFC 5424 support is
documented on the main syslog documentation page, with information about
how to use it effectively. Second is the application documentation for
the `syslogd` application addition, which enables easy use of the new
RFC 5424 support.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-06-13 20:26:57 +08:00
T. L.
29e6d4f96e Documentation/drivers/analog/adc/ads1115: Add missing documentation for ioctl
This commit adds the missing documentation for the ioctl command ANIOC_ADS1115_READ_CHANNEL.

Signed-off-by: Tony Lin <99093620+justapotato213@users.noreply.github.com>
2025-05-29 22:03:43 -04:00
p-szafonimateusz
fab4f68b6f drivers/usbhost: add xHCI support
add xHCI PCI driver (usbhost).

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-05-15 21:58:57 +08:00
Lars Kruse
57a7cb503a Documentation: fix spelling 2025-05-15 11:33:41 +08:00
Lars Kruse
b333ad3ab5 style: fix typos
Thanks, codespell!
2025-04-30 13:45:46 +08:00
Lars Kruse
797cc869ae Documentation: group DAC devices by communication interface 2025-04-29 16:17:44 -03:00
Lars Kruse
9b3914b740 drivers/analog/mcp47x6: Add support for MCP47X6 DAC series
The MCP47X6 series consists of the following single channel DAC chips:
- MCP4706 (8 bit)
- MCP4716 (10 bit)
- MCP4726 (12 bit)

The driver supports the following configurations:
- gain
- power down
- voltage reference

Persistent configuration storage in the internal EEPROM is not
implemented.
2025-04-29 16:17:44 -03:00
Daniel Byshkin
504f838577 sensors/nau7802: Add support for the NAU7802
This patch adds support for the NAU7802 24 bit ADC from Nuvoton.
Please read the documentation for more details.

Signed-off-by: Daniel Byshkin <online@bskdany.com>
2025-04-01 09:38:37 +08:00
Tony Lin
10d46929b9 Documentation/drivers/analog/adc/ads1115: Add documentation for the Texas Instrument ADS1115 driver
This commit adds the documentation for the Texas Instruments ADS1115 Driver.

Signed-off-by: Tony Lin <99093620+justapotato213@users.noreply.github.com>
2025-03-25 09:49:51 +01:00
Kevin Witteveen (MartiniMarter)
6b3f7e0939 Documentation/components/drivers/character/wireless: IOCTL interface initial documentation.
Adds initial documentation to the IOCTL commands of wireless character devices.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-03-23 17:51:15 +08:00
Matteo Golin
c1858a23fb Documentation: Add documentation for RN2XX3 driver
Adds a documentation page about the driver's programming interface and
new WLIOC commands.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-03-06 06:10:19 -03:00
Alan Carvalho de Assis
47d0356c65 doc: Add documentation to USERLED subsystem
The USERLED subsystem is responsible to register and to control the
user LEDs on the board.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-03-02 00:13:29 +08:00
Kevin Witteveen (MartiniMarter)
b698cc1338 Documentation: add SX126x plan
Added detailed information about the SX126x and its current state in development.
Added directories for wireless character driver and LPWAN.
Added indexes to each directory and its contents within.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-02-27 16:03:18 -03:00
Michal Lenc
86917b4777 drivers/pwm: add PWMIOC_FAULTS_FETCH_AND_CLEAR ioctl for fault clears
This ioctl clears the active fault inputs. Some faults can be latched
(still active even if the source is not active anymore), so they have
to be cleared from the software. The argument is a pointer to unsigned
long bitmask variable. This bitmask specifies which faults are to be
cleared.

The ioctl also can fetch the faults active prior to the clear. These
faults are saved to the argument specifying which faults are to be
cleared. Therefore passing zero bitmask means the driver will only return
active faults and clear none. Passing NULL pointer means the driver
will clear all active and return none.

The implementation of this ioctl is per driver.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-27 11:47:51 -03:00