Home
last modified time | relevance | path

Searched +full:switch +full:- +full:sample (Results 1 – 25 of 321) sorted by relevance

12345678910>>...13

/Zephyr-latest/samples/net/dsa/
DREADME.rst1 .. zephyr:code-sample:: dsa
2 :name: DSA (Distributed Switch Architecture)
3 :relevant-api: DSA
5 Test and debug Distributed Switch Architecture
10 Example on testing/debugging Distributed Switch Architecture
12 The source code for this sample application can be found at:
18 - :ref:`networking_with_host`
25 Follow these steps to build the DSA sample application:
27 .. zephyr-app-commands::
28 :zephyr-app: samples/net/dsa
/Zephyr-latest/samples/boards/nordic/nrfx_prs/
DREADME.rst1 .. zephyr:code-sample:: nrf_nrfx_prs
9 This sample shows how to use in Zephyr nRF peripherals that share the same ID
11 share certain hardware resources, but it is possible to switch between them and
15 this sample uses the nrfx drivers directly for those peripheral instances that
18 Zephyr console and SPIM1 is used for performing additional sample transfers).
20 The sample uses two buttons:
21 - by pressing Button 1 user can request a transfer to be performed using the
23 - by pressing Button 2 user can switch between the two peripherals
28 The sample outputs on the standard console the hex codes of all sent and
35 on the boards supported by the sample are assigned as MOSI/MISO and TX/RX pins.
[all …]
Dsample.yaml1 sample:
4 sample.boards.nrf.nrfx_prs:
6 - nrf5340dk/nrf5340/cpuapp
7 - nrf9160dk/nrf9160
9 - nrf5340dk/nrf5340/cpuapp
10 - nrf9160dk/nrf9160
17 - "nrfx PRS example on .*"
18 - "-> press \".*\" to trigger a transfer"
19 - "-> press \".*\" to switch the type of peripheral"
20 - "Switched to SPIM"
[all …]
/Zephyr-latest/drivers/sensor/adi/adxl345/
Dadxl345_decoder.c4 * SPDX-License-Identifier: Apache-2.0
53 static inline void adxl345_accel_convert_q31(q31_t *out, int16_t sample, int32_t range, in adxl345_accel_convert_q31() argument
57 switch (range) { in adxl345_accel_convert_q31()
59 if (sample & BIT(9)) { in adxl345_accel_convert_q31()
60 sample |= ADXL345_COMPLEMENT_MASK(10); in adxl345_accel_convert_q31()
64 if (sample & BIT(10)) { in adxl345_accel_convert_q31()
65 sample |= ADXL345_COMPLEMENT_MASK(11); in adxl345_accel_convert_q31()
69 if (sample & BIT(11)) { in adxl345_accel_convert_q31()
70 sample |= ADXL345_COMPLEMENT_MASK(12); in adxl345_accel_convert_q31()
74 if (sample & BIT(12)) { in adxl345_accel_convert_q31()
[all …]
/Zephyr-latest/drivers/sensor/f75303/
Df75303.c4 * SPDX-License-Identifier: Apache-2.0
25 uint8_t off_h, uint8_t off_l, uint16_t *sample) in f75303_fetch() argument
41 *sample = val_h << 3 | val_l >> 5; in f75303_fetch()
48 struct f75303_data *data = dev->data; in f75303_fetch_local()
49 const struct f75303_config *config = dev->config; in f75303_fetch_local()
51 return f75303_fetch(&config->i2c, in f75303_fetch_local()
54 &data->sample_local); in f75303_fetch_local()
59 struct f75303_data *data = dev->data; in f75303_fetch_remote1()
60 const struct f75303_config *config = dev->config; in f75303_fetch_remote1()
62 return f75303_fetch(&config->i2c, in f75303_fetch_remote1()
[all …]
/Zephyr-latest/samples/drivers/led/is31fl3194/
DREADME.rst1 .. zephyr:code-sample:: is31fl3194
3 :relevant-api: led_interface
10 This sample cycles several colors on an RGB LED forever using the LED API.
15 This sample can be built and executed on an Arduino Nicla Sense ME, or on
20 .. zephyr-app-commands::
21 :zephyr-app: samples/drivers/led/is31fl3194
26 After flashing, the LED starts to switch colors and messages with the current
27 LED color are printed on the console. If a runtime error occurs, the sample
/Zephyr-latest/samples/shields/x_nucleo_53l0a1/
DREADME.rst1 .. zephyr:code-sample:: x-nucleo-53l0a1
2 :name: X-NUCLEO-53L0A1 shield
3 :relevant-api: sensor_interface gpio_interface
5 Interact with the 7-segment display and VL53L0X ranging sensor of an X-NUCLEO-53L0A1 shield.
9 This sample demonstrate the usage of the 4 digits x 7 segments display and the
12 When flashed on a board, 2 modes are available. To switch from one mode to the
16 -------------------------
23 --------------------------------
31 To switch from one mode to another, press the button ``sw0``
36 This sample communicates over I2C with the X-NUCLEO-53L0A1 shield
[all …]
/Zephyr-latest/tests/benchmarks/latency_measure/src/
Dcondvar.c4 * SPDX-License-Identifier: Apache-2.0
10 * 2. Signal a condition variable (with context switch)
43 sum[0] += timing_cycles_get(&start, &timestamp.sample); in start_thread_entry()
44 sum[1] += timing_cycles_get(&timestamp.sample, &finish); in start_thread_entry()
66 timestamp.sample = timing_timestamp_get(); in alt_thread_entry()
88 priority - 2, start_options, K_FOREVER); in condvar_blocking_ops()
95 priority - 1, alt_options, K_FOREVER); in condvar_blocking_ops()
111 "%-40s - Wait for a condvar (context switch)", tag); in condvar_blocking_ops()
123 "%-40s - Signal a condvar (context switch)", tag); in condvar_blocking_ops()
Dfifo.c4 * SPDX-License-Identifier: Apache-2.0
108 priority - 1, options, K_FOREVER); in fifo_ops()
119 "%-40s - Add data to FIFO (no ctx switch)", tag); in fifo_ops()
122 cycles -= timestamp_overhead_adjustment(options, options); in fifo_ops()
131 "%-40s - Get data from FIFO (no ctx switch)", tag); in fifo_ops()
133 cycles -= timestamp_overhead_adjustment(options, options); in fifo_ops()
143 "%-40s - Allocate to add data to FIFO (no ctx switch)", tag); in fifo_ops()
154 "%-40s - Free when getting data from FIFO (no ctx switch)", tag); in fifo_ops()
193 mid = timestamp.sample; in alt_thread_entry()
214 mid = timestamp.sample; in alt_thread_entry()
[all …]
Dlifo.c4 * SPDX-License-Identifier: Apache-2.0
108 priority - 1, options, K_FOREVER); in lifo_ops()
119 "%-40s - Add data to LIFO (no ctx switch)", tag); in lifo_ops()
122 cycles -= timestamp_overhead_adjustment(options, options); in lifo_ops()
131 "%-40s - Get data from LIFO (no ctx switch)", tag); in lifo_ops()
133 cycles -= timestamp_overhead_adjustment(options, options); in lifo_ops()
143 "%-40s - Allocate to add data to LIFO (no ctx switch)", tag); in lifo_ops()
154 "%-40s - Free when getting data from LIFO (no ctx switch)", tag); in lifo_ops()
193 mid = timestamp.sample; in alt_thread_entry()
214 mid = timestamp.sample; in alt_thread_entry()
[all …]
/Zephyr-latest/samples/sensor/th02/
DREADME.rst1 .. zephyr:code-sample:: th02
3 :relevant-api: sensor_interface
9 This sample periodically reads temperature and humidity from the Grove
17 This sample uses the TH02 sensor and the grove LCD display. Both devices are
22 - `Grove Temperature And Humidity`_
23 - `Grove LCD Module`_
31 The LCD display requires 5 volts, so the voltage switch on the shield needs to
38 - TH02 (Si7005): https://www.silabs.com/documents/public/data-sheets/Si7005.pdf
41 .. _Grove LCD Module: http://wiki.seeed.cc/Grove-LCD_RGB_Backlight/
42 …emperature And Humidity: http://wiki.seeed.cc/Grove-TemptureAndHumidity_Sensor-High-Accuracy_AndMi…
/Zephyr-latest/drivers/sensor/maxim/max44009/
Dmax44009.c4 * SPDX-License-Identifier: Apache-2.0
22 const struct max44009_config *config = dev->config; in max44009_reg_read()
40 if (i2c_transfer_dt(&config->i2c, msgs, 2) != 0) { in max44009_reg_read()
41 return -EIO; in max44009_reg_read()
50 const struct max44009_config *config = dev->config; in max44009_reg_write()
53 return i2c_write_dt(&config->i2c, tx_buf, sizeof(tx_buf)); in max44009_reg_write()
63 return -EIO; in max44009_reg_update()
81 return -ENOTSUP; in max44009_attr_set()
84 switch (attr) { in max44009_attr_set()
87 cr = val->val1 * 1000 + val->val2 / 1000; in max44009_attr_set()
[all …]
/Zephyr-latest/samples/boards/espressif/xt_wdt/
DREADME.rst1 .. zephyr:code-sample:: esp32-xt-wdt
9 This sample shows how to work with XTAL32K Watchdog Timer (XT WDT) peripheral.
10 To properly run this sample, you need to have a board with an external 32.728 Hz
14 the XT WDT interrupt. Internally the hardware switch the RTC SLOW clock source from
23 * ESP32-C3
24 * ESP32-S2
25 * ESP32-S3
33 .. code-block:: console
35 west build -p -b esp32s3_devkitm/esp32s3/procpu samples/boards/espressif/xt_wdt
41 Sample Output
[all …]
/Zephyr-latest/samples/drivers/display/src/
Dmain.c4 * Based on ST7789V sample:
7 * SPDX-License-Identifier: Apache-2.0
11 LOG_MODULE_REGISTER(sample, LOG_LEVEL_INF);
51 switch (corner) { in fill_buffer_argb8888()
76 switch (corner) { in fill_buffer_rgb888()
103 switch (corner) { in get_rgb565_color()
149 switch (corner) { in fill_buffer_mono()
193 LOG_ERR("Device %s not found. Aborting sample.", in main()
194 display_dev->name); in main()
202 LOG_INF("Display sample for %s", display_dev->name); in main()
[all …]
/Zephyr-latest/tests/benchmarks/latency_measure/
DREADME.rst7 * Context switch time between preemptive threads using k_yield
8 * Context switch time between cooperative threads using k_yield
9 * Time to switch from ISR back to interrupted thread
12 * Time to signal a semaphore then test that semaphore with a context switch
21 * Time it takes to wait on a fifo.lifo.(and context switch)
22 * Time it takes to wake and switch to a thread waiting on a fifo.LIFO
24 * Time it takes to wait for events (and context switch)
25 * Time it takes to wake and switch to a thread waiting for events
42 EXTRA_CONF_FILE="prj.userspace.conf" west build -p -b <board> <path to project>
51 +-----------------------------+------------------------------------+
[all …]
/Zephyr-latest/drivers/sensor/adi/adxl362/
Dadxl362_decoder.c4 * SPDX-License-Identifier: Apache-2.0
52 *out = ((data_in - ADXL362_TEMP_BIAS_LSB) / ADXL362_TEMP_LSB_PER_C in adxl362_temp_convert_q31()
72 buffer + sizeof(struct adxl362_fifo_data) + enc_data->fifo_byte_count; in adxl362_decode_stream()
85 if (enc_data->has_tmp) { in adxl362_decode_stream()
89 uint64_t period_ns = accel_period_ns[enc_data->accel_odr]; in adxl362_decode_stream()
91 /* Calculate which sample is decoded. */ in adxl362_decode_stream()
93 sample_num = ((uint8_t *)*fit - buffer) / sample_set_size; in adxl362_decode_stream()
108 if (enc_data->has_tmp) { in adxl362_decode_stream()
112 data->header.base_timestamp_ns = enc_data->timestamp; in adxl362_decode_stream()
113 data->header.reading_count = 1; in adxl362_decode_stream()
[all …]
/Zephyr-latest/samples/basic/custom_dts_binding/
DREADME.rst1 .. zephyr:code-sample:: gpio-custom-dts-binding
3 :relevant-api: gpio_interface devicetree-generic-id devicetree-generic-exist
10 In Zephyr, all hardware-specific configuration is described in the devicetree.
18 For typical use cases like LEDs or buttons, the existing :dtcompatible:`gpio-leds` or
19 :dtcompatible:`gpio-keys` compatibles can be used.
21 This sample demonstrates how to use a GPIO pin for other purposes with a custom devicetree binding.
25 :zephyr_file:`samples/basic/custom_dts_binding/dts/bindings/power-switch.yaml`. The gate driver for
35 Afterwards, the sample can be built and executed for the ``<board>`` as follows:
37 .. zephyr-app-commands::
38 :zephyr-app: samples/basic/custom_dts_binding
[all …]
/Zephyr-latest/drivers/sensor/st/iis2mdc/
Diis2mdc.c1 /* ST Microelectronics IIS2MDC 3-axis magnetometer sensor
5 * SPDX-License-Identifier: Apache-2.0
28 struct iis2mdc_data *iis2mdc = dev->data; in iis2mdc_set_odr()
31 switch (val->val1) { in iis2mdc_set_odr()
45 return -EINVAL; in iis2mdc_set_odr()
48 if (iis2mdc_data_rate_set(iis2mdc->ctx, odr)) { in iis2mdc_set_odr()
49 return -EIO; in iis2mdc_set_odr()
60 struct iis2mdc_data *iis2mdc = dev->data; in iis2mdc_set_hard_iron()
65 offset[i] = val->val1; in iis2mdc_set_hard_iron()
69 return iis2mdc_mag_user_offset_set(iis2mdc->ctx, offset); in iis2mdc_set_hard_iron()
[all …]
/Zephyr-latest/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/
Dradio_df.c4 * SPDX-License-Identifier: Apache-2.0
33 * MAX_DFE_GPIO-1, with the given parenthesized separator.
44 /* Selection of GPIOs to be used to switch antennas by Radio */
57 /* The number of dfegpio[n]-gpios properties which are set. */
64 * dfegpio[n]-gpios properties which are set.
81 * Check that we have an antenna switch pattern for the DFE idle
91 "Set the dfe-pdu-antenna devicetree property.");
102 * - SWITCHPATTERN[0] for idle period (PDU Tx/Rx), in radio_df_ant_switch_pattern_set()
103 * - SWITCHPATTERN[1] for guard and reference period, in radio_df_ant_switch_pattern_set()
104 * - SWITCHPATTERN[2] and following for switch-sampling slots. in radio_df_ant_switch_pattern_set()
[all …]
/Zephyr-latest/subsys/sensing/sensor/phy_3d_sensor/
Dphy_3d_sensor.c4 * SPDX-License-Identifier: Apache-2.0
39 scaled_value = -scaled_value; in shifted_q31_to_scaled_int64()
48 return (q31_t)((val * BIT(31 - shift) / scale)); in scaled_int64_to_shifted_q31()
103 const struct phy_3d_sensor_config *cfg = dev->config; in phy_3d_sensor_init()
104 struct phy_3d_sensor_data *data = dev->data; in phy_3d_sensor_init()
107 for (i = 0; i < cfg->sensor_num; i++) { in phy_3d_sensor_init()
108 switch (cfg->sensor_types[i]) { in phy_3d_sensor_init()
110 data->customs[i] = &custom_accel; in phy_3d_sensor_init()
113 data->customs[i] = &custom_gyro; in phy_3d_sensor_init()
117 cfg->sensor_types[i]); in phy_3d_sensor_init()
[all …]
/Zephyr-latest/drivers/sensor/st/lsm6dso/
Dlsm6dso.c1 /* ST Microelectronics LSM6DSO 6-axis IMU sensor driver
5 * SPDX-License-Identifier: Apache-2.0
36 return -EINVAL; in lsm6dso_freq_to_odr_val()
47 return lsm6dso_odr_map[ARRAY_SIZE(lsm6dso_odr_map) - 1]; in lsm6dso_odr_to_freq_val()
62 return -EINVAL; in lsm6dso_accel_range_to_fs_val()
86 return -EINVAL; in lsm6dso_gyro_range_to_fs_val()
91 const struct lsm6dso_config *cfg = dev->config; in lsm6dso_reboot()
92 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm6dso_reboot()
95 return -EIO; in lsm6dso_reboot()
98 /* Wait sensor turn-on time as per datasheet */ in lsm6dso_reboot()
[all …]
/Zephyr-latest/drivers/sensor/st/lsm6dso16is/
Dlsm6dso16is.c1 /* ST Microelectronics LSM6DSO16IS 6-axis IMU sensor driver
5 * SPDX-License-Identifier: Apache-2.0
38 return -EINVAL; in lsm6dso16is_freq_to_odr_val()
49 return lsm6dso16is_odr_map[ARRAY_SIZE(lsm6dso16is_odr_map) - 1]; in lsm6dso16is_odr_to_freq_val()
64 return -EINVAL; in lsm6dso16is_accel_range_to_fs_val()
80 return -EINVAL; in lsm6dso16is_gyro_range_to_fs_val()
85 const struct lsm6dso16is_config *cfg = dev->config; in lsm6dso16is_reboot()
86 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm6dso16is_reboot()
89 return -EIO; in lsm6dso16is_reboot()
92 /* Wait sensor turn-on time as per datasheet */ in lsm6dso16is_reboot()
[all …]
/Zephyr-latest/samples/net/secure_mqtt_sensor_actuator/src/
Ddevice.c4 * SPDX-License-Identifier: Apache-2.0
55 int device_read_sensor(struct sensor_sample *sample) in device_read_sensor() argument
60 /* Read sample only if a real sensor device is present in device_read_sensor()
64 sample->unit = SENSOR_UNIT; in device_read_sensor()
65 sample->value = 20.0 + (double)sys_rand32_get() / UINT32_MAX * 5.0; in device_read_sensor()
71 LOG_ERR("Failed to fetch sensor sample [%d]", rc); in device_read_sensor()
81 sample->unit = SENSOR_UNIT; in device_read_sensor()
82 sample->value = sensor_value_to_double(&sensor_val); in device_read_sensor()
90 switch (state) { in device_write_led()
107 rc = -EINVAL; in device_write_led()
[all …]
/Zephyr-latest/drivers/sensor/st/ism330dhcx/
Dism330dhcx.c1 /* ST Microelectronics ISM330DHCX 6-axis IMU sensor driver
5 * SPDX-License-Identifier: Apache-2.0
39 return -EINVAL; in ism330dhcx_freq_to_odr_val()
50 return ism330dhcx_odr_map[ARRAY_SIZE(ism330dhcx_odr_map) - 1]; in ism330dhcx_odr_to_freq_val()
66 return -EINVAL; in ism330dhcx_accel_range_to_fs_val()
104 return -EINVAL; in ism330dhcx_gyro_range_to_fs_val()
109 struct ism330dhcx_data *data = dev->data; in ism330dhcx_reboot()
111 if (ism330dhcx_boot_set(data->ctx, 1) < 0) { in ism330dhcx_reboot()
112 return -EIO; in ism330dhcx_reboot()
115 /* Wait sensor turn-on time as per datasheet */ in ism330dhcx_reboot()
[all …]
/Zephyr-latest/boards/segger/ip_k66f/doc/
Dindex.rst6 The Segger IP Switch Board is a Evaluation board based on NXP Kinetis K66 MCU.
7 It comes with Micrel/Microchip KSZ8794CNX integrated 4-port 10/100 managed
8 Ethernet switch with Gigabit RGMII/MII/RMII interface.
10 - KSZ8794CNX enables evaluation for switch functions
11 - On-board debug probe J-Link-OB for programming
16 - MK66FN2M0VMD18 MCU (180 MHz, 2 MB flash memory, 256 KB RAM, low-power,
17 crystal-less USB
18 - Dual role USB interface with micro-B USB connector
19 - 2 User LED
20 - On-board debug probe J-Link-OB for programming
[all …]

12345678910>>...13