Skip to content

Commit 6f76ed3

Browse files
committed
Update sdd
1 parent b65806b commit 6f76ed3

File tree

2 files changed

+33
-45
lines changed

2 files changed

+33
-45
lines changed
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,53 @@
11
# Components::LoadSwitch
22

3-
A generic load switch for controlling power to components
3+
![LoadSwitch](LoadSwitch.svg)
44

5-
## Usage Examples
6-
Add usage examples here
5+
## Overview
76

8-
### Diagrams
9-
Add diagrams here
7+
The `LoadSwitch` component is an active F' component that controls a single load switch output
8+
through the `gpioSet` output port (connected to the platform's GPIO driver). It exposes two
9+
async commands to turn the switch on and off, telemetry reporting the current state, and an
10+
async `Reset` input which toggles the switch (off, short delay, on).
1011

11-
### Typical Usage
12-
The load switch would be used whenever a sensor is to be turned on or off.
12+
## Responsibility
1313

14-
## Class Diagram
15-
Add a class diagram here
14+
- Control the power rail for a connected peripheral by asserting/deasserting a GPIO.
15+
- Report state changes via an event and telemetry channel.
1616

17-
## Port Descriptions
18-
| Name | Description |
19-
|---|---|
20-
| Status | Boolean value displaying whether the load switch is on or not. |
17+
## External interface
2118

22-
## Component States
23-
| Name | Description |
24-
|-------|--------------------------------------|
25-
| Off | No power to the component |
26-
| On | Power supplied to the component |
27-
| Error | An error occurred in the load switch |
19+
### Commands
2820

29-
## Sequence Diagrams
30-
Add sequence diagrams here
21+
| Name | Description | Implementation notes |
22+
|---|---|---|
23+
| TURN_ON | Turn on the associated power rail | `TURN_ON_cmdHandler` sets the gpio via `gpioSet_out(0, Fw::Logic::HIGH)`, emits `StatusChanged` (ON), updates `IsOn` telemetry, replies OK. |
24+
| TURN_OFF | Turn off the associated power rail | `TURN_OFF_cmdHandler` sets the gpio via `gpioSet_out(0, Fw::Logic::LOW)`, emits `StatusChanged` (OFF), updates `IsOn` telemetry, replies OK. |
3125

32-
## Parameters
33-
| Name | Description |
34-
|---|---|
35-
|---|---|
26+
### Telemetry
3627

37-
## Commands
38-
| Name | Description |
39-
|---|---|
40-
| On | Turn on power to the component |
41-
| Off | Turn off power to the component |
28+
| Name | Type | Description |
29+
|---|---:|---|
30+
| IsOn | Fw.On | Current power state; written after commands and on Reset handling. |
4231

43-
## Events
44-
| Name | Description |
45-
|---|---|
46-
| StatusChanged | Emits event whenever the status of the load switch changes |
32+
### Events
4733

48-
## Telemetry
49-
| Name | Description |
50-
|---|---|
51-
| IsOn | Returns whether the load switch is supplying power to the component or not |
34+
| Name | Severity | ID | Format |
35+
|---|---|---:|---|
36+
| StatusChanged | activity high | 1 | "Load switch state changed to {}" |
5237

53-
## Unit Tests
54-
| Name | Description | Output | Coverage |
55-
|---|---|---|---|
38+
The component logs the `StatusChanged` event whenever the switch transitions due to a command or a Reset.
39+
40+
### Ports
41+
42+
| Port name | Direction | Port type | Notes |
5643
|---|---|---|---|
44+
| gpioSet | output | Drv.GpioWrite | Used to write the physical GPIO. Implementation always uses index 0 (`gpioSet_out(0, ...)`). |
45+
| Reset | input (async) | Fw.Signal | Causes the component to perform a hardware reset sequence: LOW -> wait 100ms -> HIGH. |
5746

58-
## Requirements
59-
| Name | Description | Validation |
60-
|---|---|---|
61-
|---|---|---|
6247

6348
## Change Log
49+
6450
| Date | Description |
6551
|---|---|
6652
| 10-22-2025 | Sarah, Kevin, and MoMata's first commit |
53+
| 11-07-2025 | Updated SDD to match implementation in `LoadSwitch.cpp/.hpp/.fpp` (commands, telemetry, event, ports, reset behavior). |

0 commit comments

Comments
 (0)