Skip to content

Commit

Permalink
i2c updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mkellner committed Nov 2, 2016
1 parent b8b3544 commit 3a4774f
Show file tree
Hide file tree
Showing 22 changed files with 103 additions and 40 deletions.
8 changes: 4 additions & 4 deletions kinoma/kpr/libraries/Pins/aspen/pins_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function setPin(mux, pin, type)
case 0: mux.back[37] = type; break;
case 1: mux.back[36] = type; break;
case 2: mux.back[39] = type; break;
case 3: mux.back[40] = type; break;
case 3: mux.back[38] = type; break;
case 4: mux.back[43] = type; break;
case 5: mux.back[42] = type; break;
case 6: mux.back[47] = type; break;
Expand Down Expand Up @@ -125,7 +125,7 @@ function setPin(mux, pin, type)
case 37: mux.leftPins[0] = type; break;
case 36: mux.leftPins[1] = type; break;
case 39: mux.leftPins[2] = type; break;
case 40: mux.leftPins[3] = type; break;
case 38: mux.leftPins[3] = type; break;
case 43: mux.leftPins[4] = type; break;
case 42: mux.leftPins[5] = type; break;
case 47: mux.leftPins[6] = type; break;
Expand Down Expand Up @@ -269,8 +269,8 @@ exports.getFixed = function(directions)
{ pin: 44, type: "Mirrored" },
{ pin: 45, type: "Ground" },
{ pin: 46, type: "Ground" },
{ pin: 43, type: "Mirrored" },
{ pin: 44, type: "Mirrored" },
{ pin: 47, type: "Mirrored" },
{ pin: 48, type: "Mirrored" },
{ pin: 49, type: "Power", voltage: 3.3 },
{ pin: 50, type: "Power", voltage: 5 },
];
Expand Down
8 changes: 4 additions & 4 deletions kinoma/kpr/libraries/Pins/mac/pins_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function setPin(mux, pin, type)
case 0: mux.back[37] = type; break;
case 1: mux.back[36] = type; break;
case 2: mux.back[39] = type; break;
case 3: mux.back[40] = type; break;
case 3: mux.back[38] = type; break;
case 4: mux.back[43] = type; break;
case 5: mux.back[42] = type; break;
case 6: mux.back[47] = type; break;
Expand Down Expand Up @@ -125,7 +125,7 @@ function setPin(mux, pin, type)
case 37: mux.leftPins[0] = type; break;
case 36: mux.leftPins[1] = type; break;
case 39: mux.leftPins[2] = type; break;
case 40: mux.leftPins[3] = type; break;
case 38: mux.leftPins[3] = type; break;
case 43: mux.leftPins[4] = type; break;
case 42: mux.leftPins[5] = type; break;
case 47: mux.leftPins[6] = type; break;
Expand Down Expand Up @@ -269,8 +269,8 @@ exports.getFixed = function(directions)
{ pin: 44, type: "Mirrored" },
{ pin: 45, type: "Ground" },
{ pin: 46, type: "Ground" },
{ pin: 43, type: "Mirrored" },
{ pin: 44, type: "Mirrored" },
{ pin: 47, type: "Mirrored" },
{ pin: 48, type: "Mirrored" },
{ pin: 49, type: "Power", voltage: 3.3 },
{ pin: 50, type: "Power", voltage: 5 },

Expand Down
8 changes: 4 additions & 4 deletions kinoma/kpr/libraries/Pins/pi/pins_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ exports.getFixed = function(directions)
var fixedPins = [
{ pin: 1, type: "Power", voltage: 3.3 },
{ pin: 2, type: "Power", voltage: 5 },
{ pin: 3, type: "I2CData", sda: 3, bus: 1 },
{ pin: 3, type: "I2CData", bus: 0 },
{ pin: 4, type: "Power", voltage: 5 },
{ pin: 5, type: "I2CClock", clock: 5, bus: 1 },
{ pin: 5, type: "I2CClock", bus: 0 },
{ pin: 6, type: "Ground" },
{ pin: 7, type: "Digital", direction: directions[7] },
{ pin: 8, type: "UartTX" },
Expand All @@ -247,8 +247,8 @@ exports.getFixed = function(directions)
{ pin: 24, type: "Digital", direction: directions[24] },
{ pin: 25, type: "Ground" },
{ pin: 26, type: "Digital", direction: directions[26] },
{ pin: 27, type: "Digital", direction: directions[27] },
{ pin: 28, type: "Digital", direction: directions[28] },
{ pin: 27, type: "Ground" },
{ pin: 28, type: "Ground" },
{ pin: 29, type: "Digital", direction: directions[29] },
{ pin: 30, type: "Ground" },
{ pin: 31, type: "Digital", direction: directions[31] },
Expand Down
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/andro/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/beaglebone/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/chip/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/edison/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,7 +96,7 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}

7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/guitar/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/hikey/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/iap140/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/iap220/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/linkit7688/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/nanopim1/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,7 +96,7 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}

7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/odroidc2/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/pi/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
7 changes: 5 additions & 2 deletions kinoma/kpr/projects/embed/devices/pine64/pins/I2C.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ exports.pins = {
i2c: {type: "I2C"}
}

exports.configure = function()
exports.configure = function(configuration)
{
this.sda = configuration.pins.i2c.sda;
this.clock = configuration.pins.i2c.clock;
this.bus = configuration.pins.i2c.bus;
this.i2c.init();
}

Expand Down Expand Up @@ -93,6 +96,6 @@ exports.processCallSMB = function(param)
exports.setAddress = function(address)
{
this.i2c.close();
this.i2c = PINS.create( { type: "I2C", sda: this.sda, clock: this.clock, address: address } );
this.i2c = PINS.create( { type: "I2C", bus: this.bus, sda: this.sda, clock: this.clock, address: address } );
this.i2c.init();
}
3 changes: 2 additions & 1 deletion xs6/sources/mc/modules/xm_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ xs_wm_connect(xsMachine *the)
{
switch (xsTypeOf(xsArg(0))) {
case xsIntegerType:
case xsNumberType: {
case xsNumberType:
case xsStringType:{
uint32_t state = xsToInteger(xsArg(0));
switch (state & MC_CONNECTION_MODE_MASK) {
case MC_CONNECTION_CONFIG_NORMAL:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3a4774f

Please sign in to comment.