Increase default TX power from 14 to 17 dBm and enable CRC
by default to improve link reliability and data integrity.
Signed-off-by: Arjav Patel <arjav1528@gmail.com>
Previously, the ST7796 driver required the board to pass a struct
st7796_config_s at initialization time, carrying display resolution,
color depth, orientation (MADCTL), BGR flag, SPI frequency, and
initial rotation.
All of these are chip-level properties, not board wiring details.
This created an awkward split: board code computed MADCTL values,
selected BPP, and derived effective resolution depending on orientation
(knowledge that belongs exclusively in the generic driver).
This commit removes that split entirely, following the same pattern used
by the ST7789 driver in drivers/lcd/Kconfig. It also implements the
getpower/setpower interface for standard framebuffer power management.
What was changed (per file):
drivers/lcd/Kconfig:
- Added a full 'if LCD_ST7796' ... 'endif # LCD_ST7796' block containing
all chip-level configuration.
- Includes LCD_ST7796_XRES/YRES, LCD_ST7796_BPP, LCD_ST7796_FREQUENCY,
LCD_ST7796_SPIMODE, LCD_ST7796_BGR, LCD_ST7796_INVCOLOR,
and orientation/rotation choices.
drivers/lcd/st7796.c:
- Removed struct st7796_config_s from struct st7796_dev_s.
- Moved struct st7796_cmd_s from public header to Private Types.
- Added compile-time macros derived from Kconfig:
ST7796_XRES/YRES (swapped for landscape),
ST7796_MADCTL_BASE,
ST7796_SPIMODE,
ST7796_BYTESPP,
ST7796_COLORFMT.
- Implemented st7796_getpower() and st7796_setpower() using the
st7796_board_power() board callback.
- Registered power functions in st7796_fbinitialize() vtable.
- Updated st7796_init_display() to make INVON/INVOFF conditional on
CONFIG_LCD_ST7796_INVCOLOR.
- Simplified st7796_fbinitialize() signature to only take
'struct spi_dev_s *spi'.
include/nuttx/lcd/st7796.h:
- Removed legacy macros (ST7796_XRES_RAW, etc.) and configuration
structures.
- Updated st7796_fbinitialize() prototype.
- Added st7796_board_power() callback prototype.
- Removed private implementation details from the public header.
boards/arm/stm32h7/nucleo-h753zi/Kconfig:
- Removed chip-level menus (settings, orientation) now handled by the
generic driver.
- Retained only board-specific wiring concerns (pins and SPI bus).
boards/.../stm32_st7796.c:
- Removed g_st7796_config and associated board-side macros.
- Updated st7796_fbinitialize() call to the new signature.
- stm32_st7796_flush_fb() now queries effective resolution
via g_fb_vtable->getvideoinfo().
Verified on nucleo-h753zi:
Orientation: Landscape (480x320),
Rotation: 180 deg,
BGR: enabled,
INVCOLOR: disabled,
BPP: RGB565,
Frequency: 40 MHz.
Making INVCOLOR a Kconfig option (default n) fixes cases where panels
previously showed inverted colors due to hardcoded INVON.
Signed-off-by: vrmay23 <vmay.sweden@gmail.com>
support specify the address by h2r_buf_addr and r2h_buf_addr
so is can split shared memory pool
Signed-off-by: yintao <yintao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Implement `cc1101_file_ioctl` to map common NuttX wireless IOCTL commands
to CC1101 hardware registers. This allows dynamic configuration of radio
parameters from user-space applications.
* Map `WLIOC_SETRADIOFREQ` and `GETRADIOFREQ` to `FREQ[2:0]`.
* Map `WLIOC_SETADDR` and `GETADDR` to `ADDR`.
* Map `WLIOC_SETTXPOWER` and `GETTXPOWER` to internal PATABLE indexing.
* Map `WLIOC_SETMODU` and `GETMODU` to `MDMCFG2`.
* Map `WLIOC_FSK_SETBITRATE` and `GETBITRATE` to `MDMCFG4` and `MDMCFG3`.
* Map `WLIOC_FSK_SETFDEV` and `GETFDEV` to `DEVIATN`.
* Normalize positive SPI status byte returns from `cc1101_access` to `OK` (0)
to ensure POSIX compliance and prevent silently skipped register writes.
Signed-off-by: Chip L. <chplee@gmail.com>
Remove the unnecessary CONFIG_RPMSG_UART_CONSOLE preprocessor guard around
the console registration logic in uart_rpmsg_init().
The uart_rpmsg_init() function already accepts a bool isconsole parameter to
dynamically control console registration, which is designed to support flexible
console setup in distributed multi-core SOC systems. Adding the macro check on
top of this runtime parameter is redundant and negates the dynamic registration
capability.
This change fixes a regression introduced by PR #18410, which broke the functionality
of sim/rpproxy and sim/rpserver due to the incorrect macro guard preventing proper
console registration for the rpmsg UART device.
Signed-off-by: chao an <anchao.archer@bytedance.com>
Update the nrf24l01_ioctl function to fully comply with the common wireless
character driver interface defined in nuttx/wireless/ioctl.h, and complete
previously unimplemented device-specific commands.
* Add support for WLIOC_SETRADIOFREQ and WLIOC_GETRADIOFREQ with
quantitative conversion between Hz (API) and MHz (Hardware).
* Add support for WLIOC_SETTXPOWER, WLIOC_GETTXPOWER, WLIOC_SETFINEPOWER,
and WLIOC_GETFINEPOWER.
* Add WLIOC_SETMODU and WLIOC_GETMODU, strictly enforcing WLIOC_GFSK
modulation as required by the nRF24L01 physical layer.
* Map WLIOC_SETADDR and WLIOC_GETADDR to the existing TX address routines.
* Resolve -ENOSYS in NRF24L01IOC_GETRETRCFG by reading the
NRF24L01_SETUP_RETR register and decoding ARD/ARC shift bits.
* Resolve -ENOSYS in NRF24L01IOC_GETDATARATE by parsing RF_DR_LOW and
RF_DR_HIGH bits from the NRF24L01_RF_SETUP register.
Signed-off-by: Chip L. <chplee@gmail.com>
This commit implements a compile-time warning and in-code comment
warning for legacy sensor drivers. This is intended to:
- Warn users that legacy drivers may eventually be removed
- Warn developers that they should not use a legacy driver as a
reference for their new driver contributions
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Adds CONFIG_16550_POLLING options to enable polling mode for
transmission. This avoids TX interrupts and reduces interrupt latency
at the cost of blocking during TX.
Implements sendbuf() method for efficient buffer transmission
in polling mode.
Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
Signed-off-by: chao an <anchao.archer@bytedance.com>
Adds CONFIG_UART_XLNXPS_POLLING options to enable polling mode for
transmission. This avoids TX interrupts and reduces interrupt latency
at the cost of blocking during TX.
Implements sendbuf() method for efficient buffer transmission
in polling mode.
Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
Signed-off-by: chao an <anchao.archer@bytedance.com>
This PR adds complete driver support for the Xilinx UART Peripheral System (XUARTPS)
in the NuttX serial driver framework. The implementation includes the core driver code
(uart_xlnx_ps.c), configuration files (Kconfig-xlnxps), header definitions (uart_xlnx_ps.h),
and integration with the existing NuttX build system (CMakeLists.txt, Make.defs, Kconfig).
The driver supports UART0 configuration with customizable parameters (base address,
clock frequency, IRQ number, baud rate, parity, data bits, stop bits), RX/TX buffer sizing,
hardware flow control (RTS/CTS), interrupt-driven data transfer, and console mapping for XUARTPS UART0.
It also provides standard serial driver operations (setup, shutdown, attach/detach, ioctl, send/receive)
and early serial initialization for boot-time console access.
Signed-off-by: chao an <anchao.archer@bytedance.com>
Many third-party CC1101 modules (such as those populated on the Evil Crow
RF V2) feature clone silicon that hardcodes the VERSION register to 0x00
instead of the official 0x14.
Previously, the cc1101_checkpart() function strictly enforced
VERSION == 0x14, which caused cc1101_register() to return -ENODEV (-19)
and abort initialization on these compatible modules.
This commit introduces the CONFIG_WL_CC1101_IGNORE_VERSION Kconfig option.
- When disabled (default), the driver maintains strict official silicon
validation. This preserves the diagnostic ability to catch hardware
faults, such as a MISO line shorted to GND (which also reads as 0x00).
- When enabled, the driver explicitly permits VERSION == 0x00, allowing
successful initialization and interoperability with clone chips while
printing a warning to the syslog.
Signed-off-by: Chip L. <chplee@gmail.com>
This commit introduces a new Kconfig option SYSLOG_TIMESTAMP_MS to allowconfiguring
syslog timestamps to use milliseconds (ms) instead of the default microseconds (µs).
Key changes:
1. Add CONFIG_SYSLOG_TIMESTAMP_MS boolean Kconfig option (depends on SYSLOG_TIMESTAMP),
default disabled. This option lets users choose between millisecond and microsecond
precision in syslog timestamps.
2. Modify the timestamp format string in nx_vsyslog():
a. When CONFIG_SYSLOG_TIMESTAMP_MS is enabled: Use [%5ju.%03ld] (3 digits for ms).
b. When disabled (default): Retain original [%5ju.%06ld] (6 digits for µs).
3. Adjust the timestamp value calculation:
a. For ms: Divide nanoseconds by NSEC_PER_MSEC (1,000,000) to get millisecond value.
b. For µs (default): Retain division by NSEC_PER_USEC (1,000) for microsecond value.
This enhancement provides flexibility in syslog timestamp precision:
1. Millisecond precision reduces log line length and is sufficient for many use cases.
2. Maintains backward compatibility (microseconds remain the default).
3. The Kconfig dependency ensures the option is only visible when timestamps are enabled.
The change is fully conditional and has no impact on existing behavior unless the new option is explicitly enabled.
Signed-off-by: liwangzhu <liwangzhu@bytedance.com>
Signed-off-by: chao an <anchao.archer@bytedance.com>
Move network interface up operation (ifup) to work queue in RNDIS USB
device driver to avoid calling netdev_carrier_on API in interrupt context.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
DEV_GPIO_NSIGNALS relies on signal support. Add an explicit Kconfig
dependency on SIGNALS to prevent invalid no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, remove the altmdm_timer-related
implementation and API definitions.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Changes the default value for CONFIG_BOARD_LOOPSPERMSEC to -1, which is
invalid. All boards that forget to configure this value will encounter a
static assertion at compile time, enforcing that configurations
upstreamed to NuttX have calibrated values for correct delay timings.
Boards which implement ALARM_ARCH or TIMER_ARCH do not rely on the
busy-loop delay implementation and thus only have a run-time check to
ensure proper delay-timings (in the case where delays are used before
the alarm/timer driver is registered).
Some boards already in the NuttX upstream do not have calibrated values,
but there are no users who currently own the board to submit a
calibrated value for the configurations to use. In this scenario, the
value is temporarily set to 0 and a warning is displayed so that users
of these boards are informed of the calibration process.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Mainline Linux doesn't use data encapsuation or flow control in its
tty_rpmsg driver. Create a NuttX counterpart which matches this
implementation.
This driver uses the static "rpmsg-tty" name to connect with the
remote service.
Signed-off-by: Maarten Zanders <maarten@zanders.be>
Parameter isconsole in uart_rpmsg_init() has two effects: set uart
terminal flags for typical console use and register the device as
/dev/console. These are separate things. The latter might not be
wanted in all cases.
Use the already existing config option CONFIG_RPMSG_UART_CONSOLE to
conditionally register the uart as console device.
Signed-off-by: Maarten Zanders <maarten@zanders.be>
Add support for ST7796 TFT LCD controller (320x480). The driver
implements the NuttX framebuffer interface for SPI-connected displays.
Features:
- SPI interface with CONFIG_SPI_CMDDATA for D/C pin control;
- RGB565 (16-bit) and RGB666 (18-bit) color formats;
- Runtime rotation support (0, 90, 180, 270 degrees) via MADCTL;
- Board-provided configuration via st7796_config_s structure;
- Partial screen update via updatearea for efficient rendering;
- Persistent swap buffer to avoid per-frame allocations;
- Proper ST7796S initialization sequence with documented timing;
The driver uses a board-provided configuration structure allowing
flexible setup of resolution, SPI frequency, color depth, and
initial MADCTL value without requiring Kconfig options in the
generic driver.
Architecture changes in this revision as per request:
- Moved internal register commands to .c file (private)
- Moved MADCTL bit definitions to .c file (private)
- Moved struct st7796_cmd_s to .c file (private)
- Converted MADCTL orientation macros to absolute values
- Moved CONFIG_SPI_CMDDATA error check to beginning of file
- Removed duplicated CONFIG_SPI_CMDDATA guards
- Public header contains only board configuration API
- Changed the Kconfig auto-select FB from 'select' to 'depends on'
Tested with LVGL graphics library on STM32H753ZI board (my own port).
Signed-off-by: Vinicius May <vmay.sweden@gmail.com>
Intermediate files of make depend like .ddc and .dds may remain
when make is interrupted. Remove them using make distclean.
Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
1. Move DEBUGASSERT to correct place
2. Leave it out if composite device
3. Move working thread stop to separate function
4. Call it from unbind function for composite device
Signed-off-by: Ari Kimari <ari.kimari@tii.ae>
Add a generic kmatrix lower-half with polling/debounce, STM32 board adapters, Kconfig options, a public API header, and a test example/documentation.
Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
decouple kbd / keypad.
Fix some comments
add documentation
fix rule issues
Update CMakeLists.txt
update documentation.
improve documentation
In file_dup3, the file descriptor is initialized with the O_NONBLOCK flag.
If the inode's ioctl(FIONBIO) call fails with a result other than OK or
ENOTTY, the file may be mistakenly released.
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
Improve checks for the position outside of the LCD's area. Fix the input
when possible.
Slightly improve the documentation.
Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
When the VIRTIO_RPMSG_F_CPUNAME feature is not negotiated, the driver
previously would crash due to DEBUGASSERT. This commit adds support
for a fallback mechanism:
1. Add rpmsg_virtio_probe_cpuname() API that accepts an optional cpuname
parameter to be used when VIRTIO_RPMSG_F_CPUNAME is not available.
2. Modify rptun driver to pass the cpuname from rptun device config
to rpmsg_virtio_probe_cpuname().
3. Refactor rptun device register/unregister to prioritize RPMSG device
handling before other virtio device types.
This ensures the system works correctly in scenarios where the remote
side does not support the VIRTIO_RPMSG_F_CPUNAME feature.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
The vhost driver uses work_queue() for deferred probe but was missing
the SCHED_WORKQUEUE Kconfig dependency, causing link errors on boards
that don't enable workqueue by default.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
Convert VHOST_DEFERED_PROBE_PERIOD from a raw value to use MSEC2TICK()
macro, ensuring the delay is correctly converted from milliseconds to
system ticks regardless of the configured tick rate.
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Change DRIVERS_VIRTIO and DRIVERS_VHOST from menuconfig to hidden config
options. Each virtio/vhost sub-driver now automatically selects its parent
config, eliminating the need to manually enable DRIVERS_VIRTIO or
DRIVERS_VHOST in defconfig files.
This simplifies board configuration by removing redundant CONFIG_DRIVERS_VIRTIO
entries from affected defconfig files.
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Add vhost_get_vq_buffers() API to retrieve all chained buffers from a
virtqueue in one call. This simplifies handling of scatter-gather I/O
where data spans multiple descriptors.
The function populates an array of virtqueue_buf structures with buffer
pointers and lengths, returning the descriptor head index on success.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
Fix typos in comments of drivers/power/pm/activity_governor.c and unify
comment style for consistency.
Signed-off-by: Hyunjun Lee <hyunjunk.lee@samsung.com>
since the judgment for network card selection was changed from IS_UP to
IS_RUNNING, drivers that lack carrier_on need to add the carrier_on
operation; otherwise, network access issues will occur.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Add TX/RX timestamp tracking for rpmsg_port to enable latency
measurement and debugging:
- Add rpmsg_port_get_timestamp() to retrieve buffer timestamps
- Add rpmsg_port_update_timestamp() to record timestamps at TX/RX time
- Integrate timestamp recording in rpmsg_port_spi and rpmsg_port_spi_slave
- Reserve space for rpmsg_timestamp_s in buffer size calculations
Signed-off-by: liaoao <liaoao@xiaomi.com>
Add rpmsg_get_timestamp() API to get the TX/RX timestamps of an rpmsg
buffer. This is useful for latency measurement and debugging purposes.
The new rpmsg_timestamp_s structure contains:
- tx_nsec: timestamp when the buffer was transmitted
- rx_nsec: timestamp when the buffer was received
Signed-off-by: liaoao <liaoao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Replace direct virtqueue internal field access with virtqueue_nused()
API to check for pending buffers in interrupt handlers. This improves
code maintainability and handles cached memory scenarios correctly.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Resetting during initialization can cause qemu to lock up, for example, virtio-gpu. qemu does not need to reset virtio during initialization.
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
Gpio output value must be set on OLATA and OLATB registers.
Summary
Why is this change necessary?
This is a bug fix. The MCP23x17 driver was writing GPIO output values to incorrect registers, causing output
pins to not behave as expected.
What functional part of the code is being changed?
The MCP23x17 I/O expander driver (drivers/ioexpander/mcp23x17.c).
How does the change work?
The fix ensures GPIO output values are written to the OLATA and OLATB (Output Latch) registers instead of the
incorrect registers. The OLAT registers are the proper registers for controlling the actual output pin
states on the MCP23x17.
Impact
- User experience: No adaptation required. This fix corrects existing broken behavior.
- Build: No impact.
- Hardware: Affects boards using the MCP23x17 I/O expander.
- Documentation: None required.
- Security: No impact.
- Compatibility: Backward compatible - fixes incorrect behavior.
Testing
Build Host:
- OS: Ubuntu 22.04
- Compiler: arm-none-eabi-gcc
Target:
- Architecture: ARM (RP2350)
- Board: RP2350-based board
- Configuration: Custom config with MCP23x17 enabled over I2C0
Testing performed:
- Connected MCP23x17 to RP2350 via I2C0
- Attached an LED array to all 16 GPIO pins of the MCP23x17
- Configured all 16 GPIO as outputs
- Wrote a simple test application to toggle the LEDs on and off
- Before fix: LEDs did not respond correctly to output commands
- After fix: All 16 LEDs toggle on/off as expected
Signed-off-by: paolo <paolo.volpi@gmail.com>
1. Use virtio_read_config_bytes() to read the string types in
rpmsg-virtio and virtio-net;
2. Use virtio_read_config_member() to read the elements in
virtio-snd configuration space;
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>