Loading include/driver/lm75.h +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ class LM75 { unsigned int getHyst(); void setOS(unsigned char os); void setHyst(unsigned char hyst); void init(); void shutdown(); }; extern LM75 lm75; Loading model/driver/lm75.dfa 0 → 100644 +35 −0 Original line number Diff line number Diff line instance: lm75 parameters: - os - hyst states: - UNINITIALIZED - POWEROFF - ACTIVE transition: shutdown: src: [UNINITIALIZED, POWEROFF, ACTIVE] dst: POWEROFF init: src: [UNINITIALIZED, POWEROFF, ACTIVE] dst: ACTIVE getTemp: src: [ACTIVE] dst: ACTIVE setOS: src: [ACTIVE] dst: ACTIVE arguments: - name: os values: [30, 90] parameter: os setHyst: src: [ACTIVE] dst: ACTIVE arguments: - name: hyst values: [29, 60] parameter: hyst src/driver/lm75.cc +14 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,18 @@ void LM75::setHyst(unsigned char hyst) i2c.xmit(address, 3, txbuf, 0, rxbuf); } void LM75::init() { txbuf[0] = 0x01; txbuf[1] = 0x00; i2c.xmit(address, 2, txbuf, 0, rxbuf); } void LM75::shutdown() { txbuf[0] = 0x01; txbuf[1] = 0x01; i2c.xmit(address, 2, txbuf, 0, rxbuf); } LM75 lm75(0x48); Loading
include/driver/lm75.h +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ class LM75 { unsigned int getHyst(); void setOS(unsigned char os); void setHyst(unsigned char hyst); void init(); void shutdown(); }; extern LM75 lm75; Loading
model/driver/lm75.dfa 0 → 100644 +35 −0 Original line number Diff line number Diff line instance: lm75 parameters: - os - hyst states: - UNINITIALIZED - POWEROFF - ACTIVE transition: shutdown: src: [UNINITIALIZED, POWEROFF, ACTIVE] dst: POWEROFF init: src: [UNINITIALIZED, POWEROFF, ACTIVE] dst: ACTIVE getTemp: src: [ACTIVE] dst: ACTIVE setOS: src: [ACTIVE] dst: ACTIVE arguments: - name: os values: [30, 90] parameter: os setHyst: src: [ACTIVE] dst: ACTIVE arguments: - name: hyst values: [29, 60] parameter: hyst
src/driver/lm75.cc +14 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,18 @@ void LM75::setHyst(unsigned char hyst) i2c.xmit(address, 3, txbuf, 0, rxbuf); } void LM75::init() { txbuf[0] = 0x01; txbuf[1] = 0x00; i2c.xmit(address, 2, txbuf, 0, rxbuf); } void LM75::shutdown() { txbuf[0] = 0x01; txbuf[1] = 0x01; i2c.xmit(address, 2, txbuf, 0, rxbuf); } LM75 lm75(0x48);