From 86638f0ecdbfd5d5c86f664fc5717c6154a67973 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 24 May 2019 08:33:40 +0200 Subject: energy model WiP --- model/arch/msp430fr5969lp/driver/gpio.dfa | 13 +++++++++++++ model/arch/posix/driver/gpio.dfa | 31 +++++++++++++++++++++++++++++++ model/driver/lm75.dfa | 1 + model/driver/sharp96.dfa | 1 + 4 files changed, 46 insertions(+) create mode 100644 model/arch/msp430fr5969lp/driver/gpio.dfa create mode 100644 model/arch/posix/driver/gpio.dfa (limited to 'model') diff --git a/model/arch/msp430fr5969lp/driver/gpio.dfa b/model/arch/msp430fr5969lp/driver/gpio.dfa new file mode 100644 index 0000000..b1f0708 --- /dev/null +++ b/model/arch/msp430fr5969lp/driver/gpio.dfa @@ -0,0 +1,13 @@ +states: + - UNINITIALIZED + - P0_INPUT + - P0_INPUT_PULLUP + - P0_OUTPUT_LOW + - P0_OUTPUT_HIGH + +transition: + setup: + src: [UNINITIALIZED] + dst: P0_OUTPUT + input: + src: [P0_INPUT, P0_INPUT_PULLUP, P0_OUTPUT_LOW, P0_OUTPUT_HIGH] diff --git a/model/arch/posix/driver/gpio.dfa b/model/arch/posix/driver/gpio.dfa new file mode 100644 index 0000000..84c78e4 --- /dev/null +++ b/model/arch/posix/driver/gpio.dfa @@ -0,0 +1,31 @@ +codegen: + instance: gpio + includes: ['driver/gpio.h'] + +states: + - UNINITIALIZED + - P0_INPUT + - P0_OUTPUT + +parameters: + - px00_status + +transition: + setup: + src: [UNINITIALIZED] + dst: P0_OUTPUT + input: + src: [P0_INPUT, P0_OUTPUT] + dst: P0_INPUT + arguments: + - name: pin + values: ['GPIO::px00'] + output: + src: [P0_INPUT, P0_OUTPUT] + dst: P0_OUTPUT + arguments: + - name: pin + values: ['GPIO::px00'] + - name: value + values: [0, 1] + parameter: px00_status diff --git a/model/driver/lm75.dfa b/model/driver/lm75.dfa index 2c136f9..4f47afd 100644 --- a/model/driver/lm75.dfa +++ b/model/driver/lm75.dfa @@ -1,6 +1,7 @@ codegen: instance: lm75 includes: ['driver/lm75.h'] + flags: ['drivers=lm75', 'arch_drivers=i2c'] parameters: - os diff --git a/model/driver/sharp96.dfa b/model/driver/sharp96.dfa index 9b356db..9ea510d 100644 --- a/model/driver/sharp96.dfa +++ b/model/driver/sharp96.dfa @@ -2,6 +2,7 @@ codegen: instance: sharp96 includes: ['driver/spi_b.h', 'driver/sharp96.h'] setup: ['spi.setup();', 'sharp96.setup();'] + flags: ['drivers=sharp96', 'arch_drivers=spi_b,counter'] states: - UNINITIALIZED -- cgit v1.2.3