From 662e53e3e17a24df0c419a128021eda05acaca5a Mon Sep 17 00:00:00 2001 From: Nav Date: Thu, 17 Oct 2024 23:58:16 +0100 Subject: [PATCH] Tweaks to TC docs --- src/TargetController/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/TargetController/README.md b/src/TargetController/README.md index 5a16829f..448c6142 100644 --- a/src/TargetController/README.md +++ b/src/TargetController/README.md @@ -10,7 +10,7 @@ TargetController component can be found in src/TargetController. The entry point The TargetController is the second (after the SignalHandler) component to be instantiated at startup, and the second to last to be destroyed when Bloom shuts down. -The TargetController will outlive both the DebugServer and the Insight GUI components. +The TargetController will outlive both the DebugServer and Insight GUI components. ### Interfacing with the TargetController - The command-response mechanism @@ -167,7 +167,7 @@ All descriptor structs can be found in [src/Targets/](../Targets). The `TargetDescriptor` struct is the top-level descriptor struct. Instances of all other descriptor structs can be accessed via the `TargetDescriptor` struct. -The `GetTargetDescriptor` command returns a const reference to the top-level target descriptor object. +The `GetTargetDescriptor` command returns a const reference to a top-level target descriptor object. The `TargetControllerService::getTargetDescriptor()` member function can be used to obtain the top-level target descriptor: @@ -175,7 +175,7 @@ descriptor: const auto& targetDescriptor = tcService.getTargetDescriptor(); // Obtain info on the target's "data" address space -const auto& dataAsDescriptor = targetDescriptor.getAddressSpaceDescriptor("data"); +const auto& dataAsDescriptor = targetDescriptor.getAddressSpaceDescriptor("data"); // The "data" argument is the address space key /** * - dataAsDescriptor.addressRange.startAddress <- the start address of the address space * - dataAsDescriptor.size() <- the size of the address space, in bytes @@ -185,7 +185,7 @@ const auto& dataAsDescriptor = targetDescriptor.getAddressSpaceDescriptor("data" */ // Obtain info on the target's "ADC0" peripheral -const auto& adcPerDescriptor = targetDescriptor.getPeripheralDescriptor("adc0"); +const auto& adcPerDescriptor = targetDescriptor.getPeripheralDescriptor("adc0"); // The "adc0" argument is the peripheral key /** * - adcPerDescriptor.name <- the name of the peripheral * - adcPerDescriptor.getRegisterGroupDescriptor(...) <- Access a register group within the peripheral @@ -233,7 +233,7 @@ can be passed safely to the TargetController, in any TargetController command. Both the debug server and Insight GUI components hold a const reference of the master target descriptor, allowing them to access target information freely. -Do **not** modify the master target descriptor. Do **not** perform a `const_cast` on the const reference. Ever. +Do **not** mutate the master target descriptor (via `const_cast` or by any other means). Ever. ### Target state observation