Commit graph

809 commits

Author SHA1 Message Date
Ryan Turner
578c48a39c drivers: tones: add SDL-based beep generator
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ryan Turner <ryan@turnrye.com>
2026-07-25 20:25:10 +02:00
Ryan Turner
5c0df5478e drivers: audio: add SDL-based audio output driver
The Linux emulator had no working audio output: the speaker endpoint had a
NULL driver (streams returned -ENODEV). This adds an SDL2 audio playback
driver for the output path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ryan Turner <ryan@turnrye.com>
2026-07-25 20:25:10 +02:00
Silvano Seva
5a50737689 targets: linux: platform.c: apply clang-format
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-07-25 20:25:10 +02:00
Silvano Seva
0793f0c213 targets: linux: emulator: apply clang-format
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-07-25 20:25:10 +02:00
Silvano Seva
0d3d2a37ce drivers: audio_linux: apply clang-format
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-07-25 20:25:10 +02:00
Vlastimil Slinták
c8e31252cb drivers: NVM: add missing spi_acquire in W25Qx write path
W25Qx_writePage released the SPI bus mutex without ever acquiring it,
leaving page programs unguarded on shared buses and unlocking a mutex
possibly held by another thread. The lock was lost in the extended
addressing refactor (404e8403).

Fixes #476

Signed-off-by: Vlastimil Slinták <slintak@uart.cz>
2026-07-05 17:05:48 +02:00
Silvano Seva
2588968e6f mcu: stm32: apply clang-format to i2c_stm32 driver
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-06-11 22:55:42 +02:00
Behnood Abdollahi
39cfcb9686 mcu: stm32: make i2c driver return negative error values 2026-06-11 22:55:42 +02:00
Behnood Abdollahi
1fc055fbf2 drivers: NVM: fix out-of-bounds access in settings block rollover
Replace hard-coded block limit (2047) with ARRAY_SIZE(memory->data)
to correctly bound access to the 1024-entry NVM data array.
2026-06-06 08:51:17 +02:00
Behnood Abdollahi
a3ad4105c7 drivers: NVM: fix eraseSector return type 2026-06-06 08:40:50 +02:00
marco
8895b26831 mcu: AT32F423: add UART driver 2026-05-17 12:19:30 +02:00
marco
d6a7414902 mcu: AT32F423: add delays 2026-05-17 12:19:30 +02:00
Silvano Seva
e54d74d336 drivers: ADC: add ADC Driver for AT32F423 2026-05-17 12:19:30 +02:00
marco
7502aa4065 drivers: GPIO: add gpio driver for AT32F423 2026-05-17 12:19:30 +02:00
marco
7e749d23d3 Boot code for AT32F423 2026-05-17 12:19:30 +02:00
marco
f66a8299ab CMSIS library files for Artery AT32F423 MCU 2026-05-17 12:19:30 +02:00
Silvano Seva
3030cdc20f NVM: posix_file: make posixFile_init() return 1 on file creation
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-05-16 16:50:04 +02:00
Morgan Diepart
65d26c188b NVM: posix_file: return 0 on read/write success 2026-05-16 16:50:04 +02:00
Silvano Seva
1d185e26ff NVM: posix_file: apply clang-format
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-05-16 16:50:04 +02:00
Ryan Turner
99d0b85a5c drivers: fix Linux platform unable to read baseband audio file sources
fileSource_data() assigned dest from ctx->buffer but never wrote the
pointer back to the caller's *buf, leaving the consumer with the
original (uninitialized or stale) pointer it passed in. On the Linux
platform this meant baseband audio streamed from file sources was
silently dropped, breaking loopback and file-based baseband tests.

Set *buf = dest immediately after dest is initialized so the caller
always receives the valid buffer pointer.

Co-authored-by: GitHub Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ryan Turner <ryan@turnrye.com>
2026-05-10 10:56:06 +02:00
Silvano Seva
1ade63e469 drivers: SKY72310: set phase detector gain during init
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-04-28 21:14:04 +02:00
Silvano Seva
dc82283bd0 drivers: SKY72310: apply clang-format
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-04-28 19:55:47 +02:00
marco
94f0e31113 MD9600: read hardware info from external flash 2026-04-22 19:01:18 +02:00
Jetse Verschuren
4a83e8f6f4 targets: add mic oversampling configuration
Add oversampling for each target:
  - MD-3x0, MD-UV3x0, MD-9600, DM-1701, CS7000: 8  (64 kHz)
  - CS7000-PLUS: 6  (48 kHz, LPTIM3 cannot trigger ADC at 64 kHz)
  - All other targets default to 1 via #ifndef guard (no oversampling)

Co-authored-by: Ryan Turner <ryan@turnrye.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-04-20 20:21:52 +02:00
Ryan Turner
cec0043351 core: audio_codec: move mic gain to hwconfig files
Replace the platform-specific #ifdef chain for micGain in audio_codec.c
with a CONFIG_MIC_GAIN macro defined in each target's hwconfig.h. This
removes code forking in the codec and makes mic gain a per-device
hardware configuration parameter.

Co-authored-by: opencode <noreply@opencode.ai>
Signed-off-by: Ryan Turner <ryan@turnrye.com>
2026-04-20 20:04:29 +02:00
Ryan Turner
711c653fc2 style: apply clang-format to hwconfig files
Co-authored-by: opencode <noreply@opencode.ai>
Signed-off-by: Ryan Turner <ryan@turnrye.com>
2026-04-20 20:04:29 +02:00
Joshua Murphy
9a7363df8e drivers: gpio_stm32: fix OPEN_DRAIN_PU setup mode
It looks like this might be have been a typo. OPEN_DRAIN
and OPEN_DRAIN_PU are identical case statements, but
the pullup should be set.

Signed-off-by: Joshua Murphy <hello@joshmurphy.ca>
2026-04-17 18:22:22 +02:00
Joshua Murphy
088d906cb5 cs7000p: Update platform_getMicLevel() to use VOX input
platform_getMicLevel() now samples data from the ADC
configured for the hardware VOX circuit instead of the
microphone input ADC, which has a fixed 1.65V bias and
is unsuitable for checking mic level.

Normalization is performed specific to the characteristics
of the hardware VOX circuit. Values are output between 0-255
to ensure API compatibility.

Signed-off-by: Joshua Murphy <hello@joshmurphy.ca>
2026-04-11 19:38:21 +02:00
Joshua Murphy
0541d6e96c cs7000p: Update pinmap for VOX circuit, add ADC channel
The CS7000P schematic indicates the hardware VOX circuit
is connected to PC4 on the STM32H7. The pinmap.h file has
been updated to reflect this. The existing assignment of
AIN_VBAT to GPIOC,4 looks like a holdover from another
devices pinmap.

Create a new ADC channel, ADC_VOX_CH
assigned to the ADC matching the GPIO pin that
the VOX circuit is connected to.

Signed-off-by: Joshua Murphy <hello@joshmurphy.ca>
2026-04-11 19:38:21 +02:00
Joshua Murphy
08113428b2 audio: Cx000: reduce sine table amplitude to avoid clipping
The sine table used by the HR Cx000 DACs ranged from +32767 to
-32767, causing clipping on devices like the CS 7000P. The values
have been scaled down by a value of 2 so that clipping is prevented.

Signed-off-by: Joshua Murphy <hello@joshmurphy.ca>
2026-04-10 21:31:10 +02:00
Joshua Murphy
3cd41d7f52 CS7000 Plus: add support for vibration motor
Signed-off-by: Joshua Murphy <hello@joshmurphy.ca>
2026-04-08 17:45:00 +02:00
Morgan Diepart
d0af737f6b drivers: nvm: add driver for stm32 internal flash 2026-03-22 21:29:39 +01:00
Silvano Seva
9cc6115cc4 nvm: linux: update partition access indexes
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
90e18512ab nvm: CS7000: update partition access indexes
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
a71ea8a2d7 nvmem: move nvm_getDesc function to nvmem access API
With the introduction of the nonvolatile memory area descriptor table,
the nvm_getDesc function is not anymore required as part of the low-level
platform interface API. The function is now moved to the application
API, to provide safe access to NVM area information.

TG-795

Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
63db6e6457 nvmem: add nonvolatile memory device table
Add a data structure carrying information about the nonvolatile memory
devices present on a given target. The table contains a list of NVM area
descriptors and their number.
From now on, each target must define the "nvmTab" symbol of type "const
struct nvmTable", which represents the entry point for all the
user-space APIs to access the nonvolatile memory.

TG-795

Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
22174f0f67 nvmem: move device access API to a separate file
Moved all the helper function for low-level NVM device access to a
dedicated header file.

TG-796

Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
4a19c61b71 nvm: rename nvmDescriptor field "partNum" to "nbPart"
Renamed the "partNum" field of nvmDescriptor data structure to "nbPart"
to reduce abiguity. The older notation could have been interpreted as
"partition number" instead of "number of partitions".

Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
a93be2e323 nvm: drop the NVM_BITWRITE flag
There is no need for this flag, at least in the planned developments: to
avoid confusion and to keep the code clean, it is being removed.

Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
8133dad049 nvm: update W25Qx security register driver
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
78fcca80ba nvm: add base address field to nvmDescriptor struct
Added a field to nvmDescriptor data structure holding the absoute base
address of the memory area. The value is dependent on the specific
instance of the descriptor.

Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
83757f422a nvm: removed size field from nvmDevice data structure
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
9f75be0835 nvm: add size field to nvmDescriptor data structure
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-03-03 18:34:07 +01:00
Silvano Seva
821b6cb288 audio: apply clang-format to file_source
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2026-02-14 15:32:52 +01:00
Ryan Turner
996d25c585 audio: file_source: fix runtime bugs
Previous to this, the file source that is used on linux was not
working for me. This change addresses those issues found.

Co-authored-by: GitHub Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ryan Turner <ryan@turnrye.com>
2026-02-14 15:32:52 +01:00
Ryan Turner
95fdcd5fe2 copyright-and-license: adopt SPDX-compliant header
This change removes the old copyright header from project sources and
replaces it with a new simplified SPDX-compliant header. Note that files
that were missing the header but reasonably understood to be licensed
according to the root license were not corrected.

Signed-off-by: Ryan Turner <ryan@turnrye.com>
2026-01-14 20:10:07 +01:00
Ryan Turner
d2ddddf478 Fix incorrect include paths for platform-unique header files 2025-10-02 19:43:55 +02:00
Ryan Turner
35788b9c1c HR_C6000: add method to read 16-bit addressed registers
Acked-by: Silvano Seva <silseva@fastwebnet.it>
2025-09-28 18:11:48 +02:00
Ryan Turner
00a4dbb063 style: resolve ambiguous paths on include macros
Update meson and cmake config to only include openrtx and platform paths.
Update files to use <..> for system and external libraries, ".." for
project files and new relative paths as necessary.

Did not attempt to fix areas where includes that should be <..> were
previously ".."

Inspired by #96, closes #359.

Acked-by: Silvano Seva <silseva@fastwebnet.it>
2025-09-28 17:27:45 +02:00
JKI757
e738e18d16 stm32h7xx: rcc: configure USART1/USART6 kernel clock source to pclk2 2025-08-19 08:45:29 +02:00