Skip to content

Commit b8cd7a2

Browse files
Platform Applications v2.2.0
1 parent 59d7a0a commit b8cd7a2

File tree

25 files changed

+2107
-3
lines changed

25 files changed

+2107
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
# Silicon Labs Platform Applications #
1515

16-
[![Version Badge](https://img.shields.io/badge/-v2.1.0-green)](https://github.com/SiliconLabs/bluetooth_applications/releases)
17-
[![GSDK Badge](https://img.shields.io/badge/GSDK-v4.4.3-green)](https://github.com/SiliconLabs/gecko_sdk/releases)
16+
[![Version Badge](https://img.shields.io/badge/-v2.2.0-green)](https://github.com/SiliconLabs/bluetooth_applications/releases)
17+
[![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

2020
This repo contains example projects that demonstrate various applicaitons using the peripherals of Silicon Labs EFM32 and EFR32 parts.
@@ -78,6 +78,8 @@ This repository provides both SLCP projects (as External Repositories) and SLS p
7878
| 51 | Platform - EFR32xG21 Polled SPI Throughput | [Click Here](./platform_spi_flash_bandwidth/polled) |
7979
| 52 | Platform - Flash blank checking using the GPCRC | [Click Here](./platform_gpcrc_blank_check) |
8080
| 53 | Platform - Timer cascading |[Click Here](./platform_timer_cascade) |
81+
| 54 | Platform - Sine null points detector |[Click Here](./platform_sine_null_points_detector) |
82+
| 55 | Platform - IADC Tailgating |[Click Here](./platform_iadc_tailgating) |
8183

8284
## Requirements ##
8385

platform_iadc_tailgating/README.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Platform - IADC Tailgating #
2+
![Type badge](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/SiliconLabs/application_examples_ci/master/platform_applications/platform_iadc_tailgating_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_iadc_tailgating_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_iadc_tailgating_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_iadc_tailgating_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_iadc_tailgating_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_iadc_tailgating_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_iadc_tailgating_common.json&label=RAM&query=ram&color=blue)
9+
10+
## Overview ##
11+
12+
This example project demonstrates the usage of the IADC in tailgating mode. This mode gives ultimate priority to the Scan queue. The IADC will only perform single conversions immediately after completing a scan sequence. This allows the system to use the scan queue for high-priority conversions with tight timing requirements, and the single queue for low-priority, on-demand conversion events.
13+
14+
Note that this setting should only be used when scan conversions are guaranteed to trigger. If no scan sequence is triggered, any single conversion trigger will remain pending indefinitely. It is also important to note that if there is not enough time between scan conversions to service a single conversion, the next scan sequence will be delayed.
15+
16+
## Gecko SDK version ##
17+
18+
- GSDK v4.4.3
19+
20+
## Hardware Required ##
21+
22+
- [EFM32PG23 Pro Kit](https://www.silabs.com/development-tools/mcu/32-bit/efm32pg23-pro-kit?tab=overview)
23+
24+
**Note:**
25+
26+
- Tested boards for working with this example:
27+
28+
| Board ID | Description |
29+
| ---------------------- | ------ |
30+
| BRD4181b | [EFR32xG21A Wireless Gecko 2.4 GHz +10 dBm Radio Board with Secure Vault](https://www.silabs.com/development-tools/wireless/slwrb4181b-efr32xg21-wireless-gecko-radio-board?tab=overview)|
31+
| BRD4182a | [EFR32xG22 Wireless Gecko 2.4 GHz +6 dBm 5x5, QFN40 Radio Board](https://www.silabs.com/development-tools/wireless/slwrb4182a-efr32xg22-wireless-gecko-radio-board?tab=overview)|
32+
| 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)|
33+
| 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)|
34+
| BRD4270b | [EFR32FG25 902-928 MHz +16 dBm Radio Board](https://www.silabs.com/development-tools/wireless/proprietary/fg25-rb4270b-efr32fg25-radio-board?tab=overview)|
35+
| BRD4194a | [EFR32xG27 Wireless 2.4 GHz +8 dBm Radio Board](https://www.silabs.com/development-tools/wireless/xg27-rb4194a-efr32xg27-8-dbm-wireless-radio-board?tab=overview)|
36+
| 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)|
37+
38+
## Connections Required ##
39+
40+
Connect the board via the connector cable to your PC to flash the example.
41+
42+
## Setup ##
43+
44+
To test this application, you can either create a project based on an example or start with an "Empty C Project" project based on your hardware.
45+
46+
### Create a project based on an example project ###
47+
48+
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).
49+
50+
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 "tailgating".
51+
52+
3. Click the **Create** button on **Platform - IADC Tailgating** example. Example project creation dialog pops up -> click Create and Finish and the project should be generated.
53+
54+
![create_project](image/create_project.png)
55+
56+
4. Build and flash this example to the board.
57+
58+
### Start with an "Empty C Project" project ###
59+
60+
1. Create an **Empty C Project** project for your hardware using Simplicity Studio 5.
61+
62+
2. Copy all files in the `inc` and `src` folders into the project root folder (overwriting the existing file).
63+
64+
3. Install the software components:
65+
66+
3.1. Open the .slcp file in the project
67+
68+
3.2. Select the SOFTWARE COMPONENTS tab
69+
70+
3.3. Install the following components:
71+
72+
- [Platform][Peripheral][IADC]
73+
74+
- [Platform][Peripheral][PRS]
75+
76+
- [Services][IO Stream][Driver][IO Stream: USART]
77+
78+
- [Services][IO Stream][IO Stream: Retarget STDIO]
79+
80+
- [Services][IO Stream][IO Stream: STDLIB Configuration]
81+
82+
4. Enable Virtual COM UART
83+
84+
- [Platform][Board][Board Control][Configure][Enable Virtual COM UART]
85+
86+
5. Enable floating point print()
87+
88+
- [Floating point print() with GCC](https://community.silabs.com/s/article/floating-point-print-with-gcc?language=en_US)
89+
90+
6. Build and flash the project to your board.
91+
92+
## How It Works ##
93+
94+
The example uses conversion tailgating which is shown in the picture below. In the example, the Scan queue is configured to trigger a two-channel conversion periodically (5ms) on the IADC local timer, while the Single queue is configured to trigger on-demand from software. When a single conversion is requested by pressing BTN0, it waits until after the scan sequence is complete, and then the single conversion is performed. The scan conversions and the single conversion is using the same configuration 0, so a warmup delay is not inserted between the end of the scan and the beginning of the single conversion cycle. Note that this example provides plenty of time between IADC scan conversions for the single conversion to occur, thus no scan conversions are delayed.
95+
96+
![how_to_work](image/how_to_work.png)
97+
98+
The sampled value is printed out over the UART interface. Additionally, a PRS debug signal SCANENTRYDONE and SINGLEDONE is added to the project for test purposes.
99+
100+
### Pin Routing ###
101+
| Pin Name | BRD2504A | BRD4181b | BRD4182a | BRD4210a | BRD4186c | BRD4270b | BRD4194A | BRD4400C |
102+
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
103+
| IADC SCAN0 | AN 0, SMA | EXP10 (PC3) | EXP16 (PB3) | EXP16 (PC7) | EXP16 (PC7) | EXP16 (PB3) | EXP16 (PB3) | EXP16 (PC7) |
104+
| IADC SCAN1 | EXP11 (PB4)| EXP4 (PC0) | EXP15 (PB2) | EXP15 (PC5) | EXP15 (PC5) | EXP15 (PB2) | EXP15 (PB2) | EXP15 (PC5) |
105+
| IADC SINGLE | EXP16 (PA7)| EXP9 (PB1) | EXP9 (PB1) | EXP9 (PD2) | EXP9 (PD2) | EXP10 (PB4) | EXP9 (PB1) | EXP9 (PA14) |
106+
| SCANENTRYDONE | PC8 | EXP13 (PD3) | EXP13 (PD3) | EXP13 (PA7) | EXP13 (PA7) | EXP13 (PA7) | EXP13 (PA8) | EXP13 (PB5) |
107+
| SINGLEDONE | EXP13 (PC9) | EXP11 (PD2) | EXP11 (PD2) | EXP11 (PA6) | EXP11 (PA6) | EXP11 (PA6) | EXP10 (PC3) | EXP11 (PB4) |
108+
109+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Silicon Labs Project Configuration Tools: slcp, v0, Component selection file.
2+
project_name: platform_iadc_tailgating
3+
label: platform_iadc_tailgating
4+
5+
description: |
6+
This example project shows the IADC tailgating conversation mode.
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: brd2504a/app.h
31+
condition: [brd2504a]
32+
- path: brd4181b/app.h
33+
condition: [brd4181b]
34+
- path: brd4182a/app.h
35+
condition: [brd4182a]
36+
- path: brd4210a/app.h
37+
condition: [brd4210a]
38+
- path: brd4186c/app.h
39+
condition: [brd4186c]
40+
- path: brd4270b/app.h
41+
condition: [brd4270b]
42+
- path: brd4194a/app.h
43+
condition: [brd4194a]
44+
- path: brd4400c/app.h
45+
condition: [brd4400c]
46+
47+
component:
48+
- id: sl_system
49+
- id: device_init
50+
- id: emlib_iadc
51+
- id: emlib_prs
52+
- id: iostream_retarget_stdio
53+
- id: iostream_stdlib_config
54+
- id: iostream_recommended_stream
55+
- id: simple_button
56+
instance: [btn0]
57+
58+
define:
59+
- name: DEBUG_EFM
60+
61+
configuration:
62+
- {name: SL_BOARD_ENABLE_VCOM, value: '1'}
63+
64+
toolchain_settings:
65+
- {value: -u _printf_float, option: gcc_linker_option}
66+
67+
ui_hints:
68+
highlight:
69+
- path: README.md
70+
focus: true
71+
72+
other_file:
73+
- path: ../image/create_project.png
74+
directory: "image"
75+
- path: ../image/how_to_work.png
76+
directory: "image"
69 KB
Loading
77.8 KB
Loading
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/***************************************************************************//**
2+
* @file
3+
* @brief Top level application functions
4+
*******************************************************************************
5+
* # License
6+
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b>
7+
*******************************************************************************
8+
*
9+
* The licensor of this software is Silicon Laboratories Inc. Your use of this
10+
* software is governed by the terms of Silicon Labs Master Software License
11+
* Agreement (MSLA) available at
12+
* www.silabs.com/about-us/legal/master-software-license-agreement. This
13+
* software is distributed to you in Source Code format and is governed by the
14+
* sections of the MSLA applicable to Source Code.
15+
*
16+
******************************************************************************/
17+
18+
#ifndef APP_H
19+
#define APP_H
20+
21+
/*******************************************************************************
22+
******************************* DEFINES ***********************************
23+
******************************************************************************/
24+
25+
// Set CLK_ADC to 40 MHz - this will be adjusted to HFXO frequency in the
26+
// initialization process
27+
// (The CLK_ADC clock possible dived values are 1,2,3,4)
28+
#define CLK_SRC_ADC_FREQ HFXO_FREQ / 4 // CLK_SRC_ADC - 40 MHz max
29+
#define CLK_ADC_FREQ 100000 // ADC_CLK - 10 MHz max in normal mode
30+
31+
// Desired conversation interval in Hz
32+
// min 150 Hz if the CLK_ADC is 9.75MHz
33+
#define CLK_TIMER 200
34+
35+
// Number of scan channels
36+
#define NUM_INPUTS 2
37+
38+
/*
39+
* Specify the IADC input using the IADC_PosInput_t typedef. This
40+
* must be paired with a corresponding macro definition that allocates
41+
* the corresponding ABUS to the IADC. These are...
42+
*
43+
* GPIO->ABUSALLOC |= GPIO_ABUSALLOC_AEVEN0_ADC0
44+
* GPIO->ABUSALLOC |= GPIO_ABUSALLOC_AODD0_ADC0
45+
* GPIO->BBUSALLOC |= GPIO_BBUSALLOC_BEVEN0_ADC0
46+
* GPIO->BBUSALLOC |= GPIO_BBUSALLOC_BODD0_ADC0
47+
* GPIO->CDBUSALLOC |= GPIO_CDBUSALLOC_CDEVEN0_ADC0
48+
* GPIO->CDBUSALLOC |= GPIO_CDBUSALLOC_CDODD0_ADC0
49+
*
50+
* ...for port A, port B, and port C/D pins, even and odd, respectively.
51+
*/
52+
#define IADC_INPUT_0_PORT_PIN iadcPosInputPadAna0;
53+
#define IADC_INPUT_1_PORT_PIN iadcPosInputPortBPin4;
54+
#define IADC_INPUT_2_PORT_PIN iadcPosInputPortAPin7;
55+
56+
#define IADC_INPUT_1_BUS BBUSALLOC
57+
#define IADC_INPUT_1_BUSALLOC GPIO_BBUSALLOC_BEVEN0_ADC0
58+
59+
#define IADC_INPUT_2_BUS ABUSALLOC
60+
#define IADC_INPUT_2_BUSALLOC GPIO_ABUSALLOC_AODD0_ADC0
61+
62+
// PRS Channel 0-5 can be routed to port A/B and Channel 6-11 to port C/D
63+
#define SCANENTRYDONE_PRS_CHANNEL 6
64+
#define SCANENTRYDONE_PORT gpioPortC
65+
#define SCANENTRYDONE_PIN 8
66+
67+
// PRS Channel 0-5 can be routed to port A/B and Channel 6-11 to port C/D
68+
#define SINGLEDONE_PRS_CHANNEL 7
69+
#define SINGLEDONE_PORT gpioPortC
70+
#define SINGLEDONE_PIN 9
71+
72+
/***************************************************************************//**
73+
* Initialize application.
74+
******************************************************************************/
75+
void app_init(void);
76+
77+
/***************************************************************************//**
78+
* App ticking function.
79+
******************************************************************************/
80+
void app_process_action(void);
81+
82+
#endif // APP_H
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/***************************************************************************//**
2+
* @file
3+
* @brief Top level application functions
4+
*******************************************************************************
5+
* # License
6+
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b>
7+
*******************************************************************************
8+
*
9+
* The licensor of this software is Silicon Laboratories Inc. Your use of this
10+
* software is governed by the terms of Silicon Labs Master Software License
11+
* Agreement (MSLA) available at
12+
* www.silabs.com/about-us/legal/master-software-license-agreement. This
13+
* software is distributed to you in Source Code format and is governed by the
14+
* sections of the MSLA applicable to Source Code.
15+
*
16+
******************************************************************************/
17+
18+
#ifndef APP_H
19+
#define APP_H
20+
21+
/*******************************************************************************
22+
******************************* DEFINES ***********************************
23+
******************************************************************************/
24+
25+
// Set CLK_ADC to 40 MHz - this will be adjusted to HFXO frequency in the
26+
// initialization process
27+
// (The CLK_ADC clock possible dived values are 1,2,3,4)
28+
#define CLK_SRC_ADC_FREQ HFXO_FREQ / 4 // CLK_SRC_ADC - 40 MHz max
29+
#define CLK_ADC_FREQ 100000 // ADC_CLK - 10 MHz max in normal mode
30+
31+
// Desired conversation interval in Hz
32+
// min 150 Hz if the CLK_ADC is 9.75MHz
33+
#define CLK_TIMER 200
34+
35+
// Number of scan channels
36+
#define NUM_INPUTS 2
37+
38+
/*
39+
* Specify the IADC input using the IADC_PosInput_t typedef. This
40+
* must be paired with a corresponding macro definition that allocates
41+
* the corresponding ABUS to the IADC. These are...
42+
*
43+
* GPIO->ABUSALLOC |= GPIO_ABUSALLOC_AEVEN0_ADC0
44+
* GPIO->ABUSALLOC |= GPIO_ABUSALLOC_AODD0_ADC0
45+
* GPIO->BBUSALLOC |= GPIO_BBUSALLOC_BEVEN0_ADC0
46+
* GPIO->BBUSALLOC |= GPIO_BBUSALLOC_BODD0_ADC0
47+
* GPIO->CDBUSALLOC |= GPIO_CDBUSALLOC_CDEVEN0_ADC0
48+
* GPIO->CDBUSALLOC |= GPIO_CDBUSALLOC_CDODD0_ADC0
49+
*
50+
* ...for port A, port B, and port C/D pins, even and odd, respectively.
51+
*/
52+
#define IADC_INPUT_0_PORT_PIN iadcPosInputPortCPin3;
53+
#define IADC_INPUT_1_PORT_PIN iadcPosInputPortCPin0;
54+
#define IADC_INPUT_2_PORT_PIN iadcPosInputPortBPin1;
55+
56+
#define IADC_INPUT_0_BUS CDBUSALLOC
57+
#define IADC_INPUT_0_BUSALLOC GPIO_CDBUSALLOC_CDODD0_ADC0
58+
59+
#define IADC_INPUT_1_BUS CDBUSALLOC
60+
#define IADC_INPUT_1_BUSALLOC GPIO_CDBUSALLOC_CDEVEN0_ADC0
61+
62+
#define IADC_INPUT_2_BUS BBUSALLOC
63+
#define IADC_INPUT_2_BUSALLOC GPIO_BBUSALLOC_BODD0_ADC0
64+
65+
// PRS Channel 0-5 can be routed to port A/B and Channel 6-11 to port C/D
66+
#define SCANENTRYDONE_PRS_CHANNEL 6
67+
#define SCANENTRYDONE_PORT gpioPortD
68+
#define SCANENTRYDONE_PIN 3
69+
70+
// PRS Channel 0-5 can be routed to port A/B and Channel 6-11 to port C/D
71+
#define SINGLEDONE_PRS_CHANNEL 7
72+
#define SINGLEDONE_PORT gpioPortD
73+
#define SINGLEDONE_PIN 2
74+
75+
/***************************************************************************//**
76+
* Initialize application.
77+
******************************************************************************/
78+
void app_init(void);
79+
80+
/***************************************************************************//**
81+
* App ticking function.
82+
******************************************************************************/
83+
void app_process_action(void);
84+
85+
#endif // APP_H

0 commit comments

Comments
 (0)