Skip to content

Commit 0863da5

Browse files
authored
Silicon Labs CircuitPython Applications v1.3.1
1 parent a7e3f9c commit 0863da5

File tree

11 files changed

+378
-1
lines changed

11 files changed

+378
-1
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# CODEOWNERS for autoreview assigning in github
2+
* @SiliconLabsSoftware/mmte-application-examples-maintainer

.github/CONTRIBUTING.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Contributing Guideline
2+
As an open-source project, we welcome and encourage the community to submit patches directly to the project.
3+
In our collaborative open-source environment, standards and methods for submitting changes help reduce
4+
the chaos that can result from an active development community.
5+
6+
This document explains how to participate in project conversations, log bugs and enhancement requests,
7+
and submit patches to the project so your patch will be accepted quickly into the codebase.
8+
9+
## Prerequisites
10+
You should be familiar with Git and GitHub. [Getting started](https://docs.github.com/en/get-started)
11+
If you haven't already done so, you'll need to create a (free) GitHub account at https://github.com
12+
and have Git tools available on your development system. You also need to add your email address to your account.
13+
14+
As a contributor, you'll want to be familiar with the Silicon Labs tooling:
15+
- [Simplicity Studio](https://docs.silabs.com/simplicity-studio-5-users-guide/latest/ss-5-users-guide-overview/)
16+
- [Platform](https://docs.silabs.com/gecko-platform/latest/platform-overview/)
17+
- [Simplicity Commander](https://docs.silabs.com/simplicity-commander/latest/simplicity-commander-start/)
18+
19+
Read the Silicon Labs [coding guidelines](https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/coding_standard.md).
20+
## Git Setup
21+
We need to know who you are, and how to contact you. Please ass the following information to your Git installation:
22+
```
23+
git config --global user.name "FirstName LastName"
24+
git config --global user.email "firstname.lastname@example.com"
25+
```
26+
set the Git configuration variables user.name to your full name, and user.email to your email address.
27+
The user.name must be your full name (first and last at minimum), not a pseudonym or hacker handle.
28+
The email address that you use in your Git configuration must match the email address you use to sign your commits.
29+
30+
If you intend to edit commits using the github.com UI, ensure that your github profile email address and profile name also match those used in your git configuration
31+
(user.name & user.email).
32+
33+
### Set up GitHub commit signature
34+
35+
**command line setup**
36+
37+
The repository requires signed off commits. Follow this [guide](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) how to set it up.
38+
1. Generate a gpg key [howto](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key)
39+
2. Configure your local repository with the gpg key. [guide]whttps://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key)
40+
3. Configure your GitHub account with the gpg key [guide](https://docs.github.com/en/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key)
41+
42+
**Command line steps:**
43+
Use the git-bash and navigate into your local repo.
44+
1. disable all the gpg signature globally. (Optional)
45+
```
46+
$ git config --global --unset gpg.format
47+
```
48+
2. Create a gpg-key
49+
```
50+
$ gpg --full-generate-key
51+
```
52+
3. Configure the local repo with your new key.
53+
```
54+
$ gpg --list-secret-keys --keyid-format=long
55+
gpg: checking the trustdb
56+
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
57+
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
58+
/c/Users/silabsuser/.gnupg/pubring.kbx
59+
------------------------------------
60+
sec rsa3072/1234567891234567 2025-04-09 [SC]
61+
ABDGDGFDGFDGDHHSRGRG12345667912345678981
62+
uid [ultimate] Firstname Lastname <example@example.com>
63+
ssb rsa3072/11098765432110981 2025-04-09 [E]
64+
65+
$ git config user.signingkey 1234567891234567
66+
```
67+
4. Force every commit to be signed
68+
```
69+
$ git config commit.gpgsign true
70+
```
71+
5. Export your gpg key
72+
```
73+
$ gpg --armor --export 888BA795B7085898
74+
```
75+
Make sure your email address is verified by GitHub before committing anything.
76+
77+
## Licensing
78+
Please check the [Licensing.md](../LICENSE.md) for more details.
79+
80+
## Contributor License Agreement
81+
When a project receives a contribution, it must be clear that the contributor has the rights to contribute the content and that the project then has the rights to use and otherwise operate with the content (e.g., relicense or distribute). A Contributor License Agreement (CLA) is a legal document establishing these rights and defining the terms under which a license is granted by a contributor to an open-source project. A CLA clarifies that any contribution was authorized (not contributing someone else’s code without permission or without legal authority to contribute) and protects the project from potential future legal challenges.
82+
83+
Please check Silicon Labs [CLA document](https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/contributor_license_agreement.md).
84+
During the pull request review, every new contributor must sign the CLA document. It can be signed as an individual or on behalf of a company.
85+
Signatures have a 6-month expiration period.
86+
87+
## Contribution process
88+
### Creating an Issue
89+
Please follow the official GitHub [guide](https://opensource.guide/how-to-contribute/#opening-an-issue).
90+
91+
### Fork the repository
92+
When you created an issue and based on the discussion you want to contribute with your source-code.
93+
Branching is disabled on the public Silicon Labs repositories. You need to fork your own repo first.
94+
Please follow the official GitHub [guide](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project).
95+
You can create your branch on your own forked repo now.
96+
97+
### Branch Naming Convention
98+
Branch naming shall follow the following template: *IssueNumber-issue-title-goes-here*
99+
Example branch name:
100+
```
101+
99-bootloader-implementation
102+
```
103+
Issue number is necessary to maintain tracebility.
104+
Now you have a branch. You can start committing your code onto it.
105+
106+
## Commit Messages
107+
108+
Silicon Labs repositories require signed-off commits.
109+
Every commit represents a change inside the repository. Every change needs to be documented extensively.
110+
```
111+
Issuenumber-summary-of-changes
112+
113+
Detailed description what was implemented.
114+
Another line of really good description
115+
```
116+
117+
## Pull Request Guideline
118+
Okay you finished your work committed all your changes to your branch. Time to create a pull request.
119+
Refer to the general pull request [guideline](https://opensource.guide/how-to-contribute/#opening-a-pull-request) from GitHub.
120+
What to consider when raising a Pull Request:
121+
1. **Pull Request Naming**
122+
By default, GitHub uses the branch name as the pull request title. If the branch naming convention was followed, no changes are needed here.
123+
2. **Create Description**
124+
Fill out the pull request template.
125+
3. **Check the Reviewer List**
126+
GitHub assigns reviewers based on the [CODEOWNERS](CODEOWNERS) file.
127+
Add more reviewers if needed. Do not remove reviewers from the PR. Ask the repository owner for updates to the code owners.
128+
129+
### As a Reviewer
130+
131+
What to consider when reviewing a Pull Request:
132+
133+
- All builds must pass successfully.
134+
- The code must follow the Silicon Labs [coding guidelines](https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/coding_standard.md).
135+
- Write clear comments. Describe the issue and explain why you disagree (e.g., mistakes, errors, violations of conventions, performance risks, security issues, etc.).
136+
- If any comments must be addressed mandatorily, mark the pull request as “Draft.”

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 0-bug
6+
assignees: ''
7+
8+
---
9+
10+
**Summary**
11+
- Issue description
12+
- Use case / test scenario
13+
- Reference environment
14+
- SW and HW affects version
15+
- Description of test environment (e.g. R&D area, public office area, or shielded room)
16+
- Simplicity Studio version (if applicable)
17+
- Network Analyzer version (if applicable)
18+
- Is the issue reproducible with SDK sample application or only user application?
19+
20+
**To Reproduce**
21+
Steps to reproduce the behavior:
22+
1. Go to '...'
23+
2. Click on '....'
24+
3. Scroll down to '....'
25+
4. See error
26+
5. How often does the error occur (e.g. 3 out of 10 times)?
27+
28+
**Expected behavior**
29+
A clear and concise description of what you expected to happen.
30+
31+
**Actual behavior**
32+
A clear and concise description of what actually happens.
33+
34+
**Screenshots**
35+
If applicable, add screenshots to help explain your problem.
36+
37+
**Smartphone (please complete the following information):**
38+
- Device: [e.g. iPhone6]
39+
- OS: [e.g. iOS8.1]
40+
- Browser [e.g. stock browser, safari]
41+
- Version [e.g. 22]
42+
43+
**Additional context**
44+
Add any other context about the problem here.

.github/pull_request_template.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!-- Comment:
2+
A great PR typically begins with the lines below.
3+
Please note that:
4+
- The contents of this comment block are not shown in the pull request body.
5+
- Once a new pull request is opened in the project
6+
or new commit to an existing pull request will start a new build
7+
to automatically update the status of every commit on every branch.
8+
Read https://confluence.silabs.com/spaces/SCLP/pages/623313008/SOSC+-+SiliconLabsSoftware+-+Pull+Request+Process for more.
9+
-->
10+
11+
**[Description]**
12+
Hi There,
13+
This is a short description of a pull request.
14+
It can be multiline with empty lines as well.
15+
16+
**[Files]**
17+
- inc/driver.h
18+
- src/driver.c
19+
- test/app.c
20+
- etc.
21+
22+
**[Video]**

.github/workflows/01-CI-Checking.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: 01-CI-Checking
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, edited]
6+
7+
jobs:
8+
ci-check:
9+
runs-on: ubuntu-latest
10+
if: github.repository_visibility != 'public' && !contains(github.event.pull_request.body, 'SKIP_CI')
11+
steps:
12+
- name: Create GitHub App Token
13+
id: app-token
14+
uses: actions/create-github-app-token@v1
15+
with:
16+
app-id: ${{ vars.GH_APP_ID }}
17+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
18+
owner: ${{ github.repository_owner }}
19+
20+
- name: Env
21+
run: |
22+
export REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)
23+
echo "repo=$REPO_NAME" >> $GITHUB_ENV
24+
25+
- name: Trigger Check-Time Workflow
26+
id: trigger
27+
run: |
28+
response=$(curl -X POST \
29+
-H "Accept: application/vnd.github.v3+json" \
30+
-H "Authorization: token ${{ steps.app-token.outputs.token }}" \
31+
https://api.github.com/repos/SiliconLabsSoftware/aep_ci_tools/actions/workflows/circuitpython_applications.yml/dispatches \
32+
-d '{"ref":"main","inputs":{"repo_name":"${{ env.repo }}" ,"src_branch":"${{ github.event.pull_request.head.ref }}" ,"dest_branch":"${{ github.event.pull_request.base.ref }}" ,"pr_id":"${{ github.event.pull_request.number }}" ,"commit_sha":"${{ github.event.pull_request.head.sha }}"}}')
33+
34+
echo "Triggered workflow: $response"
35+
if echo "$response" | grep -q '"message": "Not Found"'; then
36+
echo "Error: Workflow or repository not found. Please check the repository name, workflow file name, and branch name."
37+
exit 1
38+
fi
39+
40+
- name: Wait for Check-Time Workflow to Complete
41+
id: wait
42+
env:
43+
TIMEOUT: 3600
44+
run: |
45+
sleep 30
46+
run_id=$(curl -s \
47+
-H "Accept: application/vnd.github.v3+json" \
48+
-H "Authorization: token ${{ steps.app-token.outputs.token }}" \
49+
https://api.github.com/repos/SiliconLabsSoftware/aep_ci_tools/actions/runs \
50+
| jq '.workflow_runs[] | select(.name=="circuitpython_applications") | .id' | head -n 1)
51+
echo "Run ID: https://github.com/SiliconLabsSoftware/aep_ci_tools/actions/runs/$run_id"
52+
53+
start_time=$(date +%s)
54+
while true; do
55+
current_time=$(date +%s)
56+
elapsed_time=$((current_time - start_time))
57+
if [ $elapsed_time -ge $TIMEOUT ]; then
58+
echo "Token generated by Github Apps expired."
59+
exit 0
60+
fi
61+
62+
status=$(curl -s \
63+
-H "Accept: application/vnd.github.v3+json" \
64+
-H "Authorization: token ${{ steps.app-token.outputs.token }}" \
65+
https://api.github.com/repos/SiliconLabsSoftware/aep_ci_tools/actions/runs/$run_id \
66+
| jq -r '.status')
67+
conclusion=$(curl -s \
68+
-H "Accept: application/vnd.github.v3+json" \
69+
-H "Authorization: token ${{ steps.app-token.outputs.token }}" \
70+
https://api.github.com/repos/SiliconLabsSoftware/aep_ci_tools/actions/runs/$run_id \
71+
| jq -r '.conclusion')
72+
echo "Status: $status, Conclusion: $conclusion"
73+
if [[ "$status" == "completed" ]]; then
74+
if [[ "$conclusion" == "success" ]]; then
75+
echo "Workflow completed successfully."
76+
exit 0
77+
else
78+
echo "Workflow failed."
79+
exit 1
80+
fi
81+
fi
82+
sleep 30
83+
done
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 02-TruffleHog-Security-Scan
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- master
7+
- "release/**"
8+
jobs:
9+
trufflehog_scan:
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Secret Scanning
18+
uses: trufflesecurity/trufflehog@v3.84.0
19+
with:
20+
extra_args: --only-verified
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 03-CLA-Assistant
2+
## This workflow is used for public repositories
3+
4+
on:
5+
issue_comment:
6+
types: [created]
7+
pull_request_target:
8+
types: [opened, closed, synchronize, reopened]
9+
10+
permissions:
11+
actions: write
12+
contents: read # this can be 'read' if the signatures are in remote repository
13+
pull-requests: write
14+
statuses: write
15+
16+
jobs:
17+
CLAAssistant:
18+
if: github.repository_visibility == 'public'
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- name: Create CLA Assistant Lite bot token
22+
uses: actions/create-github-app-token@v2
23+
id: app-token
24+
with:
25+
app-id: ${{ secrets.GH_APP_ID }}
26+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
27+
owner: SiliconLabsInternal
28+
repositories: aep-contributor-license-agreements
29+
30+
- name: "CLA Assistant"
31+
if: ${{ contains(github.event.comment.body, 'I have read the CLA Document and I hereby sign the CLA') }} || github.event_name == 'pull_request_target'
32+
uses: SiliconLabsSoftware/action-cla-assistant@silabs_flavour_v2
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
PERSONAL_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
36+
with:
37+
path-to-signatures: "cla_signatures_db.json"
38+
path-to-document: "https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/contributor_license_agreement.md"
39+
branch: 'cla-database'
40+
allowlist: silabs-*,bot*
41+
# the following are the optional inputs - If the optional inputs are not given, then default values will be taken
42+
remote-organization-name: "SiliconLabsInternal"
43+
remote-repository-name: "aep-contributor-license-agreements"
44+
create-file-commit-message: "Created the CLA database file. CLA Assistant Lite bot created this file."
45+
signed-commit-message: "$contributorName has signed the CLA in $owner/$repo#$pullRequestNo"

CLA.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Silicon Labs Contributor License Agreement
2+
3+
Follow the link for the official Silicon Labs [Contributor License Agreement](https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/contributor_license_agreement.md).

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Silicon Labs Community Terms of Use
2+
3+
Please read the full Terms of Use and Code of Conduct in the [agreements-and-guidelines](https://github.com/SiliconLabsSoftware/agreements-and-guidelines) repository: [Code of Conduct](https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/code_of_conduct.md)

LICENSE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SPDX-License-Identifier: Zlib
2+
3+
The licensor of this software is Silicon Laboratories Inc.
4+
5+
This software is provided 'as-is', without any express or implied
6+
warranty. In no event will the authors be held liable for any damages
7+
arising from the use of this software.
8+
9+
Permission is granted to anyone to use this software for any purpose,
10+
including commercial applications, and to alter it and redistribute it
11+
freely, subject to the following restrictions:
12+
13+
1. The origin of this software must not be misrepresented; you must not
14+
claim that you wrote the original software. If you use this software
15+
in a product, an acknowledgment in the product documentation would be
16+
appreciated but is not required.
17+
2. Altered source versions must be plainly marked as such, and must not be
18+
misrepresented as being the original software.
19+
3. This notice may not be removed or altered from any source distribution.

0 commit comments

Comments
 (0)