# agaelema/embedded_printf architecture

> Architecture diagram of the GitHub repository agaelema/embedded_printf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/agaelema/embedded_printf
- Repository: https://github.com/agaelema/embedded_printf

## Overview

Embedded_Printf is a small C library for formatting and converting values on microcontrollers, with serial output as its primary user-to-result path: callers use the printf-like or simple print APIs, numeric values are converted to text, and bytes are sent through a device-configured UART. It also exposes string-to-number conversion and terminal line movement. The main source files and UART configuration are excerpted; the example applications are visible only in the tree, so their runtime connections are omitted.

Main entry points: [`embedded_printf.c`](https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c) (Formatted print), [`serial_conf.h`](https://github.com/agaelema/embedded_printf/blob/master/serial_conf.h) (UART interface), [`serial_conf.c`](https://github.com/agaelema/embedded_printf/blob/master/serial_conf.c) (UART configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_formatting["Formatting and conversion"]
  node_printf_api["Formatted print<br/>[embedded_printf.c]"]
  node_simple_print["Simple print APIs<br/>[embedded_printf.c]"]
  node_string_format["String formatting<br/>[embedded_printf.c]"]
  node_integer_format["Integer conversion<br/>[embedded_printf.c]"]
  node_float_format["Float conversion<br/>[embedded_printf.c]"]
  node_string_parse["String parsing<br/>[embedded_printf.c]"]
end

subgraph group_serial["Serial output"]
  node_line_control["Terminal line control<br/>[embedded_printf.c]"]
  node_char_output["Character output<br/>[embedded_printf.c]"]
  node_uart_api["UART interface<br/>[serial_conf.h]"]
  node_uart_config["UART configuration<br/>[serial_conf.c]"]
  node_uart_device["MSP430 UART"]
end

node_caller(("Library caller"))

node_caller -->|"calls"| node_printf_api
node_caller -->|"calls"| node_simple_print
node_caller -->|"calls"| node_string_parse
node_printf_api -->|"formats strings"| node_string_format
node_printf_api -->|"converts integers"| node_integer_format
node_printf_api -.->|"converts floats"| node_float_format
node_printf_api -.->|"emits characters"| node_char_output
node_simple_print -->|"converts numbers"| node_integer_format
node_simple_print -.->|"converts floats"| node_float_format
node_simple_print -->|"prints strings"| node_string_format
node_string_format -.->|"emits characters"| node_char_output
node_line_control -->|"emits escapes"| node_char_output
node_char_output -.->|"sends bytes"| node_uart_api
node_uart_config -->|"configures UART"| node_uart_device
node_uart_api -->|"transmits bytes"| node_uart_device

click node_printf_api "https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c"
click node_simple_print "https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c"
click node_string_format "https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c"
click node_integer_format "https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c"
click node_float_format "https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c"
click node_string_parse "https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c"
click node_line_control "https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c"
click node_char_output "https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c"
click node_uart_api "https://github.com/agaelema/embedded_printf/blob/master/serial_conf.h"
click node_uart_config "https://github.com/agaelema/embedded_printf/blob/master/serial_conf.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_printf_api,node_simple_print,node_string_format,node_integer_format,node_float_format,node_string_parse toneBlue
class node_line_control,node_char_output,node_uart_api,node_uart_config,node_uart_device toneAmber
class node_caller toneIndigo
```

## Components

### Formatting and conversion

- [Formatted print](https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c): `embedded_printf.c`
- [Simple print APIs](https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c): `embedded_printf.c`
- [String formatting](https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c): `embedded_printf.c`
- [Integer conversion](https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c): `embedded_printf.c`
- [Float conversion](https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c): `embedded_printf.c`
- [String parsing](https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c): `embedded_printf.c`

### Serial output

- [Terminal line control](https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c): `embedded_printf.c`
- [Character output](https://github.com/agaelema/embedded_printf/blob/master/embedded_printf.c): `embedded_printf.c`
- [UART interface](https://github.com/agaelema/embedded_printf/blob/master/serial_conf.h): `serial_conf.h`
- [UART configuration](https://github.com/agaelema/embedded_printf/blob/master/serial_conf.c): `serial_conf.c`
- **MSP430 UART**

### Other components

- **Library caller**

## Connections

- Library caller → Formatted print: calls (evidence: `README.md`)
- Library caller → Simple print APIs: calls (evidence: `README.md`)
- Library caller → String parsing: calls (evidence: `README.md`)
- Formatted print → String formatting: formats strings (evidence: `embedded_printf.c`)
- Formatted print → Integer conversion: converts integers (evidence: `embedded_printf.c`)
- Formatted print → Float conversion: converts floats (evidence: `embedded_printf.c`)
- Formatted print → Character output: emits characters (evidence: `embedded_printf.c`)
- Simple print APIs → Integer conversion: converts numbers (evidence: `embedded_printf.c`)
- Simple print APIs → Float conversion: converts floats (evidence: `embedded_printf.c`)
- Simple print APIs → String formatting: prints strings (evidence: `embedded_printf.c`)
- String formatting → Character output: emits characters (evidence: `embedded_printf.c`)
- Terminal line control → Character output: emits escapes (evidence: `embedded_printf.c`)
- Character output → UART interface: sends bytes (evidence: `embedded_printf.c`)
- UART configuration → MSP430 UART: configures UART (evidence: `serial_conf.c`)
- UART interface → MSP430 UART: transmits bytes
