Skip to content

Commit 0c1e3c7

Browse files
authored
Platform Applications v2.10.0
1 parent 37bf924 commit 0c1e3c7

File tree

29 files changed

+2048
-10
lines changed

29 files changed

+2048
-10
lines changed

.github/workflows/pull_request_check.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI-Check
22

33
on:
44
pull_request_target:
5-
types: [opened, reopened, synchronize]
5+
types: [opened, reopened, synchronize, edited]
66

77
env:
88
SL_SLC_PATH: ${{ github.workspace }}/tools/slc_cli/slc
@@ -14,7 +14,7 @@ env:
1414

1515
jobs:
1616
readme_structure:
17-
runs-on: ubuntu-latest
17+
runs-on: ${{ github.repository_visibility == 'internal' && 'silabs-internal' || 'ubuntu-latest' }}
1818
outputs:
1919
result_readme: ${{ steps.check_readme.outputs.result_readme }}
2020
steps:
@@ -83,7 +83,7 @@ jobs:
8383
fi
8484
8585
coding_convention:
86-
runs-on: ubuntu-latest
86+
runs-on: ${{ github.repository_visibility == 'internal' && 'silabs-internal' || 'ubuntu-latest' }}
8787
outputs:
8888
result_coding: ${{ steps.check_coding.outputs.result_coding }}
8989
steps:
@@ -173,7 +173,7 @@ jobs:
173173
fi
174174
175175
build_firmware:
176-
runs-on: ubuntu-latest
176+
runs-on: ${{ github.repository_visibility == 'internal' && 'silabs-internal' || 'ubuntu-latest' }}
177177
outputs:
178178
result_build: ${{ steps.check_build.outputs.result_build }}
179179
steps:
@@ -360,7 +360,7 @@ jobs:
360360
-D"sonar.projectBaseDir=ws" \
361361
-D"sonar.sources=." \
362362
-D"sonar.inclusions=${{ steps.included_src.outputs.sonar_inclusions }}" \
363-
-D"sonar.host.url=${{ secrets.SONAR_HOST_URL }}" \
363+
-D"sonar.host.url=${{ vars.SONAR_HOST_URL }}" \
364364
-D"sonar.token=${{ secrets.SONAR_TOKEN }}" \
365365
-D"sonar.language=c" \
366366
-D"sonar.cfamily.cache.enabled=false" > sonar_log.txt
@@ -374,14 +374,14 @@ jobs:
374374
375375
if grep -qe "EXECUTION SUCCESS" sonar_log.txt; then
376376
echo "Result: Success"
377-
echo "Check report here: ${{ secrets.SONAR_HOST_URL }}/dashboard?id=${{ env.repo }}&branch=${{ github.event.pull_request.head.ref }}"
377+
echo "Check report here: ${{ vars.SONAR_HOST_URL }}/dashboard?id=${{ env.repo }}&branch=${{ github.event.pull_request.head.ref }}"
378378
echo "result_sonar=success" >> $GITHUB_OUTPUT
379379
else
380380
echo "Result: Failure"
381381
cat sonar_log.txt
382382
echo ""
383383
echo "......................"
384-
echo "Check report here: ${{ secrets.SONAR_HOST_URL }}/dashboard?id=${{ env.repo }}&branch=${{ github.event.pull_request.head.ref }}"
384+
echo "Check report here: ${{ vars.SONAR_HOST_URL }}/dashboard?id=${{ env.repo }}&branch=${{ github.event.pull_request.head.ref }}"
385385
exit 1
386386
fi
387387

.github/workflows/trufflehog_security_scan.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: TruffleHog-Security-Scan
22
on:
33
pull_request:
4-
types: [opened, reopened, synchronize]
4+
types: [opened, reopened, synchronize, edited]
55

66
jobs:
77
trufflehog_security_scan:
8-
runs-on: ubuntu-latest
8+
runs-on: ${{ github.repository_visibility == 'internal' && 'silabs-internal' || 'ubuntu-latest' }}
99
steps:
1010
- name: Checkout code
1111
uses: actions/checkout@v4

README.md

