Skip to content

Commit

Permalink
added to step 2
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewI26 committed Feb 13, 2025
1 parent e7a738a commit 42cc87e
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 19 deletions.
3 changes: 3 additions & 0 deletions docs/docs/tutorials/extra/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Improving Configuration

Explain how to break our global variables into config.yaml.
3 changes: 3 additions & 0 deletions docs/docs/tutorials/extra/handlers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Adding Handlers

Explain how to impliment custome trace handlers
3 changes: 3 additions & 0 deletions docs/docs/tutorials/extra/trace_format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Trace File Formats

explain how to add trace file formats
4 changes: 2 additions & 2 deletions docs/docs/tutorials/setup/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,4 +42,4 @@ func main() {
}
```

This `main` function will eventually start the entire SIL application.
This `main` function will be the entry point to our entire SIL application.
69 changes: 53 additions & 16 deletions docs/docs/tutorials/setup/2.md
Original file line number Diff line number Diff line change
@@ -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
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
)
```
3 changes: 2 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 42cc87e

Please sign in to comment.