Skip to content

Commit

Permalink
webapp: Show display pin mapping in device manager
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Jan 20, 2023
1 parent b96d87b commit e3d2de0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/WebApi_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ void WebApiDeviceClass::onDeviceAdminGet(AsyncWebServerRequest* request)
ethObj[F("type")] = pin.eth_type;
ethObj[F("clk_mode")] = pin.eth_clk_mode;

JsonObject displayObj = curPin.createNestedObject("display");
displayObj[F("type")] = pin.display_type;
displayObj[F("data")] = pin.display_data;
displayObj[F("clk")] = pin.display_clk;
displayObj[F("cs")] = pin.display_cs;
displayObj[F("reset")] = pin.display_reset;

response->setLength();
request->send(response);
}
Expand Down
27 changes: 27 additions & 0 deletions webapp/src/components/PinInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,33 @@
<td>{{ currentPinAssignment?.eth?.clk_mode }}</td>
</tr>

<tr>
<td rowspan="6">Display</td>
<td>type</td>
<td>{{ selectedPinAssignment?.display?.type }}</td>
<td>{{ currentPinAssignment?.display?.type }}</td>
</tr>
<tr>
<td>data</td>
<td>{{ selectedPinAssignment?.display?.data }}</td>
<td>{{ currentPinAssignment?.display?.data }}</td>
</tr>
<tr>
<td>clk</td>
<td>{{ selectedPinAssignment?.display?.clk }}</td>
<td>{{ currentPinAssignment?.display?.clk }}</td>
</tr>
<tr>
<td>cs</td>
<td>{{ selectedPinAssignment?.display?.cs }}</td>
<td>{{ currentPinAssignment?.display?.cs }}</td>
</tr>
<tr>
<td>reset</td>
<td>{{ selectedPinAssignment?.display?.reset }}</td>
<td>{{ currentPinAssignment?.display?.reset }}</td>
</tr>

</tbody>
</table>
</div>
Expand Down
9 changes: 9 additions & 0 deletions webapp/src/types/PinMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@ export interface Ethernet {
clk_mode: number;
}

export interface Display {
type: number;
data: number;
clk: number;
cs: number;
reset: number;
}

export interface Device {
name: string;
nrf24: Nrf24;
eth: Ethernet;
display: Display;
}

export interface PinMapping extends Array<Device>{}

0 comments on commit e3d2de0

Please sign in to comment.