Skip to content

Commit

Permalink
Third Party Hardware Drivers Extension v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
silabs-DanielN authored Sep 21, 2023
1 parent dfaf35c commit 3ce5007
Show file tree
Hide file tree
Showing 656 changed files with 308,847 additions and 154 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Third Party Hardware Drivers #

[![Version Badge](https://img.shields.io/badge/-v1.7.0-green)](https://github.com/SiliconLabs/third_party_hw_drivers_extension/releases)
[![Version Badge](https://img.shields.io/badge/-v1.8.0-green)](https://github.com/SiliconLabs/third_party_hw_drivers_extension/releases)
[![GSDK Badge](https://img.shields.io/badge/GSDK-v4.3.1-green)](https://github.com/SiliconLabs/gecko_sdk/releases)
![License badge](https://img.shields.io/badge/License-Zlib-green)

Expand Down Expand Up @@ -71,8 +71,16 @@ A full list of all drivers in this repository is defined below:
| environment3_bme688 | [Click Here](./driver/public/mikroe/environment3_bme688) | [Click Here](./app/example/mikroe_environment3_bme688) | [Click Here](./app/documentation/example/mikroe_environment3_bme688) |
| ozone2_mq131 | [Click Here](./driver/public/mikroe/ozone2_mq131) | [Click Here](./app/example/mikroe_ozone2_mq131) | [Click Here](./app/documentation/example/mikroe_ozone2_mq131) |
| uv_ml8511a | [Click Here](./driver/public/mikroe/uv_ml8511a) | [Click Here](./app/example/mikroe_uv_ml8511a) | [Click Here](./app/documentation/example/mikroe_uv_ml8511a) |
| tft_lcd_ili9341 | [Click Here](./driver/public/silabs/tft_lcd_ili9341) | [Click Here](./app/example/adafruit_tft_lcd_ili9341) | [Click Here](./app/documentation/example/adafruit_tft_lcd_ili9341) |
| tft_lcd_ili9341_lvgl | [Click Here](./driver/public/silabs/services_lvgl) | [Click Here](./app/example/adafruit_tft_lcd_ili9341_lvgl) | [Click Here](./app/documentation/example/adafruit_tft_lcd_ili9341_lvgl) |
| servo_pca9685 | [Click Here](./driver/public/mikroe/servo_pca9685) | [Click Here](./app/example/mikroe_servo_pca9685) | [Click Here](./app/documentation/example/mikroe_servo_pca9685) |
| force3_fsr400 | [Click Here](./driver/public/mikroe/force3_fsr400) | [Click Here](./app/example/mikroe_force3_fsr400) | [Click Here](./app/documentation/example/mikroe_force3_fsr400) |
| emg | [Click Here](./driver/public/mikroe/emg) | [Click Here](./app/example/mikroe_emg) | [Click Here](./app/documentation/example/mikroe_emg) |
| bthome_v2 | [Click Here](./driver/public/silabs/bthome_v2) | [Click Here](./app/example/bthome_v2) | [Click Here](./app/documentation/example/bthome_v2) |
| bthome_v2_server | [Click Here](./driver/public/silabs/bthome_v2_server) | [Click Here](./app/example/bthome_v2_server) | [Click Here](./app/documentation/example/bthome_v2_server) |
| services_enocean_switch_proxy_server | [Click Here](./driver/public/silabs/services_enocean_switch_proxy_server) | N/A | N/A |
| services_lin_bus_slave | [Click Here](./driver/public/silabs/services_lin_bus_slave) | [Click Here](./app/example/silabs_lin_bus) | [Click Here](./app/documentation/example/silabs_lin_bus) |


## Requirements ##

Expand Down
113 changes: 113 additions & 0 deletions app/documentation/example/adafruit_tft_lcd_ili9341/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# ILI9341 - TFT LCD with Touchscreen (Adafruit) #

## Summary ##

Small TFT displays are a great way to add graphics to your projects. These are like tiny little LCD monitors that you can drive with a simple SPI serial interface.
This project aims to implement a hardware driver interacting with the ILI9341 TFT displays via APIs of GSDK.

For testing, you'll need a ILI9341 display breakout, like [this large 2.8" TFT display breakout](https://www.adafruit.com/product/1770) or [2.4" TFT breakout](https://www.adafruit.com/product/2478) should work too. Make sure that the display you're using has the ILI9341 driver chip!

## Required Hardware ##

- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview)
- A ILI9341 TFT display as listed below:
- [Adafruit ILI9341 - 2.4" TFT LCD with Touchscreen](https://www.adafruit.com/product/2478)
- [2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket - ILI9341](https://www.adafruit.com/product/1770)
- [3.2" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket - ILI9341](https://www.adafruit.com/product/1743)

## Hardware Connection ##

To connect the Adafruit 2.4" TFT LCD (with Touchscreen) with the EFR32xG24 Explorer Kit, you can see the pins mapping table below.

| Pin | Connection | Pin function |
|:---:|:-------------:|:---------------|
| PC8 | D/C | GPIO |
| PC0 | CS | SPI CS |
| PC1 | CLK | SPI SCK |
| PC2 | MISO | SPI MISO |
| PC3 | MOSI | SPI MOSI |
| PD5 | XP(X+) | AN |
| PD4 | YP(Y+) | AN |
| PB1 | YM(Y-) | AN |
| PA0 | XM(Y+) | AN |

## Setup ##

You can either create a project based on an example project or start with an empty example project.

### Create a project based on an example project ###

1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **tft lcd**.

2. Click **Create** button on the example:

- **Third Party Hardware Drivers - ILI9341 - TFT LCD with Touchscreen (Adafruit) - SPI** if using without DMA.

- **Third Party Hardware Drivers - ILI9341 - TFT LCD with Touchscreen (Adafruit) - SPI with DMA** if using with DMA.

Example project creation dialog pops up -> click Create and Finish and Project should be generated.
![Create_example](image/create_example.png)

3. Build and flash this example to the board.

### Start with an empty example project ###

1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings.

2. Copy the file `app/example/adafruit_tft_lcd_ili9341/app.c` into the project root folder (overwriting existing file).

3. Install the software components:

- Open the .slcp file in the project.

- Select the SOFTWARE COMPONENTS tab.

- Install the following components:

- [Services][Timers][Sleep Timer]
- [Services][IO Stream][IO Stream: EUSART] → default instance name: vcom
- [Application][Utility][Log]
- [Application][Utility][Assert]
- If using without DMA: [Third Party Hardware Drivers][Display & LED][ILI9341 - TFT LCD Display (Adafruit) - SPI]
- If using with DMA: [Third Party Hardware Drivers][Display & LED][ILI9341 - TFT LCD Display (Adafruit) - SPI with DMA]
- [Third Party Hardware Drivers][Services][GLIB - OLED Graphics Library]
- [Third Party Hardware Drivers][Human Machine Interface][Touch Screen (Analog)] → use default configuration

4. Build and flash the project to your device.

**Note:**

- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide).

- SDK Extension must be enabled for the project to install **ILI9341 - TFT LCD Display (Adafruit) - SPI** or **ILI9341 - TFT LCD Display (Adafruit) - SPI with DMA** component.

## Calibration for Touch function ##

Adafruit ILI9341 uses 4 resistive touch pins (Y+ X+ Y- X-) to determine touch points. We will read the analog values from these pins to detect where the touched point is on the screen. This process will surely have uncertainties so we have to calibrate it to detect touched points properly. Please follow these steps below to calibrate the touch screen.

- Open configuration for Touch Screen (Analog) component. Enable **calibration printf** option.
![enable calib printf](image/enable_calib_printf.png)

- Open the console window to monitor values of the 'x' and 'y' when touching in some special points then update them in CALIBRATION settings.

![calib point](image/calib_point.png)

- Touch X1 point then update x for **Calib X-min** and y for **Calib Y-min**.

- Touch X2 point then update x for **Calib X-max**

- Touch X3 point then update y for **Calib Y-max**

## How It Works ##

### Testing ###

The Adafruit ILI9341 TFT LCD with Touchscreen supports both display and touch functions. During the testing, program attempts to display everything that is written on the screen with the chosen color. You can choose, which color you want to write on the screen by touching its corresponding block at the bottom of the screen. You can also delete the whole screen by touching the **DEL** block at the upper right corner of the screen.

![result](image/result.GIF)

## Report Bugs & Get Support ##

To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.

Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 112 additions & 0 deletions app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# ILI9341 - TFT LCD with Touchscreen (Adafruit) with LVGL #

## Summary ##

This example shows an example for integrating the ILI9341 display with the [LVGL library](https://lvgl.io/).
There are several settings to adjust the number draw buffers and buffering/refreshing modes in the LVGL library. For more information, please refer to [this documemtation](https://docs.lvgl.io/8.3/porting/display.html#buffering-modes).

This example uses the source files which are generated from [SquareLine Studio](https://squareline.io/). These files are provided in the `app_ui` folder. SquareLine Studio is a professional and easy-to-use UI editor software to speed up and simplify the UI development. Visiting [this page](https://squareline.io/) for more information.

## Required Hardware ##

- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview)
- A ILI9341 TFT display as listed below:
- [Adafruit ILI9341 - 2.4" TFT LCD with Touchscreen](https://www.adafruit.com/product/2478)
- [2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket - ILI9341](https://www.adafruit.com/product/1770)
- [3.2" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket - ILI9341](https://www.adafruit.com/product/1743)

## Hardware Connection ##

To connect the Adafruit 2.4" TFT LCD (with Touchscreen) with the EFR32xG24 Explorer Kit, you can see the pins mapping table below.

| Pin | Connection | Pin function |
|:---:|:-------------:|:---------------|
| PC8 | D/C | GPIO |
| PC0 | CS | SPI CS |
| PC1 | CLK | SPI SCK |
| PC2 | MISO | SPI MISO |
| PC3 | MOSI | SPI MOSI |
| PD5 | XP(X+) | AN |
| PD4 | YP(Y+) | AN |
| PB1 | YM(Y-) | AN |
| PA0 | XM(Y+) | AN |

## Setup ##

You can either create a project based on an example project or start with an empty example project.

### Create a project based on an example project ###

1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **lvgl**.

2. Click **Create** button on the example:

- **Third Party Hardware Drivers - TFT LCD with Touchscreen (Adafruit) with LVGL** if using single buffer mode without DMA.

- **Third Party Hardware Drivers - TFT LCD with Touchscreen (Adafruit) with LVGL + DMA** if using double buffered DMA mode.

Example project creation dialog pops up -> click Create and Finish and Project should be generated.
![Create_example](image/create_example.png)

3. Build and flash this example to the board.

### Start with an empty example project ###

1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings.

2. Copy the file `app/example/adafruit_tft_lcd_ili9341_lvgl/app.c` into the project root folder (overwriting existing file).

3. Copy all files in the folder below into the project root folder.

- `app_ui/brd2703a/single_buffer_without_dma` if using single buffer mode without DMA:

- `app_ui/brd2703a/double_buffered_dma` if using double buffered DMA mode:

4. Install the software components:

- Open the .slcp file in the project.

- Select the SOFTWARE COMPONENTS tab.

- Install the following components:

- [Services][Timers][Sleep Timer]
- If using single buffer mode without DMA:
- [Platform][Driver][LED][Simple LED][led0]
- [Third Party Hardware Drivers][Display & LED][ILI9341 - TFT LCD Display (Adafruit) - SPI]
- [Third Party Hardware Drivers][Human Machine Interface][Touch Screen (Analog)] → use default configuration
- [Third Party Hardware Drivers][Services][LVGL - Graphic Library] → Using settings as below:
![Create_example](image/single_buffered_lvgl_settings.png)
- If using double buffered DMA mode:
- [Platform][Driver][LED][Simple LED][led0, led1]
- [Platform][Driver][Button][Simple Button][btn0, btn1]
- [Third Party Hardware Drivers][Display & LED][ILI9341 - TFT LCD Display (Adafruit) - SPI with DMA]
- [Third Party Hardware Drivers][Human Machine Interface][Touch Screen (Analog)] → use default configuration
- [Third Party Hardware Drivers][Services][LVGL - Graphic Library] → Using settings as below:
![Create_example](image/double_buffered_lvgl_settings.png)

5. Build and flash the project to your device.

**Note:**

- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide).

## How It Works ##

### Testing ###

After resetting, the loader screen is loaded in 3s. Then the main screen provides interfaces to control the onboard LED(s) via touchscreen.

Testing with double buffered DMA mode:

![result](image/double_buffer_lvgl.gif)

Testing single buffer mode without DMA:

![result](image/single_buffer_lvgl.gif)

## Report Bugs & Get Support ##

To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.

Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions app/documentation/example/bthome_v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# BTHome v2

## Overview

![logo](image/logo.png)

BTHome is an energy-efficient, but flexible BT format for devices to broadcast their sensor data and button presses.

Devices can run over a year on a single battery. It allows data encryption and is supported by popular home automation platforms, like Home Assistant, out of the box.

For more information, please visit [BThome](https://bthome.io/).

The project aims to implement a library to provide a one-click solution to create a BTHome v2 compatible device.

![overview](image/overview.png)

## Required Hardware

- [**BGM220-EK4314A** BGM220 Bluetooth Module Explorer Kit (BRD4314A BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit)

## Hardware Connection

To track data in this example, you can use the app *Home Assistant* like the picture below.

![connection](image/connection.png)

## Setup

To test this application, you can either create a project based on an example project or start with a "Bluetooth - SoC Empty" project based on your hardware.

### Create a project based on an example project

1. From the Launcher Home, add your hardware to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter "bthome".

2. Click **Create** button on **Third Party Hardware Drivers - BTHome v2** examples. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
![create_project](image/create_project.png)

3. Build and flash this example to the board.

### Start with a "Bluetooth - SoC Empty" project

1. Create a **Bluetooth - SoC Empty** project for your hardware using Simplicity Studio 5.

2. Copy the file `app/example/bluetooth_bthome_v2/app.c` into the project root folder (overwriting the existing file).

3. Install the software components:

- Open the .slcp file in the project

- Select the SOFTWARE COMPONENTS tab

- Install the following components:

- [Platform][Driver][Button][Simple Button] → default instance name: btn0
- [Third-Party Hardware Drivers][Services][BTHome v2]

4. Build and flash the project to your device.

**Note:**

- Make sure that the SDK extension is already installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide).

- Third-party Drivers Extension must be enabled for the project to install "BTHome v2" component.

## How It Works

This example uses a device to send BLE advertisement packets in the BTHome v2 format like and energy efficient sensor. Between the broadcasting of BLE advertisements, the device is in a sleeping state, which makes it suitable for battery powered sensors.

This project aims to show how you can use a EFR32 to send BLE advertisement packets in the BTHome format.

The **Home Assistant** application utilizes the Bluetooth adapter on your phone/tablet to scan BLE devices.

![app1](image/app1.png)

Open the *Home Assistant* application on your smartphone. Click [Settings][Devices & Services][BTHome], and you will see a list of nearby devices, which are sending BTHome advertisements. Find the one named "BGM220P" and click the *ADD ENTRY*. Enter the BindKey then submit, add device to your home. Now you can see the *Pressure* data and the *Temperature* data show in the screen.

![app2](image/app2.png)

## Report Bugs & Get Support

To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.

Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3ce5007

Please sign in to comment.