Some counters, such as those that use fractional adders, tick at
resolutions greater than 4294967295Hz. This changes the freq in the common
info to a uint64_t. This adds a KConfig that can be selected by a driver.
This also has the counter ticks to sec (and vice versa) helper functions
call the get frequency for 64 bits if the kconfig is selected.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Since we have already supported sniff mode,
the corresponding link mode change event should be received.
Signed-off-by: Zhijie Zhong <zhongzhijie1@xiaomi.com>
Moves clock selection/assignment from the clock driver to the
peripherals that subscribe to the clock. This allows multiple
devices such as PWM/Counters to share a peripheral clock.
Signed-off-by: John Batch <john.batch@infineon.com>
CID (card id register) can be useful to application for traceability of SD
cards (#66460).
Adds disk ioctl command to get the CID data that is read at initialisation.
Changes the card_read_cid function to take pointer to cid register so that
the ioctl command can utilize with the passed user buf. Updated
calling functions to pass this pointer.
Signed-off-by: John Whittington <git@jbrengineering.co.uk>
CID (card id register) can be useful to application for traceability of SD
cards.
Adds disk ioctl command to get the CID data that is read at initialisation.
The struct sd_cid is moved to sd_card so that it can be read and retrieved
by card_ioctrl.
Signed-off-by: John Whittington <git@jbrengineering.co.uk>
Add an optional power policy hook to provide custom "next event"
ticks during pm_system_suspend(), in addition to the existing
kernel ticks and policy event list.
This hook enables applications and SoC-specific code to derive
the next wake-up time directly from proprietary or
hardware-specific data structures (e.g. hardware registers,
binary-only modules, complex schedulers) that are not
practical to convert into the standard PM policy event list.
The feature is gated by CONFIG_PM_CUSTOM_TICKS_HOOK and is fully
backwards compatible when disabled.
Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
On !MMU && !PCIE && !EXTERNAL_ADDRESS_TRANSLATION platforms, the
device_map() isn't defined, thus brings below ramconsole build error:
ram_console.c: In function 'ram_console_init':
ram_console.c:49:9: error: implicit declaration of function 'device_map'
Previously, I solved this issue in a workaround style[1] as below:
+#ifndef DEVICE_MMIO_IS_IN_RAM
+#define device_map(virt, phys, size, flags) *(virt) = (phys)
+#endif /* DEVICE_MMIO_IS_IN_RAM */
But during the PR review progress, pathcing device_mmio.h is suggested.
This patch implements that suggestion.
Link: https://github.com/zephyrproject-rtos/zephyr/pull/97894 [1]
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Add csr_swap() macro that performs an atomic CSR read and write using
the csrrw instruction. This completes the set of CSR access primitives
alongside the existing csr_read, csr_write, csr_read_set, and
csr_read_clear macros.
The csrrw instruction atomically reads the current CSR value into a
register while simultaneously writing a new value, which is required
for operations like IMSIC interrupt claiming where the read and write
must be indivisible.
Signed-off-by: Afonso Oliveira <afonsoo@synopsys.com>
Add a callback mechanism to allow applications to handle incoming
BR/EDR connection requests and decide whether to accept or reject
them, as well as specify the desired role (central/peripheral).
Update bt_br_set_connectable() to accept an optional callback function
parameter. When provided, callback is invoked on incoming connection
requests, allowing the application to inspect the remote device address
and Class of Device before accepting or rejecting the connection.
If no callback is provided, the connection request is accepted
internally with the default behavior based on the
`CONFIG_BT_ACCEPT_CONN_AS_CENTRAL` configuration option.
The accept_conn() function is updated to:
- Call the registered callback if available
- Pass the remote device address and Class of Device to the callback
- Accept the connection if the callback returns BT_BR_CONN_REQ_ACCEPT_*
- If the returned value is BT_BR_CONN_REQ_ACCEPT_CENTRAL, the role
switch will be requested.
- Reject the connection if the callback returns BT_BR_CONN_REQ_REJECT_*
- Add error handling and logging for failed connection acceptance
Update all existing callers of bt_br_set_connectable() to pass NULL
for the callback parameter to maintain backward compatibility.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Implement more co-processor commands in the FT8xx display driver.
The list of the new implemented commands consists of:
* CMD_FGCOLOR
* CMD_BGCOLOR
* CMD_SLIDER
* CMD_TOGGLE
* CMD_TRACK
Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
The function was casting a char* help pointer to struct shell_cmd_help*
and reading its 4-byte magic field. When the help string was shorter
than 4 bytes, this caused a read past the end of the buffer.
The fix replaces the struct cast with a byte-by-byte comparison of the
magic number.
Fixeszephyrproject-rtos/zephyr#102598
Co-authored-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Reference audio clock frequencies are supposed to be integer multiplies
of sampling frequency (44100 * 256 = 11289600, 48000 * 256 = 12288000)
and not some arbitrary numbers.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
The K_TIMEOUT_SUM() macro is intended as a means to add two
k_timeout_t values together. This may be useful for a developer
applying an exponential backoff algorithm.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Modifies the CS40L5x driver to use the error callback mechanism
added to the haptics API instead of a device-specific API
extension.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
Haptics devices provide protection features to prevent damage during
operation. Adds an error callback mechanism to the haptics API to
enable haptics device drivers to raise these conditions to the
application layer. Enumerates a subset of errors that are common
to modern haptics devices across major vendors.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
The current PMS7003 sensor driver in Zephyr only supports reading the
basic PM1.0, PM2.5, and PM10 concentration values.
This update extends the driver to support additional data provided by the
PMS7003 sensor, including:
- Standard particle concentration values (CF=1) for PM1.0, PM2.5, and PM10
- Particle counts for particles greater than or equal to 0.3 µm, 0.5 µm,
1.0 µm, 2.5 µm, 5.0 µm, and 10.0 µm per 0.1 liter of air
Adding support for these readings allows applications to access more
detailed particulate data, improving the sensor’s usability in air quality
monitoring and analysis scenarios.
Signed-off-by: Hanan Arshad <hananarshad619@gmail.com>
Add clock control and UART support for PSOC 4 family:
- Clock control drivers with PSOC 4 compatibility
- PSOC4xx clock source bindings and definitions
- HF clock divider configuration support
- UART FIFO trigger level configuration for PSOC 4100S Max
series with 8-deep FIFO (RX trigger=7, TX trigger=0)
Signed-off-by: Braeden Lane <Braeden.Lane@infineon.com>
Moved dsa_tag.h to include folder as common header file.
And we will support iterable section for vendor dsa tag
protocol drivers registering.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Upgrades the thread user_options to 16 bits from an 8-bit value to
provide more space for future values.
Also, as the size of this field has changed, the values for the
existing architecture specific thread options have also shifted
from the upper end of the old 8-bit field, to the upper end of
the new 16-bit field.
Fixes#101034
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Add device Self Test procedure. It is required to enable the
per device self-test DT property as well as the LSM6DSV16X_SELF_TEST
configuration.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
One might see this compile error depending on what order the
POSIX headers are included
include/zephyr/net/net_compat.h:143: error: "IFNAMSIZ" redefined
.../zephyr/include/zephyr/net/net_compat.h:143:
error: "IFNAMSIZ" redefined [-Werror]
143 | #define IFNAMSIZ NET_IFNAMSIZ
|
In file included from ...
.../zephyr/include/zephyr/posix/net/if.h:16:
note: this is the location of the previous definition
16 | #define IFNAMSIZ IF_NAMESIZE
|
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
There was a Kconfig option defined to limit the number of additional DNS
queries sent for aliases received in CNAME records (to avoid potential
query loops), however it was not implemented. This commit implements the
feature - the resolver will now only send up to
CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES follow-up queries after
receiving CNAME record with an alias w/o any IP addresses.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fix pm_policy_event_register() and pm_policy_event_update signatures
when CONFIG_PM is disabled.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
While the tty_* api already has functions
to set the rx and the tx timeout, the console_*
api didn't had one.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
use k_timeout_t internally, that way
the timeout has only to be calculated, when setting it and not
every time when it is used.
Also use the ys_timepoint* api instead of
counting the ms.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This helps in benchamrking raw socket (packet socket) performance in the
lines of UDP/TCP.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This commit updates the STM32Fx clock driver to add complete support for
all PLLs for all SoCs.
Supports all outputs and additional divisors:
- PLL-DIV-R
- PLLI2S-P
- PLLI2S-DIV-Q
- PLLI2S-DIV-R
Adds global checks to make sure that all:
- All PLLs share the same source clocks
- All PLLs share the same M-Divisor (on applicable SoCs)
- Both div-X and div-divX are defined (on applicable SoCs)
Functions get_plli2s_source and get_plli2ssrc_frequency are added to make
sure that PLLI2S can be used even if PLL is not defined.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>