How eserandour/minitel1b_hard works
Project Type and Purpose
• This is an Arduino hardware‐interface library (“Minitel1B_Hard”) that implements the Minitel 1B teletext protocol over a HardwareSerial port.
• It provides a C++ API (in Minitel1B_Hard.h/.cpp) for Arduino sketches to control a Minitel terminal (display text, graphics, handle keyboard input, modem commands, etc.).
• The examples/ folder contains Arduino sketches that demonstrate usage of the API on ATmega1284P, ATmega2560 (Arduino Mega), and ESP32‐WROOM‐32E boards, often with a “3615” shield.
File Structure Analysis
• Top level:
• Minitel1B_Hard.h / .cpp – core library code implementing all Minitel functions (writeCode, getKeyCode, identifyDevice, reset, graphic, etc.)
• README.md/.txt – documentation and changelog
• LICENSE
• examples/ – sample Arduino sketches grouped into subfolders, each folder containing a single .ino that uses the library.
• No build scripts or sub‐modules; relies on Arduino IDE/Cli build system and the built‐in HardwareSerial class.
Key Insights from README
• Library supports multiple MCUs via Arduino HardwareSerial (ATmega1284P, ATmega2560, ESP32).
• Implements both text and graphic teletext modes, supports character encoding (UTF-8 handling), modem/connection commands, cursor controls, etc.
• Users interact by including #include <Minitel1B_Hard.h> and invoking its methods in their .ino sketch.
Main Components
a. Application Layer (User Sketches)
– Arduino .ino files (examples like HelloWorld, Portrait, Tweet_3615, etc.)
– Calls high‐level library functions (print, writeCode, graphic, getKeyCode)
b. Library Layer (Minitel1B_Hard)
– C++ classes & methods in Minitel1B_Hard.h/.cpp
– Implements protocol per Minitel 1B spec PDF
– Encapsulates character encoding, teletext packet construction, mode switching
c. HAL / Framework Layer
– Arduino Core / HardwareSerial API
– Serial ports (Serial, Serial1, etc.) on the MCU
d. Hardware Layer
– Microcontroller (ATmega1284P, ATmega2560, or ESP32-WROOM-32E)
– Shield 3615 or direct wiring to Minitel 1B terminal
– Minitel 1B hardware (screen, keyboard, modem interface)
e. External Resources
– Teletext specification document (stum1b.pdf) for reference
– Optional power supply, connectors, GPS clock, etc.
Relationships and Data Flows
• Sketch → calls → Library API → constructs teletext sequences → writes to → HardwareSerial port → drives → Minitel terminal
• Minitel keyboard input / status lines → read from → HardwareSerial → passed back to → Library.getKeyCode() → returned to → Sketch
• Optional “identifyDevice()” and modem commands stage control signals between MCU and Minitel hardware.
Architectural Patterns and Design Principles
• Layered architecture (Application → Library → HAL → Hardware)
• Hardware abstraction: library only depends on Arduino’s Serial interface, making it portable across boards
• Separation of concerns: encoding and protocol logic isolated in library; user code only deals with high‐level functions
• Extensibility: new functions (graphics, keyboard handling) are added by extending the API in the .h/.cpp
Elements
• Component labels and brief responsibilities
• Notes on board variants (ATmega vs. ESP32) if relevant.
• Extensibility points: user can add new sketches that call the same API.