Skip to content

Commit 5dd97b6

Browse files
committed
import docs/ into all crate documentation
Closes #129.
1 parent fadf879 commit 5dd97b6

File tree

4 files changed

+11
-67
lines changed

4 files changed

+11
-67
lines changed

cortex-m-rtic-trace/src/lib.rs

Lines changed: 4 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,8 @@
1+
#![allow(rustdoc::bare_urls)]
2+
//! Auxilliary target-side crate for RTIC Scope configuration.
3+
#![doc = include_str!("../../docs/profile/README.md")]
14
#![no_std]
2-
//! This crate exposes functionality that eases the procedure of
3-
//! enabling tracing for embedded applications written using
4-
//! [RTIC](https://rtic.rs). A single function, [`configure`], is
5-
//! exposed that configures all relevant peripherals to trace software
6-
//! and hardware tasks. After [`configure`] has been called all hardware
7-
//! tasks will be traced. To trace software tasks each software task
8-
//! must also be decorated with the [`#[trace]`](trace) macro. See the
9-
//! below example:
10-
//!
11-
//! ```ignore
12-
//! #[rtic::app(device = stm32f4::stm32f401, dispatchers = [EXTI1])]
13-
//! mod app {
14-
//! use cortex_m_rtic_trace::{
15-
//! self,
16-
//! trace,
17-
//! TraceConfiguration,
18-
//! LocalTimestampOptions,
19-
//! GlobalTimestampOptions,
20-
//! TimestampClkSrc,
21-
//! TraceProtocol
22-
//! };
23-
//! use stm32f4::stm32f401::Interrupt;
24-
//!
25-
//! #[shared]
26-
//! struct Shared {}
27-
//!
28-
//! #[local]
29-
//! struct Local {}
30-
//!
31-
//! #[init]
32-
//! fn init(mut ctx: init::Context) -> (Shared, Local, init::Monotonics) {
33-
//! cortex_m_rtic_trace::configure(
34-
//! &mut ctx.core.DCB,
35-
//! &mut ctx.core.TPIU,
36-
//! &mut ctx.core.DWT,
37-
//! &mut ctx.core.ITM,
38-
//! 1, // task enter DWT comparator ID
39-
//! 2, // task exit DWT comparator ID
40-
//! &TraceConfiguration {
41-
//! delta_timestamps: LocalTimestampOptions::Enabled,
42-
//! absolute_timestamps: GlobalTimestampOptions::Disabled,
43-
//! timestamp_clk_src: TimestampClkSrc::AsyncTPIU,
44-
//! tpiu_freq: 16_000_000, // Hz
45-
//! tpiu_baud: 115_200, // B/s
46-
//! protocol: TraceProtocol::AsyncSWONRZ,
47-
//! }
48-
//! ).unwrap();
49-
//!
50-
//! rtic::pend(Interrupt::EXTI0);
51-
//! (Shared {}, Local {}, init::Monotonics())
52-
//! }
53-
//!
54-
//! // This hardware task is traced by calling configure above in init.
55-
//! #[task(binds = EXTI0, priority = 1)]
56-
//! fn hardware_task(_: hardware_task::Context) {
57-
//! software_task::spawn().unwrap();
58-
//! }
59-
//!
60-
//! // This software task is traced by calling configure above in init and by
61-
//! //decorating it with #[trace].
62-
//! #[task]
63-
//! #[trace]
64-
//! fn software_task(_: software_task::Context) {
65-
//! }
66-
//! }
67-
//! ```
5+
686
use cortex_m::peripheral::{
697
self as Core,
708
dwt::{AccessType, ComparatorAddressSettings, ComparatorFunction, EmitOption},

docs

rtic-scope-api/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#![allow(rustdoc::bare_urls)]
12
//! API used between RTIC Scope front- and backends.
3+
#![doc = include_str!("../../docs/profile/README.md")]
24

35
pub use itm::Timestamp;
46
use itm::{ExceptionAction, MalformedPacket, TracePacket};

rtic-scope-frontend-dummy/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#![allow(rustdoc::bare_urls)]
2+
//! Reference frontend implementation for RTIC Scope.
3+
#![doc = include_str!("../../docs/profile/README.md")]
4+
15
use anyhow::{Context, Result};
26
use rtic_scope_api as api;
37
use serde_json::Deserializer;

0 commit comments

Comments
 (0)