Skip to content

Commit

Permalink
handle grove/qwiic connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Oct 31, 2023
1 parent 3453d0d commit 1c3db02
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 18 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"microcontrollers",
"pbuf",
"pixdata",
"qwiic",
"Schottky",
"Slidy",
"strcmp",
Expand Down
2 changes: 1 addition & 1 deletion jacdac-ts
Submodule jacdac-ts updated 2 files
+1 −1 jacdac-spec
+3 −1 src/jdom/spec.ts
56 changes: 39 additions & 17 deletions src/components/specification/DeviceSpecification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function storeInfo(url: string) {
"category.yahboom.com": { name: "YahBoom" },
"microbit.org": { name: "MicroBit Educational Foundation" },
"amazon.com": { name: "Amazon" },
"forwardedu.com": { name: "Forward Education"}
"forwardedu.com": { name: "Forward Education" },
}

return infos[host] || { name: host }
Expand Down Expand Up @@ -200,7 +200,9 @@ export default function DeviceSpecification(props: {
<Typography component="div" variant="subtitle1">
by{" "}
<Link
to={`/devices/${identifierToUrlPath(company).replace(' ', '-')}/`}
to={`/devices/${identifierToUrlPath(
company
).replace(" ", "-")}/`}
>
{company}
</Link>
Expand Down Expand Up @@ -231,6 +233,24 @@ export default function DeviceSpecification(props: {
consume power the Jacdac bus.
</Alert>
)}
{connector === "grove" && (
<Alert severity="warning">
<AlertTitle>Grove connector.</AlertTitle>
This device has a Grove connector and is <b>
not
</b>{" "}
compatible with Jacdac cables.
</Alert>
)}
{connector === "qwiic" && (
<Alert severity="warning">
<AlertTitle>Qwiic connector.</AlertTitle>
This device has a Qwiic connector and is <b>
not
</b>{" "}
compatible with Jacdac cables.
</Alert>
)}
{requiredDeviceSpecs?.map(({ id, name }) => (
<Alert mb={1} key={id} severity="warning">
<AlertTitle>Requires {name}.</AlertTitle>
Expand Down Expand Up @@ -330,21 +350,23 @@ export default function DeviceSpecification(props: {
/>
</>
)}
{!!services?.length && (
<PageLinkList
header={
<>
<Divider light={true} />
<h3 id="devicescriptextensions">
DeviceScript Clients
</h3>
</>
}
nodes={services.map(serviceSpecificationFromClassIdentifier).map(srv => ({
href: `https://microsoft.github.io/devicescript/api/clients/${srv.shortId}`,
title: srv.name,
}))}
/>
{!!services?.length && (
<PageLinkList
header={
<>
<Divider light={true} />
<h3 id="devicescriptextensions">
DeviceScript Clients
</h3>
</>
}
nodes={services
.map(serviceSpecificationFromClassIdentifier)
.map(srv => ({
href: `https://microsoft.github.io/devicescript/api/clients/${srv.shortId}`,
title: srv.name,
}))}
/>
)}
<DeviceSpecificationList
header={<h3 id="kitdevices">Kit Devices</h3>}
Expand Down
6 changes: 6 additions & 0 deletions src/pages/tools/device-registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,12 @@ export default function DeviceRegistration() {
PCB edge connector, passive - passthrough for
power and signal
</MenuItem>
<MenuItem value="grove">
Grove connector
</MenuItem>
<MenuItem value="qwiic">
Qwiic connector
</MenuItem>
</Select>
<Typography variant="caption" component="div">
Choose the type of Jacdac connector present on the
Expand Down

0 comments on commit 1c3db02

Please sign in to comment.