Skip to content

Commit f63a8fe

Browse files
Platform Applications v2.4.0
1 parent 7839a35 commit f63a8fe

File tree

16 files changed

+1011
-1
lines changed

16 files changed

+1011
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# Silicon Labs Platform Applications #
1515

16-
[![Version Badge](https://img.shields.io/badge/-v2.3.0-green)](https://github.com/SiliconLabs/bluetooth_applications/releases)
16+
[![Version Badge](https://img.shields.io/badge/-v2.4.0-green)](https://github.com/SiliconLabs/bluetooth_applications/releases)
1717
[![GSDK Badge](https://img.shields.io/badge/GSDK-v4.4.4-green)](https://github.com/SiliconLabs/gecko_sdk/releases)
1818
![License badge](https://img.shields.io/badge/License-Zlib-green)
1919

@@ -81,6 +81,7 @@ This repository provides both SLCP projects (as External Repositories) and SLS p
8181
| 54 | Platform - Sine null points detector |[Click Here](./platform_sine_null_points_detector) |
8282
| 55 | Platform - IADC Tailgating |[Click Here](./platform_iadc_tailgating) |
8383
| 56 | Platform - IADC scan multiple external inputs |[Click Here](./platform_iadc_scan_multiple_external_input) |
84+
| 57 | Platform - LDMA trigger with TIMER |[Click Here](./platform_ldma_trigger_with_timer) |
8485

8586
## Requirements ##
8687

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Platform - LDMA trigger with TIMER #
2+
![Type badge](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/SiliconLabs/application_examples_ci/master/platform_applications/platform_ldma_trigger_with_timer_common.json&label=Type&query=type&color=green)
3+
![Technology badge](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/SiliconLabs/application_examples_ci/master/platform_applications/platform_ldma_trigger_with_timer_common.json&label=Technology&query=technology&color=green)
4+
![License badge](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/SiliconLabs/application_examples_ci/master/platform_applications/platform_ldma_trigger_with_timer_common.json&label=License&query=license&color=green)
5+
![SDK badge](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/SiliconLabs/application_examples_ci/master/platform_applications/platform_ldma_trigger_with_timer_common.json&label=SDK&query=sdk&color=green)
6+
![Build badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/SiliconLabs/application_examples_ci/master/platform_applications/platform_ldma_trigger_with_timer_build_status.json)
7+
![Flash badge](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/SiliconLabs/application_examples_ci/master/platform_applications/platform_ldma_trigger_with_timer_common.json&label=Flash&query=flash&color=blue)
8+
![RAM badge](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/SiliconLabs/application_examples_ci/master/platform_applications/platform_ldma_trigger_with_timer_common.json&label=RAM&query=ram&color=blue)
9+
10+
## Overview ##
11+
12+
This project demonstrates the usage of both the LDMA and VDAC peripherals to generate a fixed frequency sine wave using TIMER0 as a trigger source. For storing the values of the sine wave, the LDMA peripheral is used, which can either be triggered via PRS or directly by the TIMER0_CC0.
13+
14+
## Gecko SDK version ##
15+
16+
- GSDK v4.4.4
17+
18+
## Hardware Required ##
19+
20+
- [EFR32xG24 Wireless 2.4 GHz +10 dBm Radio Board](https://www.silabs.com/development-tools/wireless/xg24-rb4186c-efr32xg24-wireless-gecko-radio-board?tab=overview)
21+
22+
- Wireless Starter Kit (WSTK) Mainboard (SLWMB4002A, formerly BRD4002A)
23+
24+
**Note:**
25+
26+
- Tested boards for working with this example:
27+
28+
| Board ID | Description |
29+
| ---------------------- | ------ |
30+
| BRD4210a | [EFR32XG23 868-915 MHz +20 dBm Radio Board](https://www.silabs.com/development-tools/wireless/xg23-rb4210a-efr32xg23-868-915-mhz-20-dbm-radio-board?tab=overview)|
31+
| BRD4186c | [EFR32xG24 Wireless 2.4 GHz +10 dBm Radio Board](https://www.silabs.com/development-tools/wireless/xg24-rb4186c-efr32xg24-wireless-gecko-radio-board?tab=overview)|
32+
| BRD4270b | [EFR32FG25 902-928 MHz +16 dBm Radio Board](https://www.silabs.com/development-tools/wireless/proprietary/fg25-rb4270b-efr32fg25-radio-board?tab=overview)|
33+
| BRD4400c | [EFR32xG28 2.4 GHz BLE and +14 dBm Radio Board](https://www.silabs.com/development-tools/wireless/xg28-rb4400c-efr32xg28-2-4-ghz-ble-and-14-dbm-radio-board?tab=overview)|
34+
35+
## Connections Required ##
36+
37+
Connect the board via the connector cable to your PC to flash the example.
38+
39+
## Setup ##
40+
41+
To test this application, you can either create a project based on an example project or start with an "Empty C Project" project based on your hardware.
42+
43+
### Create a project based on an example project ###
44+
45+
1. Make sure that this repository is added to [Preferences > Simplicity Studio > External Repos](https://docs.silabs.com/simplicity-studio-5-users-guide/latest/ss-5-users-guide-about-the-launcher/welcome-and-device-tabs).
46+
47+
2. From the Launcher Home, add your product name to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "ldma".
48+
49+
3. Click the **Create** button on **Platform - LDMA trigger with TIMER** example. Example project creation dialog pops up -> click Create and Finish and the project should be generated.
50+
51+
![create_project](image/create_project.png)
52+
53+
4. Build and flash this example to the board.
54+
55+
### Start with an "Empty C Project" project ###
56+
57+
1. Create an **Empty C Project** project for your hardware using Simplicity Studio 5.
58+
59+
2. Copy all files in the `inc` and `src` folders into the project root folder (overwriting the existing file).
60+
61+
3. Install the software components:
62+
63+
3.1. Open the .slcp file in the project
64+
65+
3.2. Select the SOFTWARE COMPONENTS tab
66+
67+
3.3. Install the following components:
68+
69+
- [Platform][Peripheral][VDAC]
70+
71+
- [Platform][Peripheral][LDMA]
72+
73+
- [Platform][Peripheral][PRS]
74+
75+
- [Platform][Peripheral][TIMER]
76+
77+
- [Platform][Peripheral][Init][GPIO Init] → instance name: timer
78+
79+
4. Build and flash the project to your board.
80+
81+
## How It Works ##
82+
83+
The example uses the timer's (TIMER0) compare channel (CC0) to trigger the VDAC conversion via an LDMA memory to peripheral transfer. The number of samples of the generated sine wave is specified by the `SINE_TABLE_SIZE` macro and is used by the LDMA as a single descriptor looped transfer.
84+
85+
The application defines the `PRS_MODE` macro to switch between the default timer connection interface and the PRS peripheral to connect the timer and the LDMA request line together.
86+
87+
When the timer connection interface is used (`PRS_MODE = 0`), TIMER0 requests a transfer start via the CC0 directly routed to the LDMA peripheral.
88+
89+
When PRS is used (`PRS_MODE = 1`), the peripheral utilizes the prsConsumerLDMA_REQUEST0 consumer line for the transfer's initiation.
90+
91+
A specific output frequency of the sine wave can be configured via the `TIMER0_FREQ` macro, which also takes the number of sampling points into account.
92+
93+
For an aditional debug option, the application defines the `TIMER_DEBUG` macro, which outputs the TIMER0_CC0 signal to one of the GPIOs:
94+
95+
![generated](image/generated.png)
96+
97+
### Pin Routing ###
98+
| Output pin | BRD4210a | BRD4186c | BRD4270b | BRD4400C |
99+
| --- | --- | --- | --- | --- |
100+
| VDAC0_CH0_MAIN_OUT | PB0 | PB0 | PB0 | PB0 |
101+
| SL_EMLIB_GPIO_INIT_TIMER_PIN | PA5 | PA5 | PA5 | PA11 |
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Silicon Labs Project Configuration Tools: slcp, v0, Component selection file.
2+
project_name: platform_timer_cascading
3+
label: platform_timer_cascading
4+
5+
description: |
6+
This project cascades two 32-bit timers to be able to utilize a virtual 64-bit timer peripheral. The cascading is both done via PRS and the default cascade interface.
7+
8+
category: Example|Platform
9+
package: Platform
10+
quality: experimental
11+
12+
filter:
13+
- name: Device Type
14+
value: [SoC]
15+
- name: MCU
16+
value: [32-bit MCU]
17+
- name: Project Difficulty
18+
value: [Beginner]
19+
20+
readme:
21+
- path: ../README.md
22+
23+
source:
24+
- path: ../src/app.c
25+
- path: ../src/main.c
26+
27+
include:
28+
- path: ../inc
29+
file_list:
30+
- path: brd4210a/app.h
31+
condition: [brd4210a]
32+
- path: brd4186c/app.h
33+
condition: [brd4186c]
34+
- path: brd4270b/app.h
35+
condition: [brd4270b]
36+
- path: brd4400c/app.h
37+
condition: [brd4400c]
38+
39+
component:
40+
- id: sl_system
41+
- id: device_init
42+
- id: emlib_timer
43+
- id: emlib_prs
44+
- id: emlib_vdac
45+
- id: emlib_ldma
46+
- id: emlib_gpio_simple_init
47+
instance: [timer]
48+
49+
config_file:
50+
- override:
51+
component: emlib_gpio_simple_init
52+
file_id: emlib_gpio_simple_init_config_file_id
53+
instance: timer
54+
path: ../config/brd4186c/sl_emlib_gpio_init_timer_config.h
55+
condition: [brd4186c]
56+
- override:
57+
component: emlib_gpio_simple_init
58+
file_id: emlib_gpio_simple_init_config_file_id
59+
instance: timer
60+
path: ../config/brd4210a/sl_emlib_gpio_init_timer_config.h
61+
condition: [brd4210a]
62+
- override:
63+
component: emlib_gpio_simple_init
64+
file_id: emlib_gpio_simple_init_config_file_id
65+
instance: timer
66+
path: ../config/brd4270b/sl_emlib_gpio_init_timer_config.h
67+
condition: [brd4270b]
68+
- override:
69+
component: emlib_gpio_simple_init
70+
file_id: emlib_gpio_simple_init_config_file_id
71+
instance: timer
72+
path: ../config/brd4400c/sl_emlib_gpio_init_timer_config.h
73+
condition: [brd4400c]
74+
75+
configuration:
76+
- name: SL_BOARD_ENABLE_VCOM_PORT
77+
value: gpioPortB
78+
- name: SL_BOARD_ENABLE_VCOM_PIN
79+
value: 1
80+
81+
define:
82+
- name: DEBUG_EFM
83+
84+
other_file:
85+
- path: ../image/create_project.png
86+
directory: "image"
87+
- path: ../image/generated.png
88+
directory: "image"
89+
90+
ui_hints:
91+
highlight:
92+
- path: README.md
93+
focus: true
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#ifndef SL_EMLIB_GPIO_INIT_TIMER_CONFIG_H
2+
#define SL_EMLIB_GPIO_INIT_TIMER_CONFIG_H
3+
4+
// <<< Use Configuration Wizard in Context Menu >>>
5+
6+
// <h>Pin settings
7+
8+
// <o SL_EMLIB_GPIO_INIT_TIMER_MODE> Pin mode
9+
// <gpioModeDisabled=> Disabled
10+
// <gpioModeInput=> Input
11+
// <gpioModeInputPull=> Input with pull-up/down
12+
// <gpioModeInputPullFilter=> Input with pull-up/down and filter
13+
// <gpioModePushPull=> Push-pull output
14+
// <gpioModePushPullAlternate=> Push-pull output (alternate)
15+
// <gpioModeWiredOr=> Open-source output
16+
// <gpioModeWiredOrPullDown=> Open-source output with pull-down
17+
// <gpioModeWiredAnd=> Open-drain output
18+
// <gpioModeWiredAndFilter=> Open-drain output with filter
19+
// <gpioModeWiredAndPullUp=> Open-drain output with pull-up
20+
// <gpioModeWiredAndPullUpFilter=> Open-drain output with pull-up and filter
21+
// <gpioModeWiredAndAlternate=> Open-drain output (alternate)
22+
// <gpioModeWiredAndAlternateFilter=> Open-drain output with filter (alternate)
23+
// <gpioModeWiredAndAlternatePullUp=> Open-drain output with pull-up (alternate)
24+
// <gpioModeWiredAndAlternatePullUpFilter=> Open-drain output with pull-up and
25+
// filter (alternate)
26+
// <i> Default: gpioModePushPull
27+
#define SL_EMLIB_GPIO_INIT_TIMER_MODE gpioModePushPull
28+
29+
// <o SL_EMLIB_GPIO_INIT_TIMER_DOUT> DOUT <0-1>
30+
// <i> In push-pull mode: The drive direction for the pin
31+
// <i> In input mode: Pull-up (1) or pull-down (0)
32+
// <i> In open-source mode: Set to 0 for the idle state
33+
// <i> In open-drain mode: Set to 1 for the idle state
34+
// <i> Default: 0
35+
#define SL_EMLIB_GPIO_INIT_TIMER_DOUT 0
36+
37+
// </h> end pin settings
38+
39+
// <<< end of configuration section >>>
40+
41+
// <<< sl:start pin_tool >>>
42+
43+
// <gpio> SL_EMLIB_GPIO_INIT_TIMER
44+
// $[GPIO_SL_EMLIB_GPIO_INIT_TIMER]
45+
#define SL_EMLIB_GPIO_INIT_TIMER_PORT gpioPortA
46+
#define SL_EMLIB_GPIO_INIT_TIMER_PIN 5
47+
// [GPIO_SL_EMLIB_GPIO_INIT_TIMER0]$
48+
49+
// <<< sl:end pin_tool >>>
50+
51+
#endif // SL_EMLIB_GPIO_INIT_TIMER_CONFIG_H
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#ifndef SL_EMLIB_GPIO_INIT_TIMER_CONFIG_H
2+
#define SL_EMLIB_GPIO_INIT_TIMER_CONFIG_H
3+
4+
// <<< Use Configuration Wizard in Context Menu >>>
5+
6+
// <h>Pin settings
7+
8+
// <o SL_EMLIB_GPIO_INIT_TIMER_MODE> Pin mode
9+
// <gpioModeDisabled=> Disabled
10+
// <gpioModeInput=> Input
11+
// <gpioModeInputPull=> Input with pull-up/down
12+
// <gpioModeInputPullFilter=> Input with pull-up/down and filter
13+
// <gpioModePushPull=> Push-pull output
14+
// <gpioModePushPullAlternate=> Push-pull output (alternate)
15+
// <gpioModeWiredOr=> Open-source output
16+
// <gpioModeWiredOrPullDown=> Open-source output with pull-down
17+
// <gpioModeWiredAnd=> Open-drain output
18+
// <gpioModeWiredAndFilter=> Open-drain output with filter
19+
// <gpioModeWiredAndPullUp=> Open-drain output with pull-up
20+
// <gpioModeWiredAndPullUpFilter=> Open-drain output with pull-up and filter
21+
// <gpioModeWiredAndAlternate=> Open-drain output (alternate)
22+
// <gpioModeWiredAndAlternateFilter=> Open-drain output with filter (alternate)
23+
// <gpioModeWiredAndAlternatePullUp=> Open-drain output with pull-up (alternate)
24+
// <gpioModeWiredAndAlternatePullUpFilter=> Open-drain output with pull-up and
25+
// filter (alternate)
26+
// <i> Default: gpioModePushPull
27+
#define SL_EMLIB_GPIO_INIT_TIMER_MODE gpioModePushPull
28+
29+
// <o SL_EMLIB_GPIO_INIT_TIMER_DOUT> DOUT <0-1>
30+
// <i> In push-pull mode: The drive direction for the pin
31+
// <i> In input mode: Pull-up (1) or pull-down (0)
32+
// <i> In open-source mode: Set to 0 for the idle state
33+
// <i> In open-drain mode: Set to 1 for the idle state
34+
// <i> Default: 0
35+
#define SL_EMLIB_GPIO_INIT_TIMER_DOUT 0
36+
37+
// </h> end pin settings
38+
39+
// <<< end of configuration section >>>
40+
41+
// <<< sl:start pin_tool >>>
42+
43+
// <gpio> SL_EMLIB_GPIO_INIT_TIMER
44+
// $[GPIO_SL_EMLIB_GPIO_INIT_TIMER]
45+
#define SL_EMLIB_GPIO_INIT_TIMER_PORT gpioPortA
46+
#define SL_EMLIB_GPIO_INIT_TIMER_PIN 5
47+
// [GPIO_SL_EMLIB_GPIO_INIT_TIMER0]$
48+
49+
// <<< sl:end pin_tool >>>
50+
51+
#endif // SL_EMLIB_GPIO_INIT_TIMER_CONFIG_H
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#ifndef SL_EMLIB_GPIO_INIT_TIMER_CONFIG_H
2+
#define SL_EMLIB_GPIO_INIT_TIMER_CONFIG_H
3+
4+
// <<< Use Configuration Wizard in Context Menu >>>
5+
6+
// <h>Pin settings
7+
8+
// <o SL_EMLIB_GPIO_INIT_TIMER_MODE> Pin mode
9+
// <gpioModeDisabled=> Disabled
10+
// <gpioModeInput=> Input
11+
// <gpioModeInputPull=> Input with pull-up/down
12+
// <gpioModeInputPullFilter=> Input with pull-up/down and filter
13+
// <gpioModePushPull=> Push-pull output
14+
// <gpioModePushPullAlternate=> Push-pull output (alternate)
15+
// <gpioModeWiredOr=> Open-source output
16+
// <gpioModeWiredOrPullDown=> Open-source output with pull-down
17+
// <gpioModeWiredAnd=> Open-drain output
18+
// <gpioModeWiredAndFilter=> Open-drain output with filter
19+
// <gpioModeWiredAndPullUp=> Open-drain output with pull-up
20+
// <gpioModeWiredAndPullUpFilter=> Open-drain output with pull-up and filter
21+
// <gpioModeWiredAndAlternate=> Open-drain output (alternate)
22+
// <gpioModeWiredAndAlternateFilter=> Open-drain output with filter (alternate)
23+
// <gpioModeWiredAndAlternatePullUp=> Open-drain output with pull-up (alternate)
24+
// <gpioModeWiredAndAlternatePullUpFilter=> Open-drain output with pull-up and
25+
// filter (alternate)
26+
// <i> Default: gpioModePushPull
27+
#define SL_EMLIB_GPIO_INIT_TIMER_MODE gpioModePushPull
28+
29+
// <o SL_EMLIB_GPIO_INIT_TIMER_DOUT> DOUT <0-1>
30+
// <i> In push-pull mode: The drive direction for the pin
31+
// <i> In input mode: Pull-up (1) or pull-down (0)
32+
// <i> In open-source mode: Set to 0 for the idle state
33+
// <i> In open-drain mode: Set to 1 for the idle state
34+
// <i> Default: 0
35+
#define SL_EMLIB_GPIO_INIT_TIMER_DOUT 0
36+
37+
// </h> end pin settings
38+
39+
// <<< end of configuration section >>>
40+
41+
// <<< sl:start pin_tool >>>
42+
43+
// <gpio> SL_EMLIB_GPIO_INIT_TIMER
44+
// $[GPIO_SL_EMLIB_GPIO_INIT_TIMER]
45+
#define SL_EMLIB_GPIO_INIT_TIMER_PORT gpioPortA
46+
#define SL_EMLIB_GPIO_INIT_TIMER_PIN 5
47+
// [GPIO_SL_EMLIB_GPIO_INIT_TIMER0]$
48+
49+
// <<< sl:end pin_tool >>>
50+
51+
#endif // SL_EMLIB_GPIO_INIT_TIMER_CONFIG_H

0 commit comments

Comments
 (0)