summaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
Diffstat (limited to 'model')
-rw-r--r--model/driver/mpu9250.dfa48
1 files changed, 48 insertions, 0 deletions
diff --git a/model/driver/mpu9250.dfa b/model/driver/mpu9250.dfa
new file mode 100644
index 0000000..b1cc381
--- /dev/null
+++ b/model/driver/mpu9250.dfa
@@ -0,0 +1,48 @@
+codegen:
+ instance: mpu9250
+ includes: ['driver/i2c.h', 'driver/mpu9250.h']
+ flags: ['drivers=mpu9250', 'arch_drivers=i2c']
+ setup:
+ - i2c.setup();
+
+parameters:
+- accel_odr
+
+states:
+- UNINITIALIZED
+- SLEEP
+- STANDBY
+- LP_ACCEL
+- ACCEL
+- GYRO
+- MAGNET
+- NINEAXIS
+
+transition:
+ init:
+ src: [UNINITIALIZED, SLEEP, STANDBY, LP_ACCEL, ACCEL, GYRO, MAGNET, NINEAXIS]
+ dst: NINEAXIS
+ set_param:
+ accel_odr: 0
+ sleep:
+ src: [STANDBY, LP_ACCEL, ACCEL, GYRO, MAGNET, NINEAXIS]
+ dst: SLEEP
+ standby:
+ src: [STANDBY, LP_ACCEL, ACCEL, GYRO, MAGNET, NINEAXIS]
+ dst: SLEEP
+ lowPowerAccelOnly:
+ src: [SLEEP, STANDBY, NINEAXIS, ACCEL, GYRO, MAGNET]
+ dst: LP_ACCEL
+ arguments:
+ - name: rate
+ values: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
+ parameter: accel_odr
+ accelOnly:
+ src: [SLEEP, STANDBY, LP_ACCEL, GYRO, MAGNET, NINEAXIS]
+ dst: ACCEL
+ gyroOnly:
+ src: [SLEEP, STANDBY, LP_ACCEL, ACCEL, MAGNET, NINEAXIS]
+ dst: GYRO
+ magnetOnly:
+ src: [SLEEP, STANDBY, LP_ACCEL, ACCEL, GYRO, NINEAXIS]
+ dst: MAGNET