Skip to content

Commit

Permalink
Bluetooth Applications v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
silabs-DanielN authored Apr 3, 2024
1 parent 06d2cfd commit 5f68d22
Show file tree
Hide file tree
Showing 11 changed files with 360 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Silicon Labs Bluetooth Applications #

[![Version Badge](https://img.shields.io/badge/-v2.0.0-green)](https://github.com/SiliconLabs/bluetooth_applications/releases)
[![Version Badge](https://img.shields.io/badge/-v2.0.1-green)](https://github.com/SiliconLabs/bluetooth_applications/releases)
[![GSDK Badge](https://img.shields.io/badge/GSDK-v4.4.0-green)](https://github.com/SiliconLabs/gecko_sdk/releases)
[![TPHD Version Badge](https://img.shields.io/badge/TPHD-v2.0.0+-green)](https://github.com/SiliconLabs/third_party_hw_drivers_extension/releases)
![License badge](https://img.shields.io/badge/License-Zlib-green)
Expand Down
40 changes: 26 additions & 14 deletions bluetooth_esl_tag_mikroe_eink154_e_paper_display/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
![RAM badge](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/SiliconLabs/application_examples_ci/master/bluetooth_applications/bluetooth_esl_tag_mikroe_eink154_e_paper_display_common.json&label=RAM&query=ram&color=blue)
## Summary ##

This project aims to show how the Bluetooth LE Electronic Shelf Label (ESL) works with the E-Paper display 1,54" 200x200 dots from Mikroe using a hardware driver via APIs of the GSDK. The ESL tag displays the image transfered by the ESL Access Point using the E-Paper 1,54" display. The application is capable of storing two images in two different image slots at the same time. By default the images are stored in the NVM memory.
This project aims to show how the Bluetooth LE Electronic Shelf Label (ESL) works with the E-Paper display 1,54" 200x200 dots from Mikroe using a hardware driver via APIs of the GSDK. The ESL tag displays the image transfered by the ESL Access Point using the E-Paper 1,54" display. The application is capable of storing two images in two different image slots at the same time. By default, the images are stored in the NVM memory.

This project is based on the [**Bluetooth - SoC ESL Tag**](https://github.com/SiliconLabs/gecko_sdk/tree/gsdk_4.3/app/bluetooth/example/bt_soc_esl_tag) application that can be found with documentation on Github and also in Simplicity Studio 5. Instead of the LCD display that is on the Wireless Starter Kit Mainboard, this project uses an E-Paper display 1,54" 200x200 dots from Mikroe to display the image. The size of the transfered images should be 200x200 pixels.
This project is based on the [**Bluetooth - SoC ESL Tag**](https://github.com/SiliconLabs/gecko_sdk/tree/gsdk_4.3/app/bluetooth/example/bt_soc_esl_tag) application that can be found with documentation on GitHub and also in Simplicity Studio 5. Instead of the LCD that is on the Wireless Starter Kit Mainboard, this project uses an E-Paper display 1,54" 200x200 dots from Mikroe to display the image. The size of the transferred images should be 200x200 pixels.

The Bluetooth LE Electronic Shelf Label documentation and the setup for the ESL network can be found in the [**AN1419: Bluetooth® LE Electronic Shelf Label**](https://www.silabs.com/documents/public/application-notes/an1419-ble-electronic-shelf-label.pdf) application note. The usage of the [**ESL Access Point**](https://github.com/SiliconLabs/gecko_sdk/tree/gsdk_4.3/app/bluetooth/example_host/bt_host_esl_ap/readme) is also documented at the link.

E-Paper display is based on Active Matrix Electrophoretic Display (AMEPD) technology and has an integrated pixel driver, which uses the SPI interface to communicate with the host MCU. E-Paper display has resolution of 200(V) X 200(H) pixels and an active display area of 27.6 mm X 27.6 mm. The size of its square shaped pixels is 0.138 mm x 0.138 mm. The screen displays a clear and crisp graphics, and has an ultra-wide viewing range. Another key feature of the E-Ink technology is the extremely low power consumption, even when the display actively refresh its content.
E-Paper display is based on Active Matrix Electrophoretic Display (AMEPD) technology and has an integrated pixel driver, which uses the SPI interface to communicate with the host MCU. E-Paper display has a resolution of 200(V) X 200(H) pixels and an active display area of 27.6 mm X 27.6 mm. The size of its square-shaped pixels is 0.138 mm x 0.138 mm. The screen displays clear and crisp graphics and has an ultra-wide viewing range. Another key feature of the E-Ink technology is the extremely low power consumption, even when the display actively refreshes its content.

## Gecko SDK version ##

Expand All @@ -34,13 +34,23 @@ E-Paper display is based on Active Matrix Electrophoretic Display (AMEPD) techno

- [E-Paper display 1,54" 200x200 dots](https://www.mikroe.com/e-paper-display-154-200x200-dots)

**NOTE:**
Tested boards for working with this example:

| Board ID | Description |
| ---------------------- | ------ |
| BRD4182A | [EFR32xG22 Radio Board](https://www.silabs.com/development-tools/wireless/slwrb4182a-efr32xg22-wireless-gecko-radio-board)|
| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) |
| BRD4108A | [BG22 Bluetooth SoC Explorer Kit - BG22-EK4108A](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) |
| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) |

## Hardware Connection ##

eINK display needs an external adapter to interface with the Wireless Starter Kit Mainboard. The hardware connection is shown in the image below:

![board](image/hardware_connection.png)

The eINK Click needs to be connected to the Wireless Starter Kit Mainboard via the EXP Header pins. In the project the pins are set as in the table below:
The eINK Click needs to be connected to the Wireless Starter Kit Mainboard via the EXP Header pins. In the project, the pins are set as in the table below:

| eClick pin (Name in SS5 configurator) | xG22 (4182a) pin | Exp Header |
|----------|----------|----------|
Expand All @@ -54,17 +64,19 @@ The eINK Click needs to be connected to the Wireless Starter Kit Mainboard via t
| 3.3V | 3.3V | 20 |
| - (Rx) | - | - |

Different pin combination can also be set by changing the pin configuration in the Mikroe driver componets (E-Paper display 1.54" 200x200 dots (Mikroe) and mikroe SPIDRV).
Different pin combinations can also be set by changing the pin configuration in the Mikroe driver components (E-Paper display 1.54" 200x200 dots (Mikroe) and mikroe SPIDRV).

This example application works with the listed explorer kits as well. The eINK Click board can be easily attached to the explorer kits via the mikrobus connector. The connected eINK Click board is shown in the image below.

![board](image/hardware_connection_2.png)

## Setup ##

You can either create a project based on an example project or start with the Bluetooth - SoC ESL Tag project.

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

1. From the Launcher Home, add the BRD4182A to My Products, or connect a BRD4182A to the PC, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **Mikroe**.

2. Click **Create** button on the **Bluetooth - ESL Tag with E-Paper display 154inch 200x200 dots from Mikroe** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
1. From the Launcher Home, add the BRD4182A to My Products, or connect a BRD4182A to the PC, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **Mikroe**. Click the **Create** button on the **Bluetooth - ESL Tag with E-Paper display 154inch 200x200 dots from Mikroe** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.

![Create_example](image/project.png)

Expand Down Expand Up @@ -103,7 +115,7 @@ The required components are detailed in this section.

**E-Paper display 1.54" 200x200 dots (Mikroe)**:

This component contains the driver for the Mikroe eINK Click adaper board with the E-Paper display 1.54" 200x200 dots. The E-Paper display 1.54" 200x200 dots driver in this project is extended with APIs that are specially created for BLE ESL and has the required non-blocking structure. The pins can be configured on the configuration panel. Third-party drivers extension must be enabled for the project to install the "E-Paper Display 1.54" 200x200 dots (Mikroe)" component.
This component contains the driver for the Mikroe eINK Click adapter board with the E-Paper display 1.54" 200x200 dots. The E-Paper display 1.54" 200x200 dots driver in this project is extended with APIs that are specially created for BLE ESL and have the required non-blocking structure. The pins can be configured on the configuration panel. Third-party drivers extension must be enabled for the project to install the "E-Paper Display 1.54" 200x200 dots (Mikroe)" component.

![Import project](image/driver.png)

Expand All @@ -120,7 +132,7 @@ Configuration:

**ESL Tag NVM Image**:

The number of the Image objects can be configured in this component. By default, the transfered images are stored in the NVM memory. It is possible to store the image in the RAM. To have that, uninstall the latter component and install the **ESL Tag RAM Image** component. Note that the Image objects and the Image pool size variables have to be set properly. To save memory space in the RAM, it is recommended to use the **ESL Tag NVM Image** component.
The number of the Image objects can be configured in this component. By default, the transferred images are stored in the NVM memory. It is possible to store the image in the RAM. To to that, uninstall the latter component and install the **ESL Tag RAM Image** component. Note that the Image objects and the Image pool size variables have to be set properly. To save memory space in the RAM, it is recommended to use the **ESL Tag NVM Image** component.

![Import project](image/nvm_image.png)

Expand All @@ -132,7 +144,7 @@ To store 2 images, the NVM3 Default Instance Size should be set to 40960.

**ESL Tag User Defined Display Driver**

This component provides skeleton code for a user defined display driver - to be filled in with actual low level driver code for driving any arbitrary ESL Tag display type.
This component provides skeleton code for a user-defined display driver - to be filled in with actual low-level driver code for driving any arbitrary ESL Tag display type.

![Import project](image/user_display.png)

Expand All @@ -147,13 +159,13 @@ Note that for displaying all of the components, the following filter should be c

After downloading and importing the project, the application has to be built in Simplicity Studio 5 and flashed to the target BRD4182A radio board. Do not forget to build and flash the **Bootloader - SoC Bluetooth Apploader OTA DFU** Bootloader as well.

By following the process presented in the readme file of the [**ESL Access Point**](https://github.com/SiliconLabs/gecko_sdk/blob/gsdk_4.4/app/bluetooth/example_host/bt_host_esl_ap/readme/readme.md), the uploaded images can be displayed on the E-Paper display. There are two different image slots (0 and 1) on the ESL Tag meaning that two images can be uploaded and stored on the tag. Both of the upladed images can be displayed on the E-Paper Display separately.
By following the process presented in the readme file of the [**ESL Access Point**](https://github.com/SiliconLabs/gecko_sdk/blob/gsdk_4.4/app/bluetooth/example_host/bt_host_esl_ap/readme/readme.md), the uploaded images can be displayed on the E-Paper display. There are two different image slots (0 and 1) on the ESL Tag meaning that two images can be uploaded and stored on the tag. Both of the uploaded images can be displayed on the E-Paper Display separately.

### Testing ###

The [**ESL Access Point**](https://github.com/SiliconLabs/gecko_sdk/blob/gsdk_4.4/app/bluetooth/example_host/bt_host_esl_ap/readme/readme.md) provides many different use-cases. For instance, the Windows PowerShell can be used to contoroll the ESL Access Point.
The [**ESL Access Point**](https://github.com/SiliconLabs/gecko_sdk/blob/gsdk_4.4/app/bluetooth/example_host/bt_host_esl_ap/readme/readme.md) provides many different use cases. For instance, Windows PowerShell can be used to control the ESL Access Point.

One of the possible use-case is presented below with the following command flow:
One of the possible uses is presented below with the following command flow:

python .\app.py COM*port* --cmd → connect *BLE address* → config --full → image_update 0 image/pizza.png → sync start → disconnect → display_image *esl_id* *image_index* *display_index*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ component:
- id: sl_memory
- id: simple_led
instance:
- led1
- led0
- id: esl_tag_core
- id: esl_tag_led
- id: esl_tag_display
Expand Down Expand Up @@ -62,8 +62,26 @@ config_file:
component: spidrv
file_id: spidrv_config
instance: mikroe
path: ../config/sl_spidrv_mikroe_config.h

path: ../config/brd4182a/sl_spidrv_mikroe_config.h
condition: [brd4182a]
- override:
component: spidrv
file_id: spidrv_config
instance: mikroe
path: ../config/brd2703a/sl_spidrv_mikroe_config.h
condition: [brd2703a]
- override:
component: spidrv
file_id: spidrv_config
instance: mikroe
path: ../config/brd4108a/sl_spidrv_mikroe_config.h
condition: [brd4108a]
- override:
component: spidrv
file_id: spidrv_config
instance: mikroe
path: ../config/brd4314a/sl_spidrv_mikroe_config.h
condition: [brd4314a]
readme:
- path: ../README.md

Expand All @@ -78,6 +96,8 @@ other_file:
directory: image
- path: ../image/hardware_connection.png
directory: image
- path: ../image/hardware_connection_2.png
directory: image
- path: ../image/nvm_image.png
directory: image
- path: ../image/nvm_size.png
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/***************************************************************************//**
* @file
* @brief SPIDRV Config
*******************************************************************************
* # License
* <b>Copyright 2019 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/

#ifndef SL_SPIDRV_MIKROE_CONFIG_H
#define SL_SPIDRV_MIKROE_CONFIG_H

#include "spidrv.h"

// <<< Use Configuration Wizard in Context Menu >>>
// <h> SPIDRV settings

// <o SL_SPIDRV_MIKROE_BITRATE> SPI bitrate
// <i> Default: 1000000
#define SL_SPIDRV_MIKROE_BITRATE 1000000

// <o SL_SPIDRV_MIKROE_FRAME_LENGTH> SPI frame length <4-16>
// <i> Default: 8
#define SL_SPIDRV_MIKROE_FRAME_LENGTH 8

// <o SL_SPIDRV_MIKROE_TYPE> SPI mode
// <spidrvMaster=> Master
// <spidrvSlave=> Slave
#define SL_SPIDRV_MIKROE_TYPE spidrvMaster

// <o SL_SPIDRV_MIKROE_BIT_ORDER> Bit order on the SPI bus
// <spidrvBitOrderLsbFirst=> LSB transmitted first
// <spidrvBitOrderMsbFirst=> MSB transmitted first
#define SL_SPIDRV_MIKROE_BIT_ORDER spidrvBitOrderMsbFirst

// <o SL_SPIDRV_MIKROE_CLOCK_MODE> SPI clock mode
// <spidrvClockMode0=> SPI mode 0: CLKPOL=0, CLKPHA=0
// <spidrvClockMode1=> SPI mode 1: CLKPOL=0, CLKPHA=1
// <spidrvClockMode2=> SPI mode 2: CLKPOL=1, CLKPHA=0
// <spidrvClockMode3=> SPI mode 3: CLKPOL=1, CLKPHA=1
#define SL_SPIDRV_MIKROE_CLOCK_MODE spidrvClockMode0

// <o SL_SPIDRV_MIKROE_CS_CONTROL> SPI master chip select (CS) control scheme.
// <spidrvCsControlAuto=> CS controlled by the SPI driver
// <spidrvCsControlApplication=> CS controlled by the application
#define SL_SPIDRV_MIKROE_CS_CONTROL spidrvCsControlAuto

// <o SL_SPIDRV_MIKROE_SLAVE_START_MODE> SPI slave transfer start scheme
// <spidrvSlaveStartImmediate=> Transfer starts immediately
// <spidrvSlaveStartDelayed=> Transfer starts when the bus is idle (CS deasserted)
// <i> Only applies if instance type is spidrvSlave
#define SL_SPIDRV_MIKROE_SLAVE_START_MODE spidrvSlaveStartImmediate
// </h>
// <<< end of configuration section >>>

// <<< sl:start pin_tool >>>
// <usart signal=TX,RX,CLK,(CS)> SL_SPIDRV_MIKROE
// $[USART_SL_SPIDRV_MIKROE]
#define SL_SPIDRV_MIKROE_PERIPHERAL USART0
#define SL_SPIDRV_MIKROE_PERIPHERAL_NO 0

// USART0 TX on PC03
#define SL_SPIDRV_MIKROE_TX_PORT gpioPortC
#define SL_SPIDRV_MIKROE_TX_PIN 3

// USART0 RX on PC02
#define SL_SPIDRV_MIKROE_RX_PORT gpioPortC
#define SL_SPIDRV_MIKROE_RX_PIN 2

// USART0 CLK on PC01
#define SL_SPIDRV_MIKROE_CLK_PORT gpioPortC
#define SL_SPIDRV_MIKROE_CLK_PIN 1

// USART0 CS on PC00
#define SL_SPIDRV_MIKROE_CS_PORT gpioPortC
#define SL_SPIDRV_MIKROE_CS_PIN 0

// [USART_SL_SPIDRV_MIKROE]$
// <<< sl:end pin_tool >>>

#endif // SL_SPIDRV_MIKROE_CONFIG_H
Loading

0 comments on commit 5f68d22

Please sign in to comment.