From 42cc87e6fa73a233b0b8d1d348e72494d0830a05 Mon Sep 17 00:00:00 2001 From: Andrew Iammancini Date: Thu, 13 Feb 2025 04:32:08 +0000 Subject: [PATCH] added to step 2 --- docs/docs/tutorials/extra/config.md | 3 + docs/docs/tutorials/extra/handlers.md | 3 + docs/docs/tutorials/extra/trace_format.md | 3 + docs/docs/tutorials/setup/1.md | 4 +- docs/docs/tutorials/setup/2.md | 69 +++++++++++++++++------ docs/mkdocs.yml | 3 +- 6 files changed, 66 insertions(+), 19 deletions(-) create mode 100644 docs/docs/tutorials/extra/config.md create mode 100644 docs/docs/tutorials/extra/handlers.md create mode 100644 docs/docs/tutorials/extra/trace_format.md diff --git a/docs/docs/tutorials/extra/config.md b/docs/docs/tutorials/extra/config.md new file mode 100644 index 0000000..0a43c62 --- /dev/null +++ b/docs/docs/tutorials/extra/config.md @@ -0,0 +1,3 @@ +# Improving Configuration + +Explain how to break our global variables into config.yaml. \ No newline at end of file diff --git a/docs/docs/tutorials/extra/handlers.md b/docs/docs/tutorials/extra/handlers.md new file mode 100644 index 0000000..cefb3cf --- /dev/null +++ b/docs/docs/tutorials/extra/handlers.md @@ -0,0 +1,3 @@ +# Adding Handlers + +Explain how to impliment custome trace handlers \ No newline at end of file diff --git a/docs/docs/tutorials/extra/trace_format.md b/docs/docs/tutorials/extra/trace_format.md new file mode 100644 index 0000000..383e6d8 --- /dev/null +++ b/docs/docs/tutorials/extra/trace_format.md @@ -0,0 +1,3 @@ +# Trace File Formats + +explain how to add trace file formats \ No newline at end of file diff --git a/docs/docs/tutorials/setup/1.md b/docs/docs/tutorials/setup/1.md index 6a78a8c..b2146d9 100644 --- a/docs/docs/tutorials/setup/1.md +++ b/docs/docs/tutorials/setup/1.md @@ -32,7 +32,7 @@ Open a terminal in the `sil` directory and run this command, replacing the argum go mod init github.com/example/repo ``` -This will mark our directory as a Go module and create a `go.mod` file to track our dependencies. Let's create our modules `main` function inside the `sil/cmd` directory. +This will mark our directory as a Go module and create a `go.mod` file to track our dependencies. Let's create our module's `main` function inside the `sil/cmd` directory. ```go package main @@ -42,4 +42,4 @@ func main() { } ``` -This `main` function will eventually start the entire SIL application. \ No newline at end of file +This `main` function will be the entry point to our entire SIL application. \ No newline at end of file diff --git a/docs/docs/tutorials/setup/2.md b/docs/docs/tutorials/setup/2.md index dfdf358..74c7f11 100644 --- a/docs/docs/tutorials/setup/2.md +++ b/docs/docs/tutorials/setup/2.md @@ -1,21 +1,58 @@ -# Configuration +# Defining I/O -Although our `main` function is currently empty, let's create a `config.yaml` file to store setup variables for the application. We will then pass a path to this config when we run the SIL application. +Inside the `sil/pinout` directory, we will establish the physical input and output pins our ECU's -## Create a config +```go +package pinout -Create a `config.yaml` file inside the `sil/config` directory. +//go:generate enumer -type=PhysicalIo "physicalio.go" -```yaml -revision: "sil" -canInterfaces: - veh: "vcan0" - pt: "vcan1" -resultsDir: "/abs/path/to/sil/results" -logsDir: "/abs/path/to/sil/results/logs" -tagsFilePath: "/abs/path/to/sil/config/tags.yaml" -canTracerTimeoutMinutes: 10 -silPort: 9090 -``` +// PhysicalIo represents an input/output in its physical meaning. +type PhysicalIo int -Replace these fields with \ No newline at end of file +const ( + UnknownPhysicalIo PhysicalIo = iota + + // Front Controller IOs + DebugLedEn + DashboardEn + HvilLedEn + BrakeLightEn + StatusLedEn + RtdsEn + AccelPedalPosition1 + AccelPedalPosition2 + SteeringAngle + StartButtonN + WheelSpeedLeftA + WheelSpeedLeftB + WheelSpeedRightA + WheelSpeedRightB + + // LV Controller IOs + MotorControllerPrechargeEn // Digital output from LV controller, read as digital input + InverterSwitchEn // Digital output from LV controller, read as digital input + AccumulatorEn // Digital output from LV controller, read as digital input + ShutdownCircuitEn // Digital output from LV controller, read as digital input + TsalEn + RaspiEn + FrontControllerEn + SpeedgoatEn + MotorControllerEn + ImuGpsEn + DcdcEn + DcdcValid + + // Test bench control IOs + HvCurrentSense // Current through the accumulator (electrical signal only) + LvController3v3RefVoltage // Connected to 3.3V touch point on LV controller + FrontController3v3RefVoltage // Connected to 3.3V touch point on front controller + HvilDisable // Disables HVIL on the test bench + HvilFeedback // Reads back HVIL circuit voltage on the testbench (max 5V) + GlvmsDisable // Disables power to the test bench + + // Demo Project IOs + IndicatorLed + IndicatorButton +) +``` \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 1bef175..57b7d88 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -120,8 +120,9 @@ nav: - tutorials/setup/3.md - tutorials/setup/4.md - Extra Configuration: - - tutorial/extra/trace.md + - tutorial/extra/trace_format.md - tutorial/extra/handlers.md + - tutorial/extra/config.md - Mac Formula: - macfe/index.md - macfe/setup.md