Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
yperess committed May 20, 2024
1 parent 8178000 commit 3cef8e9
Show file tree
Hide file tree
Showing 11 changed files with 920 additions and 9 deletions.
8 changes: 8 additions & 0 deletions boards/tdk/robokit1/support/tdk_robokit1.resc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:name: TDK-Robokit1
:description: This script is prepared to run Zephyr on TDK Robokit1 board.

$name?="TDK-Robokit1"

using sysbus
mach create $name
machine LoadPlatformDescription @platforms/boards/
12 changes: 12 additions & 0 deletions drivers/sensor/asahi_kasei/akm09918c/akm09918c_emul.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ static int akm09918c_emul_init(const struct emul *target, const struct device *p
ARG_UNUSED(parent);
akm09918c_emul_reset(target);

struct akm09918c_emul_data *data = target->data;

data->reg[AKM09918C_REG_CNTL2] = AKM09918C_CNTL2_CONTINUOUS_4;

Check warning on line 135 in drivers/sensor/asahi_kasei/akm09918c/akm09918c_emul.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

drivers/sensor/asahi_kasei/akm09918c/akm09918c_emul.c:135 please, no spaces at the start of a line

return 0;
}

Expand Down Expand Up @@ -204,13 +208,21 @@ static int akm09918c_emul_backend_get_sample_range(const struct emul *target,
return 0;
}

static int akm09918c_emul_backend_set_attribute(const struct emul *target,
struct sensor_chan_spec ch,
enum sensor_attribute attribute, const void *value)
{
return -ENOTSUP;
}

static const struct i2c_emul_api akm09918c_emul_api_i2c = {
.transfer = akm09918c_emul_transfer_i2c,
};

static const struct emul_sensor_driver_api akm09918c_emul_sensor_driver_api = {
.set_channel = akm09918c_emul_backend_set_channel,
.get_sample_range = akm09918c_emul_backend_get_sample_range,
.set_attribute = akm09918c_emul_backend_set_attribute,
};

#define AKM09918C_EMUL(n) \
Expand Down
Empty file.
97 changes: 97 additions & 0 deletions drivers/sensor/attributes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
attributes:
sampling_frequency:
name: "sampling rate"
description: "Sensor sampling frequency, i.e. how many times a second the sensor takes a measurement."

Check warning on line 4 in drivers/sensor/attributes.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (line-length)

drivers/sensor/attributes.yaml:4 line too long (106 > 100 characters)
units:
name: "frequency"
symbol: "Hz"
lower_thresh:
name: "lower threshold"
description: "Lower threshold for trigger."
units:
name: "unknown"
symbol: "unknown"
upper_thresh:
name: "upper threshold"
description: "Upper threshold for trigger."
units:
name: "unknown"
symbol: "unknown"
slope_th:
name: "any motion threshold"
description: "Threshold for any-motion (slope) trigger."
units:
name: "unknown"
symbol: "unknown"
slope_dur:
name: "slope value threshold duration"
description: "Duration for which the slope values needs to be outside the threshold for the trigger to fire."

Check warning on line 28 in drivers/sensor/attributes.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (line-length)

drivers/sensor/attributes.yaml:28 line too long (113 > 100 characters)
units:
name: "time"
symbol: "s"
hysteresis:
name: "hysteresis"
description: "Hysteresis for trigger thresholds."
units:
name: "unknown"
symbol: "unknown"
oversampling:
name: "oversampling factor"
description: "Oversampling factor"
units:
name: "scale"
symbol: ""
full_scale:
name: "range"
description: "Sensor range, in SI units."
units:
name: "unknown"
symbol: "unknown"
offset:
name: "value offset"
description: "The sensor value returned will be altered by the amount indicated by offset: final_value = sensor_value + offset."

Check warning on line 52 in drivers/sensor/attributes.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (line-length)

drivers/sensor/attributes.yaml:52 line too long (132 > 100 characters)
units:
name: "unknown"
symbol: "unknown"
calib_target:
name: "calibration target"
description: "Calibration target. This will be used by the internal chip's algorithms to calibrate itself on a certain axis, or all of them."

Check warning on line 58 in drivers/sensor/attributes.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (line-length)

drivers/sensor/attributes.yaml:58 line too long (145 > 100 characters)
units:
name: "unknown"
symbol: "unknown"
configuration:
name: "operating mode"
description: "Configure the operating modes of a sensor."
units:
name: "unknown"
symbol: "unknown"
calibration:
name: "calibration value"
description: "Set a calibration value needed by a sensor."
units:
name: "unknown"
symbol: "unknown"
feature_mask:
name: "enabled/disabled feature"
description: "Enable/disable sensor features"
units:
name: "unknown"
symbol: "unknown"
alert:
name: "alert threshold"
description: "Alert threshold or alert enable/disable"
units:
name: "unknown"
symbol: "unknown"
ff_dur:
name: "free-fall duration"
description: "Free-fall duration represented in milliseconds. If the sampling frequency is changed during runtime, this attribute should be set to adjust freefall duration to the new sampling frequency."

Check warning on line 88 in drivers/sensor/attributes.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (line-length)

drivers/sensor/attributes.yaml:88 line too long (207 > 100 characters)
units:
name: "time"
symbol: "ms"
batch_duration:
name: "batch duration"
description: "Hardware batch duration in ticks"
units:
name: "time"
symbol: "ticks"
15 changes: 15 additions & 0 deletions drivers/sensor/bosch/bma4xx/sensor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
deps:
- "drivers/sensor/attributes.yaml"
- "drivers/sensor/channels.yaml"
- "drivers/sensor/triggers.yaml"
compatible:
org: "bosch"
part: "bma4xx"
channels:
accel_xyz: {}
die_temp: {}
attributes:
sampling_frequency: {}
full_scale: {}
offset: {}
configuration: {}
Loading

0 comments on commit 3cef8e9

Please sign in to comment.