Lines changed: 4 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.9.0-green)](https://github.com/SiliconLabs/bluetooth_applications/releases)
16+
[![Version Badge](https://img.shields.io/badge/-v2.10.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

@@ -96,6 +96,9 @@ This repository provides both SLCP projects (as External Repositories) and SLS p
9696
| 69 | Platform - ACMP Hysteresis Mode |[Click Here](./platform_acmp_hysteresis_mode)
9797
| 70 | Platform - Sysrtc Wakeup |[Click Here](./platform_sysrtc_wakeup)
9898
| 71 | Platform - Fixed Gate Time Frequency Measurement |[Click Here](./platform_fixed_gate_time_frequency_measurement/)
99+
| 72 | Platform - UART DFU Multislot |[Click Here](./platform_uart_dfu_multislot/)
100+
| 73 | Platform - I2S Microphone VDAC |[Click Here](./platform_i2s_mic_vdac/)
101+
| 74 | Platform - SPI FreeRTOS |[Click Here](./platform_spi_freertos/)
99102

100103
## Requirements ##
101104

platform_i2s_mic_vdac/README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Platform - I2S Microphone VDAC #
2+
![Type badge](https://img.shields.io/badge/Type-Virtual%20Application-green)
3+
![Technology badge](https://img.shields.io/badge/Technology-Platform-green)
4+
![License badge](https://img.shields.io/badge/License-Zlib-green)
5+
![SDK badge](https://img.shields.io/badge/SDK-v2025.6.1-green)
6+
![Build badge](https://img.shields.io/badge/Build-passing-green)
7+
![Flash badge](https://img.shields.io/badge/Flash-14.14%20KB-blue)
8+
![RAM badge](https://img.shields.io/badge/RAM-16.8%20KB-blue)
9+
10+
## Overview ##
11+
12+
This example demonstrates the implementation of the I2S protocol for interfacing with an external stereo microphone. The sampled audio signal is then routed to an analog pin via the VDAC.
13+
14+
## SDK version ##
15+
16+
[SiSDK v2025.6.1](https://github.com/SiliconLabs/simplicity_sdk/releases/tag/v2025.6.1)
17+
18+
## Software Required ##
19+
20+
- [Simplicity Studio v5 IDE](https://www.silabs.com/developers/simplicity-studio)
21+
22+
## Hardware Required ##
23+
24+
- Tested boards for working with this example:
25+
26+
| Board ID | Description |
27+
| ---------------------- | ------ |
28+
| BRD2601B | [EFR32xG24 Dev Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-dev-kit?tab=overview)|
29+
| BRD2608A | [EFR32xG26 Dev Kit](https://www.silabs.com/development-tools/wireless/efr32xg26-dev-kit?tab=overview)|
30+
31+
32+
## Connections Required ##
33+
34+
Connect the board via the connector cable to your PC to flash the example.
35+
36+
The table below presents the extension header pin assignments for the VDAC analog output corresponding to the tested MCUs.
37+
38+
| Pin function |EFR32xG24 Dev Kit (BRD2601B)| EFR32xG26 Dev Kit (BRD2608A) |
39+
| -------------| -------------------------- | ---------------------------- |
40+
| VDAC output | PA05 (EXP12) | PB05 (EXP12) |
41+
42+
43+
## Setup ##
44+
45+
To test this application, either create a project based on an example project or start with an "Empty C Project" project based on the desired hardware.
46+
47+
### Create a project based on an example project ###
48+
49+
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-t2abs).
50+
51+
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 "i2s".
52+
53+
3. Click the **Create** button on **Platform - I2S Microphone VDAC** example. Example project creation dialog pops up -> click Create and Finish and the project should be generated.
54+
55+
4. Build and flash this example to the board.
56+
57+
### Start with an "Empty C Project" project ###
58+
59+
1. Create an **Empty C Project** project for your hardware using Simplicity Studio 5.
60+
61+
2. Select the subfolder in the `inc` folder that corresponds to your board number. Copy all files from that subfolder into the project root folder (overwriting the existing file).
62+
63+
3. Copy all files in the `src` folders into the project root folder (overwriting the existing file).
64+
65+
4. Install the software components:
66+
67+
3.1. Open the .slcp file in the project
68+
69+
3.2. Select the SOFTWARE COMPONENTS tab
70+
71+
3.3. Install the following components:
72+
73+
- [Platform][Peripheral] → EMLIB → [GPIO]
74+
75+
- [Platform][Peripheral] → EMLIB → [USART]
76+
77+
- [Platform][Peripheral] → EMLIB → [VDAC]
78+
79+
- [Platform][Driver][DMADRV]
80+
81+
5. Build and flash the project to your board.
82+
83+
## How It Works ##
84+
85+
This example demonstrates the implementation of the I²S protocol for interfacing with a microphone.
86+
87+
Firstly, the I²S data is sampled as a 16bit (int16_t) integer at a baudrate of 3MHz. Then, the left and right audio channels' samples are separated using the LDMA peripheral via separate transfers.
88+
89+
The left channel's samples (int16_t) are then converted from a 16-bit signed integer to a 12-bit unsigned integer before being transferred to the VDAC channel output buffer via the LDMA peripheral.
90+
91+
All of the LDMA transfers use ping-pong buffers in order to effectively process data while continuously sampling it from the microphone.
92+
93+
94+
## Test measurement
95+
To validate the implementation, a constant 2000 Hz sine wave was applied to the microphone's input.
96+
97+
The expected output frequency on the left channel is half of the input signal's frequency, resulting in a sine wave with a period of 1 / (2 * 2000) = 250 µs.
98+
99+
![Scope 2kHz input](img/scope_2kHz_in.jpg)
100+
*Figure 1: Scope capture with a constant 2 kHz audio input to verify the waveform of the signal.*
101+
102+
![Logic analyzer 2kHz input](img/logic_2kHz_in.jpg)
103+
*Figure 2: Logic analyzer capture with a constant 2 kHz audio input to verify the period time of the signal.*
104+
105+
106+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Silicon Labs Project Configuration Tools: slcp, v0, Component selection file.
2+
project_name: platform_i2s_mic_vdac
3+
label: Platform - I2S Microphone VDAC
4+
5+
description: |
6+
This example project demonstrates the implementation of the I2S protocol for interfacing with a microphone. The sampled audio signal is routed to the VDAC analog pin.
7+
8+
category: Example|Platform
9+
package: Platform
10+
quality: experimmental
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+
source:
23+
- path: ../src/app.c
24+
25+
include:
26+
- path: ../inc
27+
file_list:
28+
- path: brd2601b/app.h
29+
condition: [brd2601b]
30+
- path: brd2608a/app.h
31+
condition: [brd2608a]
32+
33+
component:
34+
- id: sl_main
35+
- id: device_init
36+
- id: dmadrv
37+
- id: emlib_usart
38+
- id: emlib_vdac
39+
40+
define:
41+
- name: DEBUG_EFM
42+
43+
other_file:
44+
- path: ../img/logic_2kHz_in.jpg
45+
directory: "img"
46+
- path: ../img/scope_2kHz_in.jpg
47+
directory: "img"
48+
49+
ui_hints:
50+
highlight:
51+
- path: README.md
52+
focus: true
53+
37.7 KB
Loading
39.5 KB
Loading
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/***************************************************************************//**
2+
* @file app.h
3+
* @brief Top level application functions
4+
*******************************************************************************
5+
* # License
6+
* <b>Copyright 2025 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+
#define I2S_SCK_PORT gpioPortD
22+
#define I2S_SCK_PIN 3
23+
24+
#define I2S_SD_PORT gpioPortD
25+
#define I2S_SD_PIN 4
26+
27+
#define I2S_WS_PORT gpioPortD
28+
#define I2S_WS_PIN 5
29+
30+
#define GPIO_MIC_EN_PORT gpioPortC
31+
#define GPIO_MIC_EN_PIN 8
32+
33+
#define LRCLK_FREQUENCY_48kHz 48000
34+
#define BCLK_FREQUENCY_3MHz 64 * LRCLK_FREQUENCY_48kHz
35+
36+
#define CHANNEL_NUM 1
37+
#define CLK_VDAC_FREQ 100000
38+
39+
// EXP12
40+
#define VDAC_OUTPUT_PORT vdacChPortA
41+
#define VDAC_OUTPUT_PIN 5
42+
#define VDAC_OUTPUT_0_BUS ABUSALLOC
43+
#define VDAC_OUTPUT_0_BUSALLOC GPIO_ABUSALLOC_AODD1_VDAC0CH1
44+
45+
/***************************************************************************//**
46+
* Initialize application.
47+
******************************************************************************/
48+
void app_init(void);
49+
50+
/***************************************************************************//**
51+
* App ticking function.
52+
******************************************************************************/
53+
void app_process_action(void);
54+
55+
#endif // APP_H
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/***************************************************************************//**
2+
* @file app.h
3+
* @brief Top level application functions
4+
*******************************************************************************
5+
* # License
6+
* <b>Copyright 2025 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+
#define I2S_SCK_PORT gpioPortD
22+
#define I2S_SCK_PIN 3
23+
24+
#define I2S_SD_PORT gpioPortD
25+
#define I2S_SD_PIN 4
26+
27+
#define I2S_WS_PORT gpioPortD
28+
#define I2S_WS_PIN 5
29+
30+
#define GPIO_MIC_EN_PORT gpioPortC
31+
#define GPIO_MIC_EN_PIN 8
32+
33+
#define LRCLK_FREQUENCY_48kHz 48000
34+
#define BCLK_FREQUENCY_3MHz 64 * LRCLK_FREQUENCY_48kHz
35+
36+
#define CHANNEL_NUM 1
37+
#define CLK_VDAC_FREQ 100000
38+
39+
// EXP12
40+
#define VDAC_OUTPUT_PORT vdacChPortB
41+
#define VDAC_OUTPUT_PIN 5
42+
#define VDAC_OUTPUT_0_BUS BBUSALLOC
43+
#define VDAC_OUTPUT_0_BUSALLOC GPIO_BBUSALLOC_BODD1_VDAC0CH1
44+
45+
/***************************************************************************//**
46+
* Initialize application.
47+
******************************************************************************/
48+
void app_init(void);
49+
50+
/***************************************************************************//**
51+
* App ticking function.
52+
******************************************************************************/
53+
void app_process_action(void);
54+
55+
#endif // APP_H

0 commit comments

Comments
 (0)