A DMOD (Dynamic Modular System) module for UART (Universal Asynchronous Receiver-Transmitter) communication on embedded microcontrollers.
- Standard DMDRVI Interface: Read/write/ioctl device access pattern
- Configurable Parameters: Baud rate, data bits, parity, stop bits, flow control
- Multiple Instances: Support for multiple UART peripherals simultaneously
- Hardware Abstraction: Platform-independent API with hardware-specific implementations
- DMDRVI Integration: Full DMOD driver interface implementation
- STM32 Support: STM32F7 family currently supported
- Extensible: Easy to add support for additional microcontroller families
Using dmf-get from the DMOD release package:
dmf-get install dmuartOr install with a pre-configured setup for your board:
# Create a dependencies file (deps.dmd)
echo "dmuart@latest board/stm32f746g-disco.ini" > deps.dmd
# Install with configuration
dmf-get -d deps.dmd --config-dir ./config- Create a configuration file (
config.ini):
[dmuart]
baudrate=115200
databits=8
parity=none
stopbits=1
flowcontrol=none
instance=1- Use in your code:
#include "dmuart.h"
#include "dmdrvi.h"
#include "dmini.h"
// Load configuration and create device
dmini_context_t config = dmini_load("config.ini");
dmdrvi_dev_num_t dev_num = {0};
dmdrvi_context_t uart_ctx = dmuart_dmdrvi_create(config, &dev_num);
// Open device for read/write
void* handle = dmuart_dmdrvi_open(uart_ctx, DMDRVI_O_RDWR);
// Write data
const char* msg = "Hello UART!\n";
dmuart_dmdrvi_write(uart_ctx, handle, msg, strlen(msg), 0);
// Read data
char buffer[64];
size_t n = dmuart_dmdrvi_read(uart_ctx, handle, buffer, sizeof(buffer), 0);
// Cleanup
dmuart_dmdrvi_close(uart_ctx, handle);
dmuart_dmdrvi_free(uart_ctx);
dmini_free(config);- CMake 3.18 or higher
- ARM GCC toolchain (for embedded targets)
- DMOD framework (automatically fetched)
# Configure for STM32F7
cmake -DDMUART_MCU_SERIES=stm32f7 -B build
# Build
cmake --build buildComprehensive documentation is available in the docs/ directory:
- dmuart.md - Module overview and architecture
- api-reference.md - Complete API documentation
- configuration.md - Configuration guide with examples
- port-implementation.md - Guide for adding hardware support
View documentation using dmf-man:
dmf-man dmuart # Main documentation
dmf-man dmuart api # API reference
dmf-man dmuart config # Configuration guide
dmf-man dmuart port # Port implementation guide| Platform | Status | Notes |
|---|---|---|
| STM32F7 | β Supported | Full UART support (USART1-6, UART4-5, UART7-8) |
| Other STM32 | π§ In Progress | Easy to add using STM32 common code |
| Other MCUs | π Planned | Contributions welcome |
[dmuart]
baudrate=115200
databits=8
parity=none
stopbits=1
flowcontrol=none
instance=1[dmuart]
baudrate=9600
databits=8
parity=even
stopbits=1
flowcontrol=none
instance=2[dmuart]
baudrate=921600
databits=8
parity=none
stopbits=1
flowcontrol=rts_cts
instance=1dmuart/
βββ configs/ # Pre-configured board and MCU configurations
β βββ board/ # Board-specific configurations
β βββ mcu/ # MCU-specific configurations
βββ docs/ # Documentation (markdown format)
βββ examples/ # Example configurations
βββ include/ # Public headers
β βββ dmuart.h # Main API
β βββ dmuart_port.h # Port layer API
β βββ port/ # Port-specific headers
βββ src/
β βββ dmuart.c # Core implementation
β βββ port/ # Hardware-specific implementations
β βββ stm32_common/ # Common STM32 code
β βββ stm32f7/ # STM32F7 port
βββ tests/ # Test applications
βββ CMakeLists.txt # Build configuration
βββ manifest.dmm # DMOD manifest
See Port Implementation Guide for detailed instructions on adding support for new microcontrollers.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Patryk Kubiak - Initial work
- DMOD - Dynamic Modular System framework
- DMINI - INI configuration parser for DMOD
- DMDRVI - DMOD Driver Interface
- DMGPIO - GPIO driver module
- DMCLK - Clock configuration module
For issues, questions, or contributions:
- Open an issue on GitHub
- Check the documentation in
docs/ - Use
dmf-man dmuartfor command-line help