blob: a431f202ee9511a773f9bc1b17246aeb35c4f1e9 [file] [log] [blame]
Armando Montanezd2e49032019-12-06 13:06:01 -08001.. _chapter-pw-dumb-io:
2
3.. default-domain:: cpp
4
5.. highlight:: sh
6
7----------
8pw_dumb_io
9----------
10This module defines a simple and unoptimized interface for byte-by-byte
11input/output. This can be done over a logging system, stdio, UART, via a
12photodiode and modulated kazoo, or basically any way to get data in and out
13of an application.
14
15This facade doesn't dictate any policies on input and output data encoding,
16format, or transmission protocol. It only requires that backends return a
17``Status::OK`` if the operation succeeds. Backends may provide useful error
18Status types, but depending on the implementation-specific Status values is
19NOT recommended. Since this facade provides a very vague I/O interface, it
20does NOT provide tests. Backends are expected to provide their own testing to
21validate correctness.
22
23The intent of this module for simplifying bringup or otherwise getting data
24in/out of a CPU in a way that is platform-agnostic. The interface is designed
25to be easy to understand. There's no initialization as part of this
26interface, there's no configuration, and the interface is no-frills WYSIWYG
27byte-by-byte i/o.
28
29**It is strongly advised NOT to build projects on top of this interface.** There
30are many drawbacks to using this interface, so it's not generally suited for use
31in production.
32
33Setup
34=====
35This module requires relatively minimal setup:
36
37 1. Chose a ``pw_dumb_io`` backend, or write one yourself.
38 2. If using GN build, Specify the ``dir_pw_dumb_io_backend`` GN global
39 variable to point to your ``pw_dumb_io`` backend.
40
41Module usage
42============
43See backend docs for how to interact with the underlying dumb io implementation.
44
45Dependencies
46============
47 * pw_dumb_io_backend
48 * pw_span
49 * pw_status