Skip to content

Commit 87b0e2f

Browse files
committed
1-Wire Bus + DS18B20
1 parent 7c8e242 commit 87b0e2f

17 files changed

+4120
-21
lines changed

app.ts

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { spi0, spi1 } from "./spi-adc/SpiAdcBus";
99
import { i2c } from "./i2c-bus/I2cBus";
1010
import { gdc } from "./generic/genericDevices";
1111
import { setTimeout } from "timers";
12+
import { oneWire } from "./one-wire/OneWireBus";
1213
require("source-map-support/register")
1314

1415
export function initAsync() {
@@ -22,13 +23,15 @@ export function initAsync() {
2223
.then(function () { spi0.initAsync(cont.spi0); })
2324
.then(function () { spi1.initAsync(cont.spi1); })
2425
.then(function () { i2c.initAsync(cont.i2c); })
26+
.then(function () { oneWire.initAsync(cont.oneWire)})
2527
.then(function () { gdc.initAsync(cont.genericDevices); });
2628
}
2729
export async function stopAsync(): Promise<void> {
2830
try {
2931
console.log(`Shutting down Relay Equipment Manager`);
3032
try { await connBroker.stopAsync(); } catch (err) { console.error(`Error stopping Connection Broker: ${err.message}`); }
3133
try { await gdc.closeAsync(); } catch (err) { console.error(`Error stopping generic device controller: ${err.message}`); }
34+
try { await oneWire.closeAsync(); } catch (err) { console.error(`Error stopping 1-wire bus interface: ${err.message}`); }
3235
try { await i2c.closeAsync(); } catch (err) { console.error(`Error stopping I2c bus interface: ${err.message}`); }
3336
try { await spi0.closeAsync(); } catch (err) { console.error(`Error stopping SPI0 bus interface: ${err.message}`); }
3437
try { await spi1.closeAsync(); } catch (err) { console.error(`Error stopping SPI1 bus interface: ${err.message}`); }

boards/Controller.ts

+1,084-4
Large diffs are not rendered by default.

defaultController.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
},
1414
"i2c": { "isActive": false },
1515
"connections": [],
16-
"genericDevices": {"isActive": true}
16+
"genericDevices": {"isActive": true},
17+
"oneWire": { "isActive": false }
1718
}

devices/AnalogDevices.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,5 +254,5 @@ export class DeviceStatus {
254254
public lastComm: number;
255255
public protocol: string;
256256
public busNumber: number;
257-
public address: number;
257+
public address: number|string;
258258
}

0 commit comments

Comments
 (0)