diff --git a/README.md b/README.md
index 8ed2d581..d47f76ce 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,8 @@
# Third Party Hardware Drivers #
-[![Version Badge](https://img.shields.io/badge/-v2.0.2-green)](https://github.com/SiliconLabs/third_party_hw_drivers_extension/releases)
-[![GSDK Badge](https://img.shields.io/badge/GSDK-v4.4.0-green)](https://github.com/SiliconLabs/gecko_sdk/releases)
+[![Version Badge](https://img.shields.io/badge/-v3.0.0-green)](https://github.com/SiliconLabs/third_party_hw_drivers_extension/releases)
+[![GSDK Badge](https://img.shields.io/badge/GSDK-v4.4.3-green)](https://github.com/SiliconLabs/gecko_sdk/releases)
+[![WSDK Badge](https://img.shields.io/badge/WSDK-v3.2.0-green)](https://github.com/SiliconLabs/wiseconnect/releases)
![License badge](https://img.shields.io/badge/License-Zlib-green)
This repo contains example drivers developed by Silicon Labs engineers and are provided as [an SDK extension](https://docs.silabs.com/simplicity-studio-5-users-guide/latest/ss-5-users-guide-getting-started/install-sdk-extensions). These drivers interface with different types of external hardware and are tested against a specific device listed in the driver name. These drivers are intended to be fully compatible with Silicon Labs' wireless stacks. All drivers provide a minimal Simplicity Studio project for testing and to show an example usage of the driver. The driver source is provided for modification and extension as needed. All drivers in this repository are considered to be EVALUATION QUALITY which implies that the code provided in the repos is subjected to limited testing and is provided provided as-is. It is not suitable for production environments.
@@ -101,12 +102,16 @@ A full list of all drivers in this repository is defined below:
| mikroe_pir_pl_n823_01 | [Click Here](./driver/public/mikroe/pir_pl_n823_01) | [Click Here](./app/example/mikroe_pir_pl_n823_01) | [Click Here](./app/documentation/example/mikroe_pir_pl_n823_01) |
| mikroe_uwb_dwm1000 | [Click Here](./driver/public/mikroe/uwb_dwm1000) | [Click Here](./app/example/mikroe_uwb_dwm1000) | [Click Here](./app/documentation/example/mikroe_uwb_dwm1000) |
| mikroe_uwb2_dwm3000 | [Click Here](./driver/public/silabs/uwb2_dwm3000) | [Click Here](./app/example/mikroe_uwb2_dwm3000) | [Click Here](./app/documentation/example/mikroe_uwb2_dwm3000) |
+| sparkfun_gnss_max_m10s | [Click Here](./driver/public/silabs/gnss_max_m10s) | [Click Here](./app/example/sparkfun_gnss_max_m10s) | [Click Here](./app/documentation/example/sparkfun_gnss_max_m10s) |
+| sparkfun_6dof_imu_bmi270 | [Click Here](./driver/public/silabs/sparkfun_6dof_imu_bmi270) | [Click Here](./app/example/sparkfun_6dof_imu_bmi270) | [Click Here](./app/documentation/example/sparkfun_6dof_imu_bmi270) |
+
## Requirements ##
- Desired Silicon Labs Starter Kit
- Driver specific test hardware
-- Simplicity Studio v5.6.0.0 or newer
-- Gecko SDK Suite 4.3.1, available via Simplicity Studio
+- Simplicity Studio v5.9.2.1 or newer
+- Gecko SDK 4.4.3
+- WiSeConnect SDK 3.2.0
## How to add to Simplicity Studio IDE ##
diff --git a/app/documentation/example/mikroe_alcohol_mq3/README.md b/app/documentation/example/mikroe_alcohol_mq3/README.md
index f051ef12..0a158b83 100644
--- a/app/documentation/example/mikroe_alcohol_mq3/README.md
+++ b/app/documentation/example/mikroe_alcohol_mq3/README.md
@@ -12,15 +12,26 @@ The MQ-3 provides an analog representation of its concentration in the air sent
- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview).
+- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A).
+
- [**Mikroe Alcohol Click** board based on MQ-3 sensor](https://www.mikroe.com/alcohol-click).
## Hardware Connection ##
-The Alcohol Click supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
+- If the EFR32xG24 Explorer Kit is used:
+
+ The Alcohol Click supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
+
+ The hardware connection is shown in the image below:
+
+ ![hardware_connection](image/hardware_connection.png)
-The hardware connection is shown in the image below:
+- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:
-![hardware_connection](image/hardware_connection.png)
+ | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Acohol Click |
+ | ----------------------| ---------------| ---------------------| -------------------- |
+ | Positive analog input | ULP_GPIO_1 | P16 | OUT |
+ | Negative analog input | ULP_GPIO_7 | EXP_HEADER-15 to GND | -- |
## Setup ##
@@ -28,13 +39,20 @@ You can either create a project based on an example project or start with an emp
### 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 **mq3**.
-2. Click **Create** button on the **Third Party Hardware Drivers - MQ3 - Alcohol Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
-![create_project](image/create_project.png)
+1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **mq3**.
+
+2. Click **Create** button on the project:
+
+ - **Third Party Hardware Drivers - MQ3 - Alcohol Click (Mikroe)** example if the EFR32xG24 Explorer Kit is used.
+ ![Create_example](image/create_example_1.png)
+ - **Third Party Hardware Drivers - MQ3 - Alcohol Click (Mikroe) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used.
+ ![Create_example](image/create_example_2.png)
+
+ Example project creation dialog pops up -> click Create and Finish and Project should be generated.
### 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.
+1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings.
2. Copy the file `app/example/mikroe_alcohol_mq3/app.c` into the project root folder (overwriting existing file).
@@ -46,14 +64,19 @@ You can either create a project based on an example project or start with an emp
- Install the following components:
- - [Services] → [Timers] → [Sleep Timer]
+ **If the EFR32xG24 Explorer Kit is used:**
+ - [Services] → [Timers] → [Sleep Timer]
- [Services] → [IO Stream] → [IO Stream: USART] → default instance name: **vcom**
-
- [Application] → [Utility] → [Log]
-
- [Third Party Hardware Drivers] → [Sensors] → [MQ3 - Alcohol Click (Mikroe)] → use default configuration
+ **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:**
+
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x]
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] → [channel_0] → use default configuration
+ - [Third Party Hardware Drivers] → [Sensors] → [MQ3 - Alcohol Click (Mikroe)]
+
4. Install printf float
- Open Properties of the project.
diff --git a/app/documentation/example/mikroe_alcohol_mq3/image/create_project.png b/app/documentation/example/mikroe_alcohol_mq3/image/create_example_1.png
similarity index 100%
rename from app/documentation/example/mikroe_alcohol_mq3/image/create_project.png
rename to app/documentation/example/mikroe_alcohol_mq3/image/create_example_1.png
diff --git a/app/documentation/example/mikroe_alcohol_mq3/image/create_example_2.png b/app/documentation/example/mikroe_alcohol_mq3/image/create_example_2.png
new file mode 100644
index 00000000..ab7b7703
Binary files /dev/null and b/app/documentation/example/mikroe_alcohol_mq3/image/create_example_2.png differ
diff --git a/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/README.md b/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/README.md
index 1cdaa83c..a52e7b54 100644
--- a/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/README.md
+++ b/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/README.md
@@ -8,32 +8,48 @@ This project shows the driver implementation of a magnetic buzzer using the CMT-
- [**BGM220-EK4314A** BGM220 Bluetooth Module Explorer Kit (BRD4314A BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit)
-- [**Buzz 2 Click** board based on CMT-8540S-SMT](https://www.mikroe.com/buzz-2-click).
+- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A)
+
+- [**Buzz 2 Click** board based on CMT-8540S-SMT](https://www.mikroe.com/buzz-2-click)
## Hardware Connection ##
-The BUZZ2 Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
+- If the BGM220 Explorer Kit is used:
+
+ The BUZZ2 Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
+
+ The hardware connection is shown in the image below:
-The hardware connection is shown in the image below:
+ ![board](image/hardware_connection.png "Hardware connection")
-![board](image/hardware_connection.png "Hardware connection")
+- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:
+
+ | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Buzz 2 Click |
+ | -------------| ---------------| ---------------------| -------------------- |
+ | PWM_H | GPIO_7 | P20 | PWM |
## Setup ##
-You can either create a project based on n example project or start with an empty example project.
+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 BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter buzz.
+1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *buzz*.
+
+2. Click **Create** button on the project:
-2. Click **Create** button on the **Third Party Hardware Drivers - CMT-8540S-SMT - Buzz 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
-![Create_example](image/create_example.png)
+ - **Third Party Hardware Drivers - CMT-8540S-SMT - Buzz 2 Click (Mikroe)** example if the BGM220 Explorer Kit is used.
+ ![Create_example](image/create_example.png)
+ - **Third Party Hardware Drivers - CMT-8540S-SMT - Buzz 2 Click (Mikroe) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used.
+ ![Create_example](image/create_example_si91x.png)
+
+ Example project creation dialog pops up -> click Create and Finish and Project should be generated.
3. Build and flash this example to the board.
### Start with an empty example project ###
-1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings.
+1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings.
2. Copy the file `app/example/mikroe_buzz2_cmt_8540s_smt/app.c` into the project root folder (overwriting the existing file).
@@ -45,11 +61,19 @@ You can either create a project based on n example project or start with an empt
- Install the following components:
+ **If the BGM220 Explorer Kit is used:**
+
- [Services] → [Timers] → [Sleep Timer]
- [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom
- [Application] → [Utility] → [Log]
- [Third Party Hardware Drivers] → [Mikroe Click] → [Audio & Voice] → [CMT-8540S-SMT - Buzz 2 Click (Mikroe)]
+ **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:**
+
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x]
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [PWM] → [channel_0] → use default configuration
+ - [Third Party Hardware Drivers] → [Mikroe Click] → [Audio & Voice] → [CMT-8540S-SMT - Buzz 2 Click (Mikroe)]
+
4. Build and flash this example to the board.
**Note:**
diff --git a/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example_si91x.png b/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example_si91x.png
new file mode 100644
index 00000000..8a670329
Binary files /dev/null and b/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example_si91x.png differ
diff --git a/app/documentation/example/mikroe_oledw_ssd1306/README.md b/app/documentation/example/mikroe_oledw_ssd1306/README.md
index c0ed2700..1dbbc996 100644
--- a/app/documentation/example/mikroe_oledw_ssd1306/README.md
+++ b/app/documentation/example/mikroe_oledw_ssd1306/README.md
@@ -10,15 +10,29 @@ MikroE OLED W Click is based on the MI9639BO-W OLED module which has a size of 1
- [**BGM220-EK4314A** BGM220 Bluetooth Module Explorer Kit (BRD4314A BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit)
-- [**OLED W Click** board based on SSD1306 IC](https://www.mikroe.com/oled-w-click).
+- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A)
+
+- [**OLED W Click** board based on SSD1306 IC](https://www.mikroe.com/oled-w-click)
## Hardware Connection ##
-The OLEDW Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
+- If the BGM220P Explorer Kit is used:
+
+ The OLEDW Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
+
+ The hardware connection is shown in the image below:
-The hardware connection is shown in the image below:
+ ![board](image/hardware_connection.png "Hardware connection")
-![board](image/hardware_connection.png "Hardware connection")
+- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:
+
+ | Description | BRD4338A GPIO | BRD4002 Breakout Pad | OLED W click |
+ | -------------| ------------------------ | -------------------- | ------------------ |
+ | DATA/COMMAND | GPIO_47 | P26 | D/C |
+ | RESET | GPIO_46 | P24 | RST |
+ | CS | GPIO_49 \| GSPI_MST1_CS0 | P30 | CS |
+ | CLK | GPIO_25 \| GSPI_MST1_CLK | P25 | SCK |
+ | MOSI | GPIO_25 \| GSPI_MST1_MOSI| P29 | SDI |
## Setup ##
@@ -26,16 +40,23 @@ You can either create a project based on an example project or start with an emp
### Create a project based on an example project ###
-1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter oledw.
+1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *oledw*.
+
+2. Click **Create** button on the project:
+
+ - **Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe)** example if the BGM220P Explorer Kit is used.
+ ![Create_example](image/create_example_1.png)
-2. Click **Create** button on the **Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
-![Create_example](image/create_example.png)
+ - **Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used.
+ ![Create_example](image/create_example_2.png)
+
+ Example project creation dialog pops up -> click Create and Finish and Project should be generated.
3. Build and flash this example to the board.
### Start with an empty example project ###
-1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings.
+1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings.
2. Copy the file `app/example/mikroe_oledw_ssd1306/app.c` into the project root folder (overwriting existing file).
@@ -47,9 +68,17 @@ You can either create a project based on an example project or start with an emp
- Install the following components:
+ **If the BGM220P Explorer Kit is used:**
+
- [Services] → [Timers] → [Sleep Timer]
- [Application] → [Utility] → [Assert]
- - [Third Party Hardware Drivers] → [Display & LED] → [SSD1306 - OLED W Click (Mikroe) - SPI] → use default config
+ - [Third Party Hardware Drivers] → [Display & LED] → [SSD1306 - OLED W Click (Mikroe) - SPI] → use default configuration
+
+ **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:**
+
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x]
+ - [Application] → [Utility] → [Assert]
+ - [Third Party Hardware Drivers] → [Display & LED] → [SSD1306 - OLED W Click (Mikroe) - SPI] → use default configuration
4. Build and flash this example to the board.
@@ -70,4 +99,3 @@ The OLED display will look something like the GIF below.
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.
-
diff --git a/app/documentation/example/mikroe_oledw_ssd1306/image/create_example.png b/app/documentation/example/mikroe_oledw_ssd1306/image/create_example_1.png
similarity index 100%
rename from app/documentation/example/mikroe_oledw_ssd1306/image/create_example.png
rename to app/documentation/example/mikroe_oledw_ssd1306/image/create_example_1.png
diff --git a/app/documentation/example/mikroe_oledw_ssd1306/image/create_example_2.png b/app/documentation/example/mikroe_oledw_ssd1306/image/create_example_2.png
new file mode 100644
index 00000000..61494a7f
Binary files /dev/null and b/app/documentation/example/mikroe_oledw_ssd1306/image/create_example_2.png differ
diff --git a/app/documentation/example/mikroe_temphum9_shtc3/README.md b/app/documentation/example/mikroe_temphum9_shtc3/README.md
index d50171c3..8fe1e7d7 100644
--- a/app/documentation/example/mikroe_temphum9_shtc3/README.md
+++ b/app/documentation/example/mikroe_temphum9_shtc3/README.md
@@ -8,17 +8,28 @@ Temp-Hum 9 click is a smart temperature and humidity sensing click board™, pac
## 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)
+- [BGM220 Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) (BRD4314A)
+
+- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A)
- [**Temp&Hum 9 Click** board based on SHTC3 sensor](https://www.mikroe.com/temphum-9-click).
## Hardware Connection ##
-The Temp&Hum 9 Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
+- If the BGM220P Explorer Kit is used:
+
+ The Temp&Hum 9 Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
+
+ The hardware connection is shown in the image below:
-The hardware connection is shown in the image below:
+ ![board](image/hardware_connection.png)
-![board](image/hardware_connection.png)
+- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:
+
+ | Description | BRD4338A GPIO | BRD4002 EXP Header | Temp&Hum 9 Click |
+ | -------------| ------------- | ------------------ | ------------------ |
+ | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA |
+ | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL |
## Setup ##
@@ -26,16 +37,23 @@ You can either create a project based on an example project or start with an emp
### Create a project based on an example project ###
-1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter shtc3.
+1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *shtc3*.
+
+2. Click **Create** button on the project:
-2. Click **Create** button on the **Third Party Hardware Drivers - SHTC3 - Temp&Hump 9 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
-![Create_example](image/create_example.png)
+ - **Third Party Hardware Drivers - SHTC3 - Temp&Hump 9 Click (Mikroe)** example if the BGM220P Explorer Kit is used.
+ ![Create_example](image/create_example_1.png)
+
+ - **Third Party Hardware Drivers - SHTC3 - Temp&Hump 9 Click (Mikroe) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used.
+ ![Create_example](image/create_example_2.png)
+
+ Example project creation dialog pops up -> click Create and Finish and Project should be generated.
3. Build and flash this example to the board.
### Start with an empty example project ###
-1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings.
+1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings.
2. Copy the file `app/example/mikroe_temphum9_shtc3/app.c` into the project root folder (overwriting existing file).
@@ -47,10 +65,18 @@ You can either create a project based on an example project or start with an emp
- Install the following components:
+ **If the BGM220P Explorer Kit is used:**
+
- [Services] → [Timers] → [Sleep Timer]
- [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom
- [Application] → [Utility] → [Log]
- - [Third Party Hardware Drivers] → [Sensors] → [SHTC3 - Temp&Hump 9 Click (Mikroe)]
+ - [Third Party Hardware Drivers] → [Sensors] → [SHTC3 - Temp&Hump 9 Click (Mikroe)] → use default configuration
+
+ **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:**
+
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x]
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2]
+ - [Third Party Hardware Drivers] → [Sensors] → [SHTC3 - Temp&Hump 9 Click (Mikroe)] → use default configuration
4. Install printf float
diff --git a/app/documentation/example/mikroe_temphum9_shtc3/image/create_example.png b/app/documentation/example/mikroe_temphum9_shtc3/image/create_example_1.png
similarity index 100%
rename from app/documentation/example/mikroe_temphum9_shtc3/image/create_example.png
rename to app/documentation/example/mikroe_temphum9_shtc3/image/create_example_1.png
diff --git a/app/documentation/example/mikroe_temphum9_shtc3/image/create_example_2.png b/app/documentation/example/mikroe_temphum9_shtc3/image/create_example_2.png
new file mode 100644
index 00000000..75be4a06
Binary files /dev/null and b/app/documentation/example/mikroe_temphum9_shtc3/image/create_example_2.png differ
diff --git a/app/documentation/example/mikroe_water_detect/README.md b/app/documentation/example/mikroe_water_detect/README.md
index 1586e49b..25938c2b 100644
--- a/app/documentation/example/mikroe_water_detect/README.md
+++ b/app/documentation/example/mikroe_water_detect/README.md
@@ -12,15 +12,25 @@ This device can be used as a household flood alarm sensor, or rain detector for
- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview).
-- [Water Detect Click](https://www.mikroe.com/water-detect-click).
+- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A)
+
+- [Water Detect Click](https://www.mikroe.com/water-detect-click)
## Hardware Connection ##
-The Water Detect Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
+- If the EFR32xG24 Explorer Kit is used:
+
+ The Water Detect Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
+
+ The hardware connection is shown in the image below:
-The hardware connection is shown in the image below:
+ ![board](image/hardware_connection.png)
-![board](image/hardware_connection.png)
+- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:
+
+ | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Water Detector Click |
+ | -------------| ---------------| ---------------------| -------------------- |
+ | GPIO | GPIO_46 | P24 | INT |
## Setup ##
@@ -28,16 +38,22 @@ You can either create a project based on an example project or start with an emp
### 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 water
+1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *water*
+
+2. Click **Create** button on the project:
-2. Click **Create** button on the **Third Party Hardware Drivers - Water Detect Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
-![Create_example](image/create_example.png)
+ - **Third Party Hardware Drivers - Water Detect Click (Mikroe)** example if the EFR32xG24 Explorer Kit is used.
+ ![Create_example](image/create_example_1.png)
+ - **Third Party Hardware Drivers - Water Detect Click (Mikroe) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used.
+ ![Create_example](image/create_example_2.png)
+
+ Example project creation dialog pops up -> click Create and Finish and Project should be generated.
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" using Simplicity Studio v5. Use the default project settings.
+1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings.
2. Copy the file `app/example/mikroe_water_detect/app.c` into the project root folder (overwriting the existing file).
@@ -49,11 +65,17 @@ You can either create a project based on an example project or start with an emp
- Install the following components:
- - **[Services] → [Timers] → [Sleep Timer]**
- - **[Services] → [IO Stream] → [IO Stream: USART]** → default instance name: vcom
- - **[Application] → [Utility] → [Log]**
- - **[Third Party Hardware Drivers] → [Sensors] → [Water Detect Click (Mikroe)]** → use default configuration.
- ![config](image/water_detect_config.png)
+ **If the EFR32xG24 Explorer Kit is used:**
+
+ - [Services] → [Timers] → [Sleep Timer]
+ - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom
+ - [Application] → [Utility] → [Log]
+ - [Third Party Hardware Drivers] → [Sensors] → [Water Detect Click (Mikroe)] → use default configuration
+
+ **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:**
+
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x]
+ - [Third Party Hardware Drivers] → [Sensors] → [Water Detect Click (Mikroe)] → use default configuration
4. Build and flash this example to the board.
diff --git a/app/documentation/example/mikroe_water_detect/image/create_example.png b/app/documentation/example/mikroe_water_detect/image/create_example_1.png
similarity index 100%
rename from app/documentation/example/mikroe_water_detect/image/create_example.png
rename to app/documentation/example/mikroe_water_detect/image/create_example_1.png
diff --git a/app/documentation/example/mikroe_water_detect/image/create_example_2.png b/app/documentation/example/mikroe_water_detect/image/create_example_2.png
new file mode 100644
index 00000000..44586b82
Binary files /dev/null and b/app/documentation/example/mikroe_water_detect/image/create_example_2.png differ
diff --git a/app/documentation/example/mikroe_water_detect/image/water_detect_config.png b/app/documentation/example/mikroe_water_detect/image/water_detect_config.png
deleted file mode 100644
index 68cce812..00000000
Binary files a/app/documentation/example/mikroe_water_detect/image/water_detect_config.png and /dev/null differ
diff --git a/app/documentation/example/sparkfun_6dof_imu_bmi270/README.md b/app/documentation/example/sparkfun_6dof_imu_bmi270/README.md
new file mode 100644
index 00000000..44b1235b
--- /dev/null
+++ b/app/documentation/example/sparkfun_6dof_imu_bmi270/README.md
@@ -0,0 +1,113 @@
+# BMI270 - 6DoF IMU Breakout (SparkFun) #
+
+## Summary ##
+
+This example project showcases the driver integration of the SparkFun BMI270 - 6DoF IMU Breakout.
+
+The SparkFun BMI270 6DoF IMU Breakout is a Qwiic-enabled breakout board based on the ultra-low power BMI270 from Bosch. This chip is a highly integrated, low-power IMU optimized for wearables providing precise acceleration, angular rate measurement, and intelligent on-chip motion-triggered interrupt features. Not only does the BMI270 comprise a fast and sensitive accelerometer and gyro pair, but it also contains several intelligent, on-chip motion-triggered interrupt features.
+
+## Required Hardware ##
+
+- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview)
+- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A)
+- [SparkFun 6DoF IMU Breakout - BMI270 (Qwiic)](https://www.sparkfun.com/products/22397)
+
+**NOTE:**
+Tested boards for working with this example:
+
+| Board ID | Description |
+| ---------------------- | ------ |
+| BRD2703A | [xG24-EK2703A - EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) |
+| BRD4314A | [BGM220-EK4314A - BGM220P Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) |
+| BRD4108A | [BG22-EK4108A - EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) |
+| BRD4338A | [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) |
+
+## Hardware Connection ##
+
+- **If the "EFR32xG24 Explorer Kit" is used**:
+
+ The SparkFun 6DoF IMU Breakout - BMI270 supports Qwiic, so it can connect easily to the Qwiic header of the EFR32xG24 Explorer Kit. The hardware connection is shown in the image below:
+
+ ![board](image/hardware_connection.png)
+
+- **If the "SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit" is used**:
+
+ The hardware connection is shown in the table below:
+
+ | Description | BRD4338A GPIO | BRD4002 EXP Header | BMI270 - 6DoF IMU Breakout|
+ | -------------| ------------- | ------------------ | ------------------ |
+ | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA |
+ | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL |
+
+## 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 your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "bmi270".
+
+2. Click on the **Create** button on the project:
+
+ - **Third Party Hardware Drivers - BMI270 - 6DOF IMU (SparkFun)** example if the "EFR32xG24 Explorer Kit" is used
+ ![create_example](image/create_example.png)
+
+ - **Third Party Hardware Drivers - BMI270 - 6DOF IMU (SparkFun) - Si91x** example if the "SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit" is used
+ ![create_example_si91x](image/create_example_si91x.png)
+
+ - Example project creation dialog pops up -> click Create and Finish and Project should be generated.
+3. Build and flash this example to the board.
+
+### Start with an empty example project ###
+
+1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings.
+
+2. Copy all of the files in the "app/example/silabs_6dof_imu_bmi270/app.c" folder 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:
+
+ - **If the "EFR32xG24 Explorer Kit" is used:**
+ - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom
+ - [Application] → [Utility] → [Log]
+ - [Application] → [Utility] → [Assert]
+ - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance
+ - [Third Party Hardware Drivers] → [Sensor] → [BMI270 - 6DOF IMU Breakout (Sparkfun)] → use default configuration
+
+ - **If the "SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit" is used**
+ - [Application] → [Utility] → [Assert]
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2]
+ - [Third Party Hardware Drivers] → [Sensor] → [BMI270 - 6DOF IMU Breakout (Sparkfun)] → use default configuration
+
+4. Install "Printf float"
+
+ - Open Properties of the project.
+
+ - Select C/C++ Build > Settings > Tool Settings > GNU ARM C Linker > General > Check "Printf float".
+
+5. Build and flash this example to the board.
+
+**Note:**
+
+- Make sure that the SDK extension has already been 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 the "BMI270 - 6DOF IMU Breakout (Sparkfun)" component.
+
+## How It Works #
+
+After you flash the code and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the "EFR32xG24 Explorer Kit" or the "SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit" uses the default baud rate of 115200.
+
+First, the main program initializes the driver, configs some parameters and checks communication with the bmi270 device. After that, it read the accelerometer, gyroscope and temperature data periodically. There is a periodic timer in the code, which determines the sampling intervals; the default sampling interval rate is 500 ms. If you need more frequent sampling, it is possible to change the value of the macro "READING_INTERVAL_MSEC" in the "app.c" file. The screenshot of the console is shown in the image below:
+
+![log_output](image/log.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.
diff --git a/app/documentation/example/sparkfun_6dof_imu_bmi270/image/create_example.png b/app/documentation/example/sparkfun_6dof_imu_bmi270/image/create_example.png
new file mode 100644
index 00000000..5bef414d
Binary files /dev/null and b/app/documentation/example/sparkfun_6dof_imu_bmi270/image/create_example.png differ
diff --git a/app/documentation/example/sparkfun_6dof_imu_bmi270/image/create_example_si91x.png b/app/documentation/example/sparkfun_6dof_imu_bmi270/image/create_example_si91x.png
new file mode 100644
index 00000000..f37c5f10
Binary files /dev/null and b/app/documentation/example/sparkfun_6dof_imu_bmi270/image/create_example_si91x.png differ
diff --git a/app/documentation/example/sparkfun_6dof_imu_bmi270/image/hardware_connection.png b/app/documentation/example/sparkfun_6dof_imu_bmi270/image/hardware_connection.png
new file mode 100644
index 00000000..22b9f073
Binary files /dev/null and b/app/documentation/example/sparkfun_6dof_imu_bmi270/image/hardware_connection.png differ
diff --git a/app/documentation/example/sparkfun_6dof_imu_bmi270/image/log.png b/app/documentation/example/sparkfun_6dof_imu_bmi270/image/log.png
new file mode 100644
index 00000000..da22c39a
Binary files /dev/null and b/app/documentation/example/sparkfun_6dof_imu_bmi270/image/log.png differ
diff --git a/app/documentation/example/sparkfun_gnss_max_m10s/README.md b/app/documentation/example/sparkfun_gnss_max_m10s/README.md
new file mode 100644
index 00000000..53be8151
--- /dev/null
+++ b/app/documentation/example/sparkfun_gnss_max_m10s/README.md
@@ -0,0 +1,104 @@
+# MAX-M10S - SparkFun GNSS Receiver Breakout #
+
+## Summary ##
+
+This example project shows an example for Sparkfun MAX-M10S GNSS Receiver Breakout based on I2C communication.
+
+The SparkFun MAX-M10S GNSS Receiver Breakout is an ultra-low-power, high performance, miniaturized GNSS board that is perfect for battery operated applications. It does not need much space, such as asset trackers and wearable devices. The MAX-M10S module from u-blox has an extremely low power consumption; it is less than 25mW in continuous tracking mode.
+
+## Required Hardware ##
+
+- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit)
+
+- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A)
+
+- [SparkFun GNSS Receiver Breakout - MAX-M10S (Qwiic)](https://www.sparkfun.com/products/18037)
+
+- Option: [GPS/GNSS Magnetic Mount Antenna](https://www.sparkfun.com/products/14986)
+
+## Hardware Connection ##
+
+- If the BGM220P Explorer Kit is used:
+
+ You simply connect a *SparkFun GNSS Receiver Breakout board* to a *BGM220 Explorer Kit* board using a Qwiic cable.
+
+ ![bgm220_kit_sparkfun_oled](image/hw_connection.png)
+
+- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:
+
+ | Description | BRD4338A GPIO | BRD4002 EXP Header | SparkFun Micro OLED Breakout |
+ | -------------| ------------- | ------------------ | ---------------------------- |
+ | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA |
+ | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL |
+
+## Setup ##
+
+To test this application, you can either create a project based on an example project or start with a "Empty C Project" project based on your hardware.
+
+### Create a project based on an example project ###
+
+1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *gnss*.
+
+2. Click **Create** button on the project:
+
+ - **Third Party Hardware Drivers - MAX-M10S - GNSS Receiver Breakout (Sparkfun)** example if the BGM220P Explorer Kit is used.
+ ![create_example](image/create_example_1.png)
+ - **Third Party Hardware Drivers - MAX-M10S - GNSS Receiver Breakout (Sparkfun) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used.
+ ![create_example](image/create_example_2.png)
+
+ Example project creation dialog pops up -> click Create and Finish and Project should be generated.
+
+3. Build and flash this example to the board.
+
+### Start with an empty example project ###
+
+1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings.
+
+2. Copy the file `app/example/sparkfun_gnss_max_m10s/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:
+
+ **If the BGM220P Explorer Kit is used:**
+
+ - [Services] → [Timers] → [Sleep Timer]
+ - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom
+ - [Application] → [Utility] → [Log]
+ - [platform] → [Driver] → [I2C] → [I2CSPM] → default instance name: qwiic
+ - [Third Party Hardware Drivers] → [Wireless Connectivity] → [MAX-M10S - GNSS Receiver Breakout - I2C]
+
+ **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:**
+
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x]
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2]
+ - [Third Party Hardware Drivers] → [Wireless Connectivity] → [MAX-M10S - GNSS Receiver Breakout - I2C]
+
+4. Install printf float
+
+ - Open Properties of the project.
+
+ - Select C/C++ Build > Settings > Tool Settings >GNU ARM C Linker > General. Check Printf float.
+
+5. Build and flash the project to your device.
+
+**Note:**
+
+- Make sure that the SDK extension has already be installed. If not, 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 "MAX-M10S - GNSS Receiver Breakout - I2C" component.
+
+## How It Works ##
+
+The example performs getting the longitude and latitude coordinates and logs both values via serial output.
+
+You can use Putty or another program to read the serial output. You should expect a similar output to the one below.
+
+![logging_screen](image/log.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.
diff --git a/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_1.png b/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_1.png
new file mode 100644
index 00000000..5bb2b622
Binary files /dev/null and b/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_1.png differ
diff --git a/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_2.png b/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_2.png
new file mode 100644
index 00000000..5b66117e
Binary files /dev/null and b/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_2.png differ
diff --git a/app/documentation/example/sparkfun_gnss_max_m10s/image/hw_connection.png b/app/documentation/example/sparkfun_gnss_max_m10s/image/hw_connection.png
new file mode 100644
index 00000000..b9da89c1
Binary files /dev/null and b/app/documentation/example/sparkfun_gnss_max_m10s/image/hw_connection.png differ
diff --git a/app/documentation/example/sparkfun_gnss_max_m10s/image/log.png b/app/documentation/example/sparkfun_gnss_max_m10s/image/log.png
new file mode 100644
index 00000000..7f705238
Binary files /dev/null and b/app/documentation/example/sparkfun_gnss_max_m10s/image/log.png differ
diff --git a/app/documentation/example/sparkfun_micro_oled_ssd1306/README.md b/app/documentation/example/sparkfun_micro_oled_ssd1306/README.md
index e9aaa51d..1bf75eb0 100644
--- a/app/documentation/example/sparkfun_micro_oled_ssd1306/README.md
+++ b/app/documentation/example/sparkfun_micro_oled_ssd1306/README.md
@@ -2,7 +2,7 @@
## Summary ##
-This project shows the implementation of the OLED driver using a **SparkFun Micro OLED Breakout (Qwiic) board** with **BGM220 Explorer Kit** based on I2C communication.
+This project shows the implementation of the OLED driver using a **SparkFun Micro OLED Breakout (Qwiic) board** with Silicon Labs Platform based on I2C communication.
The SparkFun Micro OLED Breakout (Qwiic) board carries a monochrome, 64 x 48px and blue-on-black OLED display. It uses an SSD1306 controller to drive the display. Its built-in functionalities include contrast control, normal or inverse image display, vertical and horizontal scrolling functions and more. It can be used for applications where bright and crisp blue text or icons need to be displayed such as MP3 player, home appliances.
@@ -10,21 +10,32 @@ For more information about the SSD1306 controller, see the [specification page](
>Please note that this is a monochrome OLED driver.
-## Quick Look Video
+## Quick Look Video ##
[![SSD1306 Quick Look Video](image/yt_thumbnail.jpg)](https://youtu.be/0QMDpJgDQd4 "Quick Look - SparkFun Micro OLED Display - Silicon Labs")
## Required Hardware ##
-- [A BGM220 Explorer Kit board.](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit)
+- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit)
-- [A SparkFun Micro OLED Breakout (Qwiic) board.](https://www.sparkfun.com/products/14532)
+- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A)
+
+- [A SparkFun Micro OLED Breakout (Qwiic) board](https://www.sparkfun.com/products/14532)
## Hardware Connection ##
-You simply connect a *SparkFun Micro OLED Breakout (Qwiic) board* to a *BGM220 Explorer Kit* board using a Qwiic cable.
+- If the BGM220P Explorer Kit is used:
+
+ You simply connect a *SparkFun Micro OLED Breakout (Qwiic) board* to a *BGM220 Explorer Kit* board using a Qwiic cable.
+
+ ![bgm220_kit_sparkfun_oled](image/bgm220_kit_sparkfun_oled.png)
-![bgm220_kit_sparkfun_oled](image/bgm220_kit_sparkfun_oled.png)
+- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:
+
+ | Description | BRD4338A GPIO | BRD4002 EXP Header | SparkFun Micro OLED Breakout |
+ | -------------| ------------- | ------------------ | ---------------------------- |
+ | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA |
+ | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL |
**Note:** There are several jumpers on *SparkFun Micro OLED Breakout (Qwiic) board* that can be changed to facilitate several different functions. The first of which is the ADDR jumper. The ADDR jumper can be used to change the I2C address of the board. The default jumper is open by default, pulling the address pin high and giving us an I2C address of 0X3D. Closing this jumper will ground the address pin, giving us an I2C address of 0X3C.
@@ -34,20 +45,26 @@ The second of which is the I2C pull-up jumper. If multiple boards are connected
## Setup ##
-To test this application, you should connect the BMG220 Explorer Kit Board to the PC using a micro USB cable.
+To test this application, you should connect your board to the PC using a micro USB cable.
### Create a project based on an example project ###
-1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter micro oled.
+1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *micro oled*.
+
+2. Click **Create** button on the project:
+
+ - **Third Party Hardware Drivers - SSD1306 - Micro OLED Breakout Qwiic (Sparkfun)** example if the BGM220P Explorer Kit is used.
+ ![create_example](image/create_example_1.png)
+ - **Third Party Hardware Drivers - SSD1306 - Micro OLED Breakout Qwiic (Sparkfun) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used.
+ ![create_example](image/create_example_2.png)
-2. Click **Create** button on the **Third Party Hardware Drivers - SSD1306 - Micro OLED Breakout Qwiic (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
-![create_example](image/create_example.png)
+ Example project creation dialog pops up -> click Create and Finish and Project should be generated.
3. Build and flash this example to the board.
### Start with an empty example project ###
-1. Create a "Platform - Empty C Example" project for the "BGM220 Explorer Kit Board" using Simplicity Studio 5. Use the default project settings. Be sure to connect and select the BGM220 Explorer Kit Board from the "Debug Adapters" on the left before creating a project.
+1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings.
2. Copy the file `app/example/sparkfun_micro_oled_ssd1306/app.c` into the project root folder (overwriting existing file).
@@ -55,8 +72,21 @@ To test this application, you should connect the BMG220 Explorer Kit Board to th
- 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] → [Display & LED] → [SSD1306 - Micro OLED Breakout (Sparkfun) - I2C]
+
+ **If the BGM220P Explorer Kit is used:**
+
+ - [Services] → [Timers] → [Sleep Timer]
+ - [Platform] → [Driver]→ [Button] → [Simple Button] → default instance name: **btn0**
+ - [Platform] → [Driver] → [I2C] → [I2CSPM] → default instance name: **qwiic**
+ - [Third Party Hardware Drivers] → [Display & LED] → [SSD1306 - Micro OLED Breakout (Sparkfun) - I2C] → use default configuration
+ - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library]
+
+ **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:**
+
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x]
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Hardware] → [Button] → [btn0]
+ - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2]
+ - [Third Party Hardware Drivers] → [Display & LED] → [SSD1306 - Micro OLED Breakout (Sparkfun) - I2C] → use default configuration
- [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library]
4. Build and flash the project to your device.
diff --git a/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example.png b/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_1.png
similarity index 100%
rename from app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example.png
rename to app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_1.png
diff --git a/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_2.png b/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_2.png
new file mode 100644
index 00000000..5b37c35c
Binary files /dev/null and b/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_2.png differ
diff --git a/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09.slcp b/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09.slcp
index 62fb38e3..b6eaa3db 100644
--- a/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09.slcp
+++ b/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09.slcp
@@ -39,7 +39,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_neotrellis_keypad_atsamd09/image/connection.png
diff --git a/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741.slcp b/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741.slcp
index 8203ae7c..fdfa3976 100644
--- a/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741.slcp
+++ b/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741.slcp
@@ -46,7 +46,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_rgb_led_is31fl3741/image/connection.png
directory: "image"
diff --git a/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d.slcp b/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d.slcp
index 0984025f..d30664cb 100644
--- a/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d.slcp
+++ b/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d.slcp
@@ -46,7 +46,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/create_example_with_dma_mode.png
diff --git a/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma.slcp b/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma.slcp
index 58e0f4e6..e9993d78 100644
--- a/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma.slcp
+++ b/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma.slcp
@@ -46,7 +46,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/create_example_with_dma_mode.png
diff --git a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl.slcp b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl.slcp
index 45e43a7c..73412001 100644
--- a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl.slcp
+++ b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl.slcp
@@ -66,7 +66,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/create_example.png
diff --git a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma.slcp b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma.slcp
index f31263aa..3626d4b0 100644
--- a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma.slcp
+++ b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma.slcp
@@ -68,7 +68,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/create_example.png
diff --git a/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341.slcp b/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341.slcp
index 8163dc2a..1e5e68d7 100644
--- a/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341.slcp
+++ b/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341.slcp
@@ -46,7 +46,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/create_example.png
diff --git a/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma.slcp b/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma.slcp
index 2c652278..a63f979a 100644
--- a/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma.slcp
+++ b/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma.slcp
@@ -46,7 +46,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/create_example.png
diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl.slcp b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl.slcp
index 2043f617..2c8aa5bf 100644
--- a/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl.slcp
+++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl.slcp
@@ -88,7 +88,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
configuration:
- name: LV_BUFFER_MODE
diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma.slcp b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma.slcp
index 2522d7c7..15f43cf9 100644
--- a/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma.slcp
+++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma.slcp
@@ -60,7 +60,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
configuration:
- name: LV_BUFFER_MODE
diff --git a/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789.slcp b/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789.slcp
index 3987d8e4..a8a9b1e8 100644
--- a/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789.slcp
+++ b/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789.slcp
@@ -49,7 +49,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/create_example.png
diff --git a/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma.slcp b/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma.slcp
index 763718df..e6b83461 100644
--- a/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma.slcp
+++ b/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma.slcp
@@ -50,7 +50,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/create_example.png
diff --git a/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma.slcp b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma.slcp
index 783e71f2..2fe11d7d 100644
--- a/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma.slcp
+++ b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma.slcp
@@ -59,7 +59,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/create_example.png
diff --git a/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007.slcp b/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007.slcp
index 7eff814a..fabdad20 100644
--- a/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007.slcp
+++ b/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007.slcp
@@ -45,7 +45,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/adafruit_touchscreen_tsc2007/image/calib.png
diff --git a/app/example/bthome_v2_server/bthome_v2_server.slcp b/app/example/bthome_v2_server/bthome_v2_server.slcp
index 98cec0ba..eec1b6bb 100644
--- a/app/example/bthome_v2_server/bthome_v2_server.slcp
+++ b/app/example/bthome_v2_server/bthome_v2_server.slcp
@@ -66,7 +66,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/bthome_v2_server/image/connection.png
diff --git a/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048.slcp b/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048.slcp
index e8dcd58b..67d1afbe 100644
--- a/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048.slcp
+++ b/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048.slcp
@@ -47,7 +47,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/maxim_fuel_gauge_max17048/image/overview.png
diff --git a/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c.slcp b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c.slcp
index e3680251..097a1c5f 100644
--- a/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c.slcp
+++ b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c.slcp
@@ -44,7 +44,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_accel5_bma400/image/hardware_connection.png
diff --git a/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi.slcp b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi.slcp
index ab469ab7..6dc4cb70 100644
--- a/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi.slcp
+++ b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi.slcp
@@ -44,7 +44,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_accel5_bma400/image/hardware_connection.png
diff --git a/app/example/mikroe_alcohol_mq3/app.c b/app/example/mikroe_alcohol_mq3/app.c
index ed7098f0..30611490 100644
--- a/app/example/mikroe_alcohol_mq3/app.c
+++ b/app/example/mikroe_alcohol_mq3/app.c
@@ -3,27 +3,62 @@
* @brief Top level application functions
*******************************************************************************
* # License
- * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
- * The licensor of this software is Silicon Laboratories Inc. Your use of this
- * software is governed by the terms of Silicon Labs Master Software License
- * Agreement (MSLA) available at
- * www.silabs.com/about-us/legal/master-software-license-agreement. This
- * software is distributed to you in Source Code format and is governed by the
- * sections of the MSLA applicable to Source Code.
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
*
******************************************************************************/
-#include "em_iadc.h"
#include "sl_status.h"
-#include "app_log.h"
#include "sl_sleeptimer.h"
-
#include "mikroe_alcohol_mq3.h"
+#if (defined(SLI_SI917))
+#include "sl_adc_instances.h"
+#include "rsi_debug.h"
+#else
+#include "em_iadc.h"
+#include "app_log.h"
+#endif
+
+#define READING_INTERVAL_MSEC 1000
+
+#if (defined(SLI_SI917))
+#define app_printf(...) DEBUGOUT(__VA_ARGS__)
+static uint8_t channel = SL_ADC_CHANNEL_0;
+#else
+#define app_printf(...) app_log(__VA_ARGS__)
+#endif
static volatile bool alcohol_timer_expire = false;
static sl_sleeptimer_timer_handle_t alcohol_timer;
+static mikroe_adc_handle_t app_adc_handle = NULL;
static void alcohol_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer,
void *data);
@@ -33,19 +68,36 @@ static void alcohol_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer,
******************************************************************************/
void app_init(void)
{
- app_log("Application Init\n");
- mikroe_mq3_setup();
+ sl_status_t status;
+ app_printf("Application Init\n");
- if (mikroe_mq3_init(IADC0) != SL_STATUS_OK) {
- app_log("Application Init Error!\n");
- app_log("Please, run program again ...\n");
+#if (defined(SLI_SI917))
+ app_adc_handle = &channel;
+#else
+ app_adc_handle = IADC0;
+#endif
+ status = mikroe_mq3_init(app_adc_handle);
+#if (defined(SLI_SI917))
+
+ /**
+ * Due to calling trim_efuse API on ADC init in driver
+ * it will change the clock frequency,
+ * if we are not initialize the debug again
+ * it will print the garbage data in console output.
+ */
+ DEBUGINIT();
+#endif
+ if (status != SL_STATUS_OK) {
+ app_printf("Application Init Error!\n");
+ app_printf("Please, run program again ...\n");
for (;;) {}
}
- app_log("Alcohol Click is initialized.\n");
+
+ app_printf("Alcohol Click is initialized.\n");
sl_sleeptimer_delay_millisecond(100);
sl_sleeptimer_start_periodic_timer_ms(&alcohol_timer,
- 1000,
+ READING_INTERVAL_MSEC,
alcohol_sleeptimer_callback,
NULL,
0,
@@ -63,11 +115,11 @@ void app_process_action(void)
if (alcohol_timer_expire == true) {
alcohol_timer_expire = false;
if (mikroe_mq3_read_an_pin_value(&alcohol_an_value) == SL_STATUS_OK) {
- app_log("ADC Value: %u\r\n", alcohol_an_value);
+ app_printf("ADC Value: %u\r\n", alcohol_an_value);
}
if (mikroe_mq3_read_an_pin_voltage(&alcohol_an_voltage) == SL_STATUS_OK) {
- app_log("AN Voltage: %.3f[V]\r\n", alcohol_an_voltage);
+ app_printf("AN Voltage: %.3f[V]\r\n", alcohol_an_voltage);
}
}
}
diff --git a/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3.slcp b/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3.slcp
index 8477a387..2c437598 100644
--- a/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3.slcp
+++ b/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3.slcp
@@ -45,10 +45,12 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_project.png
+ - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_example_2.png
directory: "image"
- path: ../../documentation/example/mikroe_alcohol_mq3/image/console_log.png
directory: "image"
@@ -62,4 +64,4 @@ other_file:
ui_hints:
highlight:
- path: README.md
- focus: true
\ No newline at end of file
+ focus: true
diff --git a/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3_si91x.slcp b/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3_si91x.slcp
new file mode 100644
index 00000000..459e8fbc
--- /dev/null
+++ b/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3_si91x.slcp
@@ -0,0 +1,69 @@
+project_name: mikroe_alcohol_mq3_si91x
+package: platform
+label: Third Party Hardware Drivers - MQ3 - Alcohol Click (Mikroe) - Si91x
+description: |
+ This example project shows an example for Mikroe Alcohol Click board driver integration on Si91x.
+category: Example|Platform
+quality: evaluation
+
+filter:
+- name: Device Type
+ value: [SoC]
+- name: MCU
+ value: [32-bit MCU]
+- name: Project Difficulty
+ value: [Beginner]
+
+readme:
+- path: ../../documentation/example/mikroe_alcohol_mq3/README.md
+
+source:
+- path: app.c
+- path: main.c
+
+include:
+- path: ''
+ file_list:
+ - path: app.h
+
+component:
+- id: sl_system
+- id: sleeptimer_si91x
+ from: wiseconnect3_sdk
+- id: mikroe_alcohol_mq3
+ from: third_party_hw_drivers
+- id: syscalls
+ from: wiseconnect3_sdk
+- id: si917_memory_default_config
+ from: wiseconnect3_sdk
+- instance: [channel_0]
+ from: wiseconnect3_sdk
+ id: adc_instance
+
+sdk_extension:
+- id: third_party_hw_drivers
+ version: 3.0.0
+- id: wiseconnect3_sdk
+ version: 3.2.0
+
+other_file:
+ - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_example_2.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_alcohol_mq3/image/console_log.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_alcohol_mq3/image/install_float.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_alcohol_mq3/image/hardware_connection.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_alcohol_mq3/image/software_layer.png
+ directory: "image"
+
+ui_hints:
+ highlight:
+ - path: README.md
+ focus: true
+
+post_build:
+ path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb
diff --git a/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w.slcp b/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w.slcp
index 92b7b966..119f8701 100644
--- a/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w.slcp
+++ b/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w.slcp
@@ -53,7 +53,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_barcode2_em3080w/image/hardware_connection.png
diff --git a/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av.slcp b/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av.slcp
index 4dc270c7..5af78901 100644
--- a/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av.slcp
+++ b/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av.slcp
@@ -42,7 +42,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_brushless16_lb11685av/image/create_example.png
diff --git a/app/example/mikroe_buzz2_cmt_8540s_smt/app.c b/app/example/mikroe_buzz2_cmt_8540s_smt/app.c
index f31e644f..939994b5 100644
--- a/app/example/mikroe_buzz2_cmt_8540s_smt/app.c
+++ b/app/example/mikroe_buzz2_cmt_8540s_smt/app.c
@@ -1,38 +1,103 @@
/***************************************************************************//**
- * @file
- * @brief Top level application functions
+ * @file app.c
+ * @brief Example application
+ * @version 1.0.0
*******************************************************************************
* # License
- * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ * Copyright 2024 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
- * The licensor of this software is Silicon Laboratories Inc. Your use of this
- * software is governed by the terms of Silicon Labs Master Software License
- * Agreement (MSLA) available at
- * www.silabs.com/about-us/legal/master-software-license-agreement. This
- * software is distributed to you in Source Code format and is governed by the
- * sections of the MSLA applicable to Source Code.
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
*
- ******************************************************************************/
-
-/***************************************************************************//**
- * Initialize application.
******************************************************************************/
#include "sl_sleeptimer.h"
+#include "mikroe_cmt_8540s_smt.h"
#include "sl_pwm_instances.h"
+
+#if (defined(SLI_SI917))
+#include "rsi_debug.h"
+#else
#include "app_log.h"
-#include "mikroe_cmt_8540s_smt.h"
+#endif
+
+#if (defined(SLI_SI917))
+#define app_printf(...) DEBUGOUT(__VA_ARGS__)
+#else
+#define app_printf(...) app_log(__VA_ARGS__)
+#endif
+
+mikroe_pwm_handle_t app_pwm_instance = NULL;
-#define W 4 * Q // Whole 4/4 - 4 Beats
-#define H 2 * Q // Half 2/4 - 2 Beats
-#define Q 250 // Quarter 1/4 - 1 Beat
-#define E Q / 2 // Eighth 1/8 - 1/2 Beat
-#define S Q / 4 // Sixteenth 1/16 - 1/4 Beat
+#define W 4 * Q // Whole 4/4 - 4 Beats
+#define H 2 * Q // Half 2/4 - 2 Beats
+#define Q 250 // Quarter 1/4 - 1 Beat
+#define E Q / 2 // Eighth 1/8 - 1/2 Beat
+#define S Q / 4 // Sixteenth 1/16 - 1/4 Beat
-#define VOLUME 100 // goes up to 1000
+#define VOLUME 100 // goes up to 1000
-static void imperial_march( )
+static void imperial_march(void);
+
+void app_init(void)
+{
+ app_printf("- Buzzer 2 Click board driver, example application. -\n");
+
+#if (defined(SLI_SI917))
+ app_pwm_instance = &sl_pwm_channel_0_config;
+#else
+ app_pwm_instance = &sl_pwm_mikroe;
+#endif
+
+ if (SL_STATUS_OK != mikroe_cmt_8540s_smt_init(app_pwm_instance)) {
+ app_printf(
+ "> Buzzer 2 Click board driver init failed, please run program again.\n");
+ while (1) {}
+ } else {
+ app_printf("> Buzzer 2 Click board driver init successfully.\n");
+ mikroe_cmt_8540s_smt_set_duty_cycle(0.0);
+ mikroe_cmt_8540s_smt_pwm_start();
+ sl_sleeptimer_delay_millisecond(100);
+ }
+}
+
+/***************************************************************************//**
+ * App ticking function.
+ ******************************************************************************/
+void app_process_action(void)
+{
+ app_printf("Playing the Imperial March melody ...\r\n");
+ imperial_march( );
+ sl_sleeptimer_delay_millisecond(10000);
+}
+
+static void imperial_march(void)
{
mikroe_cmt_8540s_smt_play_sound(MIKROE_BUZZ2_NOTE_A6, VOLUME, Q);
sl_sleeptimer_delay_millisecond(1 + Q);
@@ -182,30 +247,3 @@ static void imperial_march( )
mikroe_cmt_8540s_smt_play_sound(MIKROE_BUZZ2_NOTE_Ab6, VOLUME, H);
sl_sleeptimer_delay_millisecond(1 + H);
}
-
-void app_init(void)
-{
- app_log(
- "- Buzzer 2 Click board driver, example application. -\n");
-
- if (SL_STATUS_OK != mikroe_cmt_8540s_smt_init(&sl_pwm_mikroe)) {
- app_log(
- "> Buzzer 2 Click board driver init failed, please run program again.\n");
- while (1) {}
- } else {
- app_log("> Buzzer 2 Click board driver init successfully.\n");
- mikroe_cmt_8540s_smt_set_duty_cycle(0.0);
- mikroe_cmt_8540s_smt_pwm_start();
- sl_sleeptimer_delay_millisecond(100);
- }
-}
-
-/***************************************************************************//**
- * App ticking function.
- ******************************************************************************/
-void app_process_action(void)
-{
- app_log("Playing the Imperial March melody ...\r\n");
- imperial_march( );
- sl_sleeptimer_delay_millisecond(10000);
-}
diff --git a/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt.slcp b/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt.slcp
index c2997ab5..c3f11083 100644
--- a/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt.slcp
+++ b/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt.slcp
@@ -44,11 +44,13 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example.png
directory: "image"
+ - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example_si91x.png
+ directory: "image"
- path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/log.png
directory: "image"
- path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/hardware_connection.png
@@ -57,4 +59,4 @@ other_file:
ui_hints:
highlight:
- path: README.md
- focus: true
\ No newline at end of file
+ focus: true
diff --git a/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt_si91x.slcp b/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt_si91x.slcp
new file mode 100644
index 00000000..c5658820
--- /dev/null
+++ b/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt_si91x.slcp
@@ -0,0 +1,66 @@
+project_name: mikroe_buzz2_cmt_8540s_smt_si91x
+package: platform
+label: Third Party Hardware Drivers - CMT-8540S-SMT - Buzz 2 Click (Mikroe) - Si91x
+description: |
+ This example project shows an example for Mikroe Buzz 2 Click board driver integration on Si91x.
+category: Example|Platform
+quality: evaluation
+
+filter:
+- name: Device Type
+ value: [SoC]
+- name: MCU
+ value: [32-bit MCU]
+- name: Project Difficulty
+ value: [Beginner]
+
+
+readme:
+- path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/README.md
+
+source:
+- path: app.c
+- path: main.c
+
+include:
+- path: ''
+ file_list:
+ - path: app.h
+
+component:
+- id: sl_system
+- id: sleeptimer_si91x
+ from: wiseconnect3_sdk
+- id: mikroe_buzz2
+ from: third_party_hw_drivers
+- id: syscalls
+ from: wiseconnect3_sdk
+- id: si917_memory_default_config
+ from: wiseconnect3_sdk
+- instance: [channel_0]
+ from: wiseconnect3_sdk
+ id: pwm_instance
+
+sdk_extension:
+- id: third_party_hw_drivers
+ version: 3.0.0
+- id: wiseconnect3_sdk
+ version: 3.2.0
+
+other_file:
+ - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example_si91x.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/log.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/hardware_connection.png
+ directory: "image"
+
+ui_hints:
+ highlight:
+ - path: README.md
+ focus: true
+
+post_build:
+ path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb
diff --git a/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166.slcp b/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166.slcp
index 534fcb85..a771a3c5 100644
--- a/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166.slcp
+++ b/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166.slcp
@@ -44,7 +44,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_captouch2_cap1166/image/hardware_connection.png
diff --git a/app/example/mikroe_co_mq7/mikroe_co_mq7.slcp b/app/example/mikroe_co_mq7/mikroe_co_mq7.slcp
index 8b1a328c..3f7ff974 100644
--- a/app/example/mikroe_co_mq7/mikroe_co_mq7.slcp
+++ b/app/example/mikroe_co_mq7/mikroe_co_mq7.slcp
@@ -58,7 +58,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
ui_hints:
highlight:
diff --git a/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958.slcp b/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958.slcp
index 8c82e245..8b715e80 100644
--- a/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958.slcp
+++ b/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958.slcp
@@ -47,7 +47,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_dcmotor24_l9958/image/create_example.png
diff --git a/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg.slcp b/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg.slcp
index 18543776..bac25af8 100644
--- a/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg.slcp
+++ b/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg.slcp
@@ -47,7 +47,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_dcmotor26_tb9053ftg/image/create_project.png
diff --git a/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg.slcp b/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg.slcp
index b65df54e..7ca0d1e2 100644
--- a/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg.slcp
+++ b/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg.slcp
@@ -44,7 +44,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_dcmotor3_tb6549fg/image/create_example.png
diff --git a/app/example/mikroe_e_paper_154_inch/mikroe_e_paper_154_inch.slcp b/app/example/mikroe_e_paper_154_inch/mikroe_e_paper_154_inch.slcp
index ccf14950..a0c48e00 100644
--- a/app/example/mikroe_e_paper_154_inch/mikroe_e_paper_154_inch.slcp
+++ b/app/example/mikroe_e_paper_154_inch/mikroe_e_paper_154_inch.slcp
@@ -34,7 +34,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_e_paper_154_inch/image/hardware_connection.png
directory: image
diff --git a/app/example/mikroe_emg/mikroe_emg.slcp b/app/example/mikroe_emg/mikroe_emg.slcp
index 8ca4ad33..9929e8fd 100644
--- a/app/example/mikroe_emg/mikroe_emg.slcp
+++ b/app/example/mikroe_emg/mikroe_emg.slcp
@@ -41,7 +41,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_emg/image/create_example.png
diff --git a/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40.slcp b/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40.slcp
index 75ed1a9d..769e085b 100644
--- a/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40.slcp
+++ b/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40.slcp
@@ -47,7 +47,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_environment2_sht40_sgp40/image/create_example.png
diff --git a/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c.slcp b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c.slcp
index c25b78fa..b4824758 100644
--- a/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c.slcp
+++ b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c.slcp
@@ -48,7 +48,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_environment3_bme688/image/create_example.png
diff --git a/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi.slcp b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi.slcp
index a216f335..c6a23a05 100644
--- a/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi.slcp
+++ b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi.slcp
@@ -48,7 +48,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_environment3_bme688/image/create_example.png
diff --git a/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500.slcp b/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500.slcp
index d28c62ef..3dffa742 100644
--- a/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500.slcp
+++ b/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500.slcp
@@ -44,7 +44,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_eth_wiz_w5500/image/board.png
diff --git a/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq.slcp b/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq.slcp
index 68c4b8e2..ae7be9be 100644
--- a/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq.slcp
+++ b/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq.slcp
@@ -44,7 +44,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_fingerprint2_a172mrq/image/hardware_connection.png
diff --git a/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400.slcp b/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400.slcp
index b6ce3244..c9d57fde 100644
--- a/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400.slcp
+++ b/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400.slcp
@@ -47,7 +47,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_force3_fsr400/image/create_example.png
diff --git a/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s.slcp b/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s.slcp
index 5d853317..6adb3989 100644
--- a/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s.slcp
+++ b/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s.slcp
@@ -49,7 +49,7 @@ toolchain_settings:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_gps_lea6s/image/create_example.png
diff --git a/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161.slcp b/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161.slcp
index 16564d6d..375af7b4 100644
--- a/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161.slcp
+++ b/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161.slcp
@@ -43,7 +43,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_heartrate2_maxm86161/image/create_example.png
diff --git a/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101.slcp b/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101.slcp
index 140cffa9..e3f0581d 100644
--- a/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101.slcp
+++ b/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101.slcp
@@ -54,7 +54,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
ui_hints:
highlight:
diff --git a/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30.slcp b/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30.slcp
index 6e16a616..f316810d 100644
--- a/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30.slcp
+++ b/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30.slcp
@@ -58,7 +58,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
ui_hints:
highlight:
diff --git a/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41.slcp b/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41.slcp
index 9c2f40b8..238a221b 100644
--- a/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41.slcp
+++ b/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41.slcp
@@ -46,7 +46,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_hvac_scd41/image/create_example.png
diff --git a/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632.slcp b/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632.slcp
index fd95b55e..b6fc6842 100644
--- a/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632.slcp
+++ b/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632.slcp
@@ -59,7 +59,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
ui_hints:
highlight:
diff --git a/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96.slcp b/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96.slcp
index a0eaf84d..c6fd6182 100644
--- a/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96.slcp
+++ b/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96.slcp
@@ -45,7 +45,7 @@ toolchain_settings:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_lte_iot2_bg96/image/create_example.png
diff --git a/app/example/mikroe_mic2/mikroe_mic2.slcp b/app/example/mikroe_mic2/mikroe_mic2.slcp
index 6f46fbde..502a1c5c 100644
--- a/app/example/mikroe_mic2/mikroe_mic2.slcp
+++ b/app/example/mikroe_mic2/mikroe_mic2.slcp
@@ -45,7 +45,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_mic2/image/create_example.png
diff --git a/app/example/mikroe_microsd/mikroe_microsd.slcp b/app/example/mikroe_microsd/mikroe_microsd.slcp
index b0b2f853..27c470bc 100644
--- a/app/example/mikroe_microsd/mikroe_microsd.slcp
+++ b/app/example/mikroe_microsd/mikroe_microsd.slcp
@@ -38,7 +38,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_microsd/image/create_example.png
directory: image
diff --git a/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150.slcp b/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150.slcp
index 743442ab..0fc8b525 100644
--- a/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150.slcp
+++ b/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150.slcp
@@ -36,7 +36,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_nfc2_pn7150/image/hardware_connection.png
directory: image
diff --git a/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read.slcp b/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read.slcp
index 54d11e5c..12603637 100644
--- a/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read.slcp
+++ b/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read.slcp
@@ -48,7 +48,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/image/hardware_connection.png
diff --git a/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write.slcp b/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write.slcp
index 3684da90..2bf58c26 100644
--- a/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write.slcp
+++ b/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write.slcp
@@ -50,7 +50,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/image/hardware_connection.png
diff --git a/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111.slcp b/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111.slcp
index 6fc753f2..35ce7cf0 100644
--- a/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111.slcp
+++ b/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111.slcp
@@ -35,7 +35,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_nfctag2_nt3h2111/image/hardware_connection.png
directory: image
diff --git a/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110.slcp b/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110.slcp
index 64c3e84d..179246de 100644
--- a/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110.slcp
+++ b/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110.slcp
@@ -44,7 +44,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_obdii_stn1110/image/hardware_connection.png
diff --git a/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351.slcp b/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351.slcp
index c30b999c..fd132172 100644
--- a/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351.slcp
+++ b/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351.slcp
@@ -39,7 +39,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_oledc_ssd1351/image/hardware_connection.png
directory: "image"
diff --git a/app/example/mikroe_oledw_ssd1306/app.c b/app/example/mikroe_oledw_ssd1306/app.c
index 7ac74a64..f79cba26 100644
--- a/app/example/mikroe_oledw_ssd1306/app.c
+++ b/app/example/mikroe_oledw_ssd1306/app.c
@@ -3,39 +3,72 @@
* @brief Top level application functions
*******************************************************************************
* # License
- * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
- * The licensor of this software is Silicon Laboratories Inc. Your use of this
- * software is governed by the terms of Silicon Labs Master Software License
- * Agreement (MSLA) available at
- * www.silabs.com/about-us/legal/master-software-license-agreement. This
- * software is distributed to you in Source Code format and is governed by the
- * sections of the MSLA applicable to Source Code.
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
*
******************************************************************************/
-/***************************************************************************//**
- * Initialize application.
- ******************************************************************************/
#include "sl_sleeptimer.h"
-#include "sl_spidrv_instances.h"
-
#include "app_assert.h"
-
#include "mikroe_ssd1306.h"
#include "mikroe_resources.h"
+#if (defined(SLI_SI917))
+#include "sl_si91x_gspi.h"
+#else
+#include "sl_spidrv_instances.h"
+#endif
+
+#if (defined(SLI_SI917))
+static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER;
+#endif
+
+mikroe_spi_handle_t app_spi_instance = NULL;
+
void app_init(void)
{
sl_status_t ret_code;
- ret_code = mikroe_ssd1306_init(sl_spidrv_mikroe_handle);
+#if (defined(SLI_SI917))
+ app_spi_instance = &gspi_instance;
+#else
+ app_spi_instance = sl_spidrv_mikroe_handle;
+#endif
+
+ ret_code = mikroe_ssd1306_init(app_spi_instance);
app_assert_status(ret_code);
mikroe_ssd1306_default_cfg();
- /*Change segment remap for Mikroe Bitmap*/
+ // Change segment remap for Mikroe Bitmap
mikroe_ssd1306_send(OLEDW_SEGREMAP, MIKROE_SSD1306_COMMAND);
}
diff --git a/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306.slcp b/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306.slcp
index 733c65dd..b59122cb 100644
--- a/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306.slcp
+++ b/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306.slcp
@@ -43,12 +43,14 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_oledw_ssd1306/image/hardware_connection.png
directory: "image"
- - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example.png
+ - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example_2.png
directory: "image"
- path: ../../documentation/example/mikroe_oledw_ssd1306/image/testing_result.gif
directory: "image"
diff --git a/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306_si91x.slcp b/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306_si91x.slcp
new file mode 100644
index 00000000..0e5d800e
--- /dev/null
+++ b/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306_si91x.slcp
@@ -0,0 +1,63 @@
+project_name: mikroe_oledw_ssd1306_si91x
+package: platform
+label: Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe) - Si91x
+description: |
+ This example project shows an example for Mikroe OLEDW Click driver integration on Si91x.
+category: Example|Platform
+quality: evaluation
+
+filter:
+- name: Device Type
+ value: [SoC]
+- name: MCU
+ value: [32-bit MCU]
+- name: Project Difficulty
+ value: [Beginner]
+
+readme:
+- path: ../../documentation/example/mikroe_oledw_ssd1306/README.md
+
+source:
+- path: app.c
+- path: main.c
+
+include:
+- path: ''
+ file_list:
+ - path: app.h
+
+component:
+- id: sl_system
+- id: app_assert
+- id: sleeptimer_si91x
+ from: wiseconnect3_sdk
+- id: mikroe_oledw
+ from: third_party_hw_drivers
+- id: syscalls
+ from: wiseconnect3_sdk
+- id: si917_memory_default_config
+ from: wiseconnect3_sdk
+
+sdk_extension:
+- id: third_party_hw_drivers
+ version: 3.0.0
+- id: wiseconnect3_sdk
+ version: 3.2.0
+
+other_file:
+ - path: ../../documentation/example/mikroe_oledw_ssd1306/image/hardware_connection.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example_2.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_oledw_ssd1306/image/testing_result.gif
+ directory: "image"
+
+ui_hints:
+ highlight:
+ - path: README.md
+ focus: true
+
+post_build:
+ path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb
diff --git a/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib.slcp b/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib.slcp
index 2b6ff5ef..90641618 100644
--- a/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib.slcp
+++ b/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib.slcp
@@ -46,7 +46,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_oledw_ssd1306_glib/image/hardware_connection.png
diff --git a/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131.slcp b/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131.slcp
index 709ad12d..4bf1ca05 100644
--- a/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131.slcp
+++ b/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131.slcp
@@ -43,7 +43,7 @@ configuration:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_ozone2_mq131/images/create_example.png
diff --git a/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01.slcp b/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01.slcp
index 62c009ba..3b573ada 100644
--- a/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01.slcp
+++ b/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01.slcp
@@ -45,7 +45,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_pir_pl_n823_01/image/create_project.png
diff --git a/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c.slcp b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c.slcp
index c5973536..0b68703b 100644
--- a/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c.slcp
+++ b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c.slcp
@@ -41,7 +41,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_pressure3_dps310/image/create_example.png
directory: "image"
diff --git a/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi.slcp b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi.slcp
index fc27b03e..1f20cb26 100644
--- a/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi.slcp
+++ b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi.slcp
@@ -41,7 +41,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
configuration:
- name: SL_SPIDRV_MIKROE_CS_CONTROL
value: "spidrvCsControlApplication"
diff --git a/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc.slcp b/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc.slcp
index c1377399..6bbea1eb 100644
--- a/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc.slcp
+++ b/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc.slcp
@@ -34,7 +34,7 @@ component:
from: third_party_hw_drivers
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/create_example.png
directory: "image"
diff --git a/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00.slcp b/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00.slcp
index b0d27397..cbe9eff4 100644
--- a/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00.slcp
+++ b/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00.slcp
@@ -48,7 +48,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_radar_mm5d91_00/image/hardware_connection.png
diff --git a/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717.slcp b/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717.slcp
index ba0de9cd..8c19ce54 100644
--- a/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717.slcp
+++ b/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717.slcp
@@ -38,7 +38,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_relay2_lca717/image/hardware_connection.png
diff --git a/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318.slcp b/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318.slcp
index 96caf4f8..1788a13d 100644
--- a/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318.slcp
+++ b/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318.slcp
@@ -47,7 +47,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_rf_meter_ad8318/image/create_example.png
diff --git a/app/example/mikroe_rng/mikroe_rng.slcp b/app/example/mikroe_rng/mikroe_rng.slcp
index cb3515e3..7d4d6529 100644
--- a/app/example/mikroe_rng/mikroe_rng.slcp
+++ b/app/example/mikroe_rng/mikroe_rng.slcp
@@ -47,7 +47,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_rng/image/create_example.png
diff --git a/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m.slcp b/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m.slcp
index 0c0f2b28..9b0f1bd7 100644
--- a/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m.slcp
+++ b/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m.slcp
@@ -47,7 +47,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_rtc10_ds3231m/image/create_project.png
diff --git a/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685.slcp b/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685.slcp
index 58413851..9a0aadc7 100644
--- a/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685.slcp
+++ b/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685.slcp
@@ -43,7 +43,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_servo_pca9685/image/create_project.png
diff --git a/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c.slcp b/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c.slcp
index 787e8f9f..abf621fe 100644
--- a/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c.slcp
+++ b/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c.slcp
@@ -44,7 +44,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_smoke2_adpd188bi/image/create_example.png
diff --git a/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_spi.slcp b/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_spi.slcp
index faecdb7c..ae1f1c17 100644
--- a/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_spi.slcp
+++ b/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_spi.slcp
@@ -44,7 +44,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_smoke2_adpd188bi/image/create_example.png
diff --git a/app/example/mikroe_stepper2_a4988/mikroe_stepper2_a4988.slcp b/app/example/mikroe_stepper2_a4988/mikroe_stepper2_a4988.slcp
index c7014355..dd244efa 100644
--- a/app/example/mikroe_stepper2_a4988/mikroe_stepper2_a4988.slcp
+++ b/app/example/mikroe_stepper2_a4988/mikroe_stepper2_a4988.slcp
@@ -42,7 +42,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_stepper2_a4988/image/create_example.png
diff --git a/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967.slcp b/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967.slcp
index d543526a..d5f78c05 100644
--- a/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967.slcp
+++ b/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967.slcp
@@ -40,7 +40,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_stepper_a3967/image/create_example.png
diff --git a/app/example/mikroe_stretch/mikroe_stretch.slcp b/app/example/mikroe_stretch/mikroe_stretch.slcp
index 398f60bf..7a060c83 100644
--- a/app/example/mikroe_stretch/mikroe_stretch.slcp
+++ b/app/example/mikroe_stretch/mikroe_stretch.slcp
@@ -41,7 +41,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_stretch/image/console_log.png
diff --git a/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40.slcp b/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40.slcp
index f298a5d9..356e5043 100644
--- a/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40.slcp
+++ b/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40.slcp
@@ -47,7 +47,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_temphum15_sht40/image/create_example.png
diff --git a/app/example/mikroe_temphum9_shtc3/app.c b/app/example/mikroe_temphum9_shtc3/app.c
index 1f84a7b3..8691c485 100644
--- a/app/example/mikroe_temphum9_shtc3/app.c
+++ b/app/example/mikroe_temphum9_shtc3/app.c
@@ -37,37 +37,65 @@
*
******************************************************************************/
-/***************************************************************************//**
- * Initialize application.
- ******************************************************************************/
-
#include "sl_sleeptimer.h"
+#include "mikroe_shtc3.h"
+
+#if (defined(SLI_SI917))
+#include "sl_i2c_instances.h"
+#include "rsi_debug.h"
+#else
#include "sl_i2cspm_instances.h"
#include "app_log.h"
-#include "mikroe_shtc3.h"
+#endif
+
+#define READING_INTERVAL_MSEC 1000
+
+#if (defined(SLI_SI917))
+#define app_printf(...) DEBUGOUT(__VA_ARGS__)
+#else
+#define app_printf(...) app_log(__VA_ARGS__)
+#endif
-static bool sensor_init_ok = false;
+#if (defined(SLI_SI917))
+#define I2C_INSTANCE_USED SL_I2C2
+static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED;
+#endif
+
+static sl_sleeptimer_timer_handle_t app_timer_handle;
+static volatile bool trigger_process = false;
+static mikroe_i2c_handle_t app_i2c_instance = NULL;
+
+void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data);
void app_init(void)
{
- app_log(
+ app_printf(
"-- SHTC3 - Temp&Hum 9 Click board driver, example application. --\n");
- if (SL_STATUS_OK != mikroe_shtc3_init(sl_i2cspm_mikroe)) {
- app_log("> SHTC3 - Temp&Hum 9 Click board driver init failed.\n");
- } else {
- sensor_init_ok = true;
+#if (defined(SLI_SI917))
+ app_i2c_instance = &i2c_instance;
+#else
+ app_i2c_instance = sl_i2cspm_mikroe;
+#endif
+
+ if (SL_STATUS_OK != mikroe_shtc3_init(app_i2c_instance)) {
+ app_printf("> SHTC3 - Temp&Hum 9 Click board driver init failed.\n");
+ return;
}
- if (sensor_init_ok) {
- mikroe_shtc3_send_command(MIKROE_SHTC3_CMD_SLEEP);
- sl_sleeptimer_delay_millisecond(500);
- mikroe_shtc3_send_command(MIKROE_SHTC3_CMD_WAKEUP);
- sl_sleeptimer_delay_millisecond(100);
+ mikroe_shtc3_send_command(MIKROE_SHTC3_CMD_SLEEP);
+ sl_sleeptimer_delay_millisecond(500);
+ mikroe_shtc3_send_command(MIKROE_SHTC3_CMD_WAKEUP);
+ sl_sleeptimer_delay_millisecond(100);
- app_log("> App init done.\n");
- app_log("> Starting periodic measurement.\n");
- }
+ app_printf("> App init done.\n");
+ app_printf("> Starting periodic measurement.\n");
+ sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle,
+ READING_INTERVAL_MSEC,
+ app_timer_callback,
+ NULL,
+ 0,
+ 0);
}
/***************************************************************************//**
@@ -77,12 +105,20 @@ void app_process_action(void)
{
mikroe_shtc3_measurement_data_t measurement_data;
- if (sensor_init_ok) {
+ if (trigger_process) {
+ trigger_process = false;
mikroe_shtc3_get_temperature_and_humidity(SHTC3_DATA_MODE_NORMAL,
&measurement_data);
- app_log(">> Temp: %.2f °C RH: %.2f %%\n", measurement_data.temperature,
- measurement_data.humidity);
- sl_sleeptimer_delay_millisecond(1000);
+ app_printf(">> Temp: %.2f °C RH: %.2f %%\n", measurement_data.temperature,
+ measurement_data.humidity);
}
}
+
+void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data)
+{
+ (void) data;
+ (void) handle;
+
+ trigger_process = true;
+}
diff --git a/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3.slcp b/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3.slcp
index 02c1f421..95085f94 100644
--- a/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3.slcp
+++ b/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3.slcp
@@ -47,10 +47,12 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example.png
+ - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example_2.png
directory: "image"
- path: ../../documentation/example/mikroe_temphum9_shtc3/image/hardware_connection.png
directory: "image"
@@ -62,4 +64,4 @@ other_file:
ui_hints:
highlight:
- path: README.md
- focus: true
\ No newline at end of file
+ focus: true
diff --git a/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3_si91x.slcp b/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3_si91x.slcp
new file mode 100644
index 00000000..90b2b082
--- /dev/null
+++ b/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3_si91x.slcp
@@ -0,0 +1,67 @@
+project_name: mikroe_temphum9_shtc3_si91x
+package: platform
+label: Third Party Hardware Drivers - SHTC3 - Temp&Hum 9 Click (Mikroe) - Si91x
+description: |
+ This example project shows an example for Mikroe Temp&Hum 9 Click board driver integration on Si91x.
+category: Example|Platform
+quality: evaluation
+
+filter:
+- name: Device Type
+ value: [SoC]
+- name: MCU
+ value: [32-bit MCU]
+- name: Project Difficulty
+ value: [Beginner]
+
+readme:
+- path: ../../documentation/example/mikroe_temphum9_shtc3/README.md
+
+source:
+- path: app.c
+- path: main.c
+
+include:
+- path: ''
+ file_list:
+ - path: app.h
+
+component:
+- id: sl_system
+- id: sleeptimer_si91x
+ from: wiseconnect3_sdk
+- id: mikroe_temphum9
+ from: third_party_hw_drivers
+- id: syscalls
+ from: wiseconnect3_sdk
+- id: si917_memory_default_config
+ from: wiseconnect3_sdk
+- instance: [i2c2]
+ from: wiseconnect3_sdk
+ id: i2c_instance
+
+sdk_extension:
+- id: third_party_hw_drivers
+ version: 3.0.0
+- id: wiseconnect3_sdk
+ version: 3.2.0
+
+other_file:
+ - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example_2.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_temphum9_shtc3/image/hardware_connection.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_temphum9_shtc3/image/float.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_temphum9_shtc3/image/log.png
+ directory: "image"
+
+ui_hints:
+ highlight:
+ - path: README.md
+ focus: true
+
+post_build:
+ path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb
diff --git a/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935.slcp b/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935.slcp
index bed75201..95969723 100644
--- a/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935.slcp
+++ b/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935.slcp
@@ -43,7 +43,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_thunder_as3935/image/create_example.png
diff --git a/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10.slcp b/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10.slcp
index 2652fa57..a3f21881 100644
--- a/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10.slcp
+++ b/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10.slcp
@@ -47,7 +47,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_turbidity_tsd10/image/create_example.png
diff --git a/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969.slcp b/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969.slcp
index 45b55f6d..436ee2a2 100644
--- a/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969.slcp
+++ b/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969.slcp
@@ -42,7 +42,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_utm7segr_max6969/image/create_example.png
diff --git a/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a.slcp b/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a.slcp
index dae19a69..fe2b5576 100644
--- a/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a.slcp
+++ b/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a.slcp
@@ -39,7 +39,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/mikroe_uv_ml8511a/image/hardware_connection.png
directory: image
diff --git a/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000.slcp b/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000.slcp
index fbafb3ba..a8e71563 100644
--- a/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000.slcp
+++ b/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000.slcp
@@ -54,7 +54,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../linker_files/brd2703a/linkerfile.ld
diff --git a/app/example/mikroe_water_detect/app.c b/app/example/mikroe_water_detect/app.c
index 92ec4777..cc4221cb 100644
--- a/app/example/mikroe_water_detect/app.c
+++ b/app/example/mikroe_water_detect/app.c
@@ -3,25 +3,60 @@
* @brief Top level application functions
*******************************************************************************
* # License
- * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
- * The licensor of this software is Silicon Laboratories Inc. Your use of this
- * software is governed by the terms of Silicon Labs Master Software License
- * Agreement (MSLA) available at
- * www.silabs.com/about-us/legal/master-software-license-agreement. This
- * software is distributed to you in Source Code format and is governed by the
- * sections of the MSLA applicable to Source Code.
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
*
******************************************************************************/
-#include "gpiointerrupt.h"
-#include "sl_sleeptimer.h"
-#include "app_log.h"
+#include "sl_sleeptimer.h"
#include "mikroe_water_detect.h"
#include "mikroe_water_detect_config.h"
-#define READING_INTERVAL_MSEC 200
+#if (defined(SLI_SI917))
+#include "sl_driver_gpio.h"
+#include "rsi_debug.h"
+#else
+#include "gpiointerrupt.h"
+#include "app_log.h"
+#endif
+
+#if (defined(SLI_SI917))
+#define GPIO_M4_INTR 7 // M4 Pin interrupt number
+#define AVL_INTR_NO 0 // available interrupt number
+#define app_printf(...) DEBUGOUT(__VA_ARGS__)
+#else
+#define app_printf(...) app_log(__VA_ARGS__)
+#endif
+
+#define READING_INTERVAL_MSEC 200
#define MIKROE_WATER_DETECT_MODE_INTERRUPT
// #define MIKROE_WATER_DETECT_MODE_POLLING
@@ -63,7 +98,19 @@ void app_init(void)
0,
0);
#endif
+
#ifdef MIKROE_WATER_DETECT_MODE_INTERRUPT
+#if (defined(SLI_SI917))
+ sl_gpio_t gpio_port_pin = {
+ WATER_DETECT_INT_PIN / 16,
+ WATER_DETECT_INT_PIN % 16
+ };
+ sl_gpio_driver_configure_interrupt(&gpio_port_pin,
+ GPIO_M4_INTR,
+ SL_GPIO_INTERRUPT_RISING_EDGE | SL_GPIO_INTERRUPT_FALLING_EDGE,
+ (void *)&wd_int_callback,
+ AVL_INTR_NO);
+#else
GPIO_ExtIntConfig(WATER_DETECT_INT_PORT,
WATER_DETECT_INT_PIN,
WATER_DETECT_INT_PIN,
@@ -73,10 +120,11 @@ void app_init(void)
GPIOINT_CallbackRegister(WATER_DETECT_INT_PIN, wd_int_callback);
GPIO_IntEnable(WATER_DETECT_INT_PIN);
#endif
- app_log(" Initialization Driver \r\n");
- app_log("------------------------- \r\n");
- app_log(" Wait to detect water... \r\n");
- app_log("------------------------- \r\n");
+#endif
+ app_printf(" Initialization Driver \r\n");
+ app_printf("------------------------- \r\n");
+ app_printf(" Wait to detect water... \r\n");
+ app_printf("------------------------- \r\n");
}
/***************************************************************************//**
@@ -85,14 +133,14 @@ void app_init(void)
void app_process_action(void)
{
if (wd_state > wd_state_old) {
- app_log(" > Water is detected < \r\n");
- app_log("------------------------- \r\n");
+ app_printf(" > Water is detected < \r\n");
+ app_printf("------------------------- \r\n");
wd_state_old = 1;
}
if (wd_state < wd_state_old) {
- app_log(" There is no water \r\n");
- app_log("------------------- \r\n");
+ app_printf(" There is no water \r\n");
+ app_printf("------------------- \r\n");
wd_state_old = 0;
}
}
diff --git a/app/example/mikroe_water_detect/mikroe_water_detect.slcp b/app/example/mikroe_water_detect/mikroe_water_detect.slcp
index e34ca039..28442669 100644
--- a/app/example/mikroe_water_detect/mikroe_water_detect.slcp
+++ b/app/example/mikroe_water_detect/mikroe_water_detect.slcp
@@ -42,17 +42,17 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- - path: ../../documentation/example/mikroe_water_detect/image/create_example.png
+ - path: ../../documentation/example/mikroe_water_detect/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_water_detect/image/create_example_2.png
directory: "image"
- path: ../../documentation/example/mikroe_water_detect/image/hardware_connection.png
directory: "image"
- path: ../../documentation/example/mikroe_water_detect/image/log.png
directory: "image"
- - path: ../../documentation/example/mikroe_water_detect/image/water_detect_config.png
- directory: "image"
- path: ../../documentation/example/mikroe_water_detect/image/sw_layer.png
directory: "image"
@@ -60,5 +60,3 @@ ui_hints:
highlight:
- path: README.md
focus: true
-
-
diff --git a/app/example/mikroe_water_detect/mikroe_water_detect_si91x.slcp b/app/example/mikroe_water_detect/mikroe_water_detect_si91x.slcp
new file mode 100644
index 00000000..0ef3751d
--- /dev/null
+++ b/app/example/mikroe_water_detect/mikroe_water_detect_si91x.slcp
@@ -0,0 +1,64 @@
+project_name: mikroe_water_detect_si91x
+package: platform
+label: Third Party Hardware Drivers - MCP606 - Water Detect Click (Mikroe) - Si91x
+description: |
+ This example project shows an example for Mikroe Water Detect Click board driver integration on Si91x.
+category: Example|Platform
+quality: evaluation
+
+filter:
+- name: Device Type
+ value: [SoC]
+- name: MCU
+ value: [32-bit MCU]
+- name: Project Difficulty
+ value: [Beginner]
+
+readme:
+- path: ../../documentation/example/mikroe_water_detect/README.md
+
+source:
+- path: app.c
+- path: main.c
+
+include:
+- path: ''
+ file_list:
+ - path: app.h
+
+component:
+- id: sl_system
+- id: sleeptimer_si91x
+ from: wiseconnect3_sdk
+- id: mikroe_water_detect
+ from: third_party_hw_drivers
+- id: syscalls
+ from: wiseconnect3_sdk
+- id: si917_memory_default_config
+ from: wiseconnect3_sdk
+
+sdk_extension:
+- id: third_party_hw_drivers
+ version: 3.0.0
+- id: wiseconnect3_sdk
+ version: 3.2.0
+
+other_file:
+ - path: ../../documentation/example/mikroe_water_detect/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_water_detect/image/create_example_2.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_water_detect/image/hardware_connection.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_water_detect/image/log.png
+ directory: "image"
+ - path: ../../documentation/example/mikroe_water_detect/image/sw_layer.png
+ directory: "image"
+
+ui_hints:
+ highlight:
+ - path: README.md
+ focus: true
+
+post_build:
+ path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb
diff --git a/app/example/silabs_ir_generate/silabs_ir_generate.slcp b/app/example/silabs_ir_generate/silabs_ir_generate.slcp
index 0dd5a62b..7f1a2c13 100644
--- a/app/example/silabs_ir_generate/silabs_ir_generate.slcp
+++ b/app/example/silabs_ir_generate/silabs_ir_generate.slcp
@@ -33,7 +33,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/silabs_ir_generate/image/create_example.png
directory: "image"
diff --git a/app/example/silabs_lin_bus/slave/silabs_lin_slave1.slcp b/app/example/silabs_lin_bus/slave/silabs_lin_slave1.slcp
index bc5bc501..a4947a7d 100644
--- a/app/example/silabs_lin_bus/slave/silabs_lin_slave1.slcp
+++ b/app/example/silabs_lin_bus/slave/silabs_lin_slave1.slcp
@@ -86,7 +86,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../../documentation/example/silabs_lin_bus/images/hardware_connection.jpg
diff --git a/app/example/silabs_lin_bus/slave/silabs_lin_slave2.slcp b/app/example/silabs_lin_bus/slave/silabs_lin_slave2.slcp
index 34a5ef31..cb6f93e8 100644
--- a/app/example/silabs_lin_bus/slave/silabs_lin_slave2.slcp
+++ b/app/example/silabs_lin_bus/slave/silabs_lin_slave2.slcp
@@ -85,7 +85,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../../documentation/example/silabs_lin_bus/images/hardware_connection.jpg
diff --git a/app/example/silabs_pir_ira_s210st01/silabs_pir_ira_s210st01.slcp b/app/example/silabs_pir_ira_s210st01/silabs_pir_ira_s210st01.slcp
index 57bfdf25..5504749c 100644
--- a/app/example/silabs_pir_ira_s210st01/silabs_pir_ira_s210st01.slcp
+++ b/app/example/silabs_pir_ira_s210st01/silabs_pir_ira_s210st01.slcp
@@ -43,7 +43,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
ui_hints:
highlight:
- path: README.md
diff --git a/app/example/silabs_triac/silabs_triac.slcp b/app/example/silabs_triac/silabs_triac.slcp
index 5ef0b569..3cf8635b 100644
--- a/app/example/silabs_triac/silabs_triac.slcp
+++ b/app/example/silabs_triac/silabs_triac.slcp
@@ -33,7 +33,7 @@ define:
- name: DEBUG_EFM
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/silabs_triac/image/create_example.png
directory: "image"
diff --git a/app/example/sparkfun_6dof_imu_bmi270/app.c b/app/example/sparkfun_6dof_imu_bmi270/app.c
new file mode 100644
index 00000000..6cb1a5a2
--- /dev/null
+++ b/app/example/sparkfun_6dof_imu_bmi270/app.c
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * @file app.c
+ * @brief Example application
+ * @version 1.0.0
+ *******************************************************************************
+ * # License
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#include "sl_sleeptimer.h"
+#include "sparkfun_bmi270.h"
+#include "app_assert.h"
+
+#if (defined(SLI_SI917))
+#include "sl_i2c_instances.h"
+#include "rsi_debug.h"
+
+#define app_printf(...) DEBUGOUT(__VA_ARGS__)
+
+#define I2C_INSTANCE_USED SL_I2C2
+static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED;
+
+#else /* None Si91x device */
+#include "sl_i2cspm_instances.h"
+#include "app_log.h"
+
+#define app_printf(...) app_log(__VA_ARGS__)
+#endif
+
+typedef struct {
+ double accelerometer[3]; ///< accelerometer values: (x, y, z) axis
+ double gyroscope[3]; ///< gyroscope values: (x, y, z) axis
+ double temperature;
+} bmi270_data_t;
+
+#define READING_INTERVAL_MSEC 500
+
+///< To store BMI270 configuration.
+static bmi270_cfg_data_t bmi_cfg_data;
+static sl_sleeptimer_timer_handle_t app_timer_handle;
+static volatile bool app_timer_expire = false;
+static mikroe_i2c_handle_t app_i2c_instance = NULL;
+
+static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data);
+static sl_status_t app_bmi270_init(void);
+
+// *****************************************************************************
+// * Initialize application.
+// *****************************************************************************
+void app_init(void)
+{
+ app_printf("-----------------------\r\n");
+ app_printf("Sparkfun BMI270 - 6DOF IMU Sensor\r\n");
+ app_printf("Application Task\r\n");
+ app_printf("-----------------------\r\n");
+
+ if (app_bmi270_init() != SL_STATUS_OK) {
+ app_printf("BMI270 inits failed\r\n");
+ app_printf("-----------------------\r\n");
+ } else {
+ app_printf("BMI270 inits successfully\r\n");
+ app_printf("-----------------------\r\n");
+ app_printf("Start measure\r\n");
+ app_printf("-----------------------\r\n");
+ }
+}
+
+// *****************************************************************************
+// * App ticking function.
+// *****************************************************************************
+void app_process_action(void)
+{
+ if (app_timer_expire == false) {
+ return;
+ }
+ app_timer_expire = false;
+
+ bmi270_data_t bmi270_data;
+ sl_status_t ret;
+
+ ret = sparkfun_bmi270_read_acc_reading(&bmi_cfg_data,
+ bmi270_data.accelerometer);
+ if (SL_STATUS_OK == ret) {
+ app_printf("Acc value: x[%0.4f] - y[%0.4f] - z[%0.4f]\r\n",
+ bmi270_data.accelerometer[0],
+ bmi270_data.accelerometer[1],
+ bmi270_data.accelerometer[2]);
+ }
+
+ ret = sparkfun_bmi270_read_gyro_reading(&bmi_cfg_data, bmi270_data.gyroscope);
+ if (SL_STATUS_OK == ret) {
+ app_printf("Gyr value: x[%0.4f] - y[%0.4f] - z[%0.4f]\r\n",
+ bmi270_data.gyroscope[0],
+ bmi270_data.gyroscope[1],
+ bmi270_data.gyroscope[2]);
+ }
+
+ ret = sparkfun_bmi270_read_temp_reading(&bmi_cfg_data,
+ &bmi270_data.temperature);
+ if (SL_STATUS_OK == ret) {
+ app_printf("Temp value: %0.4f%cC\r\n", bmi270_data.temperature, 176);
+ }
+ app_printf("-----------------------------------------\r\n");
+}
+
+static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data)
+{
+ (void) handle;
+ (void) data;
+
+ app_timer_expire = true;
+}
+
+static sl_status_t app_bmi270_init(void)
+{
+ sl_status_t ret = SL_STATUS_OK;
+
+#if (defined(SLI_SI917))
+ app_i2c_instance = &i2c_instance;
+#else
+ app_i2c_instance = sl_i2cspm_qwiic;
+#endif
+
+ /// Initializing I2C instance and slave address
+ bmi_cfg_data.i2c_instance = app_i2c_instance;
+ bmi_cfg_data.bmi270_slave_address = BMI270_ADDR;
+
+ /// Initializing IMU sensor configuration
+
+ /// append ORing of all the needed features of bmi270
+ bmi_cfg_data.enable_features.features = BMI270_FEATURE_ACC
+ | BMI270_FEATURE_GYRO
+ | BMI270_FEATURE_TEMP;
+
+ /// append the various configuration of accelerometer
+ bmi_cfg_data.acc_config.bw = BMI270_ACCEL_NORM_AVG4;
+ bmi_cfg_data.acc_config.odr = BMI270_ACCEL_ODR_100HZ;
+ bmi_cfg_data.acc_config.filter = BMI270_ACCEL_PERFO_OPT;
+ bmi_cfg_data.acc_config.range = BMI270_ACCEL_RANGE_2G;
+
+ /// append the various configuration of gyroscope
+ bmi_cfg_data.gyro_config.bw = BMI270_GYRO_BWP_NORMAL;
+ bmi_cfg_data.gyro_config.odr = BMI270_GYRO_ODR_200HZ;
+ bmi_cfg_data.gyro_config.filter = BMI270_GYRO_F_PERFO_OPT;
+ bmi_cfg_data.gyro_config.range = BMI270_GYRO_RANGE_2000DPS;
+ bmi_cfg_data.gyro_config.noise = BMI270_GYRO_N_POWER_OPT;
+
+ ret = sparkfun_bmi270_init(&bmi_cfg_data);
+ app_assert_status(ret);
+
+ ret = sparkfun_bmi270_enable_and_config_features(&bmi_cfg_data);
+ app_assert_status(ret);
+
+ // Start a periodic timer READING_INTERVAL_MSEC ms to read data from the
+ // sensor
+ ret = sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle,
+ READING_INTERVAL_MSEC,
+ app_timer_cb,
+ (void *) NULL,
+ 0,
+ 0);
+ app_assert_status(ret);
+ return ret;
+}
diff --git a/app/example/sparkfun_6dof_imu_bmi270/app.h b/app/example/sparkfun_6dof_imu_bmi270/app.h
new file mode 100644
index 00000000..02bedf57
--- /dev/null
+++ b/app/example/sparkfun_6dof_imu_bmi270/app.h
@@ -0,0 +1,31 @@
+/***************************************************************************//**
+ * @file
+ * @brief Top level application functions
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * The licensor of this software is Silicon Laboratories Inc. Your use of this
+ * software is governed by the terms of Silicon Labs Master Software License
+ * Agreement (MSLA) available at
+ * www.silabs.com/about-us/legal/master-software-license-agreement. This
+ * software is distributed to you in Source Code format and is governed by the
+ * sections of the MSLA applicable to Source Code.
+ *
+ ******************************************************************************/
+
+#ifndef APP_H
+#define APP_H
+
+/***************************************************************************//**
+ * Initialize application.
+ ******************************************************************************/
+void app_init(void);
+
+/***************************************************************************//**
+ * App ticking function.
+ ******************************************************************************/
+void app_process_action(void);
+
+#endif // APP_H
diff --git a/app/example/sparkfun_6dof_imu_bmi270/main.c b/app/example/sparkfun_6dof_imu_bmi270/main.c
new file mode 100644
index 00000000..2da253ba
--- /dev/null
+++ b/app/example/sparkfun_6dof_imu_bmi270/main.c
@@ -0,0 +1,58 @@
+/***************************************************************************//**
+ * @file main.c
+ * @brief main() function.
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * The licensor of this software is Silicon Laboratories Inc. Your use of this
+ * software is governed by the terms of Silicon Labs Master Software License
+ * Agreement (MSLA) available at
+ * www.silabs.com/about-us/legal/master-software-license-agreement. This
+ * software is distributed to you in Source Code format and is governed by the
+ * sections of the MSLA applicable to Source Code.
+ *
+ ******************************************************************************/
+#include "sl_component_catalog.h"
+#include "sl_system_init.h"
+#include "app.h"
+#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
+#include "sl_power_manager.h"
+#endif
+#if defined(SL_CATALOG_KERNEL_PRESENT)
+#include "sl_system_kernel.h"
+#else // SL_CATALOG_KERNEL_PRESENT
+#include "sl_system_process_action.h"
+#endif // SL_CATALOG_KERNEL_PRESENT
+
+int main(void)
+{
+ // Initialize Silicon Labs device, system, service(s) and protocol stack(s).
+ // Note that if the kernel is present, processing task(s) will be created by
+ // this call.
+ sl_system_init();
+
+ // Initialize the application. For example, create periodic timer(s) or
+ // task(s) if the kernel is present.
+ app_init();
+
+#if defined(SL_CATALOG_KERNEL_PRESENT)
+ // Start the kernel. Task(s) created in app_init() will start running.
+ sl_system_kernel_start();
+#else // SL_CATALOG_KERNEL_PRESENT
+ while (1) {
+ // Do not remove this call: Silicon Labs components process action routine
+ // must be called from the super loop.
+ sl_system_process_action();
+
+ // Application process.
+ app_process_action();
+
+#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
+ // Let the CPU go to sleep if the system allows it.
+ sl_power_manager_sleep();
+#endif
+ }
+#endif // SL_CATALOG_KERNEL_PRESENT
+}
diff --git a/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270.slcp b/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270.slcp
new file mode 100644
index 00000000..cf84149b
--- /dev/null
+++ b/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270.slcp
@@ -0,0 +1,65 @@
+project_name: sparkfun_6dof_imu_bmi270
+label: Third Party Hardware Drivers - BMI270 - 6DOF IMU Breakout (Sparkfun).
+package: platform
+description: |
+ This example project shows an example for the Sparkfun BMI270 6DOF IMU Sensor board.
+category: Example|Platform
+quality: evaluation
+
+filter:
+- name: Device Type
+ value: [SoC]
+- name: MCU
+ value: [32-bit MCU]
+- name: Project Difficulty
+ value: [Beginner]
+
+readme:
+- path: ../../documentation/example/sparkfun_6dof_imu_bmi270/README.md
+
+source:
+- path: app.c
+- path: main.c
+
+include:
+- path: ''
+ file_list:
+ - path: app.h
+
+component:
+- id: sl_system
+- id: device_init
+- id: i2cspm
+ instance: [qwiic]
+- id: iostream_usart
+ instance: [vcom]
+- id: app_log
+- id: app_assert
+- id: sparkfun_6dof_imu_bmi270
+ from: third_party_hw_drivers
+define:
+- name: DEBUG_EFM
+
+sdk_extension:
+- id: third_party_hw_drivers
+ version: 3.0.0
+
+toolchain_settings:
+ - option: gcc_linker_option
+ value: "-u _printf_float"
+
+other_file:
+ - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/create_example.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/create_example_si91x.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/hardware_connection.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/log.png
+ directory: "image"
+
+ui_hints:
+ highlight:
+ - path: README.md
+ focus: true
+
diff --git a/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270_si91x.slcp b/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270_si91x.slcp
new file mode 100644
index 00000000..97b939a3
--- /dev/null
+++ b/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270_si91x.slcp
@@ -0,0 +1,70 @@
+project_name: sparkfun_6dof_imu_bmi270
+label: Third Party Hardware Drivers - BMI270 - 6DOF IMU Breakout (Sparkfun).
+package: platform
+description: |
+ This example project shows an example for the Sparkfun BMI270 6DOF IMU Sensor board.
+category: Example|Platform
+quality: evaluation
+
+filter:
+- name: Device Type
+ value: [SoC]
+- name: MCU
+ value: [32-bit MCU]
+- name: Project Difficulty
+ value: [Beginner]
+
+readme:
+- path: ../../documentation/example/sparkfun_6dof_imu_bmi270/README.md
+
+source:
+- path: app.c
+- path: main.c
+
+include:
+- path: ''
+ file_list:
+ - path: app.h
+
+component:
+- id: sl_system
+- id: app_assert
+- id: syscalls
+ from: wiseconnect3_sdk
+- id: si917_memory_default_config
+ from: wiseconnect3_sdk
+- instance: [i2c2]
+ from: wiseconnect3_sdk
+ id: i2c_instance
+- id: sparkfun_6dof_imu_bmi270
+ from: third_party_hw_drivers
+define:
+- name: DEBUG_EFM
+
+sdk_extension:
+- id: third_party_hw_drivers
+ version: 3.0.0
+- id: wiseconnect3_sdk
+ version: 3.2.0
+
+toolchain_settings:
+ - option: gcc_linker_option
+ value: "-u _printf_float"
+
+other_file:
+ - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/create_example.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/create_example_si91x.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/hardware_connection.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/log.png
+ directory: "image"
+
+ui_hints:
+ highlight:
+ - path: README.md
+ focus: true
+
+post_build:
+ path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb
\ No newline at end of file
diff --git a/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q.slcp b/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q.slcp
index 97e6b91d..8ae38817 100644
--- a/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q.slcp
+++ b/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q.slcp
@@ -52,7 +52,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/api_overview.png
diff --git a/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40.slcp b/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40.slcp
index 7b6ee651..39dfe83f 100644
--- a/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40.slcp
+++ b/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40.slcp
@@ -51,7 +51,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_air_quality_sgp40/image/create_example.png
diff --git a/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x.slcp b/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x.slcp
index b593ff45..c0068072 100644
--- a/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x.slcp
+++ b/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x.slcp
@@ -52,7 +52,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_distance_vl53l1x/image/create_example.png
diff --git a/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5.slcp b/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5.slcp
index 6c68d12a..aca40995 100644
--- a/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5.slcp
+++ b/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5.slcp
@@ -44,7 +44,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_dosimeter_type5/image/connection.png
diff --git a/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811.slcp b/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811.slcp
index 77b2ac4a..2d33a533 100644
--- a/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811.slcp
+++ b/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811.slcp
@@ -53,7 +53,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_environmental_bme280_ccs811/image/console_log.png
diff --git a/app/example/sparkfun_gnss_max_m10s/app.c b/app/example/sparkfun_gnss_max_m10s/app.c
new file mode 100644
index 00000000..29f38093
--- /dev/null
+++ b/app/example/sparkfun_gnss_max_m10s/app.c
@@ -0,0 +1,193 @@
+/***************************************************************************//**
+ * @file app.c
+ * @brief Example application
+ * @version 1.0.0
+ *******************************************************************************
+ * # License
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+#include "gnss_max_m10s_driver.h"
+
+#if (defined(SLI_SI917))
+#include "sl_i2c_instances.h"
+#include "rsi_debug.h"
+#else
+#include "sl_i2cspm_instances.h"
+#include "app_log.h"
+#endif
+
+#if (defined(SLI_SI917))
+#define I2C_INSTANCE_USED SL_I2C2
+static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED;
+#endif
+
+#if (defined(SLI_SI917))
+#define app_printf(...) DEBUGOUT(__VA_ARGS__)
+#else
+#define app_printf(...) app_log(__VA_ARGS__)
+#endif
+
+///< Divisor value for latitude and longitude using UBX protocol
+#define LAT_LONG_DIVISOR_UBX 10000000
+///< Divisor value for latitude and longitude using NMEA protocol
+#define LAT_LONG_DIVISOR_NMEA 1000000
+
+///< Retry count for GNSS receiver
+#define GNSS_RETRY_COUNT 10
+///< Retry count to receive data from
+#define GNSS_DATA_RETRY_COUNT 5
+#define GNSS_DATA_TIMEOUT_RETRY_DELAY 200 ///< In ms
+#define GNSS_PER_RETRY_DELAY 500 ///< In ms
+#define GNSS_TASK_DELAY 2000 ///< In ms
+
+/// @brief Structure for MAX-M10s GNSS receiver data
+typedef struct {
+ int32_t no_of_satellites; ///< no of satellites
+ double latitude; ///< latitude value
+ double longitude; ///< longitude value
+ double altitude; ///< altitude value
+} sl_gnss_data_t;
+
+sl_max_m10s_cfg_data_t gnss_cfg_data; ///< To store GNSS receiver configuration.
+static mikroe_i2c_handle_t app_i2c_instance = NULL;
+
+/**************************************************************************//**
+ * Initialize application.
+ *****************************************************************************/
+void app_init(void)
+{
+ sl_status_t status;
+
+#if (defined(SLI_SI917))
+ app_i2c_instance = &i2c_instance;
+#else
+ app_i2c_instance = sl_i2cspm_qwiic;
+#endif
+
+ gnss_cfg_data.i2c_instance = app_i2c_instance;
+ gnss_cfg_data.device_address = GNSS_ADDRESS;
+ gnss_cfg_data.protocol_type = SL_MAX_M10S_PROTOCOL_UBX;
+
+ status = gnss_max_m10s_begin(GNSS_POLL_MAX_TIMEOUT, &gnss_cfg_data);
+ if (status != SL_STATUS_OK) {
+ app_printf("\r\nmax m10s init failed, reason: 0x%lx\r\n", status);
+ return;
+ }
+}
+
+/***************************************************************************//**
+ * App ticking function.
+ ******************************************************************************/
+void app_process_action(void)
+{
+ sl_status_t status;
+ sl_gnss_data_t gnss_data; ///< MAX-M10s GNSS receiver data
+ uint8_t fix_type = 0;
+ bool is_sensor_data_available;
+ uint8_t retry_count = 0, data_retry_count = 0;
+
+ is_sensor_data_available = false;
+
+ while (GNSS_RETRY_COUNT > retry_count) {
+ status = gnss_max_m10s_get_fix_type(&gnss_cfg_data,
+ GNSS_POLL_MAX_TIMEOUT,
+ &fix_type);
+ if (status != SL_STATUS_OK) {
+ fix_type = 0;
+ }
+
+ app_printf("\r\ngnss_receiver_task : fix type is: %d\r\n", fix_type);
+ if (((SL_MAX_M10S_PROTOCOL_UBX == gnss_cfg_data.protocol_type)
+ && ((3 == fix_type) || (2 == fix_type)))
+ || ((SL_MAX_M10S_PROTOCOL_NMEA == gnss_cfg_data.protocol_type)
+ && (1 == fix_type))) {
+ for (data_retry_count = 0; data_retry_count < GNSS_DATA_RETRY_COUNT;
+ ++data_retry_count) {
+ status =
+ gnss_max_m10s_get_nav_pvt(&gnss_cfg_data, GNSS_POLL_MAX_TIMEOUT);
+
+ if (status == SL_STATUS_OK) {
+ gnss_data.latitude = (double)gnss_cfg_data.packetUBXNAVPVT->data.lat;
+
+ if (SL_MAX_M10S_PROTOCOL_UBX == gnss_cfg_data.protocol_type) {
+ gnss_data.latitude /= LAT_LONG_DIVISOR_UBX;
+ } else if (SL_MAX_M10S_PROTOCOL_NMEA == gnss_cfg_data.protocol_type) {
+ gnss_data.latitude /= LAT_LONG_DIVISOR_NMEA;
+ }
+ app_printf("\r\ngnss_receiver_task : latitude is : %.7lf\r\n",
+ gnss_data.latitude);
+ gnss_data.longitude = (double)gnss_cfg_data.packetUBXNAVPVT->data.lon;
+
+ if (SL_MAX_M10S_PROTOCOL_UBX == gnss_cfg_data.protocol_type) {
+ gnss_data.longitude /= LAT_LONG_DIVISOR_UBX;
+ } else if (SL_MAX_M10S_PROTOCOL_NMEA == gnss_cfg_data.protocol_type) {
+ gnss_data.longitude /= LAT_LONG_DIVISOR_NMEA;
+ }
+ app_printf("\r\ngnss_receiver_task : longitude is : %.7lf\r\n",
+ gnss_data.longitude);
+ gnss_data.altitude = (double)gnss_cfg_data.packetUBXNAVPVT->data.hMSL;
+ app_printf("\r\ngnss_receiver_task : altitude is : %lf\r\n",
+ gnss_data.altitude);
+ gnss_data.no_of_satellites =
+ (int32_t)gnss_cfg_data.packetUBXNAVPVT->data.numSV;
+ app_printf("\r\ngnss_receiver_task : satellite is : %ld\r\n",
+ gnss_data.no_of_satellites);
+ is_sensor_data_available = true;
+ break;
+ } else {
+ gnss_max_m10s_delay(GNSS_DATA_TIMEOUT_RETRY_DELAY);
+ app_printf("\r\ngnss_receiver_task :"
+ " Data is not received, retry-count: %d\r\n",
+ data_retry_count);
+ continue;
+ }
+ }
+ }
+ if (true == is_sensor_data_available) {
+ app_printf("\r\ngnss_receiver_task :"
+ " Data is received, break the fix-type retry loop\r\n");
+ break;
+ }
+ retry_count++;
+ gnss_max_m10s_delay(GNSS_PER_RETRY_DELAY);
+ }
+ /// If retry count reached to maximum value then send data as null
+ if (GNSS_RETRY_COUNT == retry_count) {
+ retry_count = 0;
+ is_sensor_data_available = false;
+ app_printf("\r\ngnss_receiver_task :"
+ " GNSS receiver read failed due to fix type not found,"
+ " fix_type:%u\n", fix_type);
+ }
+ gnss_max_m10s_delay(GNSS_TASK_DELAY);
+}
diff --git a/app/example/sparkfun_gnss_max_m10s/app.h b/app/example/sparkfun_gnss_max_m10s/app.h
new file mode 100644
index 00000000..02bedf57
--- /dev/null
+++ b/app/example/sparkfun_gnss_max_m10s/app.h
@@ -0,0 +1,31 @@
+/***************************************************************************//**
+ * @file
+ * @brief Top level application functions
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * The licensor of this software is Silicon Laboratories Inc. Your use of this
+ * software is governed by the terms of Silicon Labs Master Software License
+ * Agreement (MSLA) available at
+ * www.silabs.com/about-us/legal/master-software-license-agreement. This
+ * software is distributed to you in Source Code format and is governed by the
+ * sections of the MSLA applicable to Source Code.
+ *
+ ******************************************************************************/
+
+#ifndef APP_H
+#define APP_H
+
+/***************************************************************************//**
+ * Initialize application.
+ ******************************************************************************/
+void app_init(void);
+
+/***************************************************************************//**
+ * App ticking function.
+ ******************************************************************************/
+void app_process_action(void);
+
+#endif // APP_H
diff --git a/app/example/sparkfun_gnss_max_m10s/main.c b/app/example/sparkfun_gnss_max_m10s/main.c
new file mode 100644
index 00000000..2da253ba
--- /dev/null
+++ b/app/example/sparkfun_gnss_max_m10s/main.c
@@ -0,0 +1,58 @@
+/***************************************************************************//**
+ * @file main.c
+ * @brief main() function.
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * The licensor of this software is Silicon Laboratories Inc. Your use of this
+ * software is governed by the terms of Silicon Labs Master Software License
+ * Agreement (MSLA) available at
+ * www.silabs.com/about-us/legal/master-software-license-agreement. This
+ * software is distributed to you in Source Code format and is governed by the
+ * sections of the MSLA applicable to Source Code.
+ *
+ ******************************************************************************/
+#include "sl_component_catalog.h"
+#include "sl_system_init.h"
+#include "app.h"
+#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
+#include "sl_power_manager.h"
+#endif
+#if defined(SL_CATALOG_KERNEL_PRESENT)
+#include "sl_system_kernel.h"
+#else // SL_CATALOG_KERNEL_PRESENT
+#include "sl_system_process_action.h"
+#endif // SL_CATALOG_KERNEL_PRESENT
+
+int main(void)
+{
+ // Initialize Silicon Labs device, system, service(s) and protocol stack(s).
+ // Note that if the kernel is present, processing task(s) will be created by
+ // this call.
+ sl_system_init();
+
+ // Initialize the application. For example, create periodic timer(s) or
+ // task(s) if the kernel is present.
+ app_init();
+
+#if defined(SL_CATALOG_KERNEL_PRESENT)
+ // Start the kernel. Task(s) created in app_init() will start running.
+ sl_system_kernel_start();
+#else // SL_CATALOG_KERNEL_PRESENT
+ while (1) {
+ // Do not remove this call: Silicon Labs components process action routine
+ // must be called from the super loop.
+ sl_system_process_action();
+
+ // Application process.
+ app_process_action();
+
+#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
+ // Let the CPU go to sleep if the system allows it.
+ sl_power_manager_sleep();
+#endif
+ }
+#endif // SL_CATALOG_KERNEL_PRESENT
+}
diff --git a/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s.slcp b/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s.slcp
new file mode 100644
index 00000000..193b64a7
--- /dev/null
+++ b/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s.slcp
@@ -0,0 +1,65 @@
+project_name: sparkfun_gnss_max_m10s
+package: platform
+label: Third Party Hardware Drivers - MAX-M10S - GNSS Receiver Breakout (Sparkfun)
+description: |
+ This example project shows an example for Sparkfun MAX-M10S - GNSS Receiver Breakout board driver integration.
+category: Example|Platform
+quality: evaluation
+
+filter:
+- name: Device Type
+ value: [SoC]
+- name: MCU
+ value: [32-bit MCU]
+- name: Project Difficulty
+ value: [Beginner]
+
+readme:
+- path: ../../documentation/example/sparkfun_gnss_max_m10s/README.md
+
+source:
+- path: app.c
+- path: main.c
+
+include:
+- path: ''
+ file_list:
+ - path: app.h
+
+component:
+- id: sl_system
+- id: device_init
+- id: sleeptimer
+- id: iostream_usart
+ instance: [vcom]
+- id: app_log
+- id: sparkfun_gnss_max_m10s
+ from: third_party_hw_drivers
+- id: i2cspm
+ instance: [qwiic]
+
+define:
+- name: DEBUG_EFM
+
+toolchain_settings:
+ - option: gcc_linker_option
+ value: "-u _printf_float"
+
+sdk_extension:
+- id: third_party_hw_drivers
+ version: 3.0.0
+
+other_file:
+ - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/hw_connection.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/create_example_2.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/log.png
+ directory: "image"
+
+ui_hints:
+ highlight:
+ - path: README.md
+ focus: true
diff --git a/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s_si91x.slcp b/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s_si91x.slcp
new file mode 100644
index 00000000..51cc8a6a
--- /dev/null
+++ b/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s_si91x.slcp
@@ -0,0 +1,65 @@
+project_name: sparkfun_gnss_max_m10s_si91x
+package: platform
+label: Third Party Hardware Drivers - MAX-M10S - GNSS Receiver Breakout (Sparkfun) - Si91x
+description: |
+ This example project shows an example for Sparkfun MAX-M10S - GNSS Receiver Breakout board driver integration on Si91x.
+category: Example|Platform
+quality: evaluation
+
+filter:
+- name: Device Type
+ value: [SoC]
+- name: MCU
+ value: [32-bit MCU]
+- name: Project Difficulty
+ value: [Beginner]
+
+readme:
+- path: ../../documentation/example/sparkfun_gnss_max_m10s/README.md
+
+source:
+- path: app.c
+- path: main.c
+
+include:
+- path: ''
+ file_list:
+ - path: app.h
+
+component:
+- id: sl_system
+- id: sleeptimer_si91x
+ from: wiseconnect3_sdk
+- id: sparkfun_gnss_max_m10s
+ from: third_party_hw_drivers
+- id: syscalls
+ from: wiseconnect3_sdk
+- id: si917_memory_default_config
+ from: wiseconnect3_sdk
+- instance: [i2c2]
+ from: wiseconnect3_sdk
+ id: i2c_instance
+
+sdk_extension:
+- id: third_party_hw_drivers
+ version: 3.0.0
+- id: wiseconnect3_sdk
+ version: 3.2.0
+
+other_file:
+ - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/hw_connection.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/create_example_2.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/log.png
+ directory: "image"
+
+ui_hints:
+ highlight:
+ - path: README.md
+ focus: true
+
+post_build:
+ path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb
diff --git a/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664.slcp b/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664.slcp
index 352626d1..38b3357f 100644
--- a/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664.slcp
+++ b/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664.slcp
@@ -51,7 +51,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_hr_po_max30101_max32664/image/create_example.png
diff --git a/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753.slcp b/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753.slcp
index 35a8f894..fa07f2d6 100644
--- a/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753.slcp
+++ b/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753.slcp
@@ -54,7 +54,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_human_presence_ak9753/image/create_example.png
diff --git a/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx.slcp b/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx.slcp
index 86190c8b..43809311 100644
--- a/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx.slcp
+++ b/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx.slcp
@@ -53,7 +53,7 @@ configuration:
value: "6144"
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_ir_array_amg88xx/image/create_example.png
directory: image
diff --git a/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640.slcp b/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640.slcp
index bca1e540..b124c2a7 100644
--- a/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640.slcp
+++ b/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640.slcp
@@ -62,7 +62,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_ir_array_mlx90640/image/connection.png
diff --git a/app/example/sparkfun_micro_oled_ssd1306/app.c b/app/example/sparkfun_micro_oled_ssd1306/app.c
index 2bff66c6..78dfe349 100644
--- a/app/example/sparkfun_micro_oled_ssd1306/app.c
+++ b/app/example/sparkfun_micro_oled_ssd1306/app.c
@@ -3,30 +3,62 @@
* @brief Top level application functions
*******************************************************************************
* # License
- * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ * Copyright 2024 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
- * The licensor of this software is Silicon Laboratories Inc. Your use of this
- * software is governed by the terms of Silicon Labs Master Software License
- * Agreement (MSLA) available at
- * www.silabs.com/about-us/legal/master-software-license-agreement. This
- * software is distributed to you in Source Code format and is governed by the
- * sections of the MSLA applicable to Source Code.
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
*
******************************************************************************/
-#include "sl_simple_button_instances.h"
-#include "sl_i2cspm_instances.h"
#include "glib.h"
#include "glib_font.h"
#include "micro_oled_ssd1306.h"
-#include "sl_udelay.h"
+#include "sl_sleeptimer.h"
+
+#if (defined(SLI_SI917))
+#include "sl_i2c_instances.h"
+#include "sl_si91x_button_instances.h"
+#else
+#include "sl_simple_button_instances.h"
+#include "sl_i2cspm_instances.h"
+#endif
+
+#if (defined(SLI_SI917))
+#define I2C_INSTANCE_USED SL_I2C2
+static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED;
+#endif
-static void oled_app_init(void);
+#define DISPLAY_MODE_COUNT (12)
static glib_context_t glib_context;
-#define DISPLAY_MODE_COUNT (12)
-static uint8_t display_mode = 0;
+static volatile uint8_t display_mode;
+static mikroe_i2c_handle_t app_i2c_instance = NULL;
static const unsigned char silicon_labs_logo_64x23[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -52,8 +84,19 @@ static const unsigned char silicon_labs_logo_64x23[] = {
******************************************************************************/
void app_init(void)
{
- /* Initialize the oled. */
- oled_app_init();
+#if (defined(SLI_SI917))
+ app_i2c_instance = &i2c_instance;
+#else
+ app_i2c_instance = sl_i2cspm_qwiic;
+#endif
+ // Initialize the display
+ ssd1306_init(app_i2c_instance);
+ glib_init(&glib_context);
+
+ // Fill lcd with background color
+ glib_clear(&glib_context);
+
+ display_mode = 0;
}
/***************************************************************************//**
@@ -197,27 +240,27 @@ void app_process_action(void)
glib_draw_string(&glib_context, "XBITMAP", 10, 30);
glib_update_display();
- sl_udelay_wait(500000);
+ sl_sleeptimer_delay_millisecond(500);
glib_set_invert_color();
- sl_udelay_wait(500000);
+ sl_sleeptimer_delay_millisecond(500);
glib_set_normal_color();
- sl_udelay_wait(500000);
+ sl_sleeptimer_delay_millisecond(500);
glib_set_invert_color();
- sl_udelay_wait(500000);
+ sl_sleeptimer_delay_millisecond(500);
glib_set_normal_color();
for (i = 0x8F; i > 0x00; i--) {
glib_set_contrast(i);
- sl_udelay_wait(5000);
+ sl_sleeptimer_delay_millisecond(5);
}
for (i = 0x00; i < 0x8F; i++) {
glib_set_contrast(i);
- sl_udelay_wait(5000);
+ sl_sleeptimer_delay_millisecond(5);
}
glib_scroll_right(0x00, 0x06);
- sl_udelay_wait(1000000);
+ sl_sleeptimer_delay_millisecond(1000);
glib_stop_scroll();
glib_draw_xbitmap(&glib_context,
0, 0, silicon_labs_logo_64x23,
@@ -226,7 +269,7 @@ void app_process_action(void)
glib_update_display();
glib_scroll_left(0x00, 0x06);
- sl_udelay_wait(1000000);
+ sl_sleeptimer_delay_millisecond(1000);
glib_stop_scroll();
glib_draw_xbitmap(&glib_context,
0, 0, silicon_labs_logo_64x23,
@@ -235,7 +278,7 @@ void app_process_action(void)
glib_update_display();
glib_scroll_diag_right(0x00, 0x06);
- sl_udelay_wait(1000000);
+ sl_sleeptimer_delay_millisecond(1000);
glib_stop_scroll();
glib_draw_xbitmap(&glib_context,
0, 0, silicon_labs_logo_64x23,
@@ -244,7 +287,7 @@ void app_process_action(void)
glib_update_display();
glib_scroll_diag_left(0x00, 0x06);
- sl_udelay_wait(1000000);
+ sl_sleeptimer_delay_millisecond(1000);
glib_stop_scroll();
break;
}
@@ -257,10 +300,17 @@ void app_process_action(void)
* module. It is triggered when the user activates one of the buttons.
*
******************************************************************************/
+#if (defined(SLI_SI917))
+void sl_si91x_button_isr(uint8_t pin, int8_t state)
+{
+ if (pin == button_btn0.pin) {
+ if (state == BUTTON_PRESSED) {
+#else
void sl_button_on_change(const sl_button_t *handle)
{
if (sl_button_get_state(handle) == SL_SIMPLE_BUTTON_PRESSED) {
if (&sl_button_btn0 == handle) {
+#endif
if (display_mode < DISPLAY_MODE_COUNT) {
display_mode++;
} else {
@@ -269,16 +319,3 @@ void sl_button_on_change(const sl_button_t *handle)
}
}
}
-
-/***************************************************************************//**
- * Initialize example.
- ******************************************************************************/
-static void oled_app_init(void)
-{
- /* Initialize the display */
- ssd1306_init(sl_i2cspm_qwiic);
- glib_init(&glib_context);
-
- /* Fill lcd with background color */
- glib_clear(&glib_context);
-}
diff --git a/app/example/sparkfun_micro_oled_ssd1306/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_micro_oled_ssd1306/brd2601b/sl_i2cspm_qwiic_config.h
deleted file mode 100644
index aea9b367..00000000
--- a/app/example/sparkfun_micro_oled_ssd1306/brd2601b/sl_i2cspm_qwiic_config.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/***************************************************************************//**
- * @file
- * @brief I2CSPM Config
- *******************************************************************************
- * # License
- * Copyright 2019 Silicon Laboratories Inc. www.silabs.com
- *******************************************************************************
- *
- * The licensor of this software is Silicon Laboratories Inc. Your use of this
- * software is governed by the terms of Silicon Labs Master Software License
- * Agreement (MSLA) available at
- * www.silabs.com/about-us/legal/master-software-license-agreement. This
- * software is distributed to you in Source Code format and is governed by the
- * sections of the MSLA applicable to Source Code.
- *
- ******************************************************************************/
-
-#ifndef SL_I2CSPM_QWIIC_CONFIG_H
-#define SL_I2CSPM_QWIIC_CONFIG_H
-
-// <<< Use Configuration Wizard in Context Menu
-
-// I2CSPM settings
-
-// Reference clock frequency
-// Frequency in Hz of the reference clock.
-// Select 0 to use the frequency of the currently selected clock.
-// Default: 0
-#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0
-
-// Speed mode
-// <0=> Standard mode (100kbit/s)
-// <1=> Fast mode (400kbit/s)
-// <2=> Fast mode plus (1Mbit/s)
-// Default: 0
-#define SL_I2CSPM_QWIIC_SPEED_MODE 0
-// end I2CSPM config
-
-// <<< end of configuration section >>>
-
-// <<< sl:start pin_tool >>>
-// SL_I2CSPM_QWIIC
-// $[I2C_SL_I2CSPM_QWIIC]
-#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0
-#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0
-
-// I2C0 SCL on PC04
-#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC
-#define SL_I2CSPM_QWIIC_SCL_PIN 4
-
-// I2C0 SDA on PC05
-#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC
-#define SL_I2CSPM_QWIIC_SDA_PIN 5
-// [I2C_SL_I2CSPM_QWIIC]$
-// <<< sl:end pin_tool >>>
-
-#endif // SL_I2CSPM_QWIIC_CONFIG_H
diff --git a/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306.slcp b/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306.slcp
index 0fff6649..fd78f34d 100644
--- a/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306.slcp
+++ b/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306.slcp
@@ -29,6 +29,7 @@ include:
component:
- id: sl_system
- id: device_init
+- id: sleeptimer
- id: sparkfun_micro_oled_ssd1306
from: third_party_hw_drivers
- id: services_oled_glib
@@ -39,12 +40,6 @@ component:
instance: [btn0]
config_file:
- - override:
- component: i2cspm
- file_id: i2cspm_config
- instance: qwiic
- path: brd2601b/sl_i2cspm_qwiic_config.h
- condition: [brd2601b]
- override:
component: simple_button
file_id: simple_button_config
@@ -57,19 +52,23 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/bgm220_kit_sparkfun_oled.png
directory: "image"
- - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example.png
+ - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_2.png
directory: "image"
- path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/sparkfun_oled_board.png
directory: "image"
- path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/testing_result.gif
directory: "image"
+ - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/yt_thumbnail.jpg
+ directory: "image"
ui_hints:
highlight:
- path: README.md
- focus: true
\ No newline at end of file
+ focus: true
diff --git a/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306_si91x.slcp b/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306_si91x.slcp
new file mode 100644
index 00000000..050dd4ef
--- /dev/null
+++ b/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306_si91x.slcp
@@ -0,0 +1,75 @@
+project_name: sparkfun_micro_oled_ssd1306_si91x
+package: platform
+label: Third Party Hardware Drivers - SSD1306 - Micro OLED Breakout Qwiic (Sparkfun) - Si91x
+description: |
+ This example project shows an example for Sparkfun SSD1306 - Micro OLED Breakout board driver integration on Si91x.
+category: Example|Platform
+quality: evaluation
+
+filter:
+- name: Device Type
+ value: [SoC]
+- name: MCU
+ value: [32-bit MCU]
+- name: Project Difficulty
+ value: [Beginner]
+
+readme:
+- path: ../../documentation/example/sparkfun_micro_oled_ssd1306/README.md
+
+source:
+- path: app.c
+- path: main.c
+
+include:
+- path: ''
+ file_list:
+ - path: app.h
+
+component:
+- id: sl_system
+- id: sleeptimer_si91x
+ from: wiseconnect3_sdk
+- id: sparkfun_micro_oled_ssd1306
+ from: third_party_hw_drivers
+- id: services_oled_glib
+ from: third_party_hw_drivers
+- id: syscalls
+ from: wiseconnect3_sdk
+- id: si917_memory_default_config
+ from: wiseconnect3_sdk
+- instance: [i2c2]
+ from: wiseconnect3_sdk
+ id: i2c_instance
+- id: sl_si91x_button_917
+ instance:
+ - btn0
+ from: wiseconnect3_sdk
+
+sdk_extension:
+- id: third_party_hw_drivers
+ version: 3.0.0
+- id: wiseconnect3_sdk
+ version: 3.2.0
+
+other_file:
+ - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/bgm220_kit_sparkfun_oled.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_1.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_2.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/sparkfun_oled_board.png
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/testing_result.gif
+ directory: "image"
+ - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/yt_thumbnail.jpg
+ directory: "image"
+
+ui_hints:
+ highlight:
+ - path: README.md
+ focus: true
+
+post_build:
+ path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb
diff --git a/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c.slcp b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c.slcp
index 290a237d..71e3c180 100644
--- a/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c.slcp
+++ b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c.slcp
@@ -46,7 +46,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/hw_connection_1.png
diff --git a/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart.slcp b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart.slcp
index da33554d..62ed8035 100644
--- a/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart.slcp
+++ b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart.slcp
@@ -46,7 +46,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/hw_connection_1.png
diff --git a/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040.slcp b/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040.slcp
index c7681276..08d39918 100644
--- a/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040.slcp
+++ b/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040.slcp
@@ -52,7 +52,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_proximity_vcnl4040/image/connection.png
diff --git a/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick.slcp b/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick.slcp
index e27e02fe..6a52bd69 100644
--- a/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick.slcp
+++ b/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick.slcp
@@ -51,7 +51,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_qwiic_joystick/image/logs.png
diff --git a/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad.slcp b/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad.slcp
index c9292bcc..6776c894 100644
--- a/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad.slcp
+++ b/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad.slcp
@@ -52,7 +52,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_qwiic_keypad/image/logs.png
diff --git a/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la.slcp b/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la.slcp
index 16cbdd90..dfb95fbe 100644
--- a/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la.slcp
+++ b/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la.slcp
@@ -43,7 +43,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_rfid_id12la/image/api_overview.png
diff --git a/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture.slcp b/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture.slcp
index 932d4a28..29543a6e 100644
--- a/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture.slcp
+++ b/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture.slcp
@@ -49,7 +49,7 @@ config_file:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
define:
- name: DEBUG_EFM
diff --git a/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x.slcp b/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x.slcp
index 33a0719d..58305090 100644
--- a/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x.slcp
+++ b/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x.slcp
@@ -56,7 +56,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_spectroscopy_as7265x/image/basic_reading.png
diff --git a/app/example/sparkfun_weatherstation/sparkfun_weatherstation.slcp b/app/example/sparkfun_weatherstation/sparkfun_weatherstation.slcp
index bd301f41..d4c45876 100644
--- a/app/example/sparkfun_weatherstation/sparkfun_weatherstation.slcp
+++ b/app/example/sparkfun_weatherstation/sparkfun_weatherstation.slcp
@@ -45,7 +45,7 @@ define:
sdk_extension:
- id: third_party_hw_drivers
- version: 2.0.2
+ version: 3.0.0
other_file:
- path: ../../documentation/example/sparkfun_weatherstation/image/create_example.png
diff --git a/driver/component/drivers/mikroe/alcohol_mq3.slcc b/driver/component/drivers/mikroe/alcohol_mq3.slcc
index 0af57270..ffb85996 100644
--- a/driver/component/drivers/mikroe/alcohol_mq3.slcc
+++ b/driver/component/drivers/mikroe/alcohol_mq3.slcc
@@ -22,9 +22,12 @@ config_file:
- path: public/mikroe/alcohol_mq3/config/brd4314a/mikroe_alcohol_mq3_config.h
file_id: driver_config_alcohol
condition: [brd4314a]
+ - path: public/mikroe/alcohol_mq3/config/brd4338a/mikroe_alcohol_mq3_config.h
+ file_id: driver_config_alcohol
+ condition: [device_si91x]
- path: public/mikroe/alcohol_mq3/config/other/mikroe_alcohol_mq3_config.h
file_id: driver_config_alcohol
- unless: [brd4314a, brd4108a, brd2703a]
+ unless: [brd4314a, brd4108a, brd2703a, device_si91x]
provides:
- name: mikroe_alcohol_mq3
allow_multiple: false
@@ -43,4 +46,4 @@ include:
- path: mikroe_alcohol_mq3.h
source:
- path: thirdparty/mikrosdk_click_v2/clicks/alcohol/lib/src/alcohol.c
- - path: public/mikroe/alcohol_mq3/src/mikroe_alcohol_mq3.c
\ No newline at end of file
+ - path: public/mikroe/alcohol_mq3/src/mikroe_alcohol_mq3.c
diff --git a/driver/component/drivers/mikroe/oledw_ssd1306.slcc b/driver/component/drivers/mikroe/oledw_ssd1306.slcc
index 550c4a74..71bcd553 100644
--- a/driver/component/drivers/mikroe/oledw_ssd1306.slcc
+++ b/driver/component/drivers/mikroe/oledw_ssd1306.slcc
@@ -22,9 +22,12 @@ config_file:
- path: public/mikroe/oledw_ssd1306/config/brd4314a/mikroe_ssd1306_config.h
file_id: driver_config_oledw
condition: [brd4314a]
+ - path: public/mikroe/oledw_ssd1306/config/brd4338a/mikroe_ssd1306_config.h
+ file_id: driver_config_oledw
+ condition: [brd4338a]
- path: public/mikroe/oledw_ssd1306/config/other/mikroe_ssd1306_config.h
file_id: driver_config_oledw
- unless: [brd4314a, brd4108a, brd2703a]
+ unless: [brd4314a, brd4108a, brd2703a, brd4338a]
template_contribution:
- name: component_catalog
value: mikroe_oledw
diff --git a/driver/component/drivers/mikroe/temphum9_shtc3.slcc b/driver/component/drivers/mikroe/temphum9_shtc3.slcc
index dfe924f0..1a57963d 100644
--- a/driver/component/drivers/mikroe/temphum9_shtc3.slcc
+++ b/driver/component/drivers/mikroe/temphum9_shtc3.slcc
@@ -18,6 +18,9 @@ provides:
template_contribution:
- name: component_catalog
value: mikroe_temphum9
+config_file:
+ - path: public/mikroe/temphum9_shtc3/config/mikroe_shtc3_config.h
+ file_id: driver_config_shtc3
include:
- path: inc
file_list:
diff --git a/driver/component/drivers/mikroe/water_detect.slcc b/driver/component/drivers/mikroe/water_detect.slcc
index 09769f00..518fe5fc 100644
--- a/driver/component/drivers/mikroe/water_detect.slcc
+++ b/driver/component/drivers/mikroe/water_detect.slcc
@@ -21,9 +21,12 @@ config_file:
- path: public/mikroe/water_detect/config/brd4108a/mikroe_water_detect_config.h
file_id: driver_config_waterdetect
condition: [brd4108a]
+ - path: public/mikroe/water_detect/config/brd4338a/mikroe_water_detect_config.h
+ file_id: driver_config_waterdetect
+ condition: [brd4338a]
- path: public/mikroe/water_detect/config/other/mikroe_water_detect_config.h
file_id: driver_config_waterdetect
- unless: [brd4314a, brd2703a, brd4108a]
+ unless: [brd4314a, brd2703a, brd4108a, brd4338a]
provides:
- name: mikroe_water_detect
allow_multiple: false
diff --git a/driver/component/drivers/silabs/sparkfun_6dof_imu_bmi270.slcc b/driver/component/drivers/silabs/sparkfun_6dof_imu_bmi270.slcc
new file mode 100644
index 00000000..326dafe2
--- /dev/null
+++ b/driver/component/drivers/silabs/sparkfun_6dof_imu_bmi270.slcc
@@ -0,0 +1,29 @@
+id: sparkfun_6dof_imu_bmi270
+package: third_party_hw_drivers
+label: BMI270 - 6DOF IMU Breakout (Sparkfun)
+description: >
+ Driver for the BMI270 6DOF IMU breakout board.
+category: Sensors
+quality: evaluation
+root_path: driver
+requires:
+ - name: status
+ - name: sleeptimer
+ - name: sleeptimer_si91x
+ condition: [device_si91x]
+ - name: mikroe_peripheral_driver_i2c
+config_file:
+ - path: public/silabs/sparkfun_6dof_imu_bmi270/config/sparkfun_bmi270_config.h
+ file_id: sparkfun_bmi270_config
+provides:
+ - name: sparkfun_6dof_imu_bmi270
+ allow_multiple: false
+template_contribution:
+ - name: component_catalog
+ value: sparkfun_6dof_imu_bmi270
+include:
+ - path: public/silabs/sparkfun_6dof_imu_bmi270/inc
+ file_list:
+ - path: sparkfun_bmi270.h
+source:
+ - path: public/silabs/sparkfun_6dof_imu_bmi270/src/sparkfun_bmi270.c
diff --git a/driver/component/drivers/silabs/sparkfun_gnss_max_m10s.slcc b/driver/component/drivers/silabs/sparkfun_gnss_max_m10s.slcc
new file mode 100644
index 00000000..2a3a1c1a
--- /dev/null
+++ b/driver/component/drivers/silabs/sparkfun_gnss_max_m10s.slcc
@@ -0,0 +1,33 @@
+id: sparkfun_gnss_max_m10s
+package: third_party_hw_drivers
+label: MAX-M10S - GNSS Receiver Breakout - I2C
+description: >
+ Driver for the Sparkfun GNSS Receiver Breakout board, this board relies on the MAX-M10S IC using I2C interface.
+category: Wireless Connectivity
+quality: evaluation
+root_path: driver
+requires:
+ - name: status
+ - name: mikroe_peripheral_driver_i2c
+ - name: sleeptimer
+ - name: sleeptimer_si91x
+ condition: [device_si91x]
+provides:
+ - name: sparkfun_gnss_max_m10s
+template_contribution:
+ - name: component_catalog
+ value: sparkfun_gnss_max_m10s
+include:
+ - path: public/silabs/gnss_max_m10s/inc
+ file_list:
+ - path: gnss_max_m10s_driver.h
+ - path: gnss_max_m10s_micro_nmea.h
+ - path: gnss_max_m10s_nmea_struct.h
+ - path: gnss_max_m10s_nmea.h
+ - path: gnss_max_m10s_ubx_struct.h
+ - path: gnss_max_m10s_ubx.h
+source:
+ - path: public/silabs/gnss_max_m10s/src/gnss_max_m10s_driver.c
+ - path: public/silabs/gnss_max_m10s/src/gnss_max_m10s_micro_nmea.c
+ - path: public/silabs/gnss_max_m10s/src/gnss_max_m10s_nmea.c
+ - path: public/silabs/gnss_max_m10s/src/gnss_max_m10s_ubx.c
diff --git a/driver/component/drivers/silabs/sparkfun_micro_oled_ssd1306.slcc b/driver/component/drivers/silabs/sparkfun_micro_oled_ssd1306.slcc
index b4e6a161..77a53f24 100644
--- a/driver/component/drivers/silabs/sparkfun_micro_oled_ssd1306.slcc
+++ b/driver/component/drivers/silabs/sparkfun_micro_oled_ssd1306.slcc
@@ -8,10 +8,7 @@ quality: evaluation
root_path: driver
requires:
- name: status
- - name: i2cspm
-recommends:
- - id: i2cspm
- instance: [qwiic]
+ - name: mikroe_peripheral_driver_i2c
provides:
- name: oled_display
config_file:
@@ -23,10 +20,8 @@ template_contribution:
include:
- path: public/silabs/micro_oled_ssd1306/inc
file_list:
- - path: micro_oled_ssd1306_i2c.h
- path: micro_oled_ssd1306.h
- path: oled_display.h
source:
- path: public/silabs/micro_oled_ssd1306/src/micro_oled_ssd1306.c
- - path: public/silabs/micro_oled_ssd1306/src/micro_oled_ssd1306_i2c.c
- path: public/silabs/micro_oled_ssd1306/src/oled_display.c
diff --git a/driver/component/services/mikroe_peripheral_drv_adc.slcc b/driver/component/services/mikroe_peripheral_drv_adc.slcc
index d4eb2707..21b22eeb 100644
--- a/driver/component/services/mikroe_peripheral_drv_adc.slcc
+++ b/driver/component/services/mikroe_peripheral_drv_adc.slcc
@@ -11,6 +11,8 @@ requires:
condition: [device_series_1]
- name: emlib_iadc
condition: [device_series_2]
+ - name: sl_adc
+ condition: [device_si91x]
provides:
- name: mikroe_peripheral_driver_adc
allow_multiple: false
@@ -26,3 +28,8 @@ include:
- path: hal_target.h
source:
- path: peripheral_drivers/mikroe/src/drv_analog_in.c
+ condition: [device_series_1]
+ - path: peripheral_drivers/mikroe/src/drv_analog_in.c
+ condition: [device_series_2]
+ - path: peripheral_drivers/mikroe/src/drv_analog_in_si91x.c
+ condition: [device_si91x]
diff --git a/driver/component/services/mikroe_peripheral_drv_digital_io.slcc b/driver/component/services/mikroe_peripheral_drv_digital_io.slcc
index adadb3dd..45461ec6 100644
--- a/driver/component/services/mikroe_peripheral_drv_digital_io.slcc
+++ b/driver/component/services/mikroe_peripheral_drv_digital_io.slcc
@@ -12,6 +12,9 @@ provides:
template_contribution:
- name: component_catalog
value: services_mikroe_peripheral_drivers_digital_io
+requires:
+ - name: sl_gpio
+ condition: [device_si91x]
include:
- path: peripheral_drivers/mikroe/inc
file_list:
@@ -23,4 +26,14 @@ include:
- path: hal_gpio.h
source:
- path: peripheral_drivers/mikroe/src/drv_digital_in.c
+ condition: [device_series_1]
+ - path: peripheral_drivers/mikroe/src/drv_digital_in.c
+ condition: [device_series_2]
+ - path: peripheral_drivers/mikroe/src/drv_digital_in_si91x.c
+ condition: [device_si91x]
+ - path: peripheral_drivers/mikroe/src/drv_digital_out.c
+ condition: [device_series_1]
- path: peripheral_drivers/mikroe/src/drv_digital_out.c
+ condition: [device_series_2]
+ - path: peripheral_drivers/mikroe/src/drv_digital_out_si91x.c
+ condition: [device_si91x]
diff --git a/driver/component/services/mikroe_peripheral_drv_i2c.slcc b/driver/component/services/mikroe_peripheral_drv_i2c.slcc
index 044b9fbe..eb5c1cef 100644
--- a/driver/component/services/mikroe_peripheral_drv_i2c.slcc
+++ b/driver/component/services/mikroe_peripheral_drv_i2c.slcc
@@ -8,6 +8,11 @@ quality: evaluation
root_path: driver
requires:
- name: i2cspm
+ condition: [device_series_1]
+ - name: i2cspm
+ condition: [device_series_2]
+ - name: sl_i2c
+ condition: [device_si91x]
recommends:
- id: i2cspm
instance: [mikroe]
@@ -25,3 +30,9 @@ include:
- path: drv_i2c_master.h
source:
- path: peripheral_drivers/mikroe/src/drv_i2c_master.c
+ condition: [device_series_1]
+ - path: peripheral_drivers/mikroe/src/drv_i2c_master.c
+ condition: [device_series_2]
+ - path: peripheral_drivers/mikroe/src/drv_i2c_master_si91x.c
+ condition: [device_si91x]
+
diff --git a/driver/component/services/mikroe_peripheral_drv_pwm.slcc b/driver/component/services/mikroe_peripheral_drv_pwm.slcc
index c1488982..721bbde6 100644
--- a/driver/component/services/mikroe_peripheral_drv_pwm.slcc
+++ b/driver/component/services/mikroe_peripheral_drv_pwm.slcc
@@ -8,6 +8,11 @@ quality: evaluation
root_path: driver
requires:
- name: pwm
+ condition: [device_series_1]
+ - name: pwm
+ condition: [device_series_2]
+ - name: sl_pwm
+ condition: [device_si91x]
- name: mikroe_peripheral_driver_digital_io
recommends:
- id: pwm
@@ -24,3 +29,8 @@ include:
- path: drv_pwm.h
source:
- path: peripheral_drivers/mikroe/src/drv_pwm.c
+ condition: [device_series_1]
+ - path: peripheral_drivers/mikroe/src/drv_pwm.c
+ condition: [device_series_2]
+ - path: peripheral_drivers/mikroe/src/drv_pwm_si91x.c
+ condition: [device_si91x]
diff --git a/driver/component/services/mikroe_peripheral_drv_spi.slcc b/driver/component/services/mikroe_peripheral_drv_spi.slcc
index e201526c..70d0e62c 100644
--- a/driver/component/services/mikroe_peripheral_drv_spi.slcc
+++ b/driver/component/services/mikroe_peripheral_drv_spi.slcc
@@ -8,6 +8,11 @@ quality: evaluation
root_path: driver
requires:
- name: spidrv
+ condition: [device_series_1]
+ - name: spidrv
+ condition: [device_series_2]
+ - name: sl_gspi
+ condition: [device_si91x]
- name: mikroe_peripheral_driver_digital_io
recommends:
- id: spidrv
@@ -24,3 +29,8 @@ include:
- path: drv_spi_master.h
source:
- path: peripheral_drivers/mikroe/src/drv_spi_master.c
+ condition: [device_series_1]
+ - path: peripheral_drivers/mikroe/src/drv_spi_master.c
+ condition: [device_series_2]
+ - path: peripheral_drivers/mikroe/src/drv_spi_master_si91x.c
+ condition: [device_si91x]
diff --git a/driver/peripheral_drivers/mikroe/inc/drv_analog_in.h b/driver/peripheral_drivers/mikroe/inc/drv_analog_in.h
index 82a72b35..27c8bea2 100644
--- a/driver/peripheral_drivers/mikroe/inc/drv_analog_in.h
+++ b/driver/peripheral_drivers/mikroe/inc/drv_analog_in.h
@@ -44,18 +44,12 @@
extern "C" {
#endif
-#include "em_cmu.h"
-#include "em_gpio.h"
-
-#if defined(_SILICON_LABS_32B_SERIES_1)
-#include "em_adc.h"
-#elif defined(_SILICON_LABS_32B_SERIES_2)
-#include "em_iadc.h"
-#endif
-
+#include
#include "hal_gpio.h"
#include "drv_name.h"
+typedef const void *mikroe_adc_handle_t; ///< Created ADC handle type
+
typedef enum
{
ADC_SUCCESS = 0,
@@ -78,7 +72,7 @@ typedef enum
ANALOG_IN_RESOLUTION_14_BIT,
ANALOG_IN_RESOLUTION_16_BIT,
- /*!< Default resolution. */
+ ///< Default resolution
ANALOG_IN_RESOLUTION_DEFAULT = ANALOG_IN_RESOLUTION_12_BIT
} analog_in_resolution_t;
@@ -89,13 +83,10 @@ typedef struct
analog_in_vref_t vref_input;
float vref_value;
} analog_in_config_t;
+
typedef struct
{
-#if defined(_SILICON_LABS_32B_SERIES_1)
- ADC_TypeDef *handle;
-#elif defined(_SILICON_LABS_32B_SERIES_2)
- IADC_TypeDef *handle;
-#endif
+ mikroe_adc_handle_t handle;
analog_in_config_t config;
} analog_in_t;
diff --git a/driver/peripheral_drivers/mikroe/inc/drv_digital_in.h b/driver/peripheral_drivers/mikroe/inc/drv_digital_in.h
index 2a5b19eb..4560e480 100644
--- a/driver/peripheral_drivers/mikroe/inc/drv_digital_in.h
+++ b/driver/peripheral_drivers/mikroe/inc/drv_digital_in.h
@@ -56,6 +56,8 @@ typedef struct {
} digital_in_t;
err_t digital_in_init(digital_in_t *in, pin_name_t name);
+err_t digital_in_pullup_init(digital_in_t *in, pin_name_t name);
+err_t digital_in_pulldown_init(digital_in_t *in, pin_name_t name);
uint8_t digital_in_read(digital_in_t *in);
#ifdef __cplusplus
diff --git a/driver/peripheral_drivers/mikroe/inc/drv_i2c_master.h b/driver/peripheral_drivers/mikroe/inc/drv_i2c_master.h
index e894e54b..de9c6127 100644
--- a/driver/peripheral_drivers/mikroe/inc/drv_i2c_master.h
+++ b/driver/peripheral_drivers/mikroe/inc/drv_i2c_master.h
@@ -4,7 +4,7 @@
* @version 1.0.0
*******************************************************************************
* # License
- * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ * Copyright 2024 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
@@ -48,7 +48,8 @@ extern "C" {
#include
#include
#include "drv_name.h"
-#include "sl_i2cspm.h"
+
+typedef const void *mikroe_i2c_handle_t; ///< Created I2C handle type
typedef enum {
I2C_MASTER_SUCCESS = 0, I2C_MASTER_ERROR = (-1)
@@ -67,7 +68,7 @@ typedef struct {
} i2c_master_config_t;
typedef struct {
- sl_i2cspm_t *handle;
+ mikroe_i2c_handle_t handle;
i2c_master_config_t config;
} i2c_master_t;
diff --git a/driver/peripheral_drivers/mikroe/inc/drv_pwm.h b/driver/peripheral_drivers/mikroe/inc/drv_pwm.h
index d4450402..768d3a09 100644
--- a/driver/peripheral_drivers/mikroe/inc/drv_pwm.h
+++ b/driver/peripheral_drivers/mikroe/inc/drv_pwm.h
@@ -46,7 +46,8 @@ extern "C" {
#include "drv_name.h"
#include "hal_gpio.h"
-#include "sl_pwm.h"
+
+typedef const void *mikroe_pwm_handle_t; ///< Created PWM handle type
typedef enum {
PWM_SUCCESS = 0, PWM_ERROR = (-1)
@@ -58,7 +59,7 @@ typedef struct {
} pwm_config_t;
typedef struct {
- sl_pwm_instance_t *handle;
+ mikroe_pwm_handle_t handle;
hal_gpio_t pin;
pwm_config_t config;
} pwm_t;
diff --git a/driver/peripheral_drivers/mikroe/inc/drv_spi_master.h b/driver/peripheral_drivers/mikroe/inc/drv_spi_master.h
index 6d194fed..016a8d0b 100644
--- a/driver/peripheral_drivers/mikroe/inc/drv_spi_master.h
+++ b/driver/peripheral_drivers/mikroe/inc/drv_spi_master.h
@@ -48,7 +48,8 @@ extern "C" {
#include
#include
#include "drv_name.h"
-#include "spidrv.h"
+
+typedef const void *mikroe_spi_handle_t; ///< Created SPI handle type
typedef enum {
SPI_MASTER_SUCCESS = 0, SPI_MASTER_ERROR = (-1)
@@ -81,7 +82,7 @@ typedef struct {
} spi_master_config_t;
typedef struct {
- SPIDRV_Handle_t handle;
+ mikroe_spi_handle_t handle;
spi_master_config_t config;
} spi_master_t;
@@ -101,6 +102,10 @@ err_t spi_master_write(spi_master_t *obj,
err_t spi_master_read(spi_master_t *obj,
uint8_t *read_data_buffer,
size_t read_data_length);
+err_t spi_master_exchange(spi_master_t *obj,
+ uint8_t *write_data_buffer,
+ uint8_t *read_data_buffer,
+ size_t exchange_data_length);
err_t spi_master_write_then_read(spi_master_t *obj,
uint8_t *write_data_buffer,
size_t length_write_data,
diff --git a/driver/peripheral_drivers/mikroe/inc/hal_gpio.h b/driver/peripheral_drivers/mikroe/inc/hal_gpio.h
index 3e235656..f72d04cc 100644
--- a/driver/peripheral_drivers/mikroe/inc/hal_gpio.h
+++ b/driver/peripheral_drivers/mikroe/inc/hal_gpio.h
@@ -44,22 +44,35 @@
extern "C" {
#endif
-#define HAL_PIN_NC 0xffffffff
-#define HAL_PORT_NC 0xffffffff
+#define HAL_PIN_NC 0xffffffff
+#define HAL_PORT_NC 0xffffffff
-#define PORT_SIZE (16)
+#define PORT_SIZE (16)
+
+#ifndef SL_SI91X_ULP_GPIO_PORT
+#define SL_SI91X_ULP_GPIO_PORT 4 ///< ULP GPIO port number
+#endif
#define hal_gpio_pin_index(pin_name) \
- ((pin_name) % PORT_SIZE)
+ ((pin_name) % PORT_SIZE)
+
#define hal_gpio_port_index(pin_name) \
- ((pin_name) / PORT_SIZE)
+ ((pin_name) / PORT_SIZE)
#define hal_gpio_pin_mask(pin_name) \
- (0x01 << gpio_pin_index(pin_name))
+ (0x01 << gpio_pin_index(pin_name))
+
+#if (defined(SLI_SI917))
+#define hal_gpio_pin_name(port_index, pin_index) \
+ ((port_index) == SL_SI91X_ULP_GPIO_PORT) \
+ ? ((pin_name_t)(port_index) * PORT_SIZE + (pin_index)) \
+ : ((pin_name_t)(pin_index))
+#else
#define hal_gpio_pin_name(port_index, pin_index) \
- ((pin_name_t)(port_index) * PORT_SIZE + (pin_index))
+ ((pin_name_t)(port_index) * PORT_SIZE + (pin_index))
+#endif
#define hal_gpio_port_name(port_index) \
- ((port_name_t)(port_index) * PORT_SIZE)
+ ((port_name_t)(port_index) * PORT_SIZE)
typedef struct {
uint32_t base;
diff --git a/driver/peripheral_drivers/mikroe/src/drv_analog_in.c b/driver/peripheral_drivers/mikroe/src/drv_analog_in.c
index 93ba3b2f..57f8de9c 100644
--- a/driver/peripheral_drivers/mikroe/src/drv_analog_in.c
+++ b/driver/peripheral_drivers/mikroe/src/drv_analog_in.c
@@ -37,10 +37,18 @@
*
******************************************************************************/
+#include
#include
#include
+#include "em_cmu.h"
#include "drv_analog_in.h"
+#if defined(_SILICON_LABS_32B_SERIES_1)
+#include "em_adc.h"
+#elif defined(_SILICON_LABS_32B_SERIES_2)
+#include "em_iadc.h"
+#endif
+
#if defined(_SILICON_LABS_32B_SERIES_1)
#define CLK_ADC_FREQ 16000000
#elif defined(_SILICON_LABS_32B_SERIES_2)
@@ -57,10 +65,10 @@
#if defined(_SILICON_LABS_32B_SERIES_2)
#define calc_adc_pos(port, pin) \
- ((((port) * 16) + pin) + (unsigned int)iadcNegInputPortAPin0)
+ ((((port) * 16) + pin) + (unsigned int)iadcNegInputPortAPin0)
#define adc_mux_even(ref, adc, bus, index) \
- GPIO->bus ## BUSALLOC |= \
- GPIO_ ## bus ## BUSALLOC_ ## bus ## EVEN ## index ## _ ## adc;
+ GPIO->bus ## BUSALLOC |= \
+ GPIO_ ## bus ## BUSALLOC_ ## bus ## EVEN ## index ## _ ## adc;
#endif
#if defined(_SILICON_LABS_32B_SERIES_1)
@@ -103,10 +111,11 @@ err_t analog_in_open(analog_in_t *obj, analog_in_config_t *config)
analog_in_config_t *p_config = &obj->config;
memcpy(p_config, config, sizeof(analog_in_config_t));
- if (ADC_SUCCESS != hal_adc_init(obj)) {
+ if (_acquire(obj, true) == ACQUIRE_FAIL) {
return ADC_ERROR;
}
- return _acquire(obj, true);
+
+ return hal_adc_init(obj);
}
err_t analog_in_set_resolution(analog_in_t *obj,
@@ -409,27 +418,28 @@ static err_t hal_adc_init(analog_in_t *obj)
return ADC_ERROR;
}
- ADC_Init(obj->handle, &init);
- ADC_InitSingle(obj->handle, &initSingle);
+ ADC_Init((ADC_TypeDef *)obj->handle, &init);
+ ADC_InitSingle((ADC_TypeDef *)obj->handle, &initSingle);
return ADC_SUCCESS;
}
static void hal_adc_deinit(analog_in_t *obj)
{
- ADC_Reset(obj->handle);
+ ADC_Reset((ADC_TypeDef *)obj->handle);
}
uint16_t hal_adc_read(analog_in_t *obj)
{
+ ADC_TypeDef *ptr = (ADC_TypeDef *)obj->handle;
// Start ADC conversion
- ADC_Start(obj->handle, adcStartSingle);
+ ADC_Start(ptr, adcStartSingle);
// Wait for conversion to be complete
- while (!(obj->handle->STATUS & _ADC_STATUS_SINGLEDV_MASK)) {}
+ while (!(ptr->STATUS & _ADC_STATUS_SINGLEDV_MASK)) {}
// Get ADC result
- return (uint16_t)ADC_DataSingleGet(obj->handle);
+ return (uint16_t)ADC_DataSingleGet((ADC_TypeDef *)obj->handle);
}
#elif defined(_SILICON_LABS_32B_SERIES_2)
@@ -442,9 +452,9 @@ static err_t allocate_analog_bus_even0(analog_in_t *obj)
adc_mux_even(obj->handle, ADC0, A, 0);
return ADC_SUCCESS;
#elif (IADC_COUNT == 2)
- } else if (obj->handle == IADC1) {
- adc_mux_even(obj->handle, ADC1, A, 0);
- return ADC_SUCCESS;
+ } else if (obj->handle == IADC1) {
+ adc_mux_even(obj->handle, ADC1, A, 0);
+ return ADC_SUCCESS;
#endif
} else {
return ADC_ERROR;
@@ -456,9 +466,9 @@ static err_t allocate_analog_bus_even0(analog_in_t *obj)
adc_mux_even(obj->handle, ADC0, B, 0);
return ADC_SUCCESS;
#elif (IADC_COUNT == 2)
- } else if (obj->handle == IADC1) {
- adc_mux_even(obj->handle, ADC1, B, 0);
- return ADC_SUCCESS;
+ } else if (obj->handle == IADC1) {
+ adc_mux_even(obj->handle, ADC1, B, 0);
+ return ADC_SUCCESS;
#endif
} else {
return ADC_ERROR;
@@ -471,9 +481,9 @@ static err_t allocate_analog_bus_even0(analog_in_t *obj)
adc_mux_even(obj->handle, ADC0, CD, 0);
return ADC_SUCCESS;
#elif (IADC_COUNT == 2)
- } else if (obj->handle == IADC1) {
- adc_mux_even(obj->handle, ADC1, CD, 0);
- return ADC_SUCCESS;
+ } else if (obj->handle == IADC1) {
+ adc_mux_even(obj->handle, ADC1, CD, 0);
+ return ADC_SUCCESS;
#endif
} else {
return ADC_ERROR;
@@ -499,8 +509,8 @@ static err_t hal_adc_init(analog_in_t *obj)
if (obj->handle == IADC0) {
CMU_ClockEnable(cmuClock_IADC0, true);
#elif (IADC_COUNT == 2)
- } else if (obj->handle == IADC0) {
- CMU_ClockEnable(cmuClock_IADC0, true);
+} else if (obj->handle == IADC0) {
+ CMU_ClockEnable(cmuClock_IADC0, true);
#endif
} else {
return ADC_ERROR;
@@ -513,12 +523,12 @@ static err_t hal_adc_init(analog_in_t *obj)
// Set the prescaler needed for the intended IADC clock frequency
init.srcClkPrescale =
- IADC_calcSrcClkPrescale(obj->handle, CLK_SRC_ADC_FREQ, 0);
+ IADC_calcSrcClkPrescale((IADC_TypeDef *)obj->handle, CLK_SRC_ADC_FREQ, 0);
// Shutdown between conversions to reduce current
init.warmup = iadcWarmupNormal;
- /*
+ /**
* Configuration 0 is used by both scan and single conversions by
* default. Use internal bandgap as the reference and specify the
* reference voltage in mV.
@@ -544,8 +554,8 @@ static err_t hal_adc_init(analog_in_t *obj)
initAllConfigs.configs[0].vRef = reference_voltage;
#if defined(_IADC_CFG_REFSEL_VREF2P5)
} else if (reference_voltage <= 2500) {
- initAllConfigs.configs[0].reference = iadcCfgReferenceExt2V5;
- initAllConfigs.configs[0].vRef = reference_voltage;
+ initAllConfigs.configs[0].reference = iadcCfgReferenceExt2V5;
+ initAllConfigs.configs[0].vRef = reference_voltage;
#endif
#if defined(_IADC_CFG_REFSEL_VREFBUF)
} else if (reference_voltage < (MIKROE_CONFIG_ADC_AVDD - 300)) {
@@ -607,7 +617,7 @@ static err_t hal_adc_init(analog_in_t *obj)
return ADC_ERROR;
}
- /*
+ /**
* Resolution is not configurable directly but is based on the
* selected oversampling ratio (osrHighSpeed), which defaults to
* 2x and generates 12-bit results.
@@ -620,7 +630,7 @@ static err_t hal_adc_init(analog_in_t *obj)
initAllConfigs.configs[0].osrHighSpeed = iadcCfgOsrHighSpeed2x;
initAllConfigs.configs[0].analogGain = iadcCfgAnalogGain1x;
- /*
+ /**
* CLK_SRC_ADC must be prescaled by some value greater than 1 to
* derive the intended CLK_ADC frequency.
*
@@ -632,13 +642,13 @@ static err_t hal_adc_init(analog_in_t *obj)
* 2-clock input multiplexer switching time is included.
*/
initAllConfigs.configs[0].adcClkPrescale =
- IADC_calcAdcClkPrescale(obj->handle,
+ IADC_calcAdcClkPrescale((IADC_TypeDef *)obj->handle,
CLK_ADC_FREQ,
0,
iadcCfgModeNormal,
init.srcClkPrescale);
- /*
+ /**
* Specify the input channel. When negInput = iadcNegInputGnd, the
* conversion is single-ended.
*/
@@ -654,27 +664,27 @@ static err_t hal_adc_init(analog_in_t *obj)
}
// Initialize IADC
- IADC_init(obj->handle, &init, &initAllConfigs);
+ IADC_init((IADC_TypeDef *)obj->handle, &init, &initAllConfigs);
// Initialize a single-channel conversion
- IADC_initSingle(obj->handle, &initSingle, &singleInput);
+ IADC_initSingle((IADC_TypeDef *)obj->handle, &initSingle, &singleInput);
return ADC_SUCCESS;
}
static void hal_adc_deinit(analog_in_t *obj)
{
- IADC_reset(obj->handle);
+ IADC_reset((IADC_TypeDef *)obj->handle);
}
uint16_t hal_adc_read(analog_in_t *obj)
{
- IADC_command(obj->handle, iadcCmdStartSingle);
+ IADC_command((IADC_TypeDef *)obj->handle, iadcCmdStartSingle);
// while combined status bits 8 & 6 don't equal 1 and 0 respectively)
- while ((IADC_getStatus(obj->handle) & (_IADC_STATUS_CONVERTING_MASK
- | _IADC_STATUS_SINGLEFIFODV_MASK))
+ while ((IADC_getStatus((IADC_TypeDef *)obj->handle)
+ & (_IADC_STATUS_CONVERTING_MASK | _IADC_STATUS_SINGLEFIFODV_MASK))
!= IADC_STATUS_SINGLEFIFODV) {}
- return IADC_pullSingleFifoResult(obj->handle).data;
+ return IADC_pullSingleFifoResult((IADC_TypeDef *)obj->handle).data;
}
#endif
diff --git a/driver/peripheral_drivers/mikroe/src/drv_analog_in_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_analog_in_si91x.c
new file mode 100644
index 00000000..cba6e400
--- /dev/null
+++ b/driver/peripheral_drivers/mikroe/src/drv_analog_in_si91x.c
@@ -0,0 +1,258 @@
+/***************************************************************************//**
+ * @file drv_analog_in_si91x.c
+ * @brief mikroSDK 2.0 Click Peripheral Drivers - Analog IN for Si91x
+ * @version 1.0.0
+ *******************************************************************************
+ * # License
+ * Copyright 2024 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#include "sl_status.h"
+#include "drv_analog_in.h"
+#include "sl_si91x_adc.h"
+#include "sl_adc_instances.h"
+
+#define ADC_MAX_OP_VALUE 4096 // Maximum output value get from adc
+#define AUXADC_DATA_TWELFTH BIT(11) // Reading twelfth bit of AUXADC_DATA reg
+
+static analog_in_t *_owner = NULL;
+static sl_adc_config_t drv_adc_config;
+static volatile boolean_t data_sample_complete_flag = false;
+
+static void callback_event(uint8_t channel_no, uint8_t event);
+static err_t _acquire(analog_in_t *obj, bool obj_open_state);
+static err_t hal_adc_read(analog_in_t *obj, uint16_t *data);
+
+void analog_in_configure_default(analog_in_config_t *config)
+{
+ config->input_pin = 0xFFFFFFFF;
+ config->resolution = ANALOG_IN_RESOLUTION_DEFAULT;
+ config->vref_input = ANALOG_IN_VREF_EXTERNAL;
+ config->vref_value = 3.3;
+}
+
+err_t analog_in_open(analog_in_t *obj, analog_in_config_t *config)
+{
+ sl_status_t status;
+ analog_in_config_t *p_config = &obj->config;
+
+ memcpy(p_config, config, sizeof(analog_in_config_t));
+
+ if (_acquire(obj, true) == ACQUIRE_FAIL) {
+ return ADC_ERROR;
+ }
+
+ drv_adc_config.num_of_channel_enable = 1;
+ drv_adc_config.operation_mode = SL_ADC_STATIC_MODE;
+ sl_adc_channel_config.channel = *(uint8_t *)obj->handle;
+ sl_adc_channel_config.num_of_samples[sl_adc_channel_config.channel] = 1;
+
+ // Initialize ADC
+ status = sl_si91x_adc_init(sl_adc_channel_config,
+ drv_adc_config,
+ obj->config.vref_value);
+ if (status != SL_STATUS_OK) {
+ return ADC_ERROR;
+ }
+ // Configure ADC channel.
+ status = sl_si91x_adc_set_channel_configuration(sl_adc_channel_config,
+ drv_adc_config);
+ if (status != SL_STATUS_OK) {
+ return ADC_ERROR;
+ }
+ // Register user callback function
+ status = sl_si91x_adc_register_event_callback(callback_event);
+ if (status != SL_STATUS_OK) {
+ return ADC_ERROR;
+ }
+
+ return ADC_SUCCESS;
+}
+
+err_t analog_in_set_resolution(analog_in_t *obj,
+ analog_in_resolution_t resolution)
+{
+ if (_acquire(obj, false) != ACQUIRE_FAIL) {
+ obj->config.resolution = resolution;
+ return ADC_SUCCESS;
+ }
+
+ return ADC_ERROR;
+}
+
+err_t analog_in_set_vref_input(analog_in_t *obj, analog_in_vref_t vref)
+{
+ (void) vref;
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return ADC_ERROR;
+ }
+ // TODO
+ return ADC_SUCCESS;
+}
+
+err_t analog_in_set_vref_value(analog_in_t *obj, float vref_value)
+{
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return ADC_ERROR;
+ }
+
+ obj->config.vref_value = vref_value;
+ if (sl_si91x_adc_init(sl_adc_channel_config,
+ drv_adc_config,
+ vref_value) != SL_STATUS_OK) {
+ return ADC_ERROR;
+ }
+
+ return ADC_SUCCESS;
+}
+
+err_t analog_in_read(analog_in_t *obj, uint16_t *readDatabuf)
+{
+ uint16_t adc_value;
+
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return ADC_ERROR;
+ }
+
+ if (hal_adc_read(obj, &adc_value) != SL_STATUS_OK) {
+ return ADC_ERROR;
+ }
+
+ switch (obj->config.resolution) {
+ case ANALOG_IN_RESOLUTION_6_BIT:
+ *readDatabuf = adc_value >> 6;
+ break;
+ case ANALOG_IN_RESOLUTION_8_BIT:
+ *readDatabuf = adc_value >> 4;
+ break;
+ case ANALOG_IN_RESOLUTION_10_BIT:
+ *readDatabuf = adc_value >> 2;
+ break;
+ case ANALOG_IN_RESOLUTION_12_BIT:
+ *readDatabuf = adc_value;
+ break;
+ default:
+ return ADC_ERROR;
+ }
+
+ return ADC_SUCCESS;
+}
+
+err_t analog_in_read_voltage(analog_in_t *obj, float *readDatabuf)
+{
+ uint16_t adc_value;
+
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return ADC_ERROR;
+ }
+
+ if (hal_adc_read(obj, &adc_value) != SL_STATUS_OK) {
+ return ADC_ERROR;
+ }
+
+ *readDatabuf = (float)adc_value * obj->config.vref_value / ADC_MAX_OP_VALUE;
+ return ADC_SUCCESS;
+}
+
+void analog_in_close(analog_in_t *obj)
+{
+ sl_si91x_adc_deinit(drv_adc_config);
+ obj->handle = NULL;
+ _owner = NULL;
+}
+
+static err_t _acquire(analog_in_t *obj, bool obj_open_state)
+{
+ err_t status = ACQUIRE_SUCCESS;
+
+ if ((obj_open_state == true) && (_owner == obj)) {
+ return ACQUIRE_FAIL;
+ }
+ if (_owner != obj) {
+ _owner = obj;
+ }
+ return status;
+}
+
+static err_t hal_adc_read(analog_in_t *obj, uint16_t *data)
+{
+ (void)obj;
+ uint16_t adc_value;
+
+ // Start the ADC operation
+ if (sl_si91x_adc_start(drv_adc_config) != SL_STATUS_OK) {
+ return ADC_ERROR;
+ }
+ // Wait until ADC data acquisition done
+ while (data_sample_complete_flag != true) {}
+ data_sample_complete_flag = false;
+ if (sl_si91x_adc_stop(drv_adc_config) != SL_STATUS_OK) {
+ return ADC_ERROR;
+ }
+ if (sl_si91x_adc_read_data_static(sl_adc_channel_config,
+ drv_adc_config,
+ &adc_value) != SL_STATUS_OK) {
+ return ADC_ERROR;
+ }
+
+ if (adc_value & AUXADC_DATA_TWELFTH) {
+ adc_value = (int16_t)(adc_value & (ADC_MASK_VALUE));
+ } else {
+ adc_value = adc_value | AUXADC_DATA_TWELFTH;
+ }
+
+ *data = adc_value;
+ return ADC_SUCCESS;
+}
+
+/*******************************************************************************
+ * Callback event function
+ * It is responsible for the event which are triggered by ADC interface
+ * @param event : INTERNAL_DMA => Single channel data acquisition done.
+ * ADC_STATIC_MODE_CALLBACK => Static mode adc data
+ * acquisition done.
+ ******************************************************************************/
+static void callback_event(uint8_t channel_no, uint8_t event)
+{
+ (void) channel_no;
+
+ switch (event) {
+ case SL_INTERNAL_DMA:
+ break;
+ case SL_ADC_STATIC_MODE_EVENT:
+ data_sample_complete_flag = true;
+ break;
+ }
+}
+
+// ------------------------------------------------------------------------- END
diff --git a/driver/peripheral_drivers/mikroe/src/drv_digital_in.c b/driver/peripheral_drivers/mikroe/src/drv_digital_in.c
index e167965e..f57eec9f 100644
--- a/driver/peripheral_drivers/mikroe/src/drv_digital_in.c
+++ b/driver/peripheral_drivers/mikroe/src/drv_digital_in.c
@@ -40,7 +40,38 @@
#include "drv_digital_in.h"
#include "em_gpio.h"
+static err_t drv_digital_in_init(digital_in_t *in,
+ pin_name_t name,
+ GPIO_Mode_TypeDef mode,
+ unsigned int out);
+
err_t digital_in_init(digital_in_t *in, pin_name_t name)
+{
+ return drv_digital_in_init(in, name, gpioModeInput, 0);
+}
+
+err_t digital_in_pullup_init(digital_in_t *in, pin_name_t name)
+{
+ return drv_digital_in_init(in, name, gpioModeInputPull, 1);
+}
+
+err_t digital_in_pulldown_init(digital_in_t *in, pin_name_t name)
+{
+ return drv_digital_in_init(in, name, gpioModeInputPull, 0);
+}
+
+uint8_t digital_in_read(digital_in_t *in)
+{
+ if (GPIO_PORT_VALID(in->pin.base)) {
+ return (uint8_t) ((GPIO_PortInGet(in->pin.base) & in->pin.mask) != 0);
+ }
+ return 0;
+}
+
+static err_t drv_digital_in_init(digital_in_t *in,
+ pin_name_t name,
+ GPIO_Mode_TypeDef mode,
+ unsigned int out)
{
GPIO_Port_TypeDef port_index;
unsigned int pin_index;
@@ -57,18 +88,10 @@ err_t digital_in_init(digital_in_t *in, pin_name_t name)
if (!GPIO_PORT_PIN_VALID(port_index, pin_index)) {
return DIGITAL_IN_UNSUPPORTED_PIN;
}
- GPIO_PinModeSet(port_index, pin_index, gpioModeInput, 0);
+ GPIO_PinModeSet(port_index, pin_index, mode, out);
in->pin.base = port_index;
in->pin.mask = 1 << pin_index;
return DIGITAL_IN_SUCCESS;
}
-uint8_t digital_in_read(digital_in_t *in)
-{
- if (GPIO_PORT_VALID(in->pin.base)) {
- return (uint8_t) ((GPIO_PortInGet(in->pin.base) & in->pin.mask) != 0);
- }
- return 0;
-}
-
// ------------------------------------------------------------------------- END
diff --git a/driver/peripheral_drivers/mikroe/src/drv_digital_in_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_digital_in_si91x.c
new file mode 100644
index 00000000..bb105010
--- /dev/null
+++ b/driver/peripheral_drivers/mikroe/src/drv_digital_in_si91x.c
@@ -0,0 +1,174 @@
+/***************************************************************************//**
+ * @file drv_digital_in_si91x.c
+ * @brief mikroSDK 2.0 Click Peripheral Drivers - Digital IN for Si91x
+ * @version 1.0.0
+ *******************************************************************************
+ * # License
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#include "drv_digital_in.h"
+#include "sl_si91x_peripheral_gpio.h"
+
+static err_t drv_digital_in_init(digital_in_t *in,
+ pin_name_t name,
+ sl_gpio_mode_t mode,
+ uint32_t out);
+
+static uint8_t sl_si91x_gpio_pad_mapping(unsigned int pin)
+{
+ switch (pin) {
+ case 6:
+ return 1;
+ case 7:
+ return 2;
+ case 8:
+ return 3;
+ case 9:
+ return 4;
+ case 10:
+ return 5;
+ case 11:
+ return 6;
+ case 12:
+ return 7;
+ case 15:
+ return 8;
+ case 31:
+ case 32:
+ case 33:
+ case 34:
+ return 9;
+ case 46:
+ return 10;
+ case 47:
+ return 11;
+ case 48:
+ return 12;
+ case 49:
+ return 13;
+ case 50:
+ return 14;
+ case 51:
+ return 15;
+ case 52:
+ return 16;
+ case 53:
+ return 17;
+ case 54:
+ return 18;
+ case 55:
+ return 19;
+ case 56:
+ return 20;
+ case 57:
+ return 21;
+ default:
+ return 0;
+ }
+}
+
+err_t digital_in_init(digital_in_t *in, pin_name_t name)
+{
+ return drv_digital_in_init(in, name, SL_GPIO_MODE_0, 0);
+}
+
+err_t digital_in_pullup_init(digital_in_t *in, pin_name_t name)
+{
+ return drv_digital_in_init(in, name, SL_GPIO_MODE_0, 1);
+}
+
+err_t digital_in_pulldown_init(digital_in_t *in, pin_name_t name)
+{
+ return drv_digital_in_init(in, name, SL_GPIO_MODE_0, 0);
+}
+
+uint8_t digital_in_read(digital_in_t *in)
+{
+ return sl_gpio_get_pin_input(in->pin.base, in->pin.mask);
+}
+
+static err_t drv_digital_in_init(digital_in_t *in,
+ pin_name_t name,
+ sl_gpio_mode_t mode,
+ uint32_t out)
+{
+ sl_gpio_port_t port_index;
+ unsigned int pin_index;
+ uint8_t pad_number;
+
+ in->pin.base = (uint32_t) -1;
+ in->pin.mask = 0;
+ if (HAL_PIN_NC == name) {
+ return DIGITAL_IN_UNSUPPORTED_PIN;
+ }
+
+ port_index = (sl_gpio_port_t) hal_gpio_port_index(name);
+ pin_index = hal_gpio_pin_index(name);
+
+ if (!SL_GPIO_VALIDATE_PORT(port_index)) {
+ return DIGITAL_IN_UNSUPPORTED_PIN;
+ }
+ if (port_index == SL_ULP_GPIO_PORT) {
+ if (!SL_GPIO_VALIDATE_ULP_PORT_PIN(port_index, pin_index)) {
+ return DIGITAL_IN_UNSUPPORTED_PIN;
+ }
+ } else {
+ if (!SL_GPIO_NDEBUG_PORT_PIN(port_index, pin_index)) {
+ return DIGITAL_IN_UNSUPPORTED_PIN;
+ }
+ }
+
+ if (port_index == SL_ULP_GPIO_PORT) {
+ sl_si91x_gpio_enable_clock((sl_si91x_gpio_select_clock_t)ULPCLK_GPIO);
+ sl_si91x_gpio_enable_ulp_pad_receiver(pin_index);
+ } else {
+ sl_si91x_gpio_enable_clock((sl_si91x_gpio_select_clock_t)M4CLK_GPIO);
+ sl_si91x_gpio_enable_pad_receiver(name);
+ pad_number = sl_si91x_gpio_pad_mapping(name);
+ if (pad_number) {
+ sl_si91x_gpio_enable_pad_selection(pad_number);
+ }
+ }
+
+ sl_gpio_set_pin_mode(port_index, pin_index, mode, out);
+ sl_si91x_gpio_set_pin_direction(port_index,
+ pin_index,
+ (sl_si91x_gpio_direction_t)GPIO_INPUT);
+
+ in->pin.base = port_index;
+ in->pin.mask = pin_index;
+ return DIGITAL_IN_SUCCESS;
+}
+
+// ------------------------------------------------------------------------- END
diff --git a/driver/peripheral_drivers/mikroe/src/drv_digital_out.c b/driver/peripheral_drivers/mikroe/src/drv_digital_out.c
index 735605ca..e702ecc1 100644
--- a/driver/peripheral_drivers/mikroe/src/drv_digital_out.c
+++ b/driver/peripheral_drivers/mikroe/src/drv_digital_out.c
@@ -1,6 +1,6 @@
/***************************************************************************//**
* @file drv_digital_out.h
- * @brief mikroSDK 2.0 Click Peripheral Drivers
+ * @brief mikroSDK 2.0 Click Peripheral Drivers - Digital OUT
* @version 1.0.0
*******************************************************************************
* # License
diff --git a/driver/peripheral_drivers/mikroe/src/drv_digital_out_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_digital_out_si91x.c
new file mode 100644
index 00000000..d753cfd1
--- /dev/null
+++ b/driver/peripheral_drivers/mikroe/src/drv_digital_out_si91x.c
@@ -0,0 +1,171 @@
+/***************************************************************************//**
+ * @file drv_digital_out_si91x.c
+ * @brief mikroSDK 2.0 Click Peripheral Drivers - Digital OUT for Si91x
+ * @version 1.0.0
+ *******************************************************************************
+ * # License
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#include "drv_digital_out.h"
+#include "sl_si91x_peripheral_gpio.h"
+
+static uint8_t sl_si91x_gpio_pad_mapping(unsigned int pin)
+{
+ switch (pin) {
+ case 6:
+ return 1;
+ case 7:
+ return 2;
+ case 8:
+ return 3;
+ case 9:
+ return 4;
+ case 10:
+ return 5;
+ case 11:
+ return 6;
+ case 12:
+ return 7;
+ case 15:
+ return 8;
+ case 31:
+ case 32:
+ case 33:
+ case 34:
+ return 9;
+ case 46:
+ return 10;
+ case 47:
+ return 11;
+ case 48:
+ return 12;
+ case 49:
+ return 13;
+ case 50:
+ return 14;
+ case 51:
+ return 15;
+ case 52:
+ return 16;
+ case 53:
+ return 17;
+ case 54:
+ return 18;
+ case 55:
+ return 19;
+ case 56:
+ return 20;
+ case 57:
+ return 21;
+ default:
+ return 0;
+ }
+}
+
+err_t digital_out_init(digital_out_t *out, pin_name_t name)
+{
+ sl_gpio_port_t port_index;
+ unsigned int pin_index;
+ uint8_t pad_number;
+
+ out->pin.base = (uint32_t) -1;
+ out->pin.mask = 0;
+ if (HAL_PIN_NC == name) {
+ return DIGITAL_OUT_UNSUPPORTED_PIN;
+ }
+
+ port_index = (sl_gpio_port_t) hal_gpio_port_index(name);
+ pin_index = hal_gpio_pin_index(name);
+
+ if (!SL_GPIO_VALIDATE_PORT(port_index)) {
+ return DIGITAL_OUT_UNSUPPORTED_PIN;
+ }
+
+ if (port_index == SL_ULP_GPIO_PORT) {
+ if (!SL_GPIO_VALIDATE_ULP_PORT_PIN(port_index, pin_index)) {
+ return DIGITAL_OUT_UNSUPPORTED_PIN;
+ }
+ } else {
+ if (!SL_GPIO_NDEBUG_PORT_PIN(port_index, pin_index)) {
+ return DIGITAL_OUT_UNSUPPORTED_PIN;
+ }
+ }
+
+ if (port_index == SL_ULP_GPIO_PORT) {
+ sl_si91x_gpio_enable_clock((sl_si91x_gpio_select_clock_t)ULPCLK_GPIO);
+ sl_si91x_gpio_enable_ulp_pad_receiver(pin_index);
+ } else {
+ sl_si91x_gpio_enable_clock((sl_si91x_gpio_select_clock_t)M4CLK_GPIO);
+ sl_si91x_gpio_enable_pad_receiver(name);
+ pad_number = sl_si91x_gpio_pad_mapping(name);
+ if (pad_number) {
+ sl_si91x_gpio_enable_pad_selection(pad_number);
+ }
+ }
+
+ sl_gpio_set_pin_mode(port_index, pin_index, SL_GPIO_MODE_0, 0);
+ sl_si91x_gpio_set_pin_direction(port_index,
+ pin_index,
+ (sl_si91x_gpio_direction_t)GPIO_OUTPUT);
+
+ out->pin.base = port_index;
+ out->pin.mask = pin_index;
+ return DIGITAL_OUT_SUCCESS;
+}
+
+void digital_out_high(digital_out_t *out)
+{
+ sl_gpio_set_pin_output(out->pin.base, out->pin.mask);
+}
+
+void digital_out_low(digital_out_t *out)
+{
+ sl_gpio_clear_pin_output(out->pin.base, out->pin.mask);
+}
+
+void digital_out_toggle(digital_out_t *out)
+{
+ sl_gpio_toggle_pin_output(out->pin.base, out->pin.mask);
+}
+
+void digital_out_write(digital_out_t *out, uint8_t value)
+{
+ if (value) {
+ sl_gpio_set_pin_output(out->pin.base, out->pin.mask);
+ } else {
+ sl_gpio_clear_pin_output(out->pin.base, out->pin.mask);
+ }
+}
+
+// ------------------------------------------------------------------------- END
diff --git a/driver/peripheral_drivers/mikroe/src/drv_i2c_master.c b/driver/peripheral_drivers/mikroe/src/drv_i2c_master.c
index 0041914b..18c2f025 100644
--- a/driver/peripheral_drivers/mikroe/src/drv_i2c_master.c
+++ b/driver/peripheral_drivers/mikroe/src/drv_i2c_master.c
@@ -1,10 +1,10 @@
/***************************************************************************//**
* @file drv_i2c_master.h
- * @brief mikroSDK 2.0 Click Peripheral Drivers
+ * @brief mikroSDK 2.0 Click Peripheral Drivers - I2C Master
* @version 1.0.0
*******************************************************************************
* # License
- * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ * Copyright 2024 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
@@ -37,27 +37,15 @@
*
******************************************************************************/
+#include "sl_i2cspm.h"
#include "drv_i2c_master.h"
#include "sl_status.h"
-static void i2c_master_config_speed(i2c_master_t *obj);
-
static i2c_master_t *_owner = NULL;
+static uint32_t last_i2c_speed_used;
-static err_t _acquire(i2c_master_t *obj, bool obj_open_state)
-{
- err_t status = ACQUIRE_SUCCESS;
-
- if ((obj_open_state == true) && (_owner == obj)) {
- return ACQUIRE_FAIL;
- }
-
- if (_owner != obj) {
- _owner = obj;
- }
-
- return status;
-}
+static void i2c_master_config_speed(i2c_master_t *obj);
+static err_t _acquire(i2c_master_t *obj, bool obj_open_state);
void i2c_master_configure_default(i2c_master_config_t *config)
{
@@ -80,82 +68,90 @@ err_t i2c_master_open(i2c_master_t *obj, i2c_master_config_t *config)
err_t i2c_master_set_speed(i2c_master_t *obj, uint32_t speed)
{
- if (_acquire(obj, false) != ACQUIRE_FAIL) {
- obj->config.speed = speed;
-
- // Configure i2c speed
- i2c_master_config_speed(obj);
- return I2C_MASTER_SUCCESS;
- } else {
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
return I2C_MASTER_ERROR;
}
+
+ obj->config.speed = speed;
+ // Configure i2c speed
+ i2c_master_config_speed(obj);
+
+ return I2C_MASTER_SUCCESS;
}
err_t i2c_master_set_timeout(i2c_master_t *obj, uint16_t timeout_pass_count)
{
- if (_acquire(obj, false) != ACQUIRE_FAIL) {
- obj->config.timeout_pass_count = timeout_pass_count;
- // TODO Set timeout
- return I2C_MASTER_SUCCESS;
- } else {
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
return I2C_MASTER_ERROR;
}
+
+ obj->config.timeout_pass_count = timeout_pass_count;
+ // TODO Set timeout
+ return I2C_MASTER_SUCCESS;
}
err_t i2c_master_set_slave_address(i2c_master_t *obj, uint8_t address)
{
- if (_acquire(obj, false) != ACQUIRE_FAIL) {
- obj->config.addr = address;
- return I2C_MASTER_SUCCESS;
- } else {
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
return I2C_MASTER_ERROR;
}
+
+ obj->config.addr = address;
+ return I2C_MASTER_SUCCESS;
}
err_t i2c_master_write(i2c_master_t *obj,
uint8_t *write_data_buf,
size_t len_write_data)
{
- if (_acquire(obj, false) != ACQUIRE_FAIL) {
- I2C_TransferSeq_TypeDef seq;
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return I2C_MASTER_ERROR;
+ }
+
+ I2C_TransferSeq_TypeDef seq;
+
+ if (last_i2c_speed_used != obj->config.speed) {
+ i2c_master_config_speed(obj);
+ }
- seq.addr = obj->config.addr << 1;
- seq.flags = I2C_FLAG_WRITE;
+ seq.addr = obj->config.addr << 1;
+ seq.flags = I2C_FLAG_WRITE;
- /*Write buffer*/
- seq.buf[0].data = write_data_buf;
- seq.buf[0].len = len_write_data;
+ // Write buffer
+ seq.buf[0].data = write_data_buf;
+ seq.buf[0].len = len_write_data;
- if (I2CSPM_Transfer(obj->handle, &seq) != i2cTransferDone) {
- return I2C_MASTER_ERROR;
- }
- return I2C_MASTER_SUCCESS;
- } else {
+ if (I2CSPM_Transfer((sl_i2cspm_t *)obj->handle, &seq) != i2cTransferDone) {
return I2C_MASTER_ERROR;
}
+ return I2C_MASTER_SUCCESS;
}
err_t i2c_master_read(i2c_master_t *obj,
uint8_t *read_data_buf,
size_t len_read_data)
{
- if (_acquire(obj, false) != ACQUIRE_FAIL) {
- I2C_TransferSeq_TypeDef seq;
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return I2C_MASTER_ERROR;
+ }
- seq.addr = obj->config.addr << 1;
- seq.flags = I2C_FLAG_READ;
+ I2C_TransferSeq_TypeDef seq;
- /*Read buffer*/
- seq.buf[0].data = read_data_buf;
- seq.buf[0].len = len_read_data;
+ if (last_i2c_speed_used != obj->config.speed) {
+ i2c_master_config_speed(obj);
+ }
- if (I2CSPM_Transfer(obj->handle, &seq) != i2cTransferDone) {
- return I2C_MASTER_ERROR;
- }
- return I2C_MASTER_SUCCESS;
- } else {
+ seq.addr = obj->config.addr << 1;
+ seq.flags = I2C_FLAG_READ;
+
+ // Read buffer
+ seq.buf[0].data = read_data_buf;
+ seq.buf[0].len = len_read_data;
+
+ if (I2CSPM_Transfer((sl_i2cspm_t *)obj->handle, &seq) != i2cTransferDone) {
return I2C_MASTER_ERROR;
}
+ return I2C_MASTER_SUCCESS;
}
err_t i2c_master_write_then_read(i2c_master_t *obj,
@@ -164,27 +160,46 @@ err_t i2c_master_write_then_read(i2c_master_t *obj,
uint8_t *read_data_buf,
size_t len_read_data)
{
- if (_acquire(obj, false) != ACQUIRE_FAIL) {
- I2C_TransferSeq_TypeDef seq;
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return I2C_MASTER_ERROR;
+ }
+
+ I2C_TransferSeq_TypeDef seq;
- seq.addr = obj->config.addr << 1;
- seq.flags = I2C_FLAG_WRITE_READ;
+ if (last_i2c_speed_used != obj->config.speed) {
+ i2c_master_config_speed(obj);
+ }
- /*Write buffer*/
- seq.buf[0].data = write_data_buf;
- seq.buf[0].len = len_write_data;
+ seq.addr = obj->config.addr << 1;
+ seq.flags = I2C_FLAG_WRITE_READ;
- /*Read buffer*/
- seq.buf[1].data = read_data_buf;
- seq.buf[1].len = len_read_data;
+ // Write buffer
+ seq.buf[0].data = write_data_buf;
+ seq.buf[0].len = len_write_data;
- if (I2CSPM_Transfer(obj->handle, &seq) != i2cTransferDone) {
- return I2C_MASTER_ERROR;
- }
- return I2C_MASTER_SUCCESS;
- } else {
+ // Read buffer
+ seq.buf[1].data = read_data_buf;
+ seq.buf[1].len = len_read_data;
+
+ if (I2CSPM_Transfer((sl_i2cspm_t *)obj->handle, &seq) != i2cTransferDone) {
return I2C_MASTER_ERROR;
}
+ return I2C_MASTER_SUCCESS;
+}
+
+static err_t _acquire(i2c_master_t *obj, bool obj_open_state)
+{
+ err_t status = ACQUIRE_SUCCESS;
+
+ if ((obj_open_state == true) && (_owner == obj)) {
+ return ACQUIRE_FAIL;
+ }
+
+ if (_owner != obj) {
+ _owner = obj;
+ }
+
+ return status;
}
void i2c_master_close(i2c_master_t *obj)
@@ -198,6 +213,8 @@ static void i2c_master_config_speed(i2c_master_t *obj)
uint32_t speed;
I2C_ClockHLR_TypeDef i2c_mode;
+ last_i2c_speed_used = obj->config.speed;
+
switch (obj->config.speed) {
default:
case I2C_MASTER_SPEED_STANDARD:
@@ -214,7 +231,7 @@ static void i2c_master_config_speed(i2c_master_t *obj)
break;
}
// Set reference clock to zero to get the default reference clock
- I2C_BusFreqSet(obj->handle, 0, speed, i2c_mode);
+ I2C_BusFreqSet((sl_i2cspm_t *)obj->handle, 0, speed, i2c_mode);
}
// ------------------------------------------------------------------------- END
diff --git a/driver/peripheral_drivers/mikroe/src/drv_i2c_master_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_i2c_master_si91x.c
new file mode 100644
index 00000000..ca96ff2f
--- /dev/null
+++ b/driver/peripheral_drivers/mikroe/src/drv_i2c_master_si91x.c
@@ -0,0 +1,299 @@
+/***************************************************************************//**
+ * @file drv_i2c_master_si91x.c
+ * @brief mikroSDK 2.0 Click Peripheral Drivers - I2C Master for Si91x
+ * @version 1.0.0
+ *******************************************************************************
+ * # License
+ * Copyright 2024 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#include "drv_i2c_master.h"
+#include "sl_si91x_i2c.h"
+#include "sl_status.h"
+
+#define TX_THRESHOLD 0 // tx threshold value
+#define RX_THRESHOLD 0 // rx threshold value
+
+static sl_i2c_config_t i2c_config = {
+ .mode = SL_I2C_LEADER_MODE,
+ .operating_mode = SL_I2C_STANDARD_MODE,
+ .transfer_type = SL_I2C_USING_INTERRUPT,
+ .i2c_callback = NULL,
+};
+
+static i2c_master_t *_owner = NULL;
+static uint32_t last_i2c_speed_used;
+
+static err_t _acquire(i2c_master_t *obj, bool obj_open_state);
+static err_t i2c_master_set_configuration(i2c_master_t *obj);
+static void wait_till_i2c_gets_idle(sl_i2c_instance_t i2c_instance);
+
+void i2c_master_configure_default(i2c_master_config_t *config)
+{
+ config->addr = 0;
+
+ config->sda = 0xFFFFFFFF;
+ config->scl = 0xFFFFFFFF;
+
+ config->speed = I2C_MASTER_SPEED_STANDARD;
+ config->timeout_pass_count = 10000;
+}
+
+err_t i2c_master_open(i2c_master_t *obj, i2c_master_config_t *config)
+{
+ sl_i2c_status_t i2c_status;
+ sl_i2c_instance_t i2c_handle = *(sl_i2c_instance_t *)obj->handle;
+
+ i2c_master_config_t *p_config = &obj->config;
+ memcpy(p_config, config, sizeof(i2c_master_config_t));
+
+ if (_acquire(obj, true) == ACQUIRE_FAIL) {
+ return I2C_MASTER_ERROR;
+ }
+
+ if (i2c_master_set_configuration(obj) != I2C_MASTER_SUCCESS) {
+ return I2C_MASTER_ERROR;
+ }
+ // Configuring RX and TX FIFO thresholds
+ i2c_status
+ = sl_i2c_driver_configure_fifo_threshold(i2c_handle,
+ TX_THRESHOLD,
+ RX_THRESHOLD);
+ if (i2c_status != SL_I2C_SUCCESS) {
+ return I2C_MASTER_ERROR;
+ }
+
+ return I2C_MASTER_SUCCESS;
+}
+
+err_t i2c_master_set_speed(i2c_master_t *obj, uint32_t speed)
+{
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return I2C_MASTER_ERROR;
+ }
+
+ obj->config.speed = speed;
+ // Configure i2c speed
+ return i2c_master_set_configuration(obj);
+}
+
+err_t i2c_master_set_timeout(i2c_master_t *obj, uint16_t timeout_pass_count)
+{
+ if (_acquire(obj, false) != ACQUIRE_FAIL) {
+ obj->config.timeout_pass_count = timeout_pass_count;
+ // TODO Set timeout
+ return I2C_MASTER_SUCCESS;
+ }
+
+ return I2C_MASTER_ERROR;
+}
+
+err_t i2c_master_set_slave_address(i2c_master_t *obj, uint8_t address)
+{
+ if (_acquire(obj, false) != ACQUIRE_FAIL) {
+ obj->config.addr = address;
+ return I2C_MASTER_SUCCESS;
+ }
+
+ return I2C_MASTER_ERROR;
+}
+
+err_t i2c_master_write(i2c_master_t *obj,
+ uint8_t *write_data_buf,
+ size_t len_write_data)
+{
+ sl_i2c_status_t i2c_status;
+ sl_i2c_instance_t i2c_handle = *(sl_i2c_instance_t *)obj->handle;
+
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return I2C_MASTER_ERROR;
+ }
+
+ if (last_i2c_speed_used != obj->config.speed) {
+ i2c_master_set_configuration(obj);
+ }
+
+ i2c_status = sl_i2c_driver_send_data_blocking(i2c_handle,
+ obj->config.addr,
+ write_data_buf,
+ len_write_data);
+ if (i2c_status != SL_I2C_SUCCESS) {
+ return I2C_MASTER_ERROR;
+ }
+
+ wait_till_i2c_gets_idle(i2c_handle);
+ return I2C_MASTER_SUCCESS;
+}
+
+err_t i2c_master_read(i2c_master_t *obj,
+ uint8_t *read_data_buf,
+ size_t len_read_data)
+{
+ sl_i2c_status_t i2c_status;
+ sl_i2c_instance_t i2c_handle = *(sl_i2c_instance_t *)obj->handle;
+
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return I2C_MASTER_ERROR;
+ }
+
+ if (last_i2c_speed_used != obj->config.speed) {
+ i2c_master_set_configuration(obj);
+ }
+
+ i2c_status
+ = sl_i2c_driver_receive_data_blocking(i2c_handle,
+ obj->config.addr,
+ read_data_buf,
+ len_read_data);
+ if (i2c_status != SL_I2C_SUCCESS) {
+ return I2C_MASTER_ERROR;
+ }
+ wait_till_i2c_gets_idle(i2c_handle);
+ return I2C_MASTER_SUCCESS;
+}
+
+err_t i2c_master_write_then_read(i2c_master_t *obj,
+ uint8_t *write_data_buf,
+ size_t len_write_data,
+ uint8_t *read_data_buf,
+ size_t len_read_data)
+{
+ sl_i2c_status_t i2c_status;
+ sl_i2c_instance_t i2c_handle = *(sl_i2c_instance_t *)obj->handle;
+
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return I2C_MASTER_ERROR;
+ }
+
+ if (last_i2c_speed_used != obj->config.speed) {
+ i2c_master_set_configuration(obj);
+ }
+
+ // Enabling combined format transfer, by enabling repeated start
+ sl_i2c_driver_enable_repeated_start(i2c_handle, TRUE);
+ i2c_status
+ = sl_i2c_driver_send_data_blocking(i2c_handle,
+ obj->config.addr,
+ write_data_buf,
+ len_write_data);
+ if (i2c_status != SL_I2C_SUCCESS) {
+ return I2C_MASTER_ERROR;
+ }
+
+ // Adding delay for synchronization before leader sends read request
+ for (uint32_t x = 0; x < 2500; x++) {
+ __NOP();
+ }
+ // Disabling repeated start before last cycle of transfer
+ sl_i2c_driver_enable_repeated_start(i2c_handle, FALSE);
+ i2c_status
+ = sl_i2c_driver_receive_data_blocking(i2c_handle,
+ obj->config.addr,
+ read_data_buf,
+ len_read_data);
+ if (i2c_status != SL_I2C_SUCCESS) {
+ return I2C_MASTER_ERROR;
+ }
+ wait_till_i2c_gets_idle(i2c_handle);
+ return I2C_MASTER_SUCCESS;
+}
+
+void i2c_master_close(i2c_master_t *obj)
+{
+ obj->handle = NULL;
+ _owner = NULL;
+}
+
+static err_t _acquire(i2c_master_t *obj, bool obj_open_state)
+{
+ err_t status = ACQUIRE_SUCCESS;
+
+ if ((obj_open_state == true) && (_owner == obj)) {
+ return ACQUIRE_FAIL;
+ }
+
+ if (_owner != obj) {
+ _owner = obj;
+ }
+
+ return status;
+}
+
+static err_t i2c_master_set_configuration(i2c_master_t *obj)
+{
+ sl_i2c_status_t i2c_status;
+ sl_i2c_instance_t i2c_handle = *(sl_i2c_instance_t *)obj->handle;
+
+ last_i2c_speed_used = obj->config.speed;
+
+ if (obj->config.speed >= I2C_MASTER_SPEED_FAST) {
+ i2c_config.operating_mode = SL_I2C_FAST_PLUS_MODE;
+ } else {
+ i2c_config.operating_mode = obj->config.speed + 1;
+ }
+
+ /**
+ * Re-Initializing I2C instance
+ * (update i2c config-strucure name as per instance used)
+ */
+ i2c_status = sl_i2c_driver_init(i2c_handle,
+ &i2c_config);
+ if (i2c_status != SL_I2C_SUCCESS) {
+ return I2C_MASTER_ERROR;
+ }
+
+ return I2C_MASTER_SUCCESS;
+}
+
+/*******************************************************************************
+ * Function to wait till I2C leader/follower comes to idle state
+ *
+ * @param i2c (I2C_TypeDef) Pointer to the I2C instance base address.
+ * @return none
+ ******************************************************************************/
+static void wait_till_i2c_gets_idle(sl_i2c_instance_t i2c_instance)
+{
+ I2C_TypeDef *i2c = I2C2;
+
+ if (i2c_instance == SL_I2C0) {
+ i2c = I2C0;
+ } else if (i2c_instance == SL_I2C1) {
+ i2c = I2C1;
+ } else if (i2c_instance == SL_I2C2) {
+ i2c = I2C2;
+ }
+ // waiting for I2C instance to be in idle state
+ while (i2c->IC_STATUS_b.ACTIVITY) {}
+}
+
+// ------------------------------------------------------------------------- END
diff --git a/driver/peripheral_drivers/mikroe/src/drv_pwm.c b/driver/peripheral_drivers/mikroe/src/drv_pwm.c
index 3044d59b..1955c278 100644
--- a/driver/peripheral_drivers/mikroe/src/drv_pwm.c
+++ b/driver/peripheral_drivers/mikroe/src/drv_pwm.c
@@ -1,6 +1,6 @@
/***************************************************************************//**
* @file drv_pwm.h
- * @brief mikroSDK 2.0 Click Peripheral Drivers
+ * @brief mikroSDK 2.0 Click Peripheral Drivers - PWM
* @version 1.0.0
*******************************************************************************
* # License
@@ -39,24 +39,12 @@
#include
#include "em_timer.h"
+#include "sl_pwm.h"
#include "drv_pwm.h"
static pwm_t *_owner = NULL;
-static err_t _acquire(pwm_t *obj, bool obj_open_state)
-{
- err_t status = ACQUIRE_SUCCESS;
-
- if ((obj_open_state == true) && (_owner == obj)) {
- return ACQUIRE_FAIL;
- }
-
- if (_owner != obj) {
- _owner = obj;
- }
-
- return status;
-}
+static err_t _acquire(pwm_t *obj, bool obj_open_state);
void pwm_configure_default(pwm_config_t *config)
{
@@ -66,21 +54,16 @@ void pwm_configure_default(pwm_config_t *config)
err_t pwm_open(pwm_t *obj, pwm_config_t *config)
{
- sl_pwm_config_t sl_pwm_config;
pwm_config_t *p_config = &obj->config;
memcpy(p_config, config, sizeof(pwm_config_t));
- sl_pwm_deinit(obj->handle);
- sl_pwm_config.frequency = config->freq_hz;
- sl_pwm_config.polarity = PWM_ACTIVE_HIGH;
- sl_pwm_init(obj->handle, &sl_pwm_config);
return _acquire(obj, true);
}
err_t pwm_start(pwm_t *obj)
{
if (_acquire(obj, false) != ACQUIRE_FAIL) {
- sl_pwm_start(obj->handle);
+ sl_pwm_start((sl_pwm_instance_t *)obj->handle);
return PWM_SUCCESS;
} else {
return PWM_ERROR;
@@ -90,7 +73,7 @@ err_t pwm_start(pwm_t *obj)
err_t pwm_stop(pwm_t *obj)
{
if (_acquire(obj, false) != ACQUIRE_FAIL) {
- sl_pwm_stop(obj->handle);
+ sl_pwm_stop((sl_pwm_instance_t *)obj->handle);
return PWM_SUCCESS;
} else {
return PWM_ERROR;
@@ -100,7 +83,7 @@ err_t pwm_stop(pwm_t *obj)
err_t pwm_set_duty(pwm_t *obj, float duty_ratio)
{
if (_acquire(obj, false) != ACQUIRE_FAIL) {
- sl_pwm_set_duty_cycle(obj->handle, duty_ratio * 100);
+ sl_pwm_set_duty_cycle((sl_pwm_instance_t *)obj->handle, duty_ratio * 100);
return PWM_SUCCESS;
} else {
return PWM_ERROR;
@@ -109,26 +92,46 @@ err_t pwm_set_duty(pwm_t *obj, float duty_ratio)
err_t pwm_set_freq(pwm_t *obj, uint32_t freq_hz)
{
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return PWM_ERROR;
+ }
+
sl_pwm_config_t sl_pwm_config;
- if (_acquire(obj, false) != ACQUIRE_FAIL) {
- obj->config.freq_hz = freq_hz;
+ obj->config.freq_hz = freq_hz;
- sl_pwm_deinit(obj->handle);
- sl_pwm_config.frequency = freq_hz;
- sl_pwm_config.polarity = PWM_ACTIVE_HIGH;
- sl_pwm_init(obj->handle, &sl_pwm_config);
- return PWM_SUCCESS;
- } else {
+ if (sl_pwm_deinit((sl_pwm_instance_t *)obj->handle) != SL_STATUS_OK) {
+ return PWM_ERROR;
+ }
+ sl_pwm_config.frequency = freq_hz;
+ sl_pwm_config.polarity = PWM_ACTIVE_HIGH;
+ if (sl_pwm_init((sl_pwm_instance_t *)obj->handle, &sl_pwm_config)
+ != SL_STATUS_OK) {
return PWM_ERROR;
}
+ return PWM_SUCCESS;
}
void pwm_close(pwm_t *obj)
{
- sl_pwm_deinit(obj->handle);
+ sl_pwm_deinit((sl_pwm_instance_t *)obj->handle);
obj->handle = NULL;
_owner = NULL;
}
+static err_t _acquire(pwm_t *obj, bool obj_open_state)
+{
+ err_t status = ACQUIRE_SUCCESS;
+
+ if ((obj_open_state == true) && (_owner == obj)) {
+ return ACQUIRE_FAIL;
+ }
+
+ if (_owner != obj) {
+ _owner = obj;
+ }
+
+ return status;
+}
+
// ------------------------------------------------------------------------- END
diff --git a/driver/peripheral_drivers/mikroe/src/drv_pwm_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_pwm_si91x.c
new file mode 100644
index 00000000..da508a82
--- /dev/null
+++ b/driver/peripheral_drivers/mikroe/src/drv_pwm_si91x.c
@@ -0,0 +1,183 @@
+/***************************************************************************//**
+ * @file drv_pwm.h
+ * @brief mikroSDK 2.0 Click Peripheral Drivers - PWM for Si91x
+ * @version 1.0.0
+ *******************************************************************************
+ * # License
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#include "drv_pwm.h"
+#include "sl_si91x_pwm.h"
+#include "sl_status.h"
+
+#define DUTY_CYCLE_UPDATE 0x01 // Enable duty cycle updating bit in register
+
+static pwm_t *_owner = NULL;
+
+static err_t _acquire(pwm_t *obj, bool obj_open_state);
+
+void pwm_configure_default(pwm_config_t *config)
+{
+ config->pin = 0xFFFFFFFF;
+ config->freq_hz = 0;
+}
+
+err_t pwm_open(pwm_t *obj, pwm_config_t *config)
+{
+ pwm_config_t *p_config = &obj->config;
+ sl_pwm_config_t *ptr = (sl_pwm_config_t *)obj->handle;
+
+ memcpy(p_config, config, sizeof(pwm_config_t));
+ if (_acquire(obj, true) == ACQUIRE_FAIL) {
+ return PWM_ERROR;
+ }
+
+ ptr->is_polarity_high = SL_POLARITYH_LOW;
+ // set the PWM configuration parameters
+ if (sl_si91x_pwm_set_configuration(ptr) != SL_STATUS_OK) {
+ return PWM_ERROR;
+ }
+
+ // set base time period control
+ if (sl_si91x_pwm_control_period(SL_TIME_PERIOD_POSTSCALE_1_1,
+ SL_TIME_PERIOD_PRESCALE_1,
+ ptr->channel) != SL_STATUS_OK) {
+ return PWM_ERROR;
+ }
+
+ // set duty cycle control parameters
+ if (sl_si91x_pwm_configure_duty_cycle(SL_DUTY_CYCLE_ENABLE,
+ DUTY_CYCLE_UPDATE,
+ ptr->channel) != SL_STATUS_OK) {
+ return PWM_ERROR;
+ }
+
+ return PWM_SUCCESS;
+}
+
+err_t pwm_start(pwm_t *obj)
+{
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return PWM_ERROR;
+ }
+
+ sl_pwm_config_t *ptr = (sl_pwm_config_t *)obj->handle;
+
+ if (sl_si91x_pwm_start(ptr->channel) != SL_STATUS_OK) {
+ return PWM_ERROR;
+ }
+ return PWM_SUCCESS;
+}
+
+err_t pwm_stop(pwm_t *obj)
+{
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return PWM_ERROR;
+ }
+
+ sl_pwm_config_t *ptr = (sl_pwm_config_t *)obj->handle;
+
+ if (sl_si91x_pwm_stop(ptr->channel) != SL_STATUS_OK) {
+ return PWM_ERROR;
+ }
+ return PWM_SUCCESS;
+}
+
+err_t pwm_set_duty(pwm_t *obj, float duty_ratio)
+{
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return PWM_ERROR;
+ }
+
+ sl_pwm_config_t *ptr = (sl_pwm_config_t *)obj->handle;
+ uint16_t time_period;
+ uint32_t ticks;
+
+ // Get time period
+ if (sl_si91x_pwm_get_time_period(ptr->channel,
+ &time_period) != SL_STATUS_OK) {
+ return PWM_ERROR;
+ }
+ ticks = (uint32_t)(time_period * (1 - duty_ratio));
+ // Set Duty cycle value for channel
+ if (sl_si91x_pwm_set_duty_cycle(ticks,
+ ptr->channel) != SL_STATUS_OK) {
+ return PWM_ERROR;
+ }
+ return PWM_SUCCESS;
+}
+
+err_t pwm_set_freq(pwm_t *obj, uint32_t freq_hz)
+{
+ if (_acquire(obj, false) == ACQUIRE_FAIL) {
+ return PWM_ERROR;
+ }
+
+ sl_pwm_config_t *ptr = (sl_pwm_config_t *)obj->handle;
+
+ obj->config.freq_hz = freq_hz;
+
+ ptr->is_polarity_high = SL_POLARITYH_LOW;
+ // Update PWM frequency into channel config
+ ptr->frequency = freq_hz;
+ // set the PWM configuration parameters
+ if (sl_si91x_pwm_set_configuration(ptr) != SL_STATUS_OK) {
+ return PWM_ERROR;
+ }
+ return PWM_SUCCESS;
+}
+
+void pwm_close(pwm_t *obj)
+{
+ sl_si91x_pwm_deinit();
+ obj->handle = NULL;
+ _owner = NULL;
+}
+
+static err_t _acquire(pwm_t *obj, bool obj_open_state)
+{
+ err_t status = ACQUIRE_SUCCESS;
+
+ if ((obj_open_state == true) && (_owner == obj)) {
+ return ACQUIRE_FAIL;
+ }
+
+ if (_owner != obj) {
+ _owner = obj;
+ }
+
+ return status;
+}
+
+// ------------------------------------------------------------------------- END
diff --git a/driver/peripheral_drivers/mikroe/src/drv_spi_master.c b/driver/peripheral_drivers/mikroe/src/drv_spi_master.c
index b0648e6a..fdeb410b 100644
--- a/driver/peripheral_drivers/mikroe/src/drv_spi_master.c
+++ b/driver/peripheral_drivers/mikroe/src/drv_spi_master.c
@@ -1,6 +1,6 @@
/***************************************************************************//**
* @file drv_spi_master.h
- * @brief mikroSDK 2.0 Click Peripheral Drivers
+ * @brief mikroSDK 2.0 Click Peripheral Drivers - SPI Master
* @version 1.0.0
*******************************************************************************
* # License
@@ -39,37 +39,18 @@
#include "drv_spi_master.h"
#include "drv_digital_out.h"
+#include "spidrv.h"
static spi_master_t *_owner = NULL;
+static uint32_t last_spi_speed_used;
+static spi_master_mode_t last_spi_mode_used;
static spi_master_chip_select_polarity_t spi_master_chip_select_polarity =
SPI_MASTER_CHIP_SELECT_DEFAULT_POLARITY;
-static err_t _acquire(spi_master_t *obj, bool obj_open_state)
-{
- if ((obj_open_state == true) && (_owner == obj)) {
- return ACQUIRE_FAIL;
- }
-
- if (_owner != obj) {
- _owner = obj;
- }
-
- return ACQUIRE_SUCCESS;
-}
-
-static void spi_master_get_init_data(spi_master_t *obj, SPIDRV_Init_t *initData)
-{
- SPIDRV_Init_t *p_initData = &obj->handle->initData;
- // Get SPI driver instance initialization structure.
- memcpy(initData, p_initData, sizeof(SPIDRV_Init_t));
-}
-
-static void spi_master_configure_gpio_pin(digital_out_t *out, pin_name_t name)
-{
- out->pin.base = (GPIO_Port_TypeDef) hal_gpio_port_index(name);
- out->pin.mask = 1 << hal_gpio_pin_index(name);
-}
+static err_t spi_master_set_config(spi_master_t *obj);
+static err_t _acquire(spi_master_t *obj, bool obj_open_state);
+static void spi_master_configure_gpio_pin(digital_out_t *out, pin_name_t name);
void spi_master_configure_default(spi_master_config_t *config)
{
@@ -146,8 +127,10 @@ err_t spi_master_set_speed(spi_master_t *obj, uint32_t speed)
}
obj->config.speed = speed;
+ last_spi_speed_used = speed;
// Set SPI bus bitrate.
- if (SPIDRV_SetBitrate(obj->handle, speed) != ECODE_EMDRV_SPIDRV_OK) {
+ if (SPIDRV_SetBitrate((SPIDRV_Handle_t)obj->handle, speed)
+ != ECODE_EMDRV_SPIDRV_OK) {
return SPI_MASTER_ERROR;
}
@@ -159,22 +142,13 @@ err_t spi_master_set_speed(spi_master_t *obj, uint32_t speed)
******************************************************************************/
err_t spi_master_set_mode(spi_master_t *obj, spi_master_mode_t mode)
{
- SPIDRV_Init_t initData;
-
if (_acquire(obj, false) != ACQUIRE_SUCCESS) {
return SPI_MASTER_ERROR;
}
obj->config.mode = mode;
- spi_master_get_init_data(obj, &initData);
- initData.clockMode = (SPIDRV_ClockMode_t) mode;
- // DeInitialize an SPI driver instance.
- SPIDRV_DeInit(obj->handle);
- // Initialize an SPI driver instance with new mode.
- SPIDRV_Init(obj->handle, &initData);
-
- return SPI_MASTER_SUCCESS;
+ return spi_master_set_config(obj);
}
/***************************************************************************//**
@@ -202,7 +176,23 @@ err_t spi_master_write(spi_master_t *obj,
return SPI_MASTER_ERROR;
}
- if (SPIDRV_MTransmitB(obj->handle, write_data_buffer,
+ if (last_spi_speed_used != obj->config.speed) {
+ last_spi_speed_used = obj->config.speed;
+ // Update SPI bus bitrate.
+ if (SPIDRV_SetBitrate((SPIDRV_Handle_t)obj->handle, last_spi_speed_used)
+ != ECODE_EMDRV_SPIDRV_OK) {
+ return SPI_MASTER_ERROR;
+ }
+ }
+
+ if (last_spi_mode_used != obj->config.mode) {
+ // Update the config mode
+ if (spi_master_set_config(obj) != SPI_MASTER_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+ }
+
+ if (SPIDRV_MTransmitB((SPIDRV_Handle_t)obj->handle, write_data_buffer,
write_data_length) != ECODE_EMDRV_SPIDRV_OK) {
return SPI_MASTER_ERROR;
}
@@ -222,18 +212,72 @@ err_t spi_master_read(spi_master_t *obj,
return SPI_MASTER_ERROR;
}
+ if (last_spi_speed_used != obj->config.speed) {
+ last_spi_speed_used = obj->config.speed;
+ // Update SPI bus bitrate.
+ if (SPIDRV_SetBitrate((SPIDRV_Handle_t)obj->handle, last_spi_speed_used)
+ != ECODE_EMDRV_SPIDRV_OK) {
+ return SPI_MASTER_ERROR;
+ }
+ }
+
+ if (last_spi_mode_used != obj->config.mode) {
+ // Update the config mode
+ if (spi_master_set_config(obj) != SPI_MASTER_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+ }
+
// The data transmit buffer will be populated with user-defined data
for (size_t i = 0; i < read_data_length; i++) {
write_data_buffer[i] = _owner->config.default_write_data;
}
- if (SPIDRV_MTransferB(obj->handle, write_data_buffer, read_data_buffer,
+ if (SPIDRV_MTransferB((SPIDRV_Handle_t)obj->handle, write_data_buffer,
+ read_data_buffer,
read_data_length) != ECODE_EMDRV_SPIDRV_OK) {
return SPI_MASTER_ERROR;
}
return SPI_MASTER_SUCCESS;
}
+/***************************************************************************//**
+ * Exchange bytes on SPI bus.
+ ******************************************************************************/
+err_t spi_master_exchange(spi_master_t *obj,
+ uint8_t *write_data_buffer,
+ uint8_t *read_data_buffer,
+ size_t exchange_data_length)
+{
+ if (_acquire(obj, false) != ACQUIRE_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+
+ if (last_spi_speed_used != obj->config.speed) {
+ last_spi_speed_used = obj->config.speed;
+ // Update SPI bus bitrate.
+ if (SPIDRV_SetBitrate((SPIDRV_Handle_t)obj->handle, last_spi_speed_used)
+ != ECODE_EMDRV_SPIDRV_OK) {
+ return SPI_MASTER_ERROR;
+ }
+ }
+
+ if (last_spi_mode_used != obj->config.mode) {
+ // Update the config mode
+ if (spi_master_set_config(obj) != SPI_MASTER_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+ }
+
+ if (SPIDRV_MTransferB((SPIDRV_Handle_t)obj->handle,
+ write_data_buffer,
+ read_data_buffer,
+ exchange_data_length) != ECODE_EMDRV_SPIDRV_OK) {
+ return SPI_MASTER_ERROR;
+ }
+ return SPI_MASTER_SUCCESS;
+}
+
/***************************************************************************//**
* Perform a sequence of SPI Master writes
* immediately followed by a SPI Master read.
@@ -244,12 +288,48 @@ err_t spi_master_write_then_read(spi_master_t *obj,
uint8_t *read_data_buffer,
size_t length_read_data)
{
+ size_t tx_len = length_write_data + length_read_data;
+ uint8_t tx_buffer[tx_len];
+ uint8_t rx_buffer[tx_len];
+
if (_acquire(obj, false) != ACQUIRE_SUCCESS) {
return SPI_MASTER_ERROR;
}
- spi_master_write(obj, write_data_buffer, length_write_data);
- spi_master_read(obj, read_data_buffer, length_read_data);
+ if (last_spi_speed_used != obj->config.speed) {
+ last_spi_speed_used = obj->config.speed;
+ // Update SPI bus bitrate.
+ if (SPIDRV_SetBitrate((SPIDRV_Handle_t)obj->handle, last_spi_speed_used)
+ != ECODE_EMDRV_SPIDRV_OK) {
+ return SPI_MASTER_ERROR;
+ }
+ }
+
+ if (last_spi_mode_used != obj->config.mode) {
+ // Update the config mode
+ if (spi_master_set_config(obj) != SPI_MASTER_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+ }
+
+ for (size_t i = 0; i < length_write_data; i++) {
+ tx_buffer[i] = write_data_buffer[i];
+ }
+ // The data transmit buffer will be populated with user-defined data
+ for (size_t i = length_write_data; i < tx_len; i++) {
+ tx_buffer[i] = _owner->config.default_write_data;
+ }
+
+ if (SPIDRV_MTransferB((SPIDRV_Handle_t)obj->handle,
+ tx_buffer,
+ rx_buffer,
+ tx_len) != ECODE_EMDRV_SPIDRV_OK) {
+ return SPI_MASTER_ERROR;
+ }
+
+ for (size_t i = 0; i < length_read_data; i++) {
+ read_data_buffer[i] = rx_buffer[i + length_write_data];
+ }
return SPI_MASTER_SUCCESS;
}
@@ -260,4 +340,47 @@ void spi_master_close(spi_master_t *obj)
_owner = NULL;
}
+static err_t _acquire(spi_master_t *obj, bool obj_open_state)
+{
+ if ((obj_open_state == true) && (_owner == obj)) {
+ return ACQUIRE_FAIL;
+ }
+
+ if (_owner != obj) {
+ _owner = obj;
+ }
+
+ return ACQUIRE_SUCCESS;
+}
+
+static void spi_master_configure_gpio_pin(digital_out_t *out, pin_name_t name)
+{
+ out->pin.base = (GPIO_Port_TypeDef) hal_gpio_port_index(name);
+ out->pin.mask = 1 << hal_gpio_pin_index(name);
+}
+
+static err_t spi_master_set_config(spi_master_t *obj)
+{
+ SPIDRV_Init_t initData;
+ SPIDRV_Handle_t ptr = (SPIDRV_Handle_t)obj->handle;
+
+ last_spi_mode_used = obj->config.mode;
+
+ // Get SPI driver instance initialization structure.
+ memcpy(&initData, &ptr->initData, sizeof(SPIDRV_Init_t));
+ initData.clockMode = (SPIDRV_ClockMode_t) obj->config.mode;
+ initData.bitRate = obj->config.speed;
+ // DeInitialize an SPI driver instance.
+ if (SPIDRV_DeInit((SPIDRV_Handle_t)obj->handle) != ECODE_EMDRV_SPIDRV_OK) {
+ return SPI_MASTER_ERROR;
+ }
+ // Initialize an SPI driver instance with new mode.
+ if (SPIDRV_Init((SPIDRV_Handle_t)obj->handle,
+ &initData) != ECODE_EMDRV_SPIDRV_OK) {
+ return SPI_MASTER_ERROR;
+ }
+
+ return SPI_MASTER_SUCCESS;
+}
+
// ------------------------------------------------------------------------- END
diff --git a/driver/peripheral_drivers/mikroe/src/drv_spi_master_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_spi_master_si91x.c
new file mode 100644
index 00000000..df755aa5
--- /dev/null
+++ b/driver/peripheral_drivers/mikroe/src/drv_spi_master_si91x.c
@@ -0,0 +1,434 @@
+/***************************************************************************//**
+ * @file drv_spi_master.h
+ * @brief mikroSDK 2.0 Click Peripheral Drivers - SPI Master for Si91x
+ * @version 1.0.0
+ *******************************************************************************
+ * # License
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#include "drv_spi_master.h"
+#include "drv_digital_out.h"
+#include "sl_si91x_gspi.h"
+
+#define GSPI_INTF_PLL_CLK 180000000 // Intf pll clock frequency
+#define GSPI_INTF_PLL_REF_CLK 40000000 // Intf pll reference clock freq
+#define GSPI_SOC_PLL_CLK 20000000 // Soc pll clock frequency
+#define GSPI_SOC_PLL_REF_CLK 40000000 // Soc pll reference clock freq
+#define GSPI_INTF_PLL_500_CTRL_VALUE 0xD900 // Intf pll control value
+#define GSPI_SOC_PLL_MM_COUNT_LIMIT 0xA4 // Soc pll count limit
+#define GSPI_DVISION_FACTOR 0 // Division factor
+#define GSPI_SWAP_READ_DATA 1 // true to enable swap read
+#define GSPI_SWAP_WRITE_DATA 0 // true to enable swap write
+#define GSPI_BITRATE 10000000 // Bitrate for setting
+#define GSPI_BIT_WIDTH 8 // Default Bit width
+
+static spi_master_t *_owner = NULL;
+static sl_gspi_handle_t gspi_driver_handle = NULL;
+static uint32_t last_spi_speed_used;
+static spi_master_mode_t last_spi_mode_used;
+
+extern sl_gspi_control_config_t gspi_configuration;
+
+static spi_master_chip_select_polarity_t spi_master_chip_select_polarity =
+ SPI_MASTER_CHIP_SELECT_DEFAULT_POLARITY;
+
+static void callback_event(uint32_t event);
+static err_t _acquire(spi_master_t *obj, bool obj_open_state);
+static void spi_master_configure_gpio_pin(digital_out_t *out, pin_name_t name);
+static err_t spi_master_set_configuration(spi_master_t *obj);
+
+void spi_master_configure_default(spi_master_config_t *config)
+{
+ config->default_write_data = 0;
+ config->sck = 0xFFFFFFFF;
+ config->miso = 0xFFFFFFFF;
+ config->mosi = 0xFFFFFFFF;
+ config->speed = 100000;
+ config->mode = SPI_MASTER_MODE_DEFAULT;
+}
+
+err_t spi_master_open(spi_master_t *obj, spi_master_config_t *config)
+{
+ sl_status_t status;
+ spi_master_config_t *p_config = &obj->config;
+ sl_gspi_clock_config_t clock_config = {
+ .soc_pll_mm_count_value = GSPI_SOC_PLL_MM_COUNT_LIMIT,
+ .intf_pll_500_control_value = GSPI_INTF_PLL_500_CTRL_VALUE,
+ .intf_pll_clock = GSPI_INTF_PLL_CLK,
+ .intf_pll_reference_clock = GSPI_INTF_PLL_REF_CLK,
+ .soc_pll_clock = GSPI_SOC_PLL_CLK,
+ .soc_pll_reference_clock = GSPI_SOC_PLL_REF_CLK,
+ .division_factor = GSPI_DVISION_FACTOR
+ };
+
+ memcpy(p_config, config, sizeof(spi_master_config_t));
+ if (_acquire(obj, true) == ACQUIRE_FAIL) {
+ return SPI_MASTER_ERROR;
+ }
+
+ // Configuration of clock with the default clock parameters
+ status = sl_si91x_gspi_configure_clock(&clock_config);
+ if (status != SL_STATUS_OK) {
+ return SPI_MASTER_ERROR;
+ }
+ // Pass the address of void pointer, it will be updated with the address
+ // of GSPI instance which can be used in other APIs.
+ status = sl_si91x_gspi_init(SL_GSPI_MASTER, &gspi_driver_handle);
+ if (status != SL_STATUS_OK) {
+ return SPI_MASTER_ERROR;
+ }
+
+ if (spi_master_set_configuration(obj) != SPI_MASTER_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+ // Register user callback function
+ status = sl_si91x_gspi_register_event_callback(gspi_driver_handle,
+ callback_event);
+ if (status != SL_STATUS_OK) {
+ return SPI_MASTER_ERROR;
+ }
+
+ // Validation for executing the API only once
+ status = sl_si91x_gspi_set_slave_number(GSPI_SLAVE_0);
+ if (status != SL_STATUS_OK) {
+ return SPI_MASTER_ERROR;
+ }
+
+ return SPI_MASTER_SUCCESS;
+}
+
+void spi_master_select_device(pin_name_t chip_select)
+{
+ digital_out_t struct_cs;
+
+ if (chip_select == 0xFFFFFFFF) {
+ return;
+ }
+
+ spi_master_configure_gpio_pin(&struct_cs, chip_select);
+
+ if (spi_master_chip_select_polarity
+ == SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_HIGH) {
+ digital_out_high(&struct_cs);
+ } else {
+ digital_out_low(&struct_cs);
+ }
+}
+
+void spi_master_deselect_device(pin_name_t chip_select)
+{
+ digital_out_t struct_cs;
+
+ if (chip_select == 0xFFFFFFFF) {
+ return;
+ }
+
+ spi_master_configure_gpio_pin(&struct_cs, chip_select);
+
+ if (spi_master_chip_select_polarity
+ == SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_HIGH) {
+ digital_out_low(&struct_cs);
+ } else {
+ digital_out_high(&struct_cs);
+ }
+}
+
+void spi_master_set_chip_select_polarity(
+ spi_master_chip_select_polarity_t polarity)
+{
+ if (polarity == SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_HIGH) {
+ spi_master_chip_select_polarity =
+ SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_HIGH;
+ } else {
+ spi_master_chip_select_polarity =
+ SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_LOW;
+ }
+}
+
+/***************************************************************************//**
+ * Set SPI Master driver communication speed.
+ ******************************************************************************/
+err_t spi_master_set_speed(spi_master_t *obj, uint32_t speed)
+{
+ if (_acquire(obj, false) != ACQUIRE_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+
+ obj->config.speed = speed;
+
+ return spi_master_set_configuration(obj);
+}
+
+/***************************************************************************//**
+ * Set SPI Master driver communication mode.
+ ******************************************************************************/
+err_t spi_master_set_mode(spi_master_t *obj, spi_master_mode_t mode)
+{
+ if (_acquire(obj, false) != ACQUIRE_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+
+ obj->config.mode = mode;
+
+ return spi_master_set_configuration(obj);
+}
+
+/***************************************************************************//**
+ * Set SPI Master driver default ( dummy ) write data.
+ ******************************************************************************/
+err_t spi_master_set_default_write_data(spi_master_t *obj,
+ uint8_t default_write_data)
+{
+ if (_acquire(obj, false) != ACQUIRE_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+
+ obj->config.default_write_data = default_write_data;
+ return SPI_MASTER_SUCCESS;
+}
+
+/***************************************************************************//**
+ * Write byte to SPI bus.
+ ******************************************************************************/
+err_t spi_master_write(spi_master_t *obj,
+ uint8_t *write_data_buffer,
+ size_t write_data_length)
+{
+ sl_status_t status;
+
+ if (_acquire(obj, false) != ACQUIRE_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+
+ if ((last_spi_speed_used != obj->config.speed)
+ || (last_spi_mode_used != obj->config.mode)) {
+ // Update the config
+ spi_master_set_configuration(obj);
+ }
+
+ status = sl_si91x_gspi_send_data(gspi_driver_handle,
+ write_data_buffer,
+ write_data_length);
+ if (status != SL_STATUS_OK) {
+ return SPI_MASTER_ERROR;
+ }
+ return SPI_MASTER_SUCCESS;
+}
+
+/***************************************************************************//**
+ * Read byte from SPI bus.
+ ******************************************************************************/
+err_t spi_master_read(spi_master_t *obj,
+ uint8_t *read_data_buffer,
+ size_t read_data_length)
+{
+ sl_status_t status;
+ uint8_t write_data_buffer[read_data_length];
+
+ if (_acquire(obj, false) != ACQUIRE_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+
+ if ((last_spi_speed_used != obj->config.speed)
+ || (last_spi_mode_used != obj->config.mode)) {
+ // Update the config
+ spi_master_set_configuration(obj);
+ }
+
+ // The data transmit buffer will be populated with user-defined data
+ for (size_t i = 0; i < read_data_length; i++) {
+ write_data_buffer[i] = _owner->config.default_write_data;
+ }
+
+ status = sl_si91x_gspi_transfer_data(gspi_driver_handle,
+ write_data_buffer,
+ read_data_buffer,
+ read_data_length);
+ if (status != SL_STATUS_OK) {
+ return SPI_MASTER_ERROR;
+ }
+ return SPI_MASTER_SUCCESS;
+}
+
+/***************************************************************************//**
+ * Exchange bytes on SPI bus.
+ ******************************************************************************/
+err_t spi_master_exchange(spi_master_t *obj,
+ uint8_t *write_data_buffer,
+ uint8_t *read_data_buffer,
+ size_t exchange_data_length)
+{
+ sl_status_t status;
+
+ if (_acquire(obj, false) != ACQUIRE_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+
+ if ((last_spi_speed_used != obj->config.speed)
+ || (last_spi_mode_used != obj->config.mode)) {
+ // Update the config
+ spi_master_set_configuration(obj);
+ }
+
+ status = sl_si91x_gspi_transfer_data(gspi_driver_handle,
+ write_data_buffer,
+ read_data_buffer,
+ exchange_data_length);
+ if (status != SL_STATUS_OK) {
+ return SPI_MASTER_ERROR;
+ }
+ return SPI_MASTER_SUCCESS;
+}
+
+/***************************************************************************//**
+ * Perform a sequence of SPI Master writes
+ * immediately followed by a SPI Master read.
+ ******************************************************************************/
+err_t spi_master_write_then_read(spi_master_t *obj,
+ uint8_t *write_data_buffer,
+ size_t length_write_data,
+ uint8_t *read_data_buffer,
+ size_t length_read_data)
+{
+ sl_status_t status;
+ size_t tx_len = length_write_data + length_read_data;
+ uint8_t tx_buffer[tx_len];
+ uint8_t rx_buffer[tx_len];
+
+ if (_acquire(obj, false) != ACQUIRE_SUCCESS) {
+ return SPI_MASTER_ERROR;
+ }
+
+ if ((last_spi_speed_used != obj->config.speed)
+ || (last_spi_mode_used != obj->config.mode)) {
+ // Update the config
+ spi_master_set_configuration(obj);
+ }
+
+ for (size_t i = 0; i < length_write_data; i++) {
+ tx_buffer[i] = write_data_buffer[i];
+ }
+ // The data transmit buffer will be populated with user-defined data
+ for (size_t i = length_write_data; i < tx_len; i++) {
+ tx_buffer[i] = _owner->config.default_write_data;
+ }
+ status = sl_si91x_gspi_transfer_data(gspi_driver_handle,
+ tx_buffer,
+ rx_buffer,
+ tx_len);
+ if (status != SL_STATUS_OK) {
+ return SPI_MASTER_ERROR;
+ }
+
+ for (size_t i = 0; i < length_read_data; i++) {
+ read_data_buffer[i] = rx_buffer[i + length_write_data];
+ }
+
+ return SPI_MASTER_SUCCESS;
+}
+
+void spi_master_close(spi_master_t *obj)
+{
+ obj->handle = NULL;
+ _owner = NULL;
+}
+
+static err_t _acquire(spi_master_t *obj, bool obj_open_state)
+{
+ if ((obj_open_state == true) && (_owner == obj)) {
+ return ACQUIRE_FAIL;
+ }
+
+ if (_owner != obj) {
+ _owner = obj;
+ }
+
+ return ACQUIRE_SUCCESS;
+}
+
+static void spi_master_configure_gpio_pin(digital_out_t *out, pin_name_t name)
+{
+ out->pin.base = hal_gpio_port_index(name);
+ out->pin.mask = hal_gpio_pin_index(name);
+}
+
+static err_t spi_master_set_configuration(spi_master_t *obj)
+{
+ sl_gspi_control_config_t gspi_config = {
+ .bit_width = GSPI_BIT_WIDTH,
+ .bitrate = obj->config.speed,
+ .clock_mode = obj->config.mode,
+ .slave_select_mode = SL_GSPI_MASTER_HW_OUTPUT,
+ .swap_read = GSPI_SWAP_READ_DATA,
+ .swap_write = GSPI_SWAP_WRITE_DATA
+ };
+
+ last_spi_speed_used = obj->config.speed;
+ last_spi_mode_used = obj->config.mode;
+
+ // Overwrite gspi default
+ gspi_configuration = gspi_config;
+
+ /**
+ * Configuration of all other parameters that are required by GSPI
+ * gspi_configuration structure is from sl_si91x_gspi_init.h file.
+ * The user can modify this structure with the configuration of
+ * his choice by filling this structure.
+ */
+ if (sl_si91x_gspi_set_configuration(gspi_driver_handle,
+ &gspi_config) != SL_STATUS_OK) {
+ return SPI_MASTER_ERROR;
+ }
+
+ return SPI_MASTER_SUCCESS;
+}
+
+/*******************************************************************************
+ * Callback event function
+ * It is responsible for the event which are triggered by GSPI interface
+ * It updates the respective member of the structure as the event is triggered.
+ ******************************************************************************/
+static void callback_event(uint32_t event)
+{
+ switch (event) {
+ case SL_GSPI_TRANSFER_COMPLETE:
+ break;
+ case SL_GSPI_DATA_LOST:
+ break;
+ case SL_GSPI_MODE_FAULT:
+ break;
+ }
+}
+
+// ------------------------------------------------------------------------- END
diff --git a/driver/public/mikroe/alcohol_mq3/config/brd2703a/mikroe_alcohol_mq3_config.h b/driver/public/mikroe/alcohol_mq3/config/brd2703a/mikroe_alcohol_mq3_config.h
index 8e9208aa..0e6e0ce1 100644
--- a/driver/public/mikroe/alcohol_mq3/config/brd2703a/mikroe_alcohol_mq3_config.h
+++ b/driver/public/mikroe/alcohol_mq3/config/brd2703a/mikroe_alcohol_mq3_config.h
@@ -40,6 +40,8 @@
#ifndef MIKORE_ALCOHOL_MQ3_CONFIG_H_
#define MIKORE_ALCOHOL_MQ3_CONFIG_H_
+#include "em_gpio.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -56,6 +58,5 @@ extern "C" {
#ifdef __cplusplus
}
-
#endif
-#endif /* MIKORE_ALCOHOL_MQ3_CONFIG_H_ */
+#endif // MIKORE_ALCOHOL_MQ3_CONFIG_H_
diff --git a/driver/public/mikroe/alcohol_mq3/config/brd4108a/mikroe_alcohol_mq3_config.h b/driver/public/mikroe/alcohol_mq3/config/brd4108a/mikroe_alcohol_mq3_config.h
index 8e9208aa..0e6e0ce1 100644
--- a/driver/public/mikroe/alcohol_mq3/config/brd4108a/mikroe_alcohol_mq3_config.h
+++ b/driver/public/mikroe/alcohol_mq3/config/brd4108a/mikroe_alcohol_mq3_config.h
@@ -40,6 +40,8 @@
#ifndef MIKORE_ALCOHOL_MQ3_CONFIG_H_
#define MIKORE_ALCOHOL_MQ3_CONFIG_H_
+#include "em_gpio.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -56,6 +58,5 @@ extern "C" {
#ifdef __cplusplus
}
-
#endif
-#endif /* MIKORE_ALCOHOL_MQ3_CONFIG_H_ */
+#endif // MIKORE_ALCOHOL_MQ3_CONFIG_H_
diff --git a/driver/public/mikroe/alcohol_mq3/config/brd4314a/mikroe_alcohol_mq3_config.h b/driver/public/mikroe/alcohol_mq3/config/brd4314a/mikroe_alcohol_mq3_config.h
index 8e9208aa..0e6e0ce1 100644
--- a/driver/public/mikroe/alcohol_mq3/config/brd4314a/mikroe_alcohol_mq3_config.h
+++ b/driver/public/mikroe/alcohol_mq3/config/brd4314a/mikroe_alcohol_mq3_config.h
@@ -40,6 +40,8 @@
#ifndef MIKORE_ALCOHOL_MQ3_CONFIG_H_
#define MIKORE_ALCOHOL_MQ3_CONFIG_H_
+#include "em_gpio.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -56,6 +58,5 @@ extern "C" {
#ifdef __cplusplus
}
-
#endif
-#endif /* MIKORE_ALCOHOL_MQ3_CONFIG_H_ */
+#endif // MIKORE_ALCOHOL_MQ3_CONFIG_H_
diff --git a/driver/public/mikroe/alcohol_mq3/config/brd4338a/mikroe_alcohol_mq3_config.h b/driver/public/mikroe/alcohol_mq3/config/brd4338a/mikroe_alcohol_mq3_config.h
new file mode 100644
index 00000000..a3a2b45e
--- /dev/null
+++ b/driver/public/mikroe/alcohol_mq3/config/brd4338a/mikroe_alcohol_mq3_config.h
@@ -0,0 +1,43 @@
+/***************************************************************************//**
+ * @file mikroe_alcohol_mq3_config.h
+ * @brief Mikroe Alcohol MQ3 Configuration
+ * @version 1.2.0
+ *******************************************************************************
+ * # License
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#ifndef MIKORE_ALCOHOL_MQ3_CONFIG_H_
+#define MIKORE_ALCOHOL_MQ3_CONFIG_H_
+
+#endif // MIKORE_ALCOHOL_MQ3_CONFIG_H_
diff --git a/driver/public/mikroe/alcohol_mq3/config/other/mikroe_alcohol_mq3_config.h b/driver/public/mikroe/alcohol_mq3/config/other/mikroe_alcohol_mq3_config.h
index 4e98bda5..6d0b90a5 100644
--- a/driver/public/mikroe/alcohol_mq3/config/other/mikroe_alcohol_mq3_config.h
+++ b/driver/public/mikroe/alcohol_mq3/config/other/mikroe_alcohol_mq3_config.h
@@ -40,6 +40,8 @@
#ifndef MIKORE_ALCOHOL_MQ3_CONFIG_H_
#define MIKORE_ALCOHOL_MQ3_CONFIG_H_
+#include "em_gpio.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -49,7 +51,7 @@ extern "C" {
// MQ3_ANALOG_OUTPUT
// $[GPIO_MQ3_ANALOG_OUTPUT]
#warning "AN pin for MQ3 is not configured"
-// #define MQ3_ANALOG_OUTPUT_PORT gpioPortB
+// #define MQ3_ANALOG_OUTPUT_PORT 0
// #define MQ3_ANALOG_OUTPUT_PIN 0
// [GPIO_MQ3_ANALOG_OUTPUT]$
@@ -57,6 +59,5 @@ extern "C" {
#ifdef __cplusplus
}
-
#endif
-#endif /* MIKORE_ALCOHOL_MQ3_CONFIG_H_ */
+#endif // MIKORE_ALCOHOL_MQ3_CONFIG_H_
diff --git a/driver/public/mikroe/alcohol_mq3/inc/mikroe_alcohol_mq3.h b/driver/public/mikroe/alcohol_mq3/inc/mikroe_alcohol_mq3.h
index a2ed47c5..eb70c806 100644
--- a/driver/public/mikroe/alcohol_mq3/inc/mikroe_alcohol_mq3.h
+++ b/driver/public/mikroe/alcohol_mq3/inc/mikroe_alcohol_mq3.h
@@ -39,25 +39,13 @@
#ifndef MIKROE_ALCOHOL_MQ3_H_
#define MIKROE_ALCOHOL_MQ3_H_
-#include "em_cmu.h"
#include "sl_status.h"
-
-#if defined(_SILICON_LABS_32B_SERIES_1)
-#include "em_adc.h"
-#elif defined(_SILICON_LABS_32B_SERIES_2)
-#include "em_iadc.h"
-#endif
+#include "drv_analog_in.h"
#ifdef __cplusplus
extern "C" {
#endif
-#if defined(_SILICON_LABS_32B_SERIES_1)
-typedef ADC_TypeDef adc_t;
-#elif defined(_SILICON_LABS_32B_SERIES_2)
-typedef IADC_TypeDef adc_t;
-#endif
-
/**
* @brief Alcohol configuration object setup function.
* @details This function initializes click configuration structure to initial
@@ -77,7 +65,7 @@ void mikroe_mq3_setup(void);
* See #err_t definition for detailed explanation.
* @note None.
*/
-sl_status_t mikroe_mq3_init(adc_t *handle);
+sl_status_t mikroe_mq3_init(mikroe_adc_handle_t handle);
/**
* @brief Alcohol read AN pin value function.
@@ -105,4 +93,8 @@ sl_status_t mikroe_mq3_read_an_pin_value(uint16_t *data_out);
*/
sl_status_t mikroe_mq3_read_an_pin_voltage(float *data_out);
-#endif /* MIKROE_ALCOHOL_MQ3_H_ */
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MIKROE_ALCOHOL_MQ3_H_
diff --git a/driver/public/mikroe/alcohol_mq3/src/mikroe_alcohol_mq3.c b/driver/public/mikroe/alcohol_mq3/src/mikroe_alcohol_mq3.c
index 5b8a2b89..d8826ee7 100644
--- a/driver/public/mikroe/alcohol_mq3/src/mikroe_alcohol_mq3.c
+++ b/driver/public/mikroe/alcohol_mq3/src/mikroe_alcohol_mq3.c
@@ -39,7 +39,6 @@
#include
#include "mikroe_alcohol_mq3.h"
-#include "third_party_hw_drivers_helpers.h"
#include "mikroe_alcohol_mq3_config.h"
#include "alcohol.h"
@@ -51,15 +50,13 @@ void mikroe_mq3_setup(void)
alcohol_cfg_setup(&alcohol_cfg);
}
-sl_status_t mikroe_mq3_init(adc_t *handle)
+sl_status_t mikroe_mq3_init(mikroe_adc_handle_t handle)
{
if (NULL == handle) {
return SL_STATUS_INVALID_HANDLE;
}
alcohol.adc.handle = handle;
- THIRD_PARTY_HW_DRV_RETCODE_INIT();
-
alcohol_cfg_setup(&alcohol_cfg);
#if defined(MQ3_ANALOG_OUTPUT_PORT) && defined(MQ3_ANALOG_OUTPUT_PIN)
@@ -67,9 +64,11 @@ sl_status_t mikroe_mq3_init(adc_t *handle)
MQ3_ANALOG_OUTPUT_PIN);
#endif
- THIRD_PARTY_HW_DRV_RETCODE_TEST(alcohol_init(&alcohol, &alcohol_cfg));
+ if (alcohol_init(&alcohol, &alcohol_cfg) != ALCOHOL_OK) {
+ return SL_STATUS_INITIALIZATION;
+ }
- return THIRD_PARTY_HW_DRV_RETCODE_VALUE;
+ return SL_STATUS_OK;
}
sl_status_t mikroe_mq3_read_an_pin_value(uint16_t *data_out)
@@ -77,12 +76,12 @@ sl_status_t mikroe_mq3_read_an_pin_value(uint16_t *data_out)
if (NULL == data_out) {
return SL_STATUS_INVALID_PARAMETER;
}
- THIRD_PARTY_HW_DRV_RETCODE_INIT();
- THIRD_PARTY_HW_DRV_RETCODE_TEST(alcohol_read_an_pin_value(&alcohol,
- data_out));
+ if (alcohol_read_an_pin_value(&alcohol, data_out) != ALCOHOL_OK) {
+ return SL_STATUS_FAIL;
+ }
- return THIRD_PARTY_HW_DRV_RETCODE_VALUE;
+ return SL_STATUS_OK;
}
sl_status_t mikroe_mq3_read_an_pin_voltage(float *data_out)
@@ -90,10 +89,10 @@ sl_status_t mikroe_mq3_read_an_pin_voltage(float *data_out)
if (NULL == data_out) {
return SL_STATUS_INVALID_PARAMETER;
}
- THIRD_PARTY_HW_DRV_RETCODE_INIT();
- THIRD_PARTY_HW_DRV_RETCODE_TEST(alcohol_read_an_pin_voltage(&alcohol,
- data_out));
+ if (alcohol_read_an_pin_voltage(&alcohol, data_out) != ALCOHOL_OK) {
+ return SL_STATUS_FAIL;
+ }
- return THIRD_PARTY_HW_DRV_RETCODE_VALUE;
+ return SL_STATUS_OK;
}
diff --git a/driver/public/mikroe/buzz2_cmt_8540s_smt/inc/mikroe_cmt_8540s_smt.h b/driver/public/mikroe/buzz2_cmt_8540s_smt/inc/mikroe_cmt_8540s_smt.h
index 71fef6ef..b638bf5d 100644
--- a/driver/public/mikroe/buzz2_cmt_8540s_smt/inc/mikroe_cmt_8540s_smt.h
+++ b/driver/public/mikroe/buzz2_cmt_8540s_smt/inc/mikroe_cmt_8540s_smt.h
@@ -41,7 +41,7 @@
#define MIKROE_CMT_8540S_SMT_H_
#include "sl_status.h"
-#include "sl_pwm.h"
+#include "drv_pwm.h"
#ifdef __cplusplus
extern "C" {
@@ -174,7 +174,7 @@ extern "C" {
* SL_STATUS_OK Successful initialization.
* SL_STATUS_FAIL Initialization failed.
******************************************************************************/
-sl_status_t mikroe_cmt_8540s_smt_init(sl_pwm_instance_t *pwm_instance);
+sl_status_t mikroe_cmt_8540s_smt_init(mikroe_pwm_handle_t pwm_instance);
/***************************************************************************//**
* @brief
@@ -188,7 +188,7 @@ sl_status_t mikroe_cmt_8540s_smt_init(sl_pwm_instance_t *pwm_instance);
* SL_STATUS_INVALID_PARAMETER if pwm_instance is null.
******************************************************************************/
sl_status_t mikroe_cmt_8540s_smt_set_pwm_instance(
- sl_pwm_instance_t *pwm_instance);
+ mikroe_pwm_handle_t pwm_instance);
/***************************************************************************//**
* @brief
@@ -248,4 +248,4 @@ void mikroe_cmt_8540s_smt_play_sound (uint16_t freq,
#endif
/** @} (end addtogroup cmt_8540s_smt) */
-#endif /* MIKROE_CMT_8540S_SMT_H_ */
+#endif // MIKROE_CMT_8540S_SMT_H_
diff --git a/driver/public/mikroe/buzz2_cmt_8540s_smt/src/mikroe_cmt_8540s_smt.c b/driver/public/mikroe/buzz2_cmt_8540s_smt/src/mikroe_cmt_8540s_smt.c
index b1020042..62b7fdf2 100644
--- a/driver/public/mikroe/buzz2_cmt_8540s_smt/src/mikroe_cmt_8540s_smt.c
+++ b/driver/public/mikroe/buzz2_cmt_8540s_smt/src/mikroe_cmt_8540s_smt.c
@@ -37,35 +37,34 @@
*
******************************************************************************/
-#include "stddef.h"
-#include "third_party_hw_drivers_helpers.h"
+#include
#include "mikroe_cmt_8540s_smt.h"
#include "buzz2.h"
static buzz2_t buzz2;
static buzz2_cfg_t buzz2_cfg;
-sl_status_t mikroe_cmt_8540s_smt_init(sl_pwm_instance_t *pwm_instance)
+sl_status_t mikroe_cmt_8540s_smt_init(mikroe_pwm_handle_t pwm_instance)
{
if (NULL == pwm_instance) {
return SL_STATUS_INVALID_PARAMETER;
}
- THIRD_PARTY_HW_DRV_RETCODE_INIT();
-
// Configure default i2csmp instance
buzz2.pwm.handle = pwm_instance;
// Call basic setup functions
buzz2_cfg_setup(&buzz2_cfg);
- THIRD_PARTY_HW_DRV_RETCODE_TEST(buzz2_init(&buzz2, &buzz2_cfg));
+ if (buzz2_init(&buzz2, &buzz2_cfg) != PWM_SUCCESS) {
+ return SL_STATUS_INITIALIZATION;
+ }
- return THIRD_PARTY_HW_DRV_RETCODE_VALUE;
+ return SL_STATUS_OK;
}
sl_status_t mikroe_cmt_8540s_smt_set_pwm_instance(
- sl_pwm_instance_t *pwm_instance)
+ mikroe_pwm_handle_t pwm_instance)
{
if (NULL == pwm_instance) {
return SL_STATUS_INVALID_PARAMETER;
diff --git a/driver/public/mikroe/co_mq7/src/mikroe_mq7.c b/driver/public/mikroe/co_mq7/src/mikroe_mq7.c
index 68bf71e3..3f9c6f26 100644
--- a/driver/public/mikroe/co_mq7/src/mikroe_mq7.c
+++ b/driver/public/mikroe/co_mq7/src/mikroe_mq7.c
@@ -37,12 +37,19 @@
*
******************************************************************************/
+#include
+#include "em_device.h"
#include "sl_status.h"
-#include "stddef.h"
#include "third_party_hw_drivers_helpers.h"
#include "co.h"
#include "mikroe_mq7_config.h"
+#if defined(_SILICON_LABS_32B_SERIES_1)
+#include "em_adc.h"
+#elif defined(_SILICON_LABS_32B_SERIES_2)
+#include "em_iadc.h"
+#endif
+
static co_t co;
static co_cfg_t co_cfg;
diff --git a/driver/public/mikroe/e_paper_154_inch/inc/mikroe_e_paper_154_inch.h b/driver/public/mikroe/e_paper_154_inch/inc/mikroe_e_paper_154_inch.h
index eccd6783..3593bd23 100644
--- a/driver/public/mikroe/e_paper_154_inch/inc/mikroe_e_paper_154_inch.h
+++ b/driver/public/mikroe/e_paper_154_inch/inc/mikroe_e_paper_154_inch.h
@@ -43,6 +43,7 @@
// Includes
// -----------------------------------------------------------------------------
+#include "sl_status.h"
#include "eink_154inch.h"
#include "spidrv.h"
diff --git a/driver/public/mikroe/oledw_ssd1306/config/brd2703a/mikroe_ssd1306_config.h b/driver/public/mikroe/oledw_ssd1306/config/brd2703a/mikroe_ssd1306_config.h
index 4ef40167..bbb3d670 100644
--- a/driver/public/mikroe/oledw_ssd1306/config/brd2703a/mikroe_ssd1306_config.h
+++ b/driver/public/mikroe/oledw_ssd1306/config/brd2703a/mikroe_ssd1306_config.h
@@ -43,6 +43,8 @@
extern "C" {
#endif
+#include "em_gpio.h"
+
#define OLED_DISPLAY_64_48 0
#define OLED_DISPLAY_96_39 1
#define OLED_DISPLAY_128_32 2
@@ -50,6 +52,21 @@ extern "C" {
// <<< Use Configuration Wizard in Context Menu >>>
+//MIKROE SPI SSD1306 Configuration
+
+// MIKROE SPI SSD1306 UC Configuration
+// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC).
+// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration.
+// Default: 0
+#define MIKROE_SPI_SSD1306_UC 0
+
+// Bit Rate (Bits/Second) <1-116000000>
+// Default: 10000000
+#define MIKROE_SPI_SSD1306_BITRATE 10000000
+
+//
+//
+
// Screen
// OLED Screen Resolution
@@ -87,6 +104,12 @@ extern "C" {
// <<< sl:start pin_tool >>>
+// SSD1306_CS
+// $[GPIO_SSD1306_CS]
+// #define SSD1306_CS_PORT 0
+// #define SSD1306_CS_PIN 0
+// [GPIO_SSD1306_CS]$
+
// SSD1306_DC
// $[GPIO_SSD1306_DC]
#define SSD1306_DC_PORT gpioPortA
@@ -105,4 +128,4 @@ extern "C" {
}
#endif
-#endif /* SSD1306_SPI_CONFIG_H_ */
+#endif // SSD1306_SPI_CONFIG_H_
diff --git a/driver/public/mikroe/oledw_ssd1306/config/brd4108a/mikroe_ssd1306_config.h b/driver/public/mikroe/oledw_ssd1306/config/brd4108a/mikroe_ssd1306_config.h
index 25e56b5c..3e660eba 100644
--- a/driver/public/mikroe/oledw_ssd1306/config/brd4108a/mikroe_ssd1306_config.h
+++ b/driver/public/mikroe/oledw_ssd1306/config/brd4108a/mikroe_ssd1306_config.h
@@ -43,6 +43,8 @@
extern "C" {
#endif
+#include "em_gpio.h"
+
#define OLED_DISPLAY_64_48 0
#define OLED_DISPLAY_96_39 1
#define OLED_DISPLAY_128_32 2
@@ -50,6 +52,21 @@ extern "C" {
// <<< Use Configuration Wizard in Context Menu >>>
+//MIKROE SPI SSD1306 Configuration
+
+// MIKROE SPI SSD1306 UC Configuration
+// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC).
+// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration.
+// Default: 0
+#define MIKROE_SPI_SSD1306_UC 0
+
+// Bit Rate (Bits/Second) <1-116000000>
+// Default: 10000000
+#define MIKROE_SPI_SSD1306_BITRATE 10000000
+
+//
+//
+
// Screen
// OLED Screen Resolution
@@ -87,6 +104,12 @@ extern "C" {
// <<< sl:start pin_tool >>>
+// SSD1306_CS
+// $[GPIO_SSD1306_CS]
+// #define SSD1306_CS_PORT 0
+// #define SSD1306_CS_PIN 0
+// [GPIO_SSD1306_CS]$
+
// SSD1306_DC
// $[GPIO_SSD1306_DC]
#define SSD1306_DC_PORT gpioPortB
@@ -105,4 +128,4 @@ extern "C" {
}
#endif
-#endif /* SSD1306_SPI_CONFIG_H_ */
+#endif // SSD1306_SPI_CONFIG_H_
diff --git a/driver/public/mikroe/oledw_ssd1306/config/brd4314a/mikroe_ssd1306_config.h b/driver/public/mikroe/oledw_ssd1306/config/brd4314a/mikroe_ssd1306_config.h
index 25e56b5c..3e660eba 100644
--- a/driver/public/mikroe/oledw_ssd1306/config/brd4314a/mikroe_ssd1306_config.h
+++ b/driver/public/mikroe/oledw_ssd1306/config/brd4314a/mikroe_ssd1306_config.h
@@ -43,6 +43,8 @@
extern "C" {
#endif
+#include "em_gpio.h"
+
#define OLED_DISPLAY_64_48 0
#define OLED_DISPLAY_96_39 1
#define OLED_DISPLAY_128_32 2
@@ -50,6 +52,21 @@ extern "C" {
// <<< Use Configuration Wizard in Context Menu >>>
+//MIKROE SPI SSD1306 Configuration
+
+// MIKROE SPI SSD1306 UC Configuration
+// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC).
+// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration.
+// Default: 0
+#define MIKROE_SPI_SSD1306_UC 0
+
+// Bit Rate (Bits/Second) <1-116000000>
+// Default: 10000000
+#define MIKROE_SPI_SSD1306_BITRATE 10000000
+
+//
+//
+
// Screen
// OLED Screen Resolution
@@ -87,6 +104,12 @@ extern "C" {
// <<< sl:start pin_tool >>>
+// SSD1306_CS
+// $[GPIO_SSD1306_CS]
+// #define SSD1306_CS_PORT 0
+// #define SSD1306_CS_PIN 0
+// [GPIO_SSD1306_CS]$
+
// SSD1306_DC
// $[GPIO_SSD1306_DC]
#define SSD1306_DC_PORT gpioPortB
@@ -105,4 +128,4 @@ extern "C" {
}
#endif
-#endif /* SSD1306_SPI_CONFIG_H_ */
+#endif // SSD1306_SPI_CONFIG_H_
diff --git a/driver/public/mikroe/oledw_ssd1306/config/brd4338a/mikroe_ssd1306_config.h b/driver/public/mikroe/oledw_ssd1306/config/brd4338a/mikroe_ssd1306_config.h
new file mode 100644
index 00000000..288c0976
--- /dev/null
+++ b/driver/public/mikroe/oledw_ssd1306/config/brd4338a/mikroe_ssd1306_config.h
@@ -0,0 +1,129 @@
+/***************************************************************************//**
+ * @file micro_oled_ssd1306_config.h
+ * @brief Micro OLED SSD1306 Configuration
+ * @version 1.0.0
+ *******************************************************************************
+ * # License
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+#ifndef SSD1306_SPI_CONFIG_H_
+#define SSD1306_SPI_CONFIG_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define OLED_DISPLAY_64_48 0
+#define OLED_DISPLAY_96_39 1
+#define OLED_DISPLAY_128_32 2
+#define OLED_DISPLAY_128_64 3
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+//MIKROE SPI SSD1306 Configuration
+
+// MIKROE SPI SSD1306 UC Configuration
+// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC).
+// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration.
+// Default: 0
+#define MIKROE_SPI_SSD1306_UC 0
+
+// Bit Rate (Bits/Second) <1-116000000>
+// Default: 10000000
+#define MIKROE_SPI_SSD1306_BITRATE 10000000
+
+//
+//
+
+// Screen
+
+// OLED Screen Resolution
+// 64x48
+// 96x39
+// 128x32
+// 128x64
+// Default: 64x48
+// The screen width parameter is used
+// to configure display driver.
+#define CONFIG_OLED_DISPLAY_RESOLUTION OLED_DISPLAY_96_39
+
+//
+// <<< end of configuration section >>>
+
+#if (CONFIG_OLED_DISPLAY_RESOLUTION == OLED_DISPLAY_64_48)
+#define CONFIG_OLED_DISPLAY_64_48
+#define SSD1306_DISPLAY_WIDTH 64
+#define SSD1306_DISPLAY_HEIGHT 48
+#define SSD1306_USE_PAGE_ADDRESSING_MODE
+#elif (CONFIG_OLED_DISPLAY_RESOLUTION == OLED_DISPLAY_96_39)
+#define CONFIG_OLED_DISPLAY_96_39
+#define SSD1306_DISPLAY_WIDTH 96
+#define SSD1306_DISPLAY_HEIGHT 39
+#define SSD1306_USE_PAGE_ADDRESSING_MODE
+#elif (CONFIG_OLED_DISPLAY_RESOLUTION == OLED_DISPLAY_128_32)
+#define CONFIG_OLED_DISPLAY_128_32
+#define SSD1306_DISPLAY_WIDTH 128
+#define SSD1306_DISPLAY_HEIGHT 32
+#elif (CONFIG_OLED_DISPLAY_RESOLUTION == OLED_DISPLAY_128_64)
+#define CONFIG_OLED_DISPLAY_128_64
+#define SSD1306_DISPLAY_WIDTH 128
+#define SSD1306_DISPLAY_HEIGHT 64
+#endif
+
+// <<< sl:start pin_tool >>>
+
+// SSD1306_CS
+// $[GPIO_SSD1306_CS]
+// #define SSD1306_CS_PORT 0
+// #define SSD1306_CS_PIN 0
+// [GPIO_SSD1306_CS]$
+
+// SSD1306_DC
+// $[GPIO_SSD1306_DC]
+#define SSD1306_DC_PORT 0
+#define SSD1306_DC_PIN 47
+// [GPIO_SSD1306_DC]$
+
+// SSD1306_RST
+// $[GPIO_SSD1306_RST]
+#define SSD1306_RST_PORT 0
+#define SSD1306_RST_PIN 46
+// [GPIO_SSD1306_RST]$
+
+// <<< sl:end pin_tool >>>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SSD1306_SPI_CONFIG_H_
diff --git a/driver/public/mikroe/oledw_ssd1306/config/other/mikroe_ssd1306_config.h b/driver/public/mikroe/oledw_ssd1306/config/other/mikroe_ssd1306_config.h
index 38da34c7..439333ec 100644
--- a/driver/public/mikroe/oledw_ssd1306/config/other/mikroe_ssd1306_config.h
+++ b/driver/public/mikroe/oledw_ssd1306/config/other/mikroe_ssd1306_config.h
@@ -43,6 +43,10 @@
extern "C" {
#endif
+#ifndef SLI_SI917
+#include "em_gpio.h"
+#endif
+
#define OLED_DISPLAY_64_48 0
#define OLED_DISPLAY_96_39 1
#define OLED_DISPLAY_128_32 2
@@ -50,6 +54,21 @@ extern "C" {
// <<< Use Configuration Wizard in Context Menu >>>
+//MIKROE SPI SSD1306 Configuration
+
+// MIKROE SPI SSD1306 UC Configuration
+// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC).
+// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration.
+// Default: 0
+#define MIKROE_SPI_SSD1306_UC 0
+
+// Bit Rate (Bits/Second) <1-116000000>
+// Default: 10000000
+#define MIKROE_SPI_SSD1306_BITRATE 10000000
+
+//
+//
+
// Screen
// OLED Screen Resolution
@@ -87,18 +106,24 @@ extern "C" {
// <<< sl:start pin_tool >>>
+// SSD1306_CS
+// $[GPIO_SSD1306_CS]
+// #define SSD1306_CS_PORT 0
+// #define SSD1306_CS_PIN 0
+// [GPIO_SSD1306_CS]$
+
// SSD1306_DC
// $[GPIO_SSD1306_DC]
#warning "DC pin for SSD1306 is not configured"
-// #define SSD1306_DC_PORT gpioPortB
-// #define SSD1306_DC_PIN 4
+// #define SSD1306_DC_PORT 0
+// #define SSD1306_DC_PIN 0
// [GPIO_SSD1306_DC]$
// SSD1306_RST
// $[GPIO_SSD1306_RST]
#warning "RST pin for SSD1306 is not configured"
-// #define SSD1306_RST_PORT gpioPortC
-// #define SSD1306_RST_PIN 6
+// #define SSD1306_RST_PORT 0
+// #define SSD1306_RST_PIN 0
// [GPIO_SSD1306_RST]$
// <<< sl:end pin_tool >>>
@@ -107,4 +132,4 @@ extern "C" {
}
#endif
-#endif /* SSD1306_SPI_CONFIG_H_ */
+#endif // SSD1306_SPI_CONFIG_H_
diff --git a/driver/public/mikroe/oledw_ssd1306/inc/mikroe_resources.h b/driver/public/mikroe/oledw_ssd1306/inc/mikroe_resources.h
index a7b5400b..ea4f67de 100644
--- a/driver/public/mikroe/oledw_ssd1306/inc/mikroe_resources.h
+++ b/driver/public/mikroe/oledw_ssd1306/inc/mikroe_resources.h
@@ -52,4 +52,4 @@ extern oledw_resources_t oledw_img[];
}
#endif
-#endif /* MIKROE_RESOURCES_H_ */
+#endif // MIKROE_RESOURCES_H_
diff --git a/driver/public/mikroe/oledw_ssd1306/inc/mikroe_ssd1306.h b/driver/public/mikroe/oledw_ssd1306/inc/mikroe_ssd1306.h
index e8e47462..1be19609 100644
--- a/driver/public/mikroe/oledw_ssd1306/inc/mikroe_ssd1306.h
+++ b/driver/public/mikroe/oledw_ssd1306/inc/mikroe_ssd1306.h
@@ -41,7 +41,6 @@
#define MIKROE_SSD1306_H_
#include "sl_status.h"
-#include "spidrv.h"
#include "oledw.h"
#ifdef __cplusplus
@@ -142,7 +141,7 @@ extern "C" {
* SL_STATUS_OK Successful initialization.
* SL_STATUS_FAIL Initialization failed.
******************************************************************************/
-sl_status_t mikroe_ssd1306_init(SPIDRV_Handle_t spi_instance);
+sl_status_t mikroe_ssd1306_init(mikroe_spi_handle_t spi_instance);
/***************************************************************************//**
* @brief
@@ -155,7 +154,7 @@ sl_status_t mikroe_ssd1306_init(SPIDRV_Handle_t spi_instance);
* SL_STATUS_OK if there are no errors
* SL_STATUS_INVALID_PARAMETER if spi_instance is null
******************************************************************************/
-sl_status_t mikroe_ssd1306_set_spi_instance(SPIDRV_Handle_t spi_instance);
+sl_status_t mikroe_ssd1306_set_spi_instance(mikroe_spi_handle_t spi_instance);
/***************************************************************************//**
* @brief
@@ -307,4 +306,4 @@ sl_status_t mikroe_ssd1306_stop_scroll(void);
/** @} (end addtogroup ssd1306) */
-#endif /* MIKROE_SSD1306_H_ */
+#endif // MIKROE_SSD1306_H_
diff --git a/driver/public/mikroe/oledw_ssd1306/inc/oled_display.h b/driver/public/mikroe/oledw_ssd1306/inc/oled_display.h
index 814f6c8b..8ed54978 100644
--- a/driver/public/mikroe/oledw_ssd1306/inc/oled_display.h
+++ b/driver/public/mikroe/oledw_ssd1306/inc/oled_display.h
@@ -37,7 +37,6 @@
#include
#include "sl_status.h"
-
#include "mikroe_ssd1306.h"
#ifdef __cplusplus
@@ -86,4 +85,4 @@ const oled_display_t *oled_display_get(void);
}
#endif
-#endif
+#endif // OLED_DISPLAY_H
diff --git a/driver/public/mikroe/oledw_ssd1306/src/mikroe_ssd1306.c b/driver/public/mikroe/oledw_ssd1306/src/mikroe_ssd1306.c
index 519e38ab..0c2a0815 100644
--- a/driver/public/mikroe/oledw_ssd1306/src/mikroe_ssd1306.c
+++ b/driver/public/mikroe/oledw_ssd1306/src/mikroe_ssd1306.c
@@ -37,7 +37,6 @@
*
******************************************************************************/
-#include "third_party_hw_drivers_helpers.h"
#include "mikroe_ssd1306_config.h"
#include "mikroe_ssd1306.h"
@@ -50,14 +49,12 @@ static oledw_t oledw;
static oledw_cfg_t oledw_cfg;
static bool initialized = false;
-sl_status_t mikroe_ssd1306_init(SPIDRV_Handle_t spi_instance)
+sl_status_t mikroe_ssd1306_init(mikroe_spi_handle_t spi_instance)
{
if (NULL == spi_instance) {
return SL_STATUS_INVALID_PARAMETER;
}
- THIRD_PARTY_HW_DRV_RETCODE_INIT();
-
// Configure default spi instance
oledw.spi.handle = spi_instance;
@@ -73,13 +70,23 @@ sl_status_t mikroe_ssd1306_init(SPIDRV_Handle_t spi_instance)
oledw_cfg.rst = hal_gpio_pin_name(SSD1306_RST_PORT, SSD1306_RST_PIN);
#endif
- THIRD_PARTY_HW_DRV_RETCODE_TEST(oledw_init(&oledw, &oledw_cfg));
+#if defined(SSD1306_CS_PORT) && defined(SSD1306_CS_PIN)
+ oledw_cfg.cs = hal_gpio_pin_name(SSD1306_CS_PORT, SSD1306_CS_PIN);
+#endif
+
+#if (MIKROE_SPI_SSD1306_UC == 1)
+ oledw_cfg.spi_speed = MIKROE_SPI_SSD1306_BITRATE;
+#endif
+
+ if (oledw_init(&oledw, &oledw_cfg) != OLEDW_OK) {
+ return SL_STATUS_INITIALIZATION;
+ }
initialized = true;
- return THIRD_PARTY_HW_DRV_RETCODE_VALUE;
+ return SL_STATUS_OK;
}
-sl_status_t mikroe_ssd1306_set_spi_instance(SPIDRV_Handle_t spi_instance)
+sl_status_t mikroe_ssd1306_set_spi_instance(mikroe_spi_handle_t spi_instance)
{
if (!initialized) {
return SL_STATUS_NOT_INITIALIZED;
@@ -96,14 +103,14 @@ sl_status_t mikroe_ssd1306_set_spi_instance(SPIDRV_Handle_t spi_instance)
sl_status_t mikroe_ssd1306_send(oledw_data_t tx_data,
oledw_data_mode_t data_mode)
{
- THIRD_PARTY_HW_DRV_RETCODE_INIT();
-
if (!initialized) {
return SL_STATUS_NOT_INITIALIZED;
}
- THIRD_PARTY_HW_DRV_RETCODE_TEST(oledw_send(&oledw, tx_data, data_mode));
+ if (oledw_send(&oledw, tx_data, data_mode) != OLEDW_OK) {
+ return SL_STATUS_FAIL;
+ }
- return THIRD_PARTY_HW_DRV_RETCODE_VALUE;
+ return SL_STATUS_OK;
}
sl_status_t mikroe_ssd1306_default_cfg(void)
@@ -268,17 +275,17 @@ sl_status_t mikroe_ssd1306_draw(const uint8_t *data)
static const uint8_t command_table[] = {
#ifdef SSD1306_USE_PAGE_ADDRESSING_MODE
- /* Set Lower Column Start Address for Page Addressing Mode */
+ // Set Lower Column Start Address for Page Addressing Mode
0x00,
- /* Set Higher Column Start Address for Page Addressing Mode */
+ // Set Higher Column Start Address for Page Addressing Mode
0x12
#else
- /* Set page start, end address + set page pointer to page start address */
+ // Set page start, end address + set page pointer to page start address
OLEDW_PAGEADDR, 0, (SSD1306_NUM_PAGES - 1),
- /* Set page start, end address + set page pointer to page start address */
+ // Set page start, end address + set page pointer to page start address
OLEDW_COLUMNADDR, 0, (SSD1306_DISPLAY_WIDTH - 1),
#endif
};
@@ -289,29 +296,31 @@ sl_status_t mikroe_ssd1306_draw(const uint8_t *data)
#ifdef SSD1306_USE_PAGE_ADDRESSING_MODE
- /* Get start address to draw from */
+ // Get start address to draw from
for (i = 0; i < SSD1306_NUM_PAGES; i++) {
- /* Send update command and first line address */
- /* Set the current RAM page address. */
+ /**
+ * Send update command and first line address
+ * Set the current RAM page address.
+ */
oledw_send(&oledw, 0xB0 + i, OLEDW_COMMAND);
for (uint16_t j = 0; j < sizeof(command_table); j++) {
oledw_send(&oledw, command_table[j], OLEDW_COMMAND);
}
- /* Send pixels for this page */
+ // Send pixels for this page
for (uint16_t j = 0; j < MIKROE_SSD1306_LCDWIDTH; j++) {
oledw_send(&oledw, *data++, OLEDW_DATA);
}
}
#else
- /* Send commands to prepare data transfer from frame buffer */
+ // Send commands to prepare data transfer from frame buffer
for (i = 0; i < sizeof(command_table); i++) {
oledw_send(&oledw, command_table[i], OLEDW_COMMAND);
}
- /*Send frame buffer data*/
+ // Send frame buffer data
for (i = 0; i < (SSD1306_DISPLAY_WIDTH * SSD1306_NUM_PAGES); i++) {
oledw_send(&oledw, *data++, OLEDW_DATA);
}
diff --git a/driver/public/mikroe/oledw_ssd1306/src/oled_display.c b/driver/public/mikroe/oledw_ssd1306/src/oled_display.c
index 7d7c9d19..197dc9a8 100644
--- a/driver/public/mikroe/oledw_ssd1306/src/oled_display.c
+++ b/driver/public/mikroe/oledw_ssd1306/src/oled_display.c
@@ -37,7 +37,7 @@
#include "mikroe_ssd1306.h"
#include "oled_display.h"
-/* This oled_frame_buffer is large enough to store one full frame. */
+// This oled_frame_buffer is large enough to store one full frame.
static uint8_t oled_frame_buffer[(SSD1306_DISPLAY_HEIGHT + 7) / 8
* SSD1306_DISPLAY_WIDTH];
@@ -66,9 +66,10 @@ static const oled_display_driver_api_t sl_memlcd_driver_api =
.stop_scroll = mikroe_ssd1306_stop_scroll,
};
-/** Flag to monitor is this driver has been initialized. The
- * oled_display_instance
- * is only valid after initialized=true. */
+/**
+ * Flag to monitor is this driver has been initialized.
+ * The oled_display_instance is only valid after initialized=true.
+ */
static bool initialized = false;
sl_status_t oled_display_init(void)
@@ -101,7 +102,7 @@ static sl_status_t fill_screen(uint16_t color)
{
uint16_t i;
- /* Fill the display with the background color of the glib_context_t */
+ // Fill the display with the background color of the glib_context_t
for (i = 0; i < sizeof(oled_frame_buffer); i++) {
oled_frame_buffer[i] = color == 0 ? 0x00 : 0xFF;
}
diff --git a/driver/public/mikroe/pir_pl_n823_01/inc/mikroe_pl_n823_01.h b/driver/public/mikroe/pir_pl_n823_01/inc/mikroe_pl_n823_01.h
index 1f441640..b10d5bb6 100644
--- a/driver/public/mikroe/pir_pl_n823_01/inc/mikroe_pl_n823_01.h
+++ b/driver/public/mikroe/pir_pl_n823_01/inc/mikroe_pl_n823_01.h
@@ -40,8 +40,9 @@
#ifndef MIKROE_PL_N823_01_H_
#define MIKROE_PL_N823_01_H_
-#include "pir.h"
#include "sl_status.h"
+#include "sl_i2cspm.h"
+#include "pir.h"
#define PIR_PL_N823_01_I2C_SLAVE_ADDRESS 0x4D
diff --git a/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_i2c.h b/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_i2c.h
index 86cd195f..a20506e0 100644
--- a/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_i2c.h
+++ b/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_i2c.h
@@ -41,6 +41,7 @@
#define MIKROE_PRESSURE3_H
#include "sl_status.h"
+#include "sl_i2cspm.h"
#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
diff --git a/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_spi.h b/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_spi.h
index e95c4678..fd1bb1bf 100644
--- a/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_spi.h
+++ b/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_spi.h
@@ -41,6 +41,7 @@
#define MIKROE_PRESSURE3_H
#include "sl_status.h"
+#include "spidrv.h"
#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
diff --git a/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_spi.h b/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_spi.h
index 33bbf42f..4c7102e0 100644
--- a/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_spi.h
+++ b/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_spi.h
@@ -38,7 +38,9 @@
******************************************************************************/
#ifndef MIKROE_ADPD188BI_H_
#define MIKROE_ADPD188BI_H_
+
#include "sl_status.h"
+#include "spidrv.h"
#include "smoke2.h"
#ifdef __cplusplus
diff --git a/driver/public/mikroe/temphum9_shtc3/config/mikroe_shtc3_config.h b/driver/public/mikroe/temphum9_shtc3/config/mikroe_shtc3_config.h
new file mode 100644
index 00000000..709f76b0
--- /dev/null
+++ b/driver/public/mikroe/temphum9_shtc3/config/mikroe_shtc3_config.h
@@ -0,0 +1,70 @@
+/***************************************************************************/ /**
+ * @file mikroe_shtc3_config.h
+ * @brief Mikroe SHTC3 configuration
+ *******************************************************************************
+ * # License
+ * Copyright 2024 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#ifndef MIKROE_SHTC3_CONFIG_H
+#define MIKROE_SHTC3_CONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+//MIKROE I2C SHTC3 Configuration
+
+// MIKROE I2C SHTC3 UC Configuration
+// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC).
+// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration.
+// Default: 0
+#define MIKROE_I2C_SHTC3_UC 0
+
+// Speed mode
+// <0=> Standard mode (100kbit/s)
+// <1=> Fast mode (400kbit/s)
+// <2=> Fast mode plus (1Mbit/s)
+// Default: 0
+#define MIKROE_I2C_SHTC3_SPEED_MODE 0
+
+//
+//
+// <<< end of configuration section >>>
+
+#ifdef __cplusplus
+}
+#endif
+#endif // MIKROE_SHTC3_CONFIG_H
diff --git a/driver/public/mikroe/temphum9_shtc3/inc/mikroe_shtc3.h b/driver/public/mikroe/temphum9_shtc3/inc/mikroe_shtc3.h
index 3369d589..5fe3427e 100644
--- a/driver/public/mikroe/temphum9_shtc3/inc/mikroe_shtc3.h
+++ b/driver/public/mikroe/temphum9_shtc3/inc/mikroe_shtc3.h
@@ -41,7 +41,7 @@
#define MIKROE_SHTC3_H_
#include "sl_status.h"
-#include "sl_i2cspm.h"
+#include "drv_i2c_master.h"
#ifdef __cplusplus
extern "C" {
@@ -168,7 +168,7 @@ typedef struct {
* SL_STATUS_OK Successful initialization.
* SL_STATUS_FAIL Initialization failed.
******************************************************************************/
-sl_status_t mikroe_shtc3_init(sl_i2cspm_t *i2cspm_instance);
+sl_status_t mikroe_shtc3_init(mikroe_i2c_handle_t i2cspm_instance);
/***************************************************************************//**
* @brief
@@ -181,7 +181,8 @@ sl_status_t mikroe_shtc3_init(sl_i2cspm_t *i2cspm_instance);
* SL_STATUS_OK if there are no errors.
* SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null.
******************************************************************************/
-sl_status_t mikroe_shtc3_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance);
+sl_status_t mikroe_shtc3_set_i2csmp_instance(
+ mikroe_i2c_handle_t i2cspm_instance);
/***************************************************************************//**
* @brief
@@ -276,4 +277,4 @@ sl_status_t mikroe_shtc3_get_temperature_and_humidity(
/** @} (end addtogroup mikroe_shtc3) */
-#endif /* MIKROE_SHTC3_H_ */
+#endif // MIKROE_SHTC3_H_
diff --git a/driver/public/mikroe/temphum9_shtc3/src/mikroe_shtc3.c b/driver/public/mikroe/temphum9_shtc3/src/mikroe_shtc3.c
index 6aadee0b..aaa391ab 100644
--- a/driver/public/mikroe/temphum9_shtc3/src/mikroe_shtc3.c
+++ b/driver/public/mikroe/temphum9_shtc3/src/mikroe_shtc3.c
@@ -37,33 +37,38 @@
*
******************************************************************************/
-#include "third_party_hw_drivers_helpers.h"
+#include "mikroe_shtc3_config.h"
#include "mikroe_shtc3.h"
#include "temphum9.h"
static temphum9_t temphum9;
static temphum9_cfg_t temphum9_cfg;
-sl_status_t mikroe_shtc3_init(sl_i2cspm_t *i2cspm_instance)
+sl_status_t mikroe_shtc3_init(mikroe_i2c_handle_t i2cspm_instance)
{
if (NULL == i2cspm_instance) {
return SL_STATUS_INVALID_PARAMETER;
}
- THIRD_PARTY_HW_DRV_RETCODE_INIT();
-
// Configure default i2csmp instance
temphum9.i2c.handle = i2cspm_instance;
// Call basic setup functions
temphum9_cfg_setup(&temphum9_cfg);
- THIRD_PARTY_HW_DRV_RETCODE_TEST(temphum9_init(&temphum9, &temphum9_cfg));
+#if (MIKROE_I2C_SHTC3_UC == 1)
+ temphum9_cfg.i2c_speed = MIKROE_I2C_SHTC3_SPEED_MODE;
+#endif
+
+ if (temphum9_init(&temphum9, &temphum9_cfg) != TEMPHUM9_OK) {
+ return SL_STATUS_INITIALIZATION;
+ }
- return THIRD_PARTY_HW_DRV_RETCODE_VALUE;
+ return SL_STATUS_OK;
}
-sl_status_t mikroe_shtc3_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance)
+sl_status_t mikroe_shtc3_set_i2csmp_instance(
+ mikroe_i2c_handle_t i2cspm_instance)
{
if (NULL == i2cspm_instance) {
return SL_STATUS_INVALID_PARAMETER;
diff --git a/driver/public/mikroe/thunder_as3935/inc/mikroe_thunder_as3935.h b/driver/public/mikroe/thunder_as3935/inc/mikroe_thunder_as3935.h
index 8e8ca16c..2b795345 100644
--- a/driver/public/mikroe/thunder_as3935/inc/mikroe_thunder_as3935.h
+++ b/driver/public/mikroe/thunder_as3935/inc/mikroe_thunder_as3935.h
@@ -42,6 +42,9 @@
// -----------------------------------------------------------------------------
// Includes
// -----------------------------------------------------------------------------
+
+#include "sl_status.h"
+#include "spidrv.h"
#include "thunder.h"
#include "mikroe_thunder_as3935_config.h"
diff --git a/driver/public/mikroe/turbidity_tsd10/inc/mikroe_tsd10.h b/driver/public/mikroe/turbidity_tsd10/inc/mikroe_tsd10.h
index 4d77f388..ac7694a7 100644
--- a/driver/public/mikroe/turbidity_tsd10/inc/mikroe_tsd10.h
+++ b/driver/public/mikroe/turbidity_tsd10/inc/mikroe_tsd10.h
@@ -40,10 +40,11 @@
#ifndef MIKROE_TURBIDITY_H
#define MIKROE_TURBIDITY_H
+#include "sl_status.h"
+#include "sl_i2cspm.h"
#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
-#include "sl_status.h"
/*!
* @addtogroup turbidity Turbidity Click Driver
diff --git a/driver/public/mikroe/water_detect/config/brd2703a/mikroe_water_detect_config.h b/driver/public/mikroe/water_detect/config/brd2703a/mikroe_water_detect_config.h
index d5b9d07e..5da1145f 100644
--- a/driver/public/mikroe/water_detect/config/brd2703a/mikroe_water_detect_config.h
+++ b/driver/public/mikroe/water_detect/config/brd2703a/mikroe_water_detect_config.h
@@ -42,6 +42,10 @@
#include "em_gpio.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// <<< sl:start pin_tool >>>
// WATER_DETECT_INT
@@ -52,4 +56,8 @@
// <<< sl:end pin_tool >>>
-#endif /* MIKROE_WATER_DETECT_CONFIG_H_ */
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MIKROE_WATER_DETECT_CONFIG_H_
diff --git a/driver/public/mikroe/water_detect/config/brd4108a/mikroe_water_detect_config.h b/driver/public/mikroe/water_detect/config/brd4108a/mikroe_water_detect_config.h
index 53486d78..53db29d7 100644
--- a/driver/public/mikroe/water_detect/config/brd4108a/mikroe_water_detect_config.h
+++ b/driver/public/mikroe/water_detect/config/brd4108a/mikroe_water_detect_config.h
@@ -42,6 +42,10 @@
#include "em_gpio.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// <<< sl:start pin_tool >>>
// WATER_DETECT_INT
@@ -52,4 +56,8 @@
// <<< sl:end pin_tool >>>
-#endif /* MIKROE_WATER_DETECT_CONFIG_H_ */
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MIKROE_WATER_DETECT_CONFIG_H_
diff --git a/driver/public/mikroe/water_detect/config/brd4314a/mikroe_water_detect_config.h b/driver/public/mikroe/water_detect/config/brd4314a/mikroe_water_detect_config.h
index 53486d78..53db29d7 100644
--- a/driver/public/mikroe/water_detect/config/brd4314a/mikroe_water_detect_config.h
+++ b/driver/public/mikroe/water_detect/config/brd4314a/mikroe_water_detect_config.h
@@ -42,6 +42,10 @@
#include "em_gpio.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// <<< sl:start pin_tool >>>
// WATER_DETECT_INT
@@ -52,4 +56,8 @@
// <<< sl:end pin_tool >>>
-#endif /* MIKROE_WATER_DETECT_CONFIG_H_ */
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MIKROE_WATER_DETECT_CONFIG_H_
diff --git a/driver/public/mikroe/water_detect/config/brd4338a/mikroe_water_detect_config.h b/driver/public/mikroe/water_detect/config/brd4338a/mikroe_water_detect_config.h
new file mode 100644
index 00000000..5f3d6feb
--- /dev/null
+++ b/driver/public/mikroe/water_detect/config/brd4338a/mikroe_water_detect_config.h
@@ -0,0 +1,61 @@
+/***************************************************************************//**
+ * @file mikroe_water_detect_config.h
+ * @brief SCL Water Detect Configuration
+ * @version 1.0.0
+ *******************************************************************************
+ * # License
+ * Copyright 2022 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#ifndef MIKROE_WATER_DETECT_CONFIG_H_
+#define MIKROE_WATER_DETECT_CONFIG_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// <<< sl:start pin_tool >>>
+
+// WATER_DETECT_INT
+// $[GPIO_WATER_DETECT_INT]
+#define WATER_DETECT_INT_PORT 0
+#define WATER_DETECT_INT_PIN 46
+// [GPIO_WATER_DETECT_INT]$
+
+// <<< sl:end pin_tool >>>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MIKROE_WATER_DETECT_CONFIG_H_
diff --git a/driver/public/mikroe/water_detect/config/other/mikroe_water_detect_config.h b/driver/public/mikroe/water_detect/config/other/mikroe_water_detect_config.h
index ccf75f18..4e61fe37 100644
--- a/driver/public/mikroe/water_detect/config/other/mikroe_water_detect_config.h
+++ b/driver/public/mikroe/water_detect/config/other/mikroe_water_detect_config.h
@@ -40,17 +40,27 @@
#ifndef MIKROE_WATER_DETECT_CONFIG_H_
#define MIKROE_WATER_DETECT_CONFIG_H_
+#ifndef SLI_SI917
#include "em_gpio.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
// <<< sl:start pin_tool >>>
// WATER_DETECT_INT
// $[GPIO_WATER_DETECT_INT]
#warning "WATER_DETECT_INT is not configured"
-// #define WATER_DETECT_INT_PORT gpioPortB
-// #define WATER_DETECT_INT_PIN 3
+// #define WATER_DETECT_INT_PORT 0
+// #define WATER_DETECT_INT_PIN 0
// [GPIO_WATER_DETECT_INT]$
// <<< sl:end pin_tool >>>
-#endif /* MIKROE_WATER_DETECT_CONFIG_H_ */
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MIKROE_WATER_DETECT_CONFIG_H_
diff --git a/driver/public/mikroe/water_detect/inc/mikroe_water_detect.h b/driver/public/mikroe/water_detect/inc/mikroe_water_detect.h
index 5a304fcb..19486267 100644
--- a/driver/public/mikroe/water_detect/inc/mikroe_water_detect.h
+++ b/driver/public/mikroe/water_detect/inc/mikroe_water_detect.h
@@ -117,4 +117,4 @@ uint8_t mikroe_water_detect_get_status(void);
#endif
/** @} (end addtogroup water_detect) */
-#endif /* MIKROE_WATER_DETECT_H_ */
+#endif // MIKROE_WATER_DETECT_H_
diff --git a/driver/public/mikroe/water_detect/src/mikroe_water_detect.c b/driver/public/mikroe/water_detect/src/mikroe_water_detect.c
index 444a91ed..eae1c80e 100644
--- a/driver/public/mikroe/water_detect/src/mikroe_water_detect.c
+++ b/driver/public/mikroe/water_detect/src/mikroe_water_detect.c
@@ -37,11 +37,9 @@
*
******************************************************************************/
-#include
-#include "waterdetect.h"
#include "mikroe_water_detect_config.h"
#include "mikroe_water_detect.h"
-#include "third_party_hw_drivers_helpers.h"
+#include "waterdetect.h"
static waterdetect_t waterdetect;
static waterdetect_cfg_t waterdetect_cfg;
@@ -50,16 +48,16 @@ static waterdetect_cfg_t waterdetect_cfg;
sl_status_t mikroe_water_detect_init(void)
{
- THIRD_PARTY_HW_DRV_RETCODE_INIT();
waterdetect_cfg_setup(&waterdetect_cfg);
#if defined(WATER_DETECT_INT_PORT) && defined(WATER_DETECT_INT_PIN)
waterdetect_cfg.int_pin = hal_gpio_pin_name(WATER_DETECT_INT_PORT,
WATER_DETECT_INT_PIN);
#endif
- THIRD_PARTY_HW_DRV_RETCODE_TEST(waterdetect_init(&waterdetect,
- &waterdetect_cfg));
- return THIRD_PARTY_HW_DRV_RETCODE_VALUE;
+ if (waterdetect_init(&waterdetect, &waterdetect_cfg) != WATERDETECT_OK) {
+ return SL_STATUS_INITIALIZATION;
+ }
+ return SL_STATUS_OK;
}
uint8_t mikroe_water_detect_get_status(void)
diff --git a/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_driver.h b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_driver.h
new file mode 100644
index 00000000..4136b546
--- /dev/null
+++ b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_driver.h
@@ -0,0 +1,1176 @@
+/***************************************************************************//**
+ * @file gnss_max_m10s_driver.h
+ * @brief MAX_M10S GNSS receiver API implementation
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ * # Evaluation Quality
+ * This code has been minimally tested to ensure that it builds and is suitable
+ * as a demonstration for evaluation purposes only. This code will be maintained
+ * at the sole discretion of Silicon Labs.
+ ******************************************************************************/
+
+#ifndef GNSS_MAX_M10S_H_
+#define GNSS_MAX_M10S_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/// Includes
+#include "sl_status.h"
+#include "gnss_max_m10s_ubx_struct.h"
+#include "gnss_max_m10s_nmea_struct.h"
+#include "drv_i2c_master.h"
+
+/******************************************************************************/
+
+/*******************************************************************************
+ *************************** Defines / Macros ********************************
+ ******************************************************************************/
+#define GNSS_ADDRESS 0x42 ///< Default GNSS receiver slave address
+#define GNSS_POLL_MAX_TIMEOUT 1100 ///< Default maximum timeout value
+#define RX_LEN 2 ///< Read buffer length 2 bytes
+#define TX_LEN 2 ///< Write buffer length 2 bytes
+#define RD_BUF 6 ///< Read buffer length 6 bytes
+#define WR_BUF 1 ///< Write buffer length 1 byte
+// #define I2C_BASE I2C2 ///< Value of I2C base
+#define MS_DELAY_COUNTER 4600 ///< Value of delay counter for milli seconds delay
+#define MAX_PAYLOAD_SIZE 276 ///< Value of maximum payload size for UBX
+#define UBX_NAV_PVT_LEN 92 ///< Value for position/velocity/time type UBX packet length
+#define UBX_NAV_STATUS_LEN 16 ///< Value for navigation status type UBX packet length
+#define UBX_NAV_DOP_LEN 18 ///< Value for dilution precision type UBX packet length
+#define UBX_NAV_CLOCK_LEN 20 ///< Value for navigation clock solution type UBX packet length
+#define UBX_NAV_EOE_LEN 4 ///< Value for navigation end of epoch type UBX packet length
+#define UBX_NAV_SAT_LEN 3068 ///< Value for the maximum possible length of the UBX-NAV-SAT message
+#define UBX_NAV_TIMELS_LEN 24 ///< Value for length of the UBX-NAV-TIMELS message
+#define UBX_NAV_TIMEUTC_LEN 20 ///< Value for length of the UBX-NAV-TIMEUTC message
+#define UBX_NAV_SIG_MAX_LEN 1480 ///< Value for maximum length for UBX-NAV-SIG packet
+#define UBX_NAV_POSLLH_LEN 28 ///< Value for length for UBX-NAV-POSLLH packet
+#define UBX_NAV_VELNED_LEN 36 ///< Value for length for UBX-NAV-VELNED packet
+#define UBX_CLASS_NAV 0x01 ///< Value for NAV type UBX class
+#define UBX_CLASS_SEC 0x27 ///< Value for SEC type UBX class
+#define UBX_CLASS_ACK 0x05 ///< Value for ACK type UBX class
+#define UBX_CLASS_NACK 0x00 ///< Value for NACK type UBX class
+#define UBX_MAX_LENGTH 3068 ///< Value for maximum UBX data length
+#define UBX_ACK_ACK 0x01 ///< Value for message ID for ACK class
+#define CFG_VALSET_MAX_KEYS 64 ///< Value for maximum number of keys for cfg valset type packet
+#define UBX_CFG_L 0x01001000 ///< Value for bool type identification of UBX data.
+#define UBLOX_CFG_I2C_INPORT_UBX UBX_CFG_L | 0x10710001 ///< Value to indicate if UBX should be an input protocol on I2C
+#define UBLOX_CFG_I2C_OUTPORT_UBX UBX_CFG_L | 0x10720001 ///< Value to indicate if UBX should be an output protocol on I2C
+#define UBLOX_CFG_I2C_OUTPORT_NMEA UBX_CFG_L | 0x10720002 ///< Value to indicate if NMEA should be an output protocol on I2C
+#define VAL_LAYER_RAM 1 ///< Value for RAM layer
+#define UBX_SYNCH_1 0xB5 ///< Value for UBX header synchronization 1
+#define UBX_SYNCH_2 0x62 ///< Value for UBX header synchronization 2
+#define UBX_CLASS_CFG 0x06 ///< Value for CFG type UBX class
+#define UBX_CFG_VALGET 0x8B ///< Value for message ID for CFG type UBX data
+#define UBX_CFG_VALSET 0x8A ///< Value for message ID for CFG VALSET type UBX data
+#define VAL_LAYER_DEFAULT 0x7 ///< Value for default layer
+#define VAL_LAYER_RAM_BBR 5 ///< Value for layer RAM and BBR
+#define VAL_LAYER_BBR 2 ///< Value for BBR layer
+#define VAL_LAYER_FLASH 4 ///< Value for Flash layer
+#define COM_TYPE_UBX 1 ///< Value for UBX type communication
+#define COM_TYPE_NMEA 2 ///< Value for UBX type communication
+#define UBX_CFG_SIZE_MASK 0x0F00F000 ///< Value for mask of UBX size
+#define UBX_SEC_UNIQID 0x03 ///< Value for message ID of UBX_SEC_UINQID type UBX message
+#define UBX_NAV_PVT 0x07 ///< Value for message ID of UBX_NAV_PVT type UBX message
+#define UBX_NAV_STATUS 0x03 ///< Value for message ID of UBX_NAV_STATUS type UBX message
+#define UBX_NAV_DOP 0x04 ///< Value for message ID of UBX_NAV_DOP type UBX message
+#define UBX_NAV_CLOCK 0x22 ///< Value for message ID of UBX_NAV_CLOCK type UBX message
+#define UBX_NAV_EOE 0x61 ///< Value for message ID of UBX_NAV_EOE type UBX message
+#define UBX_NAV_SAT 0x35 ///< Value for message ID of UBX_NAV_SAT type UBX message
+#define UBX_NAV_SIG 0x43 ///< Value for message ID of UBX_NAV_SIG type UBX message
+#define UBX_NAV_TIMELS 0x26 ///< Value for message ID of UBX_NAV_TIMELS type UBX message
+#define UBX_NAV_TIMEUTC 0x21 ///< Value for message ID of UBX_NAV_TIMEUTC type UBX message
+#define UBX_NAV_POSLLH 0x2 ///< Value for message ID of UBX_NAV_POSLLH type UBX message
+#define UBX_NAV_VELNED 0x12 ///< Value for message ID of UBX_NAV_VELNED type UBX message
+#define FILE_BUFFER_SIZE MAX_PAYLOAD_SIZE ///< Value for the UBX buffer size
+#define I2C_TRANSACTION_SIZE 32 ///< Value for I2C transaction size
+#define I2C_POLLING_WAIT 100 ///< Value to poll the I2C data
+#define NMEA_MAX_BYTE_COUNT 100 ///< Value for default maximum NMEA byte count
+
+/*******************************************************************************
+ ******************************** ENUMS ************************************
+ ******************************************************************************/
+/// @brief Enum for ublox status
+typedef enum sl_max_m10s_ublox_status_e
+{
+ SL_MAX_M10S_UBLOX_STATUS_SUCCESS=0, ///< To indicate success
+ SL_MAX_M10S_UBLOX_STATUS_FAIL, ///< To indicate failure
+ SL_MAX_M10S_UBLOX_STATUS_CRC_FAIL, ///< To indicate failure in CRC of data received
+ SL_MAX_M10S_UBLOX_STATUS_TIMEOUT, ///< To indicate timeout for a process
+ SL_MAX_M10S_UBLOX_STATUS_COMMAND_NACK, ///< To indicate that the command was un-recognised, invalid or that the module is too busy to respond
+ SL_MAX_M10S_UBLOX_STATUS_OUT_OF_RANGE, ///< To indicate the received data is out of range
+ SL_MAX_M10S_UBLOX_STATUS_INVALID_ARG, ///< To indicate invalid argument
+ SL_MAX_M10S_UBLOX_STATUS_INVALID_OPERATION, ///< To indicate invalid operation
+ SL_MAX_M10S_UBLOX_STATUS_MEM_ERR, ///< To indicate memory error
+ SL_MAX_M10S_UBLOX_STATUS_HW_ERR, ///< To indicate hardware error
+ SL_MAX_M10S_UBLOX_STATUS_DATA_SENT, ///< To indicate that a data was set successfully
+ SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED, ///< To indicate that a data was received successfully
+ SL_MAX_M10S_UBLOX_STATUS_I2C_COMM_FAILURE, ///< To indicate I2C communication error
+ SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN ///< To indicate data has or is being overwritten by another packet
+} sl_max_m10s_ublox_status_e;
+
+/// @brief Enum for UBLOX packet validity
+typedef enum
+{
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_VALID, ///< To indicate that the ublox packet validity is not achieved
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID, ///< To indicate that the ublox packet validity is achieved
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED, ///< To indicate that the ublox packet validity is not defined
+ SL_MAX_M10S_UBLOX_PACKET_NOTACKNOWLEDGED ///< To indicate that we received a not acknowledged packet
+} sl_max_m10s_ublox_packet_validity_e;
+
+/// @brief Enum to identify which ubx packet buffer is in use.
+typedef enum
+{
+ SL_MAX_M10S_UBLOX_PACKET_PACKETCFG, ///< To indicate that the packet is config type UBX packet
+ SL_MAX_M10S_UBLOX_PACKET_PACKETACK, ///< To indicate that the packet is acknowledge type UBX packet
+ SL_MAX_M10S_UBLOX_PACKET_PACKETBUF, ///< To indicate that the packet is buffer for UBX packet
+ SL_MAX_M10S_UBLOX_PACKET_PACKETAUTO ///< To indicate that the packet will be handle automatically
+} sl_max_m10s_ublox_packet_buffer_e;
+
+/// @brief Enum for different UBLOX sentence type.
+typedef enum
+{
+ SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE = 0, ///< To indicate the UBLOX sentence type is unknown or not a UBlOX sentence
+ SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NMEA, ///< To indicate the UBLOX sentence type is NMEA
+ SL_MAX_M10S_UBLOX_SENTENCE_TYPE_UBX, ///< To indicate the UBLOX sentence type is UBX
+ SL_MAX_M10S_UBLOX_SENTENCE_TYPE_RTCM ///< To indicate the UBLOX sentence type is RTCM
+} sl_max_m10s_ublox_sentence_types_e;
+
+/// @brief Enum for status of the gnss processes like begin, ping etc.
+typedef enum sl_max_m10s_gnss_status
+{
+ SL_MAX_M10S_BEGIN_OK, ///< status for begin is success
+ SL_MAX_M10S_BEGIN_FAIL, ///< status for begin is failure
+ SL_MAX_M10S_PING_OK, ///< status for ping is ok
+ SL_MAX_M10S_PING_FAIL, ///< status for begin is failure
+ SL_MAX_M10S_INIT_OK, ///< status ok for init
+ SL_MAX_M10S_INIT_FAIL, ///< status for init is failure
+ SL_MAX_M10S_UBLOX_INIT_OK, ///< status for ublox init is success
+ SL_MAX_M10S_UBLOX_INIT_FAIL, ///< status for ublox init is failure
+} sl_max_m10s_gnss_status_e;
+
+/// @brief to define which protocol is used to get data from receiver.
+typedef enum sl_max_m10s_protocol_type
+{
+ SL_MAX_M10S_PROTOCOL_UBX = 0,
+ SL_MAX_M10S_PROTOCOL_NMEA,
+}sl_max_m10s_protocol_type_e;
+
+/// @brief to store the signed or unsigned 8 bit data from the payload when extracting data from the UBX packet.
+typedef union
+{
+ uint32_t unsigned8; ///< To store unsigned 32 bit value
+ int32_t signed8; ///< To store signed 32 bit value
+} sl_max_m10s_unsigned_signed_8_t;
+
+/// @brief to store the signed or unsigned 32 bit data from the payload when extracting data from the UBX packet.
+typedef union
+{
+ uint32_t unsigned32; ///< To store unsigned 32 bit value
+ int32_t signed32; ///< To store signed 32 bit value
+} sl_max_m10s_unsigned_signed_32_t;
+
+/// @brief to store the signed or unsigned 16 bit data from the payload when extracting data from the UBX packet.
+typedef union
+{
+ uint16_t unsigned16; ///< To store unsigned 16 bit value
+ int16_t signed16; ///< To store signed 16 bit value
+} sl_max_m10s_unsigned_signed_16_t;
+
+/// @brief UBX binary specific variables
+typedef struct sl_max_m10s_ubx_packet
+{
+ uint8_t cls; ///< class of the UBX packet.
+ uint8_t id; ///< ID for the UBX packet.
+ uint16_t len; ///< Length of the payload. Does not include cls, id, or checksum bytes
+ uint16_t counter; ///< Keeps track of number of overall bytes received. Some responses are larger than 255 bytes.
+ uint16_t starting_spot; ///< The counter value needed to go past before we begin recording into payload array
+ uint8_t *payload; ///< Used to allocate RAM for the payload if/when needed.
+ uint8_t checksum_a; ///< Checksum value given from the module
+ uint8_t checksum_b; ///< Checksum value given from the module
+ sl_max_m10s_ublox_packet_validity_e valid; ///< Goes from NOT_DEFINED to VALID or NOT_VALID when checksum is checked
+ sl_max_m10s_ublox_packet_validity_e class_and_id_match; ///< Goes from NOT_DEFINED to VALID or NOT_VALID when the Class and ID match the requestedClass and requestedID
+}sl_max_m10s_ubx_packet_t;
+
+/// @brief to store the different types of pay load from UBX packets.
+typedef struct sl_max_m10s_msg_data
+{
+ uint8_t payload_ack[2]; ///< To store Acknowledge message payload
+ uint8_t payload_buf[2]; ///< To store buffer payload
+ size_t packet_cfg_payloadsize; ///< Value for CFG type packet's payload size
+ uint8_t *payload_cfg; ///< To store the CFG type payload
+ uint8_t *payload_auto; ///< To store the automatic packet payload
+}sl_max_m10s_msg_data_t;
+
+/// @brief to store the GNSS configuration data
+typedef struct sl_max_m10s_cfg_data
+{
+ uint8_t device_address; ///< gnss receiver slave address
+ uint8_t num_cfg_keys; ///< Number of CFG keys
+ uint8_t rolling_checksum_a; ///< Rolling checksum A for UBX frame
+ uint8_t rolling_checksum_b; ///< Rolling checksum B for UBX frame
+ int8_t nmea_byte_counter; ///< Counter for NMEA type data
+ int8_t max_nmea_byte_count; ///< Maximum number of NMEA byte
+ bool signs_of_life; ///< Flag to indicate if the process is ongoing
+ bool reset_current_sentence_on_bus_error; ///< Flag to indicate if there is a bus error for current UBLOX sentence
+ bool ignore_this_payload; ///< Flag to indicate the current sentence payload should be ignored
+ uint16_t rtcm_frame_counter; ///< Counter for RTCM data
+ uint16_t file_buffer_head; ///< Value for starting of file buffer
+ uint16_t file_buffer_tail; ///< Value for ending of file buffer
+ uint16_t file_buffer_max_avail; ///< Value for maximum available size in file buffer
+ uint16_t ubx_frame_counter; ///< Counter for UBX frame data
+ sl_max_m10s_gnss_status_e status; ///< Status of the driver function
+ sl_max_m10s_protocol_type_e protocol_type; ///< To check the protocol type
+ sl_max_m10s_ublox_sentence_types_e current_sentence; ///< To show the current sentence type
+ sl_max_m10s_ublox_packet_buffer_e active_packet_buffer; ///< Active packet type
+ mikroe_i2c_handle_t i2c_instance; ///< I2C instance used by the user
+ uint8_t *ubx_file_buffer; ///< To store the file buffer
+ size_t auto_send_at_space_remaining; ///< automatic send to the remaining space of the file buffer
+ sl_max_m10s_ubx_nav_pvt_t *packetUBXNAVPVT; ///< UBX_NAV_PVT type UBX packet
+ sl_max_m10s_ubx_nav_status_t *packetUBXNAVSTATUS; ///< UBX_NAV_STATUS type UBX packet
+ sl_max_m10s_ubx_nav_dop_t *packetUBXNAVDOP; ///< UBX_NAV_DOP type UBX packet
+ sl_max_m10s_ubx_nav_clock_t *packetUBXNAVCLOCK; ///< UBX_NAV_CLOCK type UBX packet
+ sl_max_m10s_ubx_nav_epoch_t *packetUBXNAVEOE; ///< UBX_NAV_EOE type UBX packet
+ sl_max_m10s_ubx_nav_sat_t *packetUBXNAVSAT; ///< UBX_NAV_SAT type UBX packet
+ sl_max_m10s_ubx_navsig_t *packetUBXNAVSIG; ///< UBX_NAV_SIG type UBX packet
+ sl_max_m10s_ubx_nav_timels_t *packetUBXNAVTIMELS; ///< UBX_NAV_TIMELS type UBX packet
+ sl_max_m10s_ubx_nav_timeutc_t *packetUBXNAVTIMEUTC; ///< UBX_NAV_TIMEUTC type UBX packet
+ sl_max_m10s_ubx_nav_posllh_t *packetUBXNAVPOSLLH; ///< UBX_NAV_POSLLH type UBX packet
+ sl_max_m10s_ubx_nav_velned_t *packetUBXNAVVELNED; ///< UBX_NAV_VELNED UBX packet
+ sl_max_m10s_ubx_unique_id_t *packetUBXUNIQID; ///< UBX_SEC_UNIQID UBX packet
+ sl_max_m10s_nmea_gga_t *storageNMEAGPGGA; ///< GPGGA type NMEA sentence
+ sl_max_m10s_nmea_gga_t *storageNMEAGNGGA; ///< GNGGA type NMEA sentence
+ sl_max_m10s_nmea_rmc_t *storageNMEAGPRMC; ///< GPRMC type NMEA sentence
+ sl_max_m10s_nmea_rmc_t *storageNMEAGNRMC; ///< GNRMC type NMEA sentence
+ sl_max_m10s_nmea_data_t *nmea_data; ///< Data from the both NMEA sentences
+ sl_max_m10s_nmea_filtering_t processing_nmea; ///< Type of sentences to be processed
+ sl_max_m10s_msg_data_t msg_data; ///< structure for payload of UBX message
+ sl_max_m10s_ubx_packet_t packet_ack; ///< structure for UBX acknowledge type message
+ sl_max_m10s_ubx_packet_t packet_buf; ///< structure to store the UBX message as buffer
+ sl_max_m10s_ubx_packet_t packet_auto; ///< structure to store automatic type UBX message
+ sl_max_m10s_ubx_packet_t packet_cfg; ///< structure to store config type UBX message
+ char nmea_buffer[100]; ///< Buffer to store NMEA sentence.
+ uint8_t nmea_address_field[6]; ///< NMEA address field
+} sl_max_m10s_cfg_data_t;
+
+// -----------------------------------------------------------------------------
+// Prototypes
+
+/**************************************************************************//**
+ * @brief De-Initialize the gnss_cfg_data structure members
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_deinit(sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Initialization for the GNSS receiver module.
+ * @param[in] max_wait : Timeout value.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note User must set GNSS configuration structure member gnss_cfg_data.protocol_type
+ * before calling this function.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_begin(uint16_t max_wait,
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Called regularly to check for available bytes on the user specified port
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] incomingUBX : pointer to incoming UBX packet.
+ * @param[in] requested_class : class for the UBX packet.
+ * @param[in] requested_id : ID for the UBX packet.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_check_ublox_internal(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *incomingUBX,
+ uint8_t requested_class,
+ uint8_t requested_id);
+
+/**************************************************************************//**
+ * @brief sends the UBX packet via I2C.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[in] expect_ack_only : to expect only acknowledged data.
+ * @return the following values are returned:
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED if we got a config packet full of response data that has CLS/ID match to our query packet
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_CRC_FAIL if we got a corrupt config packet that has CLS/ID match to our query packet
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_TIMEOUT if we timed out
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN if we got an a valid packetCfg but that the packetCfg has been
+ * or is currently being overwritten.
+ *****************************************************************************/
+sl_max_m10s_ublox_status_e gnss_max_m10s_send_command(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool expect_ack_only);
+
+/**************************************************************************//**
+ * @brief This is used when receiving messages from module.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] incoming : a byte to add to the rolling checksum.
+ *****************************************************************************/
+void gnss_max_m10s_add_to_checksum(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t incoming);
+
+/**************************************************************************//**
+ * @brief Check if we have storage allocated for an incoming "automatic" message
+ * and calculate how much RAM is needed to store the payload for a given automatic message
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_size : pointer to maximum size.
+ * @return true/false.
+ *****************************************************************************/
+bool gnss_max_m10s_auto_lookup(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t *max_size);
+
+/**************************************************************************//**
+ * @brief Add a UBX packet to the file buffer
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] msg : pointer to UBX packet.
+ * @return true if packet is stored properly else returns false.
+ *****************************************************************************/
+bool gnss_max_m10s_store_packet(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief to set output port for UBX data only.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] com_settings : communication type
+ * @param[in] max_wait : Timeout value.
+ * @param[in] layer : RAM layer.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note User must call this function after calling begin function
+ * to set the output port as:
+ * 1. COM_TYPE_UBX: for UBX protocol.
+ * 2. COM_TYPE_NMEA: for NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_set_i2c_output(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t com_settings,
+ uint8_t layer,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Function to get delay in millisecond
+ * @param[in] period : delay in milliseconds.
+ *****************************************************************************/
+void gnss_max_m10s_delay(uint32_t period);
+
+/**************************************************************************//**
+ * @brief Get the current fix type
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] fix_type : pointer to store the fix_type data from UBX_NAV_PVT packet.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_fix_type(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *fix_type);
+
+/**************************************************************************//**
+ * @brief Get the number of satellites.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] satellite : pointer to store the number of satellite data from UBX_NAV_PVT packet.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_satellite_number(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *satellite);
+
+/**************************************************************************//**
+ * @brief Get the current longitude in degrees
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] longitude : pointer to store the current longitude from UBX_NAV_PVT packet.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_longitude(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *longitude);
+
+/**************************************************************************//**
+ * @brief Get the current latitude in degrees
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] latitude : pointer to store the current latitude from UBX_NAV_PVT packet.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_latitude(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *latitude);
+
+/**************************************************************************//**
+ * @brief Get the current altitude in mm according to mean sea level
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] altitude_msl : pointer to store the altitude from mean sea level from UBX_NAV_PVT packet.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_altitude_msl(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *altitude_msl);
+
+/**************************************************************************//**
+ * @brief Get the current day
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] day : pointer to store the current day from UBX_NAV_PVT packet
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_day(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *day);
+
+/**************************************************************************//**
+ * @brief Get the current month
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] month : pointer to store the current month from UBX_NAV_PVT packet
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_month(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *month);
+
+/**************************************************************************//**
+ * @brief Get the current year
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] year : pointer to store the current year from UBX_NAV_PVT packet
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_year(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint16_t *year);
+
+/**************************************************************************//**
+ * @brief Get the hour of time in UTC format.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] hour : pointer to store the current hour in UTC from UBX_NAV_PVT packet
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_hour(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *hour);
+
+/**************************************************************************//**
+ * @brief Get the minute of time in UTC format.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] minute : pointer to store the current minute in UTC from UBX_NAV_PVT packet
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_minute(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *minute);
+
+/**************************************************************************//**
+ * @brief Get the seconds of time in UTC format.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] seconds : pointer to store the current seconds in UTC from UBX_NAV_PVT packet
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX and NMEA protocol.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_seconds(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *seconds);
+
+/**************************************************************************//**
+ * @brief Get the milliseconds of time from time of the week data of UBX packet.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] milli_seconds : pointer to store the current millisecond in UTC from UBX_NAV_PVT packet
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_milliseconds(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint16_t *milli_seconds);
+
+/**************************************************************************//**
+ * @brief Get the nanoseconds of time in UTC format.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] nano : pointer to store the current nanoseconds from UBX_NAV_PVT packet
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_nanoseconds(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *nano);
+
+/**************************************************************************//**
+ * @brief validate the date from the UBX packet.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] valid_date : to check the date validity from UBX_NAV_PVT packet
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_valid_date(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *valid_date);
+
+/**************************************************************************//**
+ * @brief get the geoid separation from GGA type NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] geoid : to store the geoid separation in mm.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with NMEA protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_geoid(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *geoid);
+
+/**************************************************************************//**
+ * @brief get the horizontal dilution of precision from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] hdop : to store the horizontal dilution of precision.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with NMEA protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_horizontal_dilution(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *hdop);
+
+/**************************************************************************//**
+ * @brief get the course over ground from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] course : to store the course over ground in degrees.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with NMEA protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_course_over_ground(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *course);
+
+/**************************************************************************//**
+ * @brief get the navigation system in use from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] nav_system : character representing navigation system in use.
+ * @details `N` = GNSS, `P` = GPS, `L` = GLONASS, `A` = Galileo, `\0` = none.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with NMEA protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navigation_system(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ char *nav_system);
+
+/**************************************************************************//**
+ * @brief validate the time from the UBX packet.
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] valid_time : to check the time from UBX_NAV_PVT packet
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_valid_time(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *valid_time);
+
+/**************************************************************************//**
+ * @brief Get the current altitude in mm according to ellipsoid model
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] altitude : pointer to store height from ellipsoid.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_altitude(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *altitude);
+
+/**************************************************************************//**
+ * @brief Get the carrier phase range solution status
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] carrier_solution : pointer to store carrier phase range solution.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_carrier_solution(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int8_t *carrier_solution);
+
+/**************************************************************************//**
+ * @brief Get whether differential corrections were applied
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] diff_solution : pointer to store the differential correctiondata.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_differential_solution(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *diff_solution);
+
+/**************************************************************************//**
+ * @brief check the heading of vehicle
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] head_vehicle_valid : pointer to store the heading of vehicle check data.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_head_vehicle_valid(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *head_vehicle_valid);
+
+/**************************************************************************//**
+ * @brief Get heading of vehicle (2-D) in degree
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] head_vehicle : pointer to store the heading of vehicle data.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_head_vehicle(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *head_vehicle);
+
+/**************************************************************************//**
+ * @brief Get whether we have a valid fix
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] gnss_fix_ok : pointer to store the valid fix data.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_gnss_fix_ok(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *gnss_fix_ok);
+
+/**************************************************************************//**
+ * @brief get the Magnetic declination accuracy
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] magnetic_accuracy : pointer to store the magnetic declination accuracy data from the UBX packet.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_magnetic_declination_accuracy(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint16_t *magnetic_accuracy);
+
+/**************************************************************************//**
+ * @brief get the Magnetic declination
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] magnetic_declination : pointer to store the magnetic declination data from the UBX packet.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_magnetic_declination(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int16_t *magnetic_declination);
+
+/**************************************************************************//**
+ * @brief Check to see if the UTC time has been fully resolved
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] fully_resolved : pointer pointer to store the validity of time and date from the UBX packet.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_fully_resolved(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *fully_resolved);
+
+/**************************************************************************//**
+ * @brief get the data to check the invalid latitude, longitude, height from mean sea level and height from ellipsoid
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] invalid_data : pointer to store invalid data.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_invalid_data(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *invalid_data);
+
+/**************************************************************************//**
+ * @brief Get the time of week data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] time_of_week : pointer to store the time of week data.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_time_of_week(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint32_t *time_of_week);
+
+/**************************************************************************//**
+ * @brief Get the horizontal accuracy estimate in mm
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] horizontal_accuracy : pointer to store the horizontal accuracy estimate.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_horizontal_accuracy(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *horizontal_accuracy);
+
+/**************************************************************************//**
+ * @brief Get the vertical accuracy estimate in mm
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] vertical_accuracy : pointer to store the vertical accuracy estimate.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_vertical_accuracy(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *vertical_accuracy);
+
+/**************************************************************************//**
+ * @brief Get the NED north velocity in mm/s
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] ned_north : pointer to store the NED north velocity.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_ned_north(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *ned_north);
+
+/**************************************************************************//**
+ * @brief Get the NED east velocity in mm/s
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] ned_east : pointer to store the NED east velocity.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_ned_east(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *ned_east);
+
+/**************************************************************************//**
+ * @brief Get the NED down velocity in mm/s
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] ned_down : pointer to store the NED down velocity.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_ned_down(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *ned_down);
+
+/**************************************************************************//**
+ * @brief Get the heading of motion (as opposed to heading of car) in degrees * 10^-5.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] head_of_motion : pointer to store the heading of motion.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_heading_of_motion(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *head_of_motion);
+
+/**************************************************************************//**
+ * @brief Get the ground speed in mm/s.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] ground_speed : pointer to store the ground speed in mm/s
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note 1. Can be used with UBX and NMEA protocol.
+ * 2. In NMEA protocol the unit for speed is in knots.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_ground_speed(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *ground_speed);
+
+/**************************************************************************//**
+ * @brief Get the heading accuracy estimate (both motion and vehicle) in degree.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] heading_accuracy : pointer to store the heading accuracy estimate (both motion and vehicle) in degree
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_heading_accuracy(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *heading_accuracy);
+
+/**************************************************************************//**
+ * @brief to check the confirm time is available or not.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] confirm_time : pointer to store the confirm time check data.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_confirm_time(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *confirm_time);
+
+/**************************************************************************//**
+ * @brief to check the confirm date is available or not.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] confirm_date : pointer to store the confirm date check data.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_confirm_date(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *confirm_date);
+
+/**************************************************************************//**
+ * @brief get the speed accuracy estimate of the space vehicle
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] speed_accuracy : pointer pointer to store the speed accuracy estimate.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_speed_accuracy(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *speed_accuracy);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-PVT type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1.To access the any data use: gnss_cfg_data.packetUBXNAVPVT.data.data_to_access
+ * 2. Scaling factor of 10^-7 should be applied while reading the latitude and longitude data.
+ * 3. Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_nav_pvt(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-STATUS type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1. To access the any data use: gnss_cfg_data.packetUBXNAVSTATUS.data.data_to_access
+ * 2. Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navstatus(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-SAT type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1. To access the any data use: gnss_cfg_data.packetUBXNAVSAT.data.block/header.data_to_access
+ * 2. Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navsat(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-SIG type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1. To access the any data use:
+ * gnss_cfg_data.packetUBXNAVSIG.data.block/header.data_to_access
+ * 2. Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navsig(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-EOE type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1. To access the any data use:
+ * gnss_cfg_data.packetUBXNAVEOE.data.data_to_access
+ * 2. Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navepoch(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-DOP type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1.Multiply with scaling factor of 0.01 while getting all the data from this function.
+ * 2.To access the any data use:
+ * gnss_cfg_data.packetUBXNAVDOP.data.data_to_access
+ * 3.Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navdop(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-POSLLH type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1. To access the any data use:
+ * gnss_cfg_data.packetUBXNAVPOSLLH.data.data_to_access
+ * 2. Scaling factor of 10^-7 should be applied while measuring
+ * latitude and longitude in degree decimal format.
+ * 3. Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navposllh(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-TIMELS type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1. To access the any data use:
+ * gnss_cfg_data.packetUBXNAVTIMELS.data.data_to_access
+ * 2. Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navtimels(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-TIMEUTC type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1. To access the any data use:
+ * gnss_cfg_data.packetUBXNAVTIMEUTC.data.data_to_access
+ * 2. Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navtimeutc(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-CLOCK type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1. To access the any data use:
+ * gnss_cfg_data.packetUBXNAVCLOCK.data.data_to_access
+ * 2. Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navclock(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the UBX-NAV-VELNED type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note 1. To access the any data use:
+ * gnss_cfg_data.packetUBXNAVVELNED.data.data_to_access
+ * 2. Scaling factor of 10^-5 should be applied while reading the data for
+ * heading accuracy and course accuracy.
+ * 3. Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navvelned(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the position dilution type data from UBX packet
+ * @param[in] gnss_cfg_data : pointer to the structure containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[out] position_dillution : pointer pointer to store the position dilution data.
+ * @return following values
+ * - \ref SL_STATUS_OK if data is available.
+ * - \ref SL_STATUS_FAIL if data is not available.
+ * @note Can be used with UBX protocol only.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_positional_dillution(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int16_t *position_dillution);
+
+/**************************************************************************//**
+ * @brief Check how much time has passed since the program started.
+ * @return time taken in milliseconds.
+ *****************************************************************************/
+uint32_t gnss_max_m10s_milli_sec();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GNSS_MAX_M10S_H_
+
+/******************************************************************************/
+/* EOF */
+/******************************************************************************/
diff --git a/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_micro_nmea.h b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_micro_nmea.h
new file mode 100644
index 00000000..cf99dfa3
--- /dev/null
+++ b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_micro_nmea.h
@@ -0,0 +1,208 @@
+/***************************************************************************//**
+ * @file gnss_max_m10s_micro_nmea.h
+ * @brief MAX_M10S GNSS receiver driver micro-NMEA related external APIs.
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ * # Evaluation Quality
+ * This code has been minimally tested to ensure that it builds and is suitable
+ * as a demonstration for evaluation purposes only. This code will be maintained
+ * at the sole discretion of Silicon Labs.
+ ******************************************************************************/
+
+#ifndef GNSS_MAX_M10S_MICRO_NMEA_H_
+#define GNSS_MAX_M10S_MICRO_NMEA_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/// Includes
+#include
+#include "gnss_max_m10s_nmea_struct.h"
+#include "gnss_max_m10s_nmea.h"
+
+/*******************************************************************************
+ *************************** Defines / Macros ********************************
+ ******************************************************************************/
+
+/*******************************************************************************
+ ************************* ENUMS and Structures *****************************
+ ******************************************************************************/
+
+// -----------------------------------------------------------------------------
+// Prototypes
+
+/**************************************************************************//**
+ * @brief initializes buffer allocated to micro nmea library.
+ * @param[in] gnss_cfg_data : pointer to the GNSS cfg data structure.
+ *****************************************************************************/
+void gnss_max_m10s_init_micro_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Clear all information related to NMEA data.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ *****************************************************************************/
+void gnss_max_m10s_clear_nmea_data(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the horizontal dilution of precision.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return horizontal dilution of precision value.
+ *****************************************************************************/
+uint8_t gnss_max_m10s_nmea_get_hdop(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief check if latest fix is valid.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return true if valid.
+ * false if not valid.
+ *****************************************************************************/
+bool gnss_max_m10s_nmea_is_valid(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the navigation system in use.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return navigation system in use.
+ *****************************************************************************/
+char gnss_max_m10s_nmea_get_nav_system(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the number of satellites from NMEA sentence.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return number of satellites.
+ *****************************************************************************/
+uint8_t gnss_max_m10s_nmea_get_num_satellites(
+ sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the latitude from NMEA sentence.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return current latitude in millionth of degree.
+ *****************************************************************************/
+int32_t gnss_max_m10s_nmea_get_latitude(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the longitude from NMEA sentence.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return current longitude in millionth of degree.
+ *****************************************************************************/
+int32_t gnss_max_m10s_nmea_get_longitude(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the altitude from mean sea level from NMEA sentence.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @param[out] alt : pointer to value of altitude in mm.
+ * @return true altitude is valid
+ * false altitude not valid
+ *****************************************************************************/
+bool gnss_max_m10s_nmea_get_altitude_msl(int32_t *alt,
+ sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the height above WGS84 Geoid in mm.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @param[out] alt : pointer to value of altitude in mm.
+ * @return true altitude is valid
+ * false altitude not valid
+ *****************************************************************************/
+bool gnss_max_m10s_nmea_get_geoid_height(int32_t *alt,
+ sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the current year.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return current year in UTC format.
+ *****************************************************************************/
+uint16_t gnss_max_m10s_nmea_get_year(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the current month of year.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return current month of year in UTC format.
+ *****************************************************************************/
+uint8_t gnss_max_m10s_nmea_get_month(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the current day.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return current day in UTC format.
+ *****************************************************************************/
+uint8_t gnss_max_m10s_nmea_get_day(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the current hour.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return current hour in UTC format.
+ *****************************************************************************/
+uint8_t gnss_max_m10s_nmea_get_hour(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the current minute.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return current minute in UTC format.
+ *****************************************************************************/
+uint8_t gnss_max_m10s_nmea_get_minute(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the current second.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return current second in UTC format.
+ *****************************************************************************/
+uint8_t gnss_max_m10s_nmea_get_second(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the speed over ground.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return speed over ground in knots.
+ *****************************************************************************/
+int32_t gnss_max_m10s_nmea_get_speed(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief Get the course over ground.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @return course over ground in degrees.
+ *****************************************************************************/
+int32_t gnss_max_m10s_nmea_get_course(sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief To process a character.
+ * @param[in] nmea_data : pointer to the NMEA data structure.
+ * @param[in] c : Character to process
+ * @return true A complete non-empty sentence has been processed
+ * false End of sentence not detected
+ *****************************************************************************/
+bool gnss_max_m10s_process_nmea(char c, sl_max_m10s_nmea_data_t *nmea_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GNSS_MAX_M10S_MICRO_NMEA_H_
+
+/******************************************************************************/
+/* EOF */
+/******************************************************************************/
diff --git a/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_nmea.h b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_nmea.h
new file mode 100644
index 00000000..1a5f0e43
--- /dev/null
+++ b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_nmea.h
@@ -0,0 +1,382 @@
+/***************************************************************************//**
+ * @file gnss_max_m10s_nmea.h
+ * @brief MAX_M10S GNSS receiver driver external APIs for NMEA sentence data
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ * # Evaluation Quality
+ * This code has been minimally tested to ensure that it builds and is suitable
+ * as a demonstration for evaluation purposes only. This code will be maintained
+ * at the sole discretion of Silicon Labs.
+ ******************************************************************************/
+
+#ifndef GNSS_MAX_M10S_NMEA_H_
+#define GNSS_MAX_M10S_NMEA_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "gnss_max_m10s_driver.h"
+#include "gnss_max_m10s_micro_nmea.h"
+#include "gnss_max_m10s_nmea_struct.h"
+
+/******************************************************************************/
+
+/*******************************************************************************
+ *************************** Defines / Macros ********************************
+ ******************************************************************************/
+
+/*******************************************************************************
+ ******************************** ENUMS ************************************
+ ******************************************************************************/
+
+// -----------------------------------------------------------------------------
+// Prototypes
+
+/**************************************************************************//**
+ * @brief To initialize the NMEA buffer and NMEA data structure.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @return the following values are returned:
+ * true for success.
+ * false for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_nmea_init(sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief To check if the header of the NMEA sentence is valid.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @return the following values are returned:
+ * true for success.
+ * false for failure.
+ *****************************************************************************/
+bool gnss_max_m10s_is_nmea_header_valid(sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief To check if we should pass this NMEA message
+ * to process from micro nmea library.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @return true for success and fail for failure.
+ *****************************************************************************/
+bool gnss_max_m10s_process_current_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Get a pointer to the automatic NMEA flags.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @return pointer to the automatic NMEA flags.
+ *****************************************************************************/
+sl_max_m10s_nmea_automatic_flags_t * gnss_max_m10s_get_nmea_flags_ptr(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Get a pointer to the complete copy NMEA data.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @return pointer to the complete copy of the NMEA data structure.
+ *****************************************************************************/
+uint8_t * gnss_max_m10s_get_complete_copy_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Get a pointer to the complete copy length.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @return pointer to the complete copy length of the NMEA data structure.
+ ****************************************************************************/
+uint8_t * gnss_max_m10s_get_nmea_complete_length_ptr(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Get the maximum length of given NMEA message.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @return the maximum length of the NMEA message.
+ ****************************************************************************/
+uint8_t gnss_max_m10s_get_nmea_max_length(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Get a pointer to the working copy NMEA data.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @return pointer to working copy of NMEA data.
+ ****************************************************************************/
+uint8_t * gnss_max_m10s_get_nmea_working_ptr(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Get a pointer to the working copy length of NMEA data.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @return pointer to the working copy length of NMEA data.
+ ****************************************************************************/
+uint8_t * gnss_max_m10s_get_nmea_working_length_ptr(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Check if the NMEA message is "auto" and has dedicated RAM allocated for it.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_is_nmea_auto(sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Get the latitude value from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] latitude : value of latitude in degree minutes format.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_latitude_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *latitude,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the longitude value from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] longitude : value of longitude in degree minutes format.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_longitude_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *longitude,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the altitude from mean sea level value from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] altitude_msl : value of altitude from mean sea level in mm.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_altitude_msl_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *altitude_msl,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the geoid separation from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] geoid : geoid separation in mm.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_geoid_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *geoid,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the quality of fix from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] quality : value of quality of fix.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_quality_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *quality,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the number of satellites from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] num_sat : number of satellites.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_satellite_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *num_sat,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the current day from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] day : current day.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_day_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *day,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the current month value from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] month : current month.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_month_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *month,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the current year from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] year : current year.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_year_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t *year,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the hour in UTC from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] hour : current hour in UTC format.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_hour_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *hour,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the current minute of hour from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] min : minute of hour in UTC format.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_min_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *min,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the current second in UTC format.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] second : value of current second in UTC format.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_second_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *second,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the horizontal dilution of precision value from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] hdop : value of horizontal dilution of precision.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_horizontal_dilution_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *hdop,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the speed over ground value from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] speed : value of speed over ground in knots.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_speed_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *speed,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the course over ground value from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] course : value of course over ground in degree.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_ground_course_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *course,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the horizontal dilution of precision value from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] hdop : value of horizontal dilution of precision.
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_horizontal_dilution_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *hdop,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Get the navigation system from NMEA sentence.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[out] nav_system : value of horizontal dilution of precision.
+ * @details `N` = GNSS, `P` = GPS, `L` = GLONASS, `A` = Galileo, `\0` = none
+ * @param[in] max_time : max timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_nav_system_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ char *nav_system,
+ uint16_t max_time);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GNSS_MAX_M10S_NMEA_H_
+
+/******************************************************************************/
+/* EOF */
+/******************************************************************************/
diff --git a/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_nmea_struct.h b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_nmea_struct.h
new file mode 100644
index 00000000..9133bda9
--- /dev/null
+++ b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_nmea_struct.h
@@ -0,0 +1,169 @@
+/***************************************************************************//**
+ * @file gnss_max_m10s_nmea_struct.h
+ * @brief MAX_M10S GNSS receiver NMEA sentence structures
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ * # Evaluation Quality
+ * This code has been minimally tested to ensure that it builds and is suitable
+ * as a demonstration for evaluation purposes only. This code will be maintained
+ * at the sole discretion of Silicon Labs.
+ ******************************************************************************/
+
+#ifndef GNSS_MAX_M10S_NMEA_STRUCT_H_
+#define GNSS_MAX_M10S_NMEA_STRUCT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+/******************************************************************************/
+
+/*******************************************************************************
+ *************************** Defines / Macros ********************************
+ ******************************************************************************/
+
+#define SL_MAX_M10S_NMEA_GGA_MAX_LENGTH 100 ///< Maximum length for GGA type NMEA sentence
+#define SL_MAX_M10S_NMEA_RMC_MAX_LENGTH 100 ///< Maximum length for RMC type NMEA sentence
+#define SL_MAX_M10S_NMEA_BYTE_COUNT SL_MAX_M10S_NMEA_GGA_MAX_LENGTH ///< Maximum byte counts for any NMEA sentence type
+
+/*******************************************************************************
+ ******************************** ENUMS ************************************
+ ******************************************************************************/
+
+/// @brief type of NMEA sentence to be processed
+typedef enum
+{
+ SL_MAX_M10S_FILTER_NMEA_ALL = 0x01, ///< To allow all NMEA sentence to be processed.
+ SL_MAX_M10S_FILTER_NMEA_GGA = 0x02, ///< To allow only GGA type NMEA sentence to be processed.
+ SL_MAX_M10S_FILTER_NMEA_RMC = 0x04, ///< To allow only RMC type NMEA sentence to be processed.
+} sl_max_m10s_filter_nmea_e;
+
+/// @brief Additional flags and pointers that need to be stored with each NMEA sentence type
+typedef struct sl_max_m10s_nmea_automatic_flags
+{
+ union
+ {
+ uint8_t all;
+ struct
+ {
+ uint8_t complete_copy_valid : 1; ///< Check if the copy of the data struct valid/fresh
+ uint8_t complete_copy_read : 1; ///< Check if the complete copy been read
+ uint8_t callback_copy_valid : 1; ///< Check if the copy of the data struct used by the callback valid/fresh
+ } bits;
+ } flags; ///< Automatic flags
+} sl_max_m10s_nmea_automatic_flags_t;
+
+/// @brief to store length and buffer for GGA type NMEA sentence
+typedef struct
+{
+ uint8_t length; ///< The number of bytes in nmea
+ uint8_t nmea[SL_MAX_M10S_NMEA_GGA_MAX_LENGTH]; ///< Buffer to store the GGA type NMEA sentence
+} sl_max_m10s_nmea_gga_data_t;
+
+/// @brief to store the GGA type NMEA sentence
+typedef struct
+{
+ sl_max_m10s_nmea_automatic_flags_t automatic_flags; ///< Automatic flags
+ sl_max_m10s_nmea_gga_data_t working_copy; ///< Incoming data is added to the working copy
+ sl_max_m10s_nmea_gga_data_t complete_copy; ///< The working copy is copied into the complete copy when all data has been received and the checksum is valid
+ void (*callback_pointer_ptr)(sl_max_m10s_nmea_gga_data_t *); ///< Callback pointer
+ sl_max_m10s_nmea_gga_data_t *callback_copy; ///< The callback gets its own preserved copy of the complete copy
+} sl_max_m10s_nmea_gga_t;
+
+/// @brief to store the length and buffer for RMC type NMEA sentence
+typedef struct
+{
+ uint8_t length; ///< The number of bytes in nmea
+ uint8_t nmea[SL_MAX_M10S_NMEA_RMC_MAX_LENGTH]; ///< Buffer to store RMC type NMEA sentence
+} sl_max_m10s_nmea_rmc_data_t;
+
+/// @brief struct to store RMC type NMEA sentence
+typedef struct
+{
+ sl_max_m10s_nmea_automatic_flags_t automatic_flags; ///< Automatic flags
+ sl_max_m10s_nmea_rmc_data_t working_copy; ///< Incoming data is added to the working copy
+ sl_max_m10s_nmea_rmc_data_t complete_copy; ///< The working copy is copied into the complete copy when all data has been received and the checksum is valid
+ void (*callback_pointer_ptr)(sl_max_m10s_nmea_rmc_data_t *); ///< pointer to callback
+ sl_max_m10s_nmea_rmc_data_t *callbackCopy; ///< The callback gets its own preserved copy of the complete copy
+} sl_max_m10s_nmea_rmc_t;
+
+/// @brief struct to allow selective logging / processing of NMEA messages
+typedef struct
+{
+ union
+ {
+ uint8_t all;
+ struct
+ {
+ uint8_t all : 1;
+ uint8_t UBX_NMEA_GGA : 1;
+ uint8_t UBX_NMEA_RMC : 1;
+ } bits;
+ };
+} sl_max_m10s_nmea_filtering_t;
+
+/// @brief to store the data used in micro-NMEA library and data parsed from NMEA sentence
+typedef struct sl_max_m10s_nmea_data
+{
+ uint8_t buffer_len; ///< NMEA sentence buffer length
+ uint8_t month; ///< Current month in UTC format
+ uint8_t day; ///< Current day in UTC format
+ uint8_t hour; ///< Current hour in UTC format
+ uint8_t minute; ///< Current minute in UTC format
+ uint8_t second; ///< Current second in UTC format
+ uint8_t quality; ///< Quality indicator for position fix
+ uint8_t num_sat; ///< number of satellites tracked
+ uint8_t hdop; ///< Horizontal dilution of precision.
+ bool altitude_valid; ///< Flag to check the validity of altitude
+ bool geoid_height_valid;///< Flag to check the validity of geoid height
+ bool is_valid; ///< Flag to check the valid data
+ char talker_id; ///< Talker ID of NMEA sentence
+ char nav_system; ///< navigation system from the NMEA sentence
+ uint16_t year; ///< Current year in UTC format
+ uint32_t geoid_height; ///< the height above WGS84 Geoid in milli-metres
+ int32_t latitude; ///< Latitude of current position in degrees and minutes
+ int32_t longitude; ///< Longitude of current position in degrees and minutes
+ int32_t altitude; ///< Altitude from mean sea level in milli-metres
+ int32_t speed; ///< Speed over ground in knots
+ int32_t course; ///< Course over ground in degrees
+ char *buffer; ///< Pointer to the start of the buffer
+ char *ptr; ///< Pointer to track the current position in NMEA sentence buffer.
+ char message_id[6]; ///< message ID of the NMEA sentence
+} sl_max_m10s_nmea_data_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GNSS_MAX_M10S_NMEA_STRUCT_H_
+
+/******************************************************************************/
+/* EOF */
+/******************************************************************************/
diff --git a/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_ubx.h b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_ubx.h
new file mode 100644
index 00000000..abb51f63
--- /dev/null
+++ b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_ubx.h
@@ -0,0 +1,344 @@
+/***************************************************************************//**
+ * @file gnss_max_m10s_ubx.h
+ * @brief MAX_M10S GNSS receiver driver external APIs for UBX sentence data.
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ * # Evaluation Quality
+ * This code has been minimally tested to ensure that it builds and is suitable
+ * as a demonstration for evaluation purposes only. This code will be maintained
+ * at the sole discretion of Silicon Labs.
+ ******************************************************************************/
+
+#ifndef GNSS_MAX_M10S_UBX_H_
+#define GNSS_MAX_M10S_UBX_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "gnss_max_m10s_driver.h"
+
+/******************************************************************************/
+
+/*******************************************************************************
+ *************************** Defines / Macros ********************************
+ ******************************************************************************/
+
+/*******************************************************************************
+ ******************************** ENUMS ************************************
+ ******************************************************************************/
+
+// -----------------------------------------------------------------------------
+// Prototypes
+
+/**************************************************************************//**
+ * @brief To process all the data from all UBX packets.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void gnss_max_m10s_process_ubx_packet(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_STATUS packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navstatus_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_DOP packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navdop_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_CLOCK packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navclock_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_EOE packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navepoch_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_SAT packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navsat_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_SIG packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navsig_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_TIMELS packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navtimels_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_TIMEUTC packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navtimeutc_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_POSLLH packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navposllh_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_VELNED packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navvelned_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To process all the data from the UBX_NAV_PVT packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_ubx_navpvt_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief Get the unique ID from UBX_SEC_UNIQID packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] msg : pointer to the packet payload.
+ *****************************************************************************/
+void sl_max_m10s_get_unique_id(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief To get all the data from the UBX_NAV_PVT packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navpvt_data(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Given a spot, extract a byte from the payload
+ * @param[in] msg : pointer to the payload
+ * @param[in] spot_to_start : starting spot for the extraction.
+ * @return byte extracted from the payload.
+ *****************************************************************************/
+uint8_t gnss_max_m10s_extract_byte(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start);
+
+/**************************************************************************//**
+ * @brief Given a character, file it away into the ubx packet structure and
+ * set valid to VALID or NOT_VALID once sentence is completely received
+ * and passes or fails CRC
+ * @param[in] gnss_cfg_data : pointer to the structure containing
+ * GNSS configuration data.
+ * @param[in] incoming : character to check
+ * @param[in] requested_class : class of the UBX packet.
+ * @param[in] requested_id : ID for the UBX packet.
+ *****************************************************************************/
+void gnss_max_m10s_process_ubx(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t incoming,
+ uint8_t requested_class,
+ uint8_t requested_id);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_PVT packet and to get all the data
+ * from the UBX_NAV_PVT packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navpvt_ubx(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_EOE packet and to get all the data
+ * from the UBX_NAV_EOE packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navepoch_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_SAT packet and to get all the data
+ * from the UBX_NAV_SAT packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navsat_ubx(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_SIG packet and to get all the data
+ * from the UBX_NAV_SIG packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navsig_ubx(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_STATUS packet and to get all the data
+ * from the UBX_NAV_STATUS packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navstatus_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_TIMELS packet and to get all the data
+ * from the UBX_NAV_TIMELS packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navtimels_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_TIMEUTC packet and to get all the data
+ * from the UBX_NAV_TIMEUTC packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navtimeutc_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_DOP packet and to get all the data
+ * from the UBX_NAV_DOP packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navdop_ubx(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_POSLLH packet and to get all the data
+ * from the UBX_NAV_POSLLH packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navposllh_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_CLOCK packet and to get all the data
+ * from the UBX_NAV_CLOCK packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navclock_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief To Initialize the UBX_NAV_VELNED packet and to get all the data
+ * from the UBX_NAV_VELNED packet.
+ * @param[in] gnss_cfg_data : pointer to the GNSS config data.
+ * @param[in] max_wait : Timeout value.
+ * @return the following values are returned:
+ * - \ref SL_STATUS_OK for success.
+ * - \ref SL_STATUS_FAIL for failure.
+ *****************************************************************************/
+sl_status_t gnss_max_m10s_get_navvelned_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GNSS_MAX_M10S_UBX_H_
+
+/******************************************************************************/
+/* EOF */
+/******************************************************************************/
diff --git a/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_ubx_struct.h b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_ubx_struct.h
new file mode 100644
index 00000000..5664ace0
--- /dev/null
+++ b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_ubx_struct.h
@@ -0,0 +1,511 @@
+/***************************************************************************//**
+ * @file gnss_max_m10s_ubx_struct.h
+ * @brief MAX_M10S GNSS receiver UBX packet structures
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ * # Evaluation Quality
+ * This code has been minimally tested to ensure that it builds and is suitable
+ * as a demonstration for evaluation purposes only. This code will be maintained
+ * at the sole discretion of Silicon Labs.
+ ******************************************************************************/
+
+#ifndef GNSS_MAX_M10S_UBX_STRUCT_H_
+#define GNSS_MAX_M10S_UBX_STRUCT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************/
+
+/*******************************************************************************
+ *************************** Defines / Macros ********************************
+ ******************************************************************************/
+
+/*******************************************************************************
+ ******************************** ENUMS ************************************
+ ******************************************************************************/
+
+/// @brief Flags to check the UBX packet update
+typedef struct sl_max_m10s_ubx_automatic_flags
+{
+ union
+ {
+ uint8_t all; ///< Used to check all the data type of the UBX packet
+ struct
+ {
+ uint8_t automatic : 1; ///< Used to check if this message be delivered and parsed "automatically" (without polling)
+ uint8_t implicitUpdate : 1; ///< Used to check if the update triggered by accessing stale data (=true) or by a call to checkUblox (=false)
+ uint8_t addToFileBuffer : 1; ///< Used to check if the raw UBX data be added to the file buffer
+ uint8_t callbackCopyValid : 1; ///< Used to check if the copy of the data struct used by the callback valid/fresh
+ } bits; ///< bits to represent different data
+ } flags; ///< To store the flags to check the UBX packet update
+}sl_max_m10s_ubx_automatic_flags_t;
+
+/// @brief structure to store the data for UBX-NAV-PVT
+typedef struct sl_max_m10s_ubx_nav_pvt_data
+{
+ uint32_t iTOW; ///< GPS time of week of the navigation epoch: ms
+ uint8_t fixType; ///< GNSSfix Type
+ uint8_t numSV; ///< Number of satellites used in navigation Solution
+ int32_t lon; ///< Longitude: deg * 1e-7
+ int32_t lat; ///< Latitude: deg * 1e-7
+ int32_t height; ///< Height above ellipsoid: mm
+ int32_t hMSL; ///< Height above mean sea level: mm
+ uint8_t hour; ///< Hour of day, range 0..23 (UTC)
+ uint8_t min; ///< Minute of hour, range 0..59 (UTC)
+ uint8_t sec; ///< Seconds of minute, range 0..60 (UTC)
+ uint8_t nano; ///< nano seconds of time (UTC)
+ uint8_t tAcc; ///< time accuracy estimate (nano seconds)
+ uint16_t year; ///< Year (UTC)
+ uint8_t month; ///< Month, range 1..12 (UTC)
+ uint8_t day; ///< Day of month, range 1..31 (UTC)
+ uint32_t hAcc; ///< Horizontal accuracy estimate: mm
+ uint32_t vAcc; ///< Vertical accuracy estimate: mm
+ int32_t velN; ///< NED north velocity: mm/s
+ int32_t velE; ///< NED east velocity: mm/s
+ int32_t velD; ///< NED down velocity: mm/s
+ int32_t gSpeed; ///< Ground Speed (2-D): mm/s
+ int32_t headMot; ///< Heading of motion (2-D): deg * 1e-5
+ uint32_t sAcc; ///< Speed accuracy estimate: mm/s
+ uint32_t headAcc; ///< Heading accuracy estimate (both motion and vehicle): deg * 1e-5
+ uint16_t pDOP; ///< Position DOP * 0.01
+ uint8_t reserved1[5]; ///< Reserved data
+ int32_t headVeh; ///< Heading of vehicle (2-D): deg * 1e-5
+ int16_t magDec; ///< Magnetic declination: deg * 1e-2
+ uint16_t magAcc; ///< Magnetic declination accuracy: deg * 1e-2
+ union
+ {
+ uint8_t all; ///< To store different data represented in bits.
+ struct
+ {
+ uint8_t valid_date : 1; ///< 1 = valid UTC Date
+ uint8_t valid_time : 1; ///< 1 = valid UTC time of day
+ uint8_t fullyResolved : 1; ///< 1 = UTC time of day has been fully resolved (no seconds uncertainty).
+ uint8_t validMag : 1; ///< 1 = valid magnetic declination
+ } bits; ///< bits to represent different data
+ } valid; ///< Validity flags
+
+ union
+ {
+ uint8_t all; ///< To store different data represented in bits.
+ struct
+ {
+ uint8_t reserved : 5; ///< Reserved bits
+ uint8_t confirmed_available : 1; ///< 1 = information about UTC Date and Time of Day validity confirmation is available
+ uint8_t confirmed_date : 1; ///< 1 = UTC Date validity could be confirmed
+ uint8_t confirmed_time : 1; ///< 1 = UTC Time of Day could be confirmed
+ }confirm_data; ///< Confirmation data
+ }confirm_flags; ///< Confirmation flags
+ union
+ {
+ uint8_t all; ///< To store different data represented in bits.
+ struct
+ {
+ uint8_t invalidLlh : 1; ///< 1 = Invalid lon, lat, height and hMSL
+ uint8_t lastCorrectionAge : 4; ///< Age of the most recently received differential correction
+ } bits; ///< bits to represent different data
+ } correction_flags; ///< Correction data flags
+ union
+ {
+ uint8_t all;
+ struct
+ {
+ uint8_t gnssFixOK : 1; ///< 1 = valid fix (i.e within DOP & accuracy masks)
+ uint8_t diffSoln : 1; ///< 1 = differential corrections were applied
+ uint8_t psmState : 3; ///< Power save mode state
+ uint8_t headVehValid : 1; ///< 1 = heading of vehicle is valid, only set if the receiver is in sensor fusion mode
+ uint8_t carrSoln : 2; ///< Carrier phase range solution status
+ } bits; ///< bits to represent different data
+ } solution_flags; ///< Solution flags
+} sl_max_m10s_ubx_nav_pvt_data_t;
+
+/// @brief To store the UBX packet with data, flags and updated values.
+typedef struct sl_max_m10s_ubx_nav_pvt
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< To store automatic flags for the UBX packet
+ sl_max_m10s_ubx_nav_pvt_data_t data; ///< To store the data for the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_nav_pvt_data_t *); ///< To store the callback pointer for UBX packet
+ sl_max_m10s_ubx_nav_pvt_data_t *callback_data; ///< To get the callback data
+} sl_max_m10s_ubx_nav_pvt_t;
+
+/// @brief structure to store the data for UBX-NAV-STATUS
+typedef struct sl_max_m10s_ubx_nav_status_data
+{
+ uint32_t iTOW; ///< GPS time of week of the navigation epoch: ms
+ uint8_t gps_fix; ///< GPS fix Type
+ union
+ {
+ uint8_t all; ///< To store different data represented in bits.
+ struct
+ {
+ uint8_t gps_fix_ok : 1; ///< 1 = position and velocity valid and within DOP and ACC Masks.
+ uint8_t differential_solution : 1; ///< 1 = differential corrections were applied
+ uint8_t week_number : 1; ///< 1 = Week Number valid (see Time Validity section for details)
+ uint8_t time_of_week : 1; ///< 1 = Time of Week valid (see Time Validity section for details)
+ } bits; ///< bits to represent different data
+ } flags; ///< Fix status flags
+ union
+ {
+ uint8_t all; ///< To store different data represented in bits.
+ struct
+ {
+ uint8_t differential_correction : 1; ///< 1 = differential corrections available
+ uint8_t correction_valid : 1; ///< 1 = valid carrSoln
+ uint8_t reserved : 4; ///< reserved bits
+ uint8_t map_matching : 2; ///< map matching status
+ } bits; ///< bits to represent different data
+ } fix_status; ///< Fix Status Information
+ union
+ {
+ uint8_t all; ///< To store different data represented in bits.
+ struct
+ {
+ uint8_t psm_state : 2; ///< power save mode stateE
+ uint8_t reserved_1 : 1; ///< reserved bit
+ uint8_t spoof_state : 2; ///< Spoofing detection state
+ uint8_t reserved_2 : 1; ///< reserved bits
+ uint8_t carrier_solution : 2; ///< Carrier phase range solution status
+ } bits; ///< bits to represent different data
+ } flags_2; ///< Additional flags
+ uint32_t time_to_first_fix; ///< Time to first fix (millisecond time tag): ms
+ uint32_t milli_sec_since_startup; ///< Milliseconds since Startup / Reset: ms
+} sl_max_m10s_ubx_nav_status_data_t;
+
+/// @brief structure to store the UBX-NAV-STATUS packet
+typedef struct
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< Automatic flags for UBX packet
+ sl_max_m10s_ubx_nav_status_data_t data; ///< Data from the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_nav_status_data_t *); ///< Callback pointer
+ sl_max_m10s_ubx_nav_status_data_t *callback_data; ///< Pointer to callback data
+} sl_max_m10s_ubx_nav_status_t;
+
+/// @brief structure to store the data for UBX-NAV-DOP
+typedef struct
+{
+ uint32_t iTOW; ///< GPS time of week of the navigation epoch: ms
+ uint16_t geometric; ///< Geometric DOP: * 0.01
+ uint16_t position; ///< Position DOP: * 0.01
+ uint16_t time; ///< Time DOP: * 0.01
+ uint16_t vertical; ///< Vertical DOP: * 0.01
+ uint16_t horizontal; ///< Horizontal DOP: * 0.01
+ uint16_t north; ///< Northing DOP: * 0.01
+ uint16_t east; ///< Easting DOP: * 0.01
+} sl_max_m10s_ubx_nav_dop_data_t;
+
+/// @brief structure to store the UBX-NAV-DOP packet
+typedef struct sl_max_m10s_ubx_nav_dop
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< Automatic flags for UBX packet
+ sl_max_m10s_ubx_nav_dop_data_t data; ///< Data from the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_nav_dop_data_t *); ///< Callback pointer
+ sl_max_m10s_ubx_nav_dop_data_t *callback_data; ///< Pointer to callback data
+} sl_max_m10s_ubx_nav_dop_t;
+
+/// @brief structure to store the data for UBX-NAV-CLOCK
+typedef struct
+{
+ uint32_t iTOW; ///< GPS time of week of the navigation epoch: ms
+ int32_t clock_bias; ///< Clock bias: ns
+ int32_t clock_drift; ///< Clock drift: ns/s
+ uint32_t time_accuracy; ///< Time accuracy estimate: ns
+ uint32_t freq_accuracy; ///< Frequency accuracy estimate: ps/s
+} sl_max_m10s_ubx_nav_clock_data_t;
+
+/// @brief structure to store the UBX-NAV-CLOCK packet
+typedef struct sl_max_m10s_ubx_nav_clock
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< Automatic flags for UBX packet
+ sl_max_m10s_ubx_nav_clock_data_t data; ///< Data from the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_nav_clock_data_t *); ///< Callback pointer
+ sl_max_m10s_ubx_nav_clock_data_t *callback_data; ///< Pointer to callback data
+} sl_max_m10s_ubx_nav_clock_t;
+
+/// @brief structure to store the data for UBX-NAV-EOE
+typedef struct
+{
+ uint32_t iTOW; ///< GPS time of week of the navigation epoch: ms
+} sl_max_m10s_ubx_nav_epoch_data_t;
+
+/// @brief structure to store the UBX-NAV-EOE packet
+typedef struct sl_max_m10s_ubx_nav_epoch
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< Automatic flags for UBX packet
+ sl_max_m10s_ubx_nav_epoch_data_t data; ///< Data from the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_nav_epoch_data_t *); ///< Callback pointer
+ sl_max_m10s_ubx_nav_epoch_data_t *callback_data; ///< Pointer to callback data
+} sl_max_m10s_ubx_nav_epoch_t;
+
+/// @brief structure to store common data for UBX-NAV-SAT packet
+typedef struct
+{
+ uint32_t iTOW; ///< GPS time of week
+ uint8_t version; ///< Message version (0x01 for this version)
+ uint8_t num_sv; ///< Number of satellites
+ uint8_t reserved1[2]; ///< Reserved bits
+} sl_max_m10s_ubx_navsat_header_t;
+
+/// @brief structure to store the data specific to subset of signal identifier for UBX-NAV-SAT
+typedef struct
+{
+ uint8_t gnss_id; ///< GNSS identifier
+ uint8_t sv_id; ///< Satellite identifier
+ uint8_t carrier_noise_ratio; ///< Carrier-to-noise density ratio: dB-Hz
+ int8_t elevation; ///< Elevation (range: +/-90): deg
+ int16_t azimuth; ///< Azimuth (range 0-360): deg
+ int16_t pseudo_range; ///< Pseudorange residual: m * 0.1
+ union
+ {
+ uint32_t all; ///< Used to check all the data type of the UBX packet
+ struct
+ {
+ uint32_t quality_indicator : 3; ///< Signal quality indicator: 0: no signal
+ uint32_t sv_used : 1; ///< 1 = Signal in the subset specified in Signal Identifiers is currently being used for navigation
+ uint32_t health : 2; ///< Signal health flag: 0: unknown 1: healthy 2: unhealthy
+ uint32_t diff_correction : 1; ///< 1 = differential correction data is available for this SV
+ uint32_t smoothed : 1; ///< 1 = carrier smoothed pseudorange used
+ uint32_t orbit_source : 3; ///< Orbit source
+ uint32_t ephemeris_avail : 1; ///< 1 = ephemeris is available for this SV
+ uint32_t almanac_avail : 1; ///< 1 = almanac is available for this SV
+ uint32_t assist_now_avail : 1; ///< 1 = AssistNow Offline data is available for this SV
+ uint32_t assist_now_autonomous_avail : 1; ///< 1 = AssistNow Autonomous data is available for this SV
+ uint32_t reserved_1 : 1; ///< reserved bit
+ uint32_t sbas_correction_used : 1; ///< 1 = SBAS corrections have been used for a signal in the subset specified in Signal Identifiers
+ uint32_t rtcm_correction_used : 1; ///< 1 = RTCM corrections have been used for a signal in the subset specified in Signal Identifiers
+ uint32_t slas_correction_used : 1; ///< 1 = QZSS SLAS corrections have been used for a signal in the subset specified in Signal Identifiers
+ uint32_t spartn_correction_used : 1; ///< 1 = SPARTN corrections have been used for a signal in the subset specified in Signal Identifiers
+ uint32_t psuedorange_correction_used : 1; ///< 1 = Pseudorange corrections have been used for a signal in the subset specified in Signal Identifiers
+ uint32_t carrier_range_correction_used : 1; ///< 1 = Carrier range corrections have been used for a signal in the subset specified in Signal Identifiers
+ uint32_t doppler_correction_used : 1; ///< 1 = Range rate (Doppler) corrections have been used for a signal in the subset specified in Signal Identifiers
+ uint32_t reserved_2 : 9; ///< reserved bits
+ } bits; ///< bits to represent different data
+ } flags; ///< Bitmask for different data
+} sl_max_m10s_ubx_navsat_block_t;
+
+/// @brief structure to store the whole data of UBX-NAV-SAT packet
+typedef struct
+{
+ sl_max_m10s_ubx_navsat_header_t header; ///< Data common for all satellites
+ sl_max_m10s_ubx_navsat_block_t blocks[255]; ///< Data for specific satellite
+} sl_max_m10s_ubx_navsat_data_t;
+
+/// @brief structure to store the data for UBX-NAV-SAT
+typedef struct sl_max_m10s_ubx_nav_sat
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< Automatic flags for UBX packet
+ sl_max_m10s_ubx_navsat_data_t data; ///< Data from the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_navsat_data_t *); ///< Callback pointer
+ sl_max_m10s_ubx_navsat_data_t *callback_data; ///< Pointer to callback data
+} sl_max_m10s_ubx_nav_sat_t;
+
+/// @brief structure to store the data of UBX-NAV-TIMLS packet.
+typedef struct
+{
+ uint32_t iTOW; ///< GPS time of week of the navigation epoch: ms
+ uint8_t version; ///< Message version (0x00 for this version)
+ uint8_t reserved_1[3]; ///< reserved
+ uint8_t src_of_current_leap; ///< Information source for the current number of leap seconds
+ int8_t current_leap_sec; ///< Current number of leap seconds since start of GPS (Jan 6, 1980), s
+ uint8_t src_of_leap_sec_change; ///< Information source for the future leap second event
+ int8_t leap_sec_change; ///< Future leap second change if one is scheduled, +1, 0, -1s
+ int32_t time_to_leap_sec_event; ///< Number of seconds until the next or from the last leap second, s
+ uint16_t date_of_leap_sec_gps_week; ///< GPS week num (WN) of the next or the last leap second event
+ uint16_t day_of_leap_sec_gps; ///< GPS day of week num (DN) for the next or last leap second event
+ uint8_t reserved_2[3]; ///< Reserved bits
+ union
+ {
+ uint8_t all; ///< To store different data represented in bits.
+ struct
+ {
+ uint8_t valid_current_leap_sec : 1; ///< 1 = Valid current number of leap seconds value
+ uint8_t valid_time_to_leap_sec_event : 1; ///< 1 = Valid time to next leap second event or from the last leap second event if no future event scheduled
+ } bits; ///< bits to represent different data
+ } valid; ///< Validity Flags
+} sl_max_m10s_ubx_nav_timels_data_t;
+
+/// @brief To store the UBX-NAV-TIMELS packet.
+typedef struct sl_max_m10s_ubx_nav_timels
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< Automatic flags for UBX packet
+ sl_max_m10s_ubx_nav_timels_data_t data; ///< Data from the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_nav_timels_data_t *); ///< Callback pointer
+ sl_max_m10s_ubx_nav_timels_data_t *callback_data; ///< Pointer to callback data
+} sl_max_m10s_ubx_nav_timels_t;
+
+/// @brief To store the UBX-NAV-TIMEUTC packet data.
+typedef struct
+{
+ uint32_t iTOW; ///< GPS time of week of the navigation epoch: ms
+ uint32_t time_accuracy; ///< Time accuracy estimate (UTC): ns
+ int32_t nano; ///< Fraction of second, range -1e9 .. 1e9 (UTC): ns
+ uint16_t year; ///< Year (UTC)
+ uint8_t month; ///< Month, range 1..12 (UTC)
+ uint8_t day; ///< Day of month, range 1..31 (UTC)
+ uint8_t hour; ///< Hour of day, range 0..23 (UTC)
+ uint8_t min; ///< Minute of hour, range 0..59 (UTC)
+ uint8_t sec; ///< Seconds of minute, range 0..60 (UTC)
+ union
+ {
+ uint8_t all; ///< To store different data represented in bits.
+ struct
+ {
+ uint8_t valid_tow : 1; ///< 1 = Valid Time of Week
+ uint8_t valid_week_number : 1; ///< 1 = Valid Week Number
+ uint8_t valid_utc : 1; ///< 1 = Valid UTC Time
+ uint8_t reserved : 1; ///< reserved bit
+ uint8_t utc_standard : 4; ///< UTC standard identifier
+ } bits; ///< bits to represent different data
+ } valid; ///< Validity flags
+} sl_max_m10s_ubx_nav_timeutc_data_t;
+
+/// @brief To store the UBX-NAV-TIMEUTC packet.
+typedef struct
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< Automatic flags for UBX packet
+ sl_max_m10s_ubx_nav_timeutc_data_t data; ///< Data from the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_nav_timeutc_data_t *); ///< Callback pointer
+ sl_max_m10s_ubx_nav_timeutc_data_t *callback_data; ///< Pointer to callback data
+} sl_max_m10s_ubx_nav_timeutc_t;
+
+/// @brief To store the UBX-NAV-SIG packet data common for all signals.
+typedef struct
+{
+ uint32_t iTOW; ///< GPS time of week
+ uint8_t version; ///< Message version (0x00 for this version)
+ uint8_t num_signals; ///< Number of signals
+ uint8_t reserved0[2]; ///< reserved
+} sl_max_m10s_ubx_navsig_header_t;
+
+/// @brief To store the UBX-NAV-SIG packet data for a specific signal.
+typedef struct
+{
+ uint8_t gnss_id; ///< GNSS identifier
+ uint8_t sv_id; ///< Satellite identifier
+ uint8_t sig_id; ///< New signal identifier
+ uint8_t freq_id; ///< GLONASS frequency slot
+ int16_t psuedo_range; ///< Pseudorange residual: m * 0.1
+ uint8_t carrier_noise_ratio; ///< Carrier-to-noise density ratio: dB-Hz
+ uint8_t quality_ind; ///< Signal quality indicator:
+ uint8_t corr_source; ///< Correction source:
+ uint8_t iono_model; ///< Ionospheric model used:
+ union
+ {
+ uint16_t all; ///< To store different data represented in bits.
+ struct
+ {
+ uint16_t health : 1; ///< Signal health flag: 0 = unknown; 1 = healthy; 2 = unhealthy
+ uint16_t pr_smoothed : 1; ///< 1 = Pseudorange has been smoothed
+ uint16_t pr_used : 1; ///< 1 = Pseudorange has been used for this signal
+ uint16_t cr_used : 1; ///< 1 = Carrier range has been used for this signal
+ uint16_t doppler_used : 1; ///< 1 = Range rate (Doppler) has been used for this signal
+ uint16_t pr_corr_used : 1; ///< 1 = Pseudorange corrections have been used for this signal
+ uint16_t carrier_corr_used : 1; ///< 1 = Carrier range corrections have been used for this signal
+ uint16_t doppler_corr_used : 1; ///< 1 = Range rate (Doppler) corrections have been usedfor this signal
+ uint16_t authentication_status : 1; ///< Authentication status of the navigation data: 0 = Unknown; 1 = Authenticated
+ } bits; ///< bits to represent different data
+ } sig_flags; ///< Signal related flags
+ uint8_t reserved1[4]; ///< Reserved bytes
+} sl_max_m10s_ubx_navsig_block_t;
+
+/// @brief To store the UBX-NAV-SIG packet whole data.
+typedef struct
+{
+ sl_max_m10s_ubx_navsig_header_t header; ///< Data common to all signals
+ sl_max_m10s_ubx_navsig_block_t blocks[92]; ///< Data for specific signal
+} sl_max_m10s_ubx_navsig_data_t;
+
+/// @brief To store the UBX-NAV-SIG packet.
+typedef struct
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< Automatic flags for UBX packet
+ sl_max_m10s_ubx_navsig_data_t data; ///< Data from the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_navsig_data_t *); ///< Callback pointer
+ sl_max_m10s_ubx_navsig_data_t *callback_data; ///< Pointer to callback data
+} sl_max_m10s_ubx_navsig_t;
+
+/// @brief To store the UBX-NAV-POSLLH packet data.
+typedef struct
+{
+ uint32_t iTOW; ///< GPS time of week of the navigation epoch: ms
+ int32_t lon; ///< Longitude: Degrees * 1e-7
+ int32_t lat; ///< Latitude: Degrees * 1e-7
+ int32_t height; ///< Height above ellipsoid: mm
+ int32_t hMSL; ///< Height above mean sea level: mm
+ uint32_t h_acc; ///< Horizontal Accuracy Estimate: mm
+ uint32_t v_acc; ///< Vertical Accuracy Estimate: mm
+} sl_max_m10s_ubx_nav_posllh_data_t;
+
+/// @brief To store the UBX-NAV-POSLLH packet.
+typedef struct
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< Automatic flags for UBX packet
+ sl_max_m10s_ubx_nav_posllh_data_t data; ///< Data from the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_nav_posllh_data_t *); ///< Callback pointer
+ sl_max_m10s_ubx_nav_posllh_data_t *callback_data; ///< Pointer to callback data
+} sl_max_m10s_ubx_nav_posllh_t;
+
+/// @brief To store the UBX-SEC_UNIQID packet.
+typedef struct
+{
+ uint8_t version; ///< GNSS receiver module version
+ uint8_t reserved0[3]; ///< reserved
+ uint8_t unique_id[6]; ///< Unique id of the GNSS module
+} sl_max_m10s_ubx_unique_id_t;
+
+/// @brief To store the UBX-NAV-VELNED packet data.
+typedef struct
+{
+ uint32_t iTOW; ///< GPS time of week of the navigation epoch: ms
+ int32_t velN; ///< North velocity component: cm/s
+ int32_t velE; ///< East velocity component: cm/s
+ int32_t velD; ///< Down velocity component: cm/s
+ uint32_t speed; ///< Speed (3-D): cm/s
+ uint32_t ground_speed; ///< Ground Speed (2-D): cm/s
+ int32_t heading; ///< Heading of motion 2-D: Degrees * 1e-5
+ uint32_t speed_acc; ///< Speed accuracy estimate: cm/s
+ uint32_t course_acc; ///< Course/Heading accuracy estimate: Degrees * 1e-5
+} sl_max_m10s_ubx_nav_velned_data_t;
+
+/// @brief To store the UBX-NAV-VELNED packet.
+typedef struct sl_max_m10s_ubx_nav_velned
+{
+ sl_max_m10s_ubx_automatic_flags_t automatic_flags; ///< Automatic flags for UBX packet
+ sl_max_m10s_ubx_nav_velned_data_t data; ///< Data from the UBX packet
+ void (*callback_pointer_ptr)(sl_max_m10s_ubx_nav_velned_data_t *); ///< Callback pointer
+ sl_max_m10s_ubx_nav_velned_data_t *callback_data; ///< Pointer to callback data
+} sl_max_m10s_ubx_nav_velned_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GNSS_MAX_M10S_UBX_STRUCT_H_
+
+/******************************************************************************/
+/* EOF */
+/******************************************************************************/
diff --git a/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_driver.c b/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_driver.c
new file mode 100644
index 00000000..5fa16014
--- /dev/null
+++ b/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_driver.c
@@ -0,0 +1,2645 @@
+/***************************************************************************//**
+ * @file gnss_max_m10s_driver.c
+ * @brief GNSS receiver module API implementation
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ * # Evaluation Quality
+ * This code has been minimally tested to ensure that it builds and is suitable
+ * as a demonstration for evaluation purposes only. This code will be maintained
+ * at the sole discretion of Silicon Labs.
+ ******************************************************************************/
+#include
+#include "sl_sleeptimer.h"
+#include "gnss_max_m10s_driver.h"
+#include "gnss_max_m10s_ubx.h"
+#include "gnss_max_m10s_nmea.h"
+#ifdef SLI_SI917
+#include "si91x_device.h"
+#endif
+
+typedef i2c_master_t max_m10s_i2c_t;
+
+static max_m10s_i2c_t max_m10s_i2c;
+
+/**************************************************************************//**
+ * @brief Initialize the UBX packet structure members
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_data(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Initialize the gnss_cfg_data structure members
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init(sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Check if the device is connected by sending the slave address
+ * through I2C.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_ping(sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Returns the number of bytes available to read.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] data : pointer to the data to send.
+ * @param[in] length : length of the data to send.
+ * @return length of data written.
+ *****************************************************************************/
+static uint8_t gnss_max_m10s_write_bytes(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *data,
+ uint8_t length);
+
+/**************************************************************************//**
+ * @brief Returns the number of bytes available to read.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] data : pointer to the buffer to store data.
+ * @param[in] length : length of the data to be read.
+ * @return length of data read.
+ *****************************************************************************/
+static uint8_t gnss_max_m10s_read_bytes(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *data,
+ uint8_t length);
+
+/**************************************************************************//**
+ * @brief Returns the number of bytes available to read.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @param[in] assumeSuccess : success or failure of function.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_ublox_init(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Checks if the GNSS receiver module is connected.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_ublox_is_connected(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief to change packet_cfg_payload_size.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] payload_size : size of the UBX payload.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_set_packet_cfg_payload_size(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ size_t payload_size);
+
+/**************************************************************************//**
+ * @brief create the UBX file buffer.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_create_file_buffer(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Given an UBX key, load the payload with data
+ * that can then be extracted to 8, 16, or 32 bits
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] key : key to the UBX packet.
+ * @param[in] layer : layer for the UBX.
+ * @param[in] max_wait : timeout value.
+ * @return the following values are returned:
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED if we got a config packet full
+ * of response data that has CLS/ID match to our query packet
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_CRC_FAIL if we got a corrupt config packet
+ * that has CLS/ID match to our query packet
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_TIMEOUT if we timed out
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN if we got an a valid packetCfg
+ * but that the packetCfg has been or is currently being overwritten
+ *****************************************************************************/
+static sl_max_m10s_ublox_status_e gnss_max_m10s_getval(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint32_t key,
+ uint8_t layer,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Given an UBX key, return its value.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] key : key to the UBX packet.
+ * @param[in] val : to store the value of the UBX key.
+ * @param[in] layer : layer for the UBX.
+ * @param[in] max_wait : timeout value.
+ * @return none.
+ *****************************************************************************/
+static bool gnss_max_m10s_getval8(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint32_t key,
+ uint8_t *val,
+ uint8_t layer,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief calculate and store the two byte checksum over
+ * the entirety of the message.
+ * @param[in] msg : pointer to the UBX packet.
+ *****************************************************************************/
+static void gnss_max_m10s_calc_checksum(sl_max_m10s_ubx_packet_t *msg);
+
+/**************************************************************************//**
+ * @brief sends the UBX packet via I2C.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] outgoingUBX : pointer to the UBX packet.
+ * @return the following values are returned:
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED if we got a config packet full
+ * of response data that has CLS/ID match to our query packet
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_CRC_FAIL if we got a corrupt config packet
+ * that has CLS/ID match to our query packet
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_TIMEOUT if we timed out
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN if we got an a valid packetCfg
+ * but that the packetCfg has been or is currently being overwritten
+ * (remember that Serial data can arrive very slowly)
+ *****************************************************************************/
+static sl_max_m10s_ublox_status_e gnss_max_m10s_send_i2c_command(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *outgoingUBX);
+
+/**************************************************************************//**
+ * @brief checks for ACK when the module is responding with register content
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] incomingUBX : pointer to UBX packet.
+ * @param[in] requested_class : class for the UBX packet.
+ * @param[in] requested_id : ID for the UBX packet.
+ * @param[in] max_time : timeout value.
+ * @return the following values are returned:
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED if we got a config packet full
+ * of response data that has CLS/ID match to our query packet
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_CRC_FAIL if we got a corrupt config packet
+ * that has CLS/ID match to our query packet
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_TIMEOUT if we timed out
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN if we got an a valid packetCfg
+ * but that the packetCfg has been or is currently being overwritten
+ * (remember that Serial data can arrive very slowly)
+ *****************************************************************************/
+static sl_max_m10s_ublox_status_e gnss_max_m10s_wait_for_ack_response(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *outgoingUBX,
+ uint8_t requested_class,
+ uint8_t requested_id,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief For non-CFG queries no ACK is sent so we use this function
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] incomingUBX : pointer to UBX packet.
+ * @param[in] requested_class : class for the UBX packet.
+ * @param[in] requested_id : ID for the UBX packet.
+ * @param[in] max_time : timeout value.
+ * @return the following values are returned:
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED if we got a config packet full
+ * of response data that has CLS/ID match to our query packet
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_CRC_FAIL if we got a corrupt config packet
+ * that has CLS/ID match to our query packet
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_TIMEOUT if we timed out
+ * - \ref SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN if we got an a valid packetCfg
+ * but that the packetCfg has been or is currently being overwritten
+ * (remember that Serial data can arrive very slowly)
+ *****************************************************************************/
+static sl_max_m10s_ublox_status_e gnss_max_m10s_wait_for_no_ack_response(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *outgoingUBX,
+ uint8_t requested_class,
+ uint8_t requested_id,
+ uint16_t max_time);
+
+/**************************************************************************//**
+ * @brief Polls I2C for data, passing any new bytes to gnss_m10s_process()
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] incomingUBX : pointer to incoming UBX packet.
+ * @param[in] requested_class : class for the UBX packet.
+ * @param[in] requested_id : ID for the UBX packet.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_check_ublox_i2c(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *incomingUBX,
+ uint8_t requested_class,
+ uint8_t requested_id);
+
+/**************************************************************************//**
+ * @brief Processes UBX binary sentences one byte at a time, take a given byte
+ * and file it into the proper array
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] incoming : character to check
+ * @param[in] incomingUBX : UBX packet to process.
+ * @param[in] requested_class : class of the UBX packet.
+ * @param[in] requested_id : ID for the UBX packet.
+ *****************************************************************************/
+static void gnss_max_m10s_process(sl_max_m10s_cfg_data_t *gnss_cfg_data_data,
+ uint8_t incoming,
+ sl_max_m10s_ubx_packet_t *incomingUBX,
+ uint8_t requested_class,
+ uint8_t requested_id);
+
+/**************************************************************************//**
+ * @brief Check how much space is available in the buffer
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return number of bytes available in the file buffer.
+ *****************************************************************************/
+static uint16_t gnss_max_m10s_file_buffer_space_available(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Check how much space is used in the buffer
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return number of bytes used in the file buffer.
+ *****************************************************************************/
+static uint16_t gnss_max_m10s_file_buffer_used(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Write the_bytes to the file buffer
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] the_bytes : pointer to bytes to write.
+ * @param[in] num_bytes : number of bytes.
+ *****************************************************************************/
+static void gnss_max_m10s_write_file_buffer(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *the_bytes,
+ uint16_t num_bytes);
+
+/**************************************************************************//**
+ * @brief Start defining a new (empty) UBX-CFG-VALSET ubx packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] layer : RAM layer.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_new_cfg_valset(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t layer);
+
+/**************************************************************************//**
+ * @brief Add another key and value to an existing UBX-CFG-VALSET ubx packet
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] key : UBX packet key.
+ * @param[in] value : UBX type communication.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_add_cfg_valset(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data_data,
+ uint32_t key,
+ uint8_t *value,
+ uint8_t N);
+
+/**************************************************************************//**
+ * @brief Send the UBX-CFG-VALSET ubx packet
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_send_cfg_valset(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+static sl_status_t gnss_max_m10s_init_packet_data(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packet_ack.cls = 0;
+ gnss_cfg_data->packet_ack.id = 0;
+ gnss_cfg_data->packet_ack.len = 0;
+ gnss_cfg_data->packet_ack.counter = 0;
+ gnss_cfg_data->packet_ack.starting_spot = 0;
+ gnss_cfg_data->packet_ack.payload = gnss_cfg_data->msg_data.payload_ack;
+ gnss_cfg_data->packet_ack.checksum_a = 0;
+ gnss_cfg_data->packet_ack.checksum_b = 0;
+ gnss_cfg_data->packet_ack.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_ack.class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+
+ gnss_cfg_data->packet_buf.cls = 0;
+ gnss_cfg_data->packet_buf.id = 0;
+ gnss_cfg_data->packet_buf.len = 0;
+ gnss_cfg_data->packet_buf.counter = 0;
+ gnss_cfg_data->packet_buf.starting_spot = 0;
+ gnss_cfg_data->packet_buf.payload = gnss_cfg_data->msg_data.payload_buf;
+ gnss_cfg_data->packet_buf.checksum_a = 0;
+ gnss_cfg_data->packet_buf.checksum_b = 0;
+ gnss_cfg_data->packet_buf.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_buf.class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+
+ gnss_cfg_data->packet_auto.cls = 0;
+ gnss_cfg_data->packet_auto.id = 0;
+ gnss_cfg_data->packet_auto.len = 0;
+ gnss_cfg_data->packet_auto.counter = 0;
+ gnss_cfg_data->packet_auto.starting_spot = 0;
+ gnss_cfg_data->packet_auto.payload = NULL;
+ gnss_cfg_data->packet_auto.checksum_a = 0;
+ gnss_cfg_data->packet_auto.checksum_b = 0;
+ gnss_cfg_data->packet_auto.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_auto.class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+
+ gnss_cfg_data->packet_cfg.cls = 0;
+ gnss_cfg_data->packet_cfg.id = 0;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.counter = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->packet_cfg.payload = NULL;
+ gnss_cfg_data->packet_cfg.checksum_a = 0;
+ gnss_cfg_data->packet_cfg.checksum_b = 0;
+ gnss_cfg_data->packet_cfg.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_cfg.class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_init(sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ sl_status_t status;
+ i2c_master_config_t max_m10s_cfg;
+
+ if (NULL == gnss_cfg_data->i2c_instance) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ // Configure default i2csmp instance
+ max_m10s_i2c.handle = gnss_cfg_data->i2c_instance;
+
+ i2c_master_configure_default(&max_m10s_cfg);
+
+ max_m10s_cfg.addr = gnss_cfg_data->device_address;
+ max_m10s_cfg.timeout_pass_count = 0;
+
+ if (i2c_master_open(&max_m10s_i2c, &max_m10s_cfg) == I2C_MASTER_ERROR) {
+ return SL_STATUS_INITIALIZATION;
+ }
+
+ gnss_max_m10s_init_packet_data(gnss_cfg_data);
+
+ gnss_cfg_data->msg_data.packet_cfg_payloadsize = 0;
+ gnss_cfg_data->msg_data.payload_cfg = NULL;
+ gnss_cfg_data->msg_data.payload_auto = NULL;
+ gnss_cfg_data->reset_current_sentence_on_bus_error = true;
+ gnss_cfg_data->auto_send_at_space_remaining = 0;
+ gnss_cfg_data->ubx_file_buffer = NULL;
+ gnss_cfg_data->file_buffer_head = 0;
+ gnss_cfg_data->file_buffer_tail = 0;
+ gnss_cfg_data->file_buffer_max_avail = 0;
+ gnss_cfg_data->ignore_this_payload = false;
+ gnss_cfg_data->max_nmea_byte_count = SL_MAX_M10S_NMEA_BYTE_COUNT;
+ gnss_cfg_data->packetUBXNAVPVT = NULL;
+ gnss_cfg_data->packetUBXNAVCLOCK = NULL;
+ gnss_cfg_data->packetUBXNAVDOP = NULL;
+ gnss_cfg_data->packetUBXNAVEOE = NULL;
+ gnss_cfg_data->packetUBXNAVPOSLLH = NULL;
+ gnss_cfg_data->packetUBXNAVSAT = NULL;
+ gnss_cfg_data->packetUBXNAVSTATUS = NULL;
+ gnss_cfg_data->packetUBXNAVSIG = NULL;
+ gnss_cfg_data->packetUBXNAVTIMELS = NULL;
+ gnss_cfg_data->packetUBXNAVTIMEUTC = NULL;
+ gnss_cfg_data->packetUBXNAVVELNED = NULL;
+ gnss_cfg_data->packetUBXUNIQID = NULL;
+ gnss_cfg_data->storageNMEAGNGGA = NULL;
+ gnss_cfg_data->storageNMEAGNRMC = NULL;
+ gnss_cfg_data->storageNMEAGPGGA = NULL;
+ gnss_cfg_data->storageNMEAGPRMC = NULL;
+ gnss_cfg_data->nmea_data = NULL;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETBUF;
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE;
+
+ if (gnss_cfg_data->protocol_type == SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_nmea_init(gnss_cfg_data);
+ } else {
+ status = SL_STATUS_OK;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_deinit(sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVPVT != NULL) {
+ free(gnss_cfg_data->packetUBXNAVPVT);
+ gnss_cfg_data->packetUBXNAVPVT = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVCLOCK != NULL) {
+ free(gnss_cfg_data->packetUBXNAVCLOCK);
+ gnss_cfg_data->packetUBXNAVCLOCK = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVDOP != NULL) {
+ free(gnss_cfg_data->packetUBXNAVDOP);
+ gnss_cfg_data->packetUBXNAVDOP = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVEOE != NULL) {
+ free(gnss_cfg_data->packetUBXNAVEOE);
+ gnss_cfg_data->packetUBXNAVEOE = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVPOSLLH != NULL) {
+ free(gnss_cfg_data->packetUBXNAVPOSLLH);
+ gnss_cfg_data->packetUBXNAVPOSLLH = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSAT != NULL) {
+ free(gnss_cfg_data->packetUBXNAVSAT);
+ gnss_cfg_data->packetUBXNAVSAT = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSIG != NULL) {
+ free(gnss_cfg_data->packetUBXNAVSIG);
+ gnss_cfg_data->packetUBXNAVSIG = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSTATUS != NULL) {
+ free(gnss_cfg_data->packetUBXNAVSTATUS);
+ gnss_cfg_data->packetUBXNAVSTATUS = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVVELNED != NULL) {
+ free(gnss_cfg_data->packetUBXNAVVELNED);
+ gnss_cfg_data->packetUBXNAVVELNED = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVTIMELS != NULL) {
+ free(gnss_cfg_data->packetUBXNAVTIMELS);
+ gnss_cfg_data->packetUBXNAVTIMELS = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVTIMEUTC != NULL) {
+ free(gnss_cfg_data->packetUBXNAVTIMEUTC);
+ gnss_cfg_data->packetUBXNAVTIMEUTC = NULL;
+ }
+
+ if (gnss_cfg_data->packetUBXUNIQID != NULL) {
+ free(gnss_cfg_data->packetUBXUNIQID);
+ gnss_cfg_data->packetUBXUNIQID = NULL;
+ }
+
+ if (gnss_cfg_data->nmea_data != NULL) {
+ free(gnss_cfg_data->nmea_data);
+ gnss_cfg_data->nmea_data = NULL;
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_begin(uint16_t max_wait,
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ sl_status_t status;
+ status = gnss_max_m10s_init(gnss_cfg_data);
+ if (SL_STATUS_OK == status) {
+ /// printf("gnss_max_m10s_init is successful\r\n");
+ gnss_cfg_data->status = SL_MAX_M10S_INIT_OK;
+ } else {
+ gnss_cfg_data->status = SL_MAX_M10S_INIT_FAIL;
+ /// printf("gnss_max_m10s_init failed!!\r\n");
+ return status;
+ }
+
+ status = gnss_max_m10s_ublox_init(gnss_cfg_data, max_wait);
+ if (SL_STATUS_OK == status) {
+ /// printf("gnss_max_m10s_ublox_init is successful\r\n");
+ gnss_cfg_data->status = SL_MAX_M10S_INIT_OK;
+ } else {
+ gnss_cfg_data->status = SL_MAX_M10S_INIT_FAIL;
+ /// printf("gnss_max_m10s_ublox_init failed!!\r\n");
+ return status;
+ }
+
+ gnss_cfg_data->status = SL_MAX_M10S_BEGIN_OK;
+ return status;
+}
+
+static sl_status_t gnss_max_m10s_ping(sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ size_t write_buffer_size = 1;
+ uint8_t i2c_write_data[write_buffer_size];
+
+ i2c_write_data[0] = 0;
+
+ if (NULL == gnss_cfg_data->i2c_instance) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ if (I2C_MASTER_SUCCESS != i2c_master_write(&max_m10s_i2c,
+ i2c_write_data,
+ write_buffer_size)) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+static uint8_t gnss_max_m10s_write_bytes(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *data, uint8_t length)
+{
+ if (NULL == gnss_cfg_data->i2c_instance) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ if (0 == length) {
+ return 0;
+ }
+
+ if (I2C_MASTER_SUCCESS != i2c_master_write(&max_m10s_i2c,
+ data,
+ length)) {
+ return 0;
+ }
+
+ return length;
+}
+
+static uint8_t gnss_max_m10s_read_bytes(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *data, uint8_t length)
+{
+ if (NULL == gnss_cfg_data->i2c_instance) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ if (0 == length) {
+ return 0;
+ }
+
+ if (I2C_MASTER_SUCCESS != i2c_master_read(&max_m10s_i2c,
+ data,
+ length)) {
+ return 0;
+ }
+
+ return length;
+}
+
+static sl_status_t gnss_max_m10s_create_file_buffer(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ if (0 == FILE_BUFFER_SIZE) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->ubx_file_buffer != NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->ubx_file_buffer =
+ (uint8_t *)malloc(FILE_BUFFER_SIZE * sizeof(uint8_t));
+
+ if (NULL == gnss_cfg_data->ubx_file_buffer) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->file_buffer_head = 0;
+ gnss_cfg_data->file_buffer_tail = 0;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_ublox_init(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ gnss_cfg_data->signs_of_life = false;
+
+ if (0 == gnss_cfg_data->msg_data.packet_cfg_payloadsize) {
+ gnss_max_m10s_set_packet_cfg_payload_size(gnss_cfg_data, MAX_PAYLOAD_SIZE);
+ }
+
+ status = gnss_max_m10s_create_file_buffer(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ goto return_failure;
+ }
+
+ status = gnss_max_m10s_ublox_is_connected(gnss_cfg_data, max_wait);
+
+ if (status != SL_STATUS_OK) {
+ goto return_failure;
+ }
+
+ return_failure:
+ return status;
+}
+
+static sl_status_t gnss_max_m10s_set_packet_cfg_payload_size(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ size_t payload_size)
+{
+ sl_status_t success = SL_STATUS_OK;
+ sl_max_m10s_msg_data_t *msg_data_local = &(gnss_cfg_data->msg_data);
+
+ if ((payload_size == 0) && (msg_data_local->payload_cfg != NULL)) {
+ free(msg_data_local->payload_cfg);
+ msg_data_local->payload_cfg = NULL;
+ gnss_cfg_data->packet_cfg.payload = msg_data_local->payload_cfg;
+ msg_data_local->packet_cfg_payloadsize = payload_size;
+ } else if (msg_data_local->payload_cfg == NULL) {
+ msg_data_local->payload_cfg =
+ (uint8_t *)malloc(payload_size * sizeof(uint8_t));
+ gnss_cfg_data->packet_cfg.payload = msg_data_local->payload_cfg;
+
+ if (msg_data_local->payload_cfg == NULL) {
+ success = SL_STATUS_FAIL;
+ msg_data_local->packet_cfg_payloadsize = 0;
+ } else {
+ msg_data_local->packet_cfg_payloadsize = payload_size;
+ }
+ } else {
+ uint8_t *new_payload = (uint8_t *)malloc(payload_size * sizeof(uint8_t));
+
+ if (new_payload == NULL) {
+ success = SL_STATUS_FAIL;
+ } else {
+ memcpy(new_payload,
+ msg_data_local->payload_cfg,
+ payload_size
+ <= msg_data_local->packet_cfg_payloadsize ? payload_size : msg_data_local->packet_cfg_payloadsize);
+
+ free(msg_data_local->payload_cfg);
+ msg_data_local->payload_cfg = new_payload;
+ gnss_cfg_data->packet_cfg.payload = msg_data_local->payload_cfg;
+ msg_data_local->packet_cfg_payloadsize = payload_size;
+ }
+ }
+
+ return (success);
+}
+
+static sl_status_t gnss_max_m10s_ublox_is_connected(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ uint8_t en;
+ bool result;
+
+ if (gnss_max_m10s_ping(gnss_cfg_data) != SL_STATUS_OK) {
+ return SL_STATUS_FAIL;
+ }
+
+ result = gnss_max_m10s_getval8(gnss_cfg_data,
+ UBLOX_CFG_I2C_INPORT_UBX,
+ &en,
+ VAL_LAYER_RAM,
+ max_wait);
+
+ if (false == result) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+static sl_max_m10s_ublox_status_e gnss_max_m10s_getval(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint32_t key,
+ uint8_t layer,
+ uint16_t max_wait)
+{
+ uint8_t get_layer;
+ sl_max_m10s_ublox_status_e ret_val;
+
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_CFG;
+ gnss_cfg_data->packet_cfg.id = UBX_CFG_VALGET;
+ gnss_cfg_data->packet_cfg.len = 4 + 4 * 1;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+
+ memset(gnss_cfg_data->msg_data.payload_cfg, 0, gnss_cfg_data->packet_cfg.len);
+
+ get_layer = VAL_LAYER_DEFAULT;
+
+ if (layer == VAL_LAYER_RAM) {
+ get_layer = 0;
+ } else if (layer == VAL_LAYER_BBR) {
+ get_layer = 1;
+ } else if (layer == VAL_LAYER_FLASH) {
+ get_layer = 2;
+ }
+
+ gnss_cfg_data->msg_data.payload_cfg[0] = 0;
+ gnss_cfg_data->msg_data.payload_cfg[1] = get_layer;
+ key &= ~UBX_CFG_SIZE_MASK;
+ gnss_cfg_data->msg_data.payload_cfg[4] = key >> 8 * 0;
+ gnss_cfg_data->msg_data.payload_cfg[5] = key >> 8 * 1;
+ gnss_cfg_data->msg_data.payload_cfg[6] = key >> 8 * 2;
+ gnss_cfg_data->msg_data.payload_cfg[7] = key >> 8 * 3;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ /// printf("getVal key: %lu\r\n",key);
+ ret_val = gnss_max_m10s_send_command(gnss_cfg_data,
+ max_wait,
+ false);
+
+ return ret_val;
+}
+
+static bool gnss_max_m10s_getval8(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint32_t key,
+ uint8_t *val,
+ uint8_t layer,
+ uint16_t max_wait)
+{
+ bool result =
+ (SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED
+ == gnss_max_m10s_getval(gnss_cfg_data, key, layer, max_wait));
+
+ if (result) {
+ *val = gnss_max_m10s_extract_byte(&(gnss_cfg_data->packet_cfg), 8);
+ }
+ return result;
+}
+
+sl_max_m10s_ublox_status_e gnss_max_m10s_send_command(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool expect_ack_only)
+{
+ sl_max_m10s_ubx_packet_t *outgoingUBX;
+ sl_max_m10s_ublox_status_e ret_val = SL_MAX_M10S_UBLOX_STATUS_SUCCESS;
+
+ if (gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETCFG) {
+ outgoingUBX = &(gnss_cfg_data->packet_cfg);
+ } else if (gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETAUTO) {
+ outgoingUBX = &(gnss_cfg_data->packet_auto);
+ } else {
+ outgoingUBX = &(gnss_cfg_data->packet_buf);
+ }
+
+ gnss_max_m10s_calc_checksum(outgoingUBX);
+
+ ret_val = gnss_max_m10s_send_i2c_command(gnss_cfg_data, outgoingUBX);
+
+ if (ret_val != SL_MAX_M10S_UBLOX_STATUS_SUCCESS) {
+ return ret_val;
+ }
+
+ if (max_wait > 0) {
+ if ((outgoingUBX->cls == UBX_CLASS_CFG) || (expect_ack_only == true)) {
+ ret_val = gnss_max_m10s_wait_for_ack_response(gnss_cfg_data,
+ outgoingUBX,
+ outgoingUBX->cls,
+ outgoingUBX->id,
+ max_wait);
+ } else {
+ ret_val = gnss_max_m10s_wait_for_no_ack_response(gnss_cfg_data,
+ outgoingUBX,
+ outgoingUBX->cls,
+ outgoingUBX->id,
+ max_wait);
+ }
+ }
+
+ return ret_val;
+}
+
+static void gnss_max_m10s_calc_checksum(sl_max_m10s_ubx_packet_t *msg)
+{
+ msg->checksum_a = 0;
+ msg->checksum_b = 0;
+
+ msg->checksum_a += msg->cls;
+ msg->checksum_b += msg->checksum_a;
+
+ msg->checksum_a += msg->id;
+ msg->checksum_b += msg->checksum_a;
+
+ msg->checksum_a += (msg->len & 0xFF);
+ msg->checksum_b += msg->checksum_a;
+
+ msg->checksum_a += (msg->len >> 8);
+ msg->checksum_b += msg->checksum_a;
+
+ for (uint16_t i = 0; i < msg->len; i++) {
+ msg->checksum_a += msg->payload[i];
+ msg->checksum_b += msg->checksum_a;
+ }
+}
+
+void gnss_max_m10s_add_to_checksum(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t incoming)
+{
+ gnss_cfg_data->rolling_checksum_a += incoming;
+ gnss_cfg_data->rolling_checksum_b += gnss_cfg_data->rolling_checksum_a;
+}
+
+static sl_max_m10s_ublox_status_e gnss_max_m10s_send_i2c_command(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *outgoingUBX)
+{
+ uint16_t bytes_left_to_send = outgoingUBX->len;
+ uint16_t start_spot = 0;
+ uint16_t i = 0;
+
+ if (bytes_left_to_send + 8 <= I2C_TRANSACTION_SIZE) {
+ uint8_t buf[I2C_TRANSACTION_SIZE];
+ buf[0] = UBX_SYNCH_1;
+ buf[1] = UBX_SYNCH_2;
+ buf[2] = outgoingUBX->cls;
+ buf[3] = outgoingUBX->id;
+ buf[4] = outgoingUBX->len & 0xFF;
+ buf[5] = outgoingUBX->len >> 8;
+
+ for (; i < outgoingUBX->len; i++) {
+ buf[i + 6] = outgoingUBX->payload[start_spot + i];
+ }
+
+ buf[i + 6] = outgoingUBX->checksum_a;
+ buf[i + 7] = outgoingUBX->checksum_b;
+
+ /// TODO : Debugging purpose.
+
+ /**
+ * printf("sendI2cCommand dump\n");
+ * for(i=0; i < bytes_left_to_send + 8; i++) {
+ * printf("0x%x ",buf[i]);
+ * }
+ */
+
+ if (gnss_max_m10s_write_bytes(gnss_cfg_data, buf, bytes_left_to_send + 8)
+ != bytes_left_to_send + 8) {
+ return SL_MAX_M10S_UBLOX_STATUS_I2C_COMM_FAILURE;
+ }
+ } else {
+ uint8_t buf[6];
+
+ buf[0] = UBX_SYNCH_1;
+ buf[1] = UBX_SYNCH_2;
+ buf[2] = outgoingUBX->cls;
+ buf[3] = outgoingUBX->id;
+ buf[4] = outgoingUBX->len & 0xFF; /// LSB
+ buf[5] = outgoingUBX->len >> 8; /// MSB
+
+ if (gnss_max_m10s_write_bytes(gnss_cfg_data, buf, 6) != 6) {
+ return SL_MAX_M10S_UBLOX_STATUS_I2C_COMM_FAILURE;
+ }
+
+ while (bytes_left_to_send > 1) {
+ uint16_t len = bytes_left_to_send;
+ uint16_t x;
+
+ if (len > I2C_TRANSACTION_SIZE) {
+ len = I2C_TRANSACTION_SIZE;
+ }
+
+ bytes_left_to_send -= len;
+ x = len;
+
+ if ((start_spot + x) >= (outgoingUBX->len)) {
+ x = outgoingUBX->len - start_spot;
+ }
+
+ if (gnss_max_m10s_write_bytes(gnss_cfg_data,
+ &outgoingUBX->payload[start_spot],
+ x) != x) {
+ return SL_MAX_M10S_UBLOX_STATUS_I2C_COMM_FAILURE;
+ }
+
+ start_spot += x;
+ }
+
+ if (bytes_left_to_send == 1) {
+ buf[0] = outgoingUBX->payload[start_spot];
+ buf[1] = outgoingUBX->checksum_a;
+ buf[2] = outgoingUBX->checksum_b;
+
+ if (gnss_max_m10s_write_bytes(gnss_cfg_data, buf, 3) != 3) {
+ return SL_MAX_M10S_UBLOX_STATUS_I2C_COMM_FAILURE;
+ }
+ } else {
+ buf[0] = outgoingUBX->checksum_a;
+ buf[1] = outgoingUBX->checksum_b;
+
+ if (gnss_max_m10s_write_bytes(gnss_cfg_data, buf, 2) != 2) {
+ return SL_MAX_M10S_UBLOX_STATUS_I2C_COMM_FAILURE;
+ }
+ }
+ }
+
+ return SL_MAX_M10S_UBLOX_STATUS_SUCCESS;
+}
+
+static sl_max_m10s_ublox_status_e gnss_max_m10s_wait_for_ack_response(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *outgoingUBX,
+ uint8_t requested_class,
+ uint8_t requested_id,
+ uint16_t max_time)
+{
+ unsigned long start_time;
+
+ gnss_cfg_data->packet_ack.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_buf.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_auto.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_ack.class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_buf.class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_auto.class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ outgoingUBX->class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ outgoingUBX->valid = SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() < (start_time + (unsigned long)max_time)) {
+ if (gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ outgoingUBX,
+ requested_class,
+ requested_id) == SL_STATUS_OK) {
+ if ((outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (gnss_cfg_data->packet_ack.class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (outgoingUBX->valid == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (outgoingUBX->cls == requested_class)
+ && (outgoingUBX->id == requested_id)) {
+ return SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED;
+ } else if ((outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED)
+ && (gnss_cfg_data->packet_ack.class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)) {
+ return SL_MAX_M10S_UBLOX_STATUS_DATA_SENT;
+ } else if ((outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (gnss_cfg_data->packet_ack.class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && ((outgoingUBX->cls != requested_class)
+ || (outgoingUBX->id != requested_id))) {
+ return SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN;
+ } else if ((gnss_cfg_data->packet_ack.class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_VALID)
+ && (outgoingUBX->valid
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_VALID)) {
+ return SL_MAX_M10S_UBLOX_STATUS_CRC_FAIL;
+ } else if (gnss_cfg_data->packet_ack.class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_NOTACKNOWLEDGED) {
+ return SL_MAX_M10S_UBLOX_STATUS_COMMAND_NACK;
+ } else if ((outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (gnss_cfg_data->packet_ack.class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_VALID)
+ && (outgoingUBX->valid
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (outgoingUBX->cls == requested_class)
+ && (outgoingUBX->id == requested_id)) {
+ return SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED;
+ } else if ((outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_VALID)
+ && (gnss_cfg_data->packet_ack.class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_VALID)) {
+ return SL_MAX_M10S_UBLOX_STATUS_FAIL;
+ } else if ((outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (gnss_cfg_data->packet_ack.class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED)) {
+ }
+ }
+
+ gnss_max_m10s_delay(1);
+ }
+
+ if ((outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (gnss_cfg_data->packet_ack.class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED)
+ && (outgoingUBX->valid == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (outgoingUBX->cls == requested_class)
+ && (outgoingUBX->id == requested_id)) {
+ return SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED;
+ }
+
+ return SL_MAX_M10S_UBLOX_STATUS_TIMEOUT;
+}
+
+static sl_max_m10s_ublox_status_e gnss_max_m10s_wait_for_no_ack_response(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *outgoingUBX,
+ uint8_t requested_class,
+ uint8_t requested_id,
+ uint16_t max_time)
+{
+ unsigned long start_time;
+
+ gnss_cfg_data->packet_ack.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_buf.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_auto.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_ack.class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_buf.class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_auto.class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ outgoingUBX->class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ outgoingUBX->valid = SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ if (gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ outgoingUBX,
+ requested_class,
+ requested_id) == SL_STATUS_OK) {
+ if ((outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (outgoingUBX->valid == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && (outgoingUBX->cls == requested_class)
+ && (outgoingUBX->id == requested_id)) {
+ return SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED;
+ } else if ((outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)
+ && ((outgoingUBX->cls != requested_class)
+ || (outgoingUBX->id != requested_id))) {
+ return SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN;
+ } else if ((outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED)
+ && (outgoingUBX->valid
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID)) {
+ } else if (outgoingUBX->class_and_id_match
+ == SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_VALID) {
+ return SL_MAX_M10S_UBLOX_STATUS_CRC_FAIL;
+ }
+ }
+
+ gnss_max_m10s_delay(1);
+ }
+
+ return SL_MAX_M10S_UBLOX_STATUS_TIMEOUT;
+}
+
+sl_status_t gnss_max_m10s_check_ublox_internal(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *incomingUBX,
+ uint8_t requested_class,
+ uint8_t requested_id)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ status = gnss_max_m10s_check_ublox_i2c(gnss_cfg_data,
+ incomingUBX,
+ requested_class,
+ requested_id);
+
+ return status;
+}
+
+void gnss_max_m10s_delay(uint32_t period)
+{
+ for (uint32_t x = 0; x < MS_DELAY_COUNTER * period; x++) {
+ __NOP();
+ }
+}
+
+static sl_status_t gnss_max_m10s_check_ublox_i2c(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *incomingUBX,
+ uint8_t requested_class,
+ uint8_t requested_id)
+{
+ uint16_t bytes_to_read;
+ uint8_t bytes_returned;
+ uint8_t rx_byte = 0;
+ bool bytes_valid = true;
+
+ bytes_to_read = 1;
+
+ while (bytes_valid) {
+ bytes_returned = gnss_max_m10s_read_bytes(gnss_cfg_data, &rx_byte,
+ (uint8_t)bytes_to_read);
+
+ if (bytes_returned) {
+ gnss_max_m10s_process(gnss_cfg_data, rx_byte, incomingUBX,
+ requested_class, requested_id);
+
+ if (rx_byte == 0xFF) {
+ bytes_valid = false;
+ }
+ } else {
+ if (gnss_cfg_data->reset_current_sentence_on_bus_error) {
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE;
+ return SL_STATUS_FAIL;
+ }
+ }
+ }
+
+ return SL_STATUS_OK;
+}
+
+bool gnss_max_m10s_auto_lookup(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t *max_size)
+{
+ uint8_t ID;
+
+ if (gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETCFG) {
+ ID = gnss_cfg_data->packet_cfg.id;
+ } else if (gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETAUTO) {
+ ID = gnss_cfg_data->packet_auto.id;
+ } else {
+ ID = gnss_cfg_data->packet_buf.id;
+ }
+
+ if (max_size != NULL) {
+ *max_size = 0;
+ }
+
+ if (ID == UBX_NAV_PVT) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_PVT_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVPVT != NULL);
+ } else if (ID == UBX_NAV_CLOCK) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_CLOCK_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVCLOCK != NULL);
+ } else if (ID == UBX_NAV_DOP) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_DOP_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVDOP != NULL);
+ } else if (ID == UBX_NAV_EOE) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_EOE_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVEOE != NULL);
+ } else if (ID == UBX_NAV_POSLLH) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_POSLLH_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVPOSLLH != NULL);
+ } else if (ID == UBX_NAV_SAT) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_SAT_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVSAT != NULL);
+ } else if (ID == UBX_NAV_SIG) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_SIG_MAX_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVSIG != NULL);
+ } else if (ID == UBX_NAV_STATUS) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_STATUS_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVSTATUS != NULL);
+ } else if (ID == UBX_NAV_TIMELS) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_TIMELS_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVTIMELS != NULL);
+ } else if (ID == UBX_NAV_TIMEUTC) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_TIMEUTC_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVTIMEUTC != NULL);
+ } else if (ID == UBX_NAV_VELNED) {
+ if (max_size != NULL) {
+ *max_size = UBX_NAV_VELNED_LEN;
+ }
+
+ return (gnss_cfg_data->packetUBXNAVVELNED != NULL);
+ }
+
+ return false;
+}
+
+static void gnss_max_m10s_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t incoming,
+ sl_max_m10s_ubx_packet_t *incomingUBX,
+ uint8_t requested_class,
+ uint8_t requested_id)
+{
+ static volatile uint8_t stored_class = 0;
+ static volatile uint8_t stored_id = 0;
+ uint16_t maxPayload = 0;
+
+ if (requested_class || requested_id) {
+ stored_class = requested_class;
+ stored_id = requested_id;
+ }
+
+ if ((gnss_cfg_data->current_sentence == SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE)
+ || (gnss_cfg_data->current_sentence
+ == SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NMEA)) {
+ if (incoming == UBX_SYNCH_1) {
+ gnss_cfg_data->ubx_frame_counter = 0;
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_UBX;
+ gnss_cfg_data->packet_buf.counter = 0;
+ gnss_cfg_data->ignore_this_payload = false;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETBUF;
+ } else if (incoming == '$') {
+ gnss_cfg_data->nmea_byte_counter = 0;
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NMEA;
+ } else if (incoming == 0xD3) {
+ gnss_cfg_data->rtcm_frame_counter = 0;
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_RTCM;
+ } else {
+ // printf("Unknown character");
+ }
+ }
+
+ if (gnss_cfg_data->current_sentence == SL_MAX_M10S_UBLOX_SENTENCE_TYPE_UBX) {
+ if ((gnss_cfg_data->ubx_frame_counter == 0) && (incoming != UBX_SYNCH_1)) {
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE;
+ } else if ((gnss_cfg_data->ubx_frame_counter == 1)
+ && (incoming != UBX_SYNCH_2)) {
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE;
+ } else if (gnss_cfg_data->ubx_frame_counter == 2) {
+ gnss_cfg_data->packet_buf.cls = incoming;
+ gnss_cfg_data->rolling_checksum_a = 0;
+ gnss_cfg_data->rolling_checksum_b = 0;
+ gnss_cfg_data->packet_buf.counter = 0;
+ gnss_cfg_data->packet_buf.valid =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_DEFINED;
+ gnss_cfg_data->packet_buf.starting_spot = incomingUBX->starting_spot;
+ } else if (gnss_cfg_data->ubx_frame_counter == 3) {
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETBUF;
+ gnss_cfg_data->packet_buf.id = incoming;
+
+ if (gnss_cfg_data->packet_buf.cls != UBX_CLASS_ACK) {
+ bool log_because_auto =
+ gnss_max_m10s_auto_lookup(gnss_cfg_data,
+ &maxPayload);
+
+ if ((gnss_cfg_data->packet_buf.cls == stored_class)
+ && (gnss_cfg_data->packet_buf.id == stored_id)) {
+ gnss_cfg_data->active_packet_buffer =
+ SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+ incomingUBX->cls = gnss_cfg_data->packet_buf.cls;
+ incomingUBX->id = gnss_cfg_data->packet_buf.id;
+ incomingUBX->counter = gnss_cfg_data->packet_buf.counter;
+ } else if (log_because_auto) {
+ if (gnss_cfg_data->msg_data.payload_auto != NULL) {
+ free(gnss_cfg_data->msg_data.payload_auto);
+
+ gnss_cfg_data->msg_data.payload_auto = NULL;
+ gnss_cfg_data->packet_auto.payload =
+ gnss_cfg_data->msg_data.payload_auto;
+ }
+
+ if ((!log_because_auto)) {
+ maxPayload = UBX_MAX_LENGTH;
+ }
+
+ gnss_cfg_data->packet_auto.payload = (uint8_t *)malloc(
+ maxPayload * sizeof(uint8_t));
+
+ if (gnss_cfg_data->packet_auto.payload == NULL) {
+ gnss_cfg_data->active_packet_buffer =
+ SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+ incomingUBX->cls = gnss_cfg_data->packet_buf.cls;
+ incomingUBX->id = gnss_cfg_data->packet_buf.id;
+ incomingUBX->counter = gnss_cfg_data->packet_buf.counter;
+ } else {
+ gnss_cfg_data->active_packet_buffer =
+ SL_MAX_M10S_UBLOX_PACKET_PACKETAUTO;
+ gnss_cfg_data->packet_auto.cls = gnss_cfg_data->packet_buf.cls;
+ gnss_cfg_data->packet_auto.id = gnss_cfg_data->packet_buf.id;
+ gnss_cfg_data->packet_auto.counter =
+ gnss_cfg_data->packet_buf.counter;
+ gnss_cfg_data->packet_auto.starting_spot =
+ gnss_cfg_data->packet_buf.starting_spot;
+ }
+ } else {
+ gnss_cfg_data->ignore_this_payload = true;
+ }
+ }
+ } else if (gnss_cfg_data->ubx_frame_counter == 4) {
+ gnss_cfg_data->packet_buf.len = incoming;
+ } else if (gnss_cfg_data->ubx_frame_counter == 5) {
+ gnss_cfg_data->packet_buf.len |= incoming << 8;
+ } else if (gnss_cfg_data->ubx_frame_counter == 6) {
+ if (gnss_cfg_data->packet_buf.len == 0) {
+ gnss_cfg_data->packet_buf.checksum_a = incoming;
+ } else {
+ gnss_cfg_data->packet_buf.payload[0] = incoming;
+ }
+ } else if (gnss_cfg_data->ubx_frame_counter == 7) {
+ if (gnss_cfg_data->packet_buf.len == 0) {
+ gnss_cfg_data->packet_buf.checksum_b = incoming;
+ } else if (gnss_cfg_data->packet_buf.len == 1) {
+ gnss_cfg_data->packet_buf.checksum_a = incoming;
+ } else { /// Length is >= 2 so this must be a payload byte
+ gnss_cfg_data->packet_buf.payload[1] = incoming;
+ }
+
+ /// if a packet is already in process or ack, class or ID of the packet matches
+ if ((gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETBUF)
+ && (gnss_cfg_data->packet_buf.cls == UBX_CLASS_ACK)
+ && (gnss_cfg_data->packet_buf.payload[0] == stored_class)
+ && (gnss_cfg_data->packet_buf.payload[1] == stored_id)) {
+ /// Check if .len is 2
+ if (gnss_cfg_data->packet_buf.len == 2) {
+ gnss_cfg_data->active_packet_buffer =
+ SL_MAX_M10S_UBLOX_PACKET_PACKETACK;
+ gnss_cfg_data->packet_ack.cls = gnss_cfg_data->packet_buf.cls;
+ gnss_cfg_data->packet_ack.id = gnss_cfg_data->packet_buf.id;
+ gnss_cfg_data->packet_ack.len = gnss_cfg_data->packet_buf.len;
+ gnss_cfg_data->packet_ack.counter = gnss_cfg_data->packet_buf.counter;
+ gnss_cfg_data->packet_ack.payload[0] =
+ gnss_cfg_data->packet_buf.payload[0];
+ gnss_cfg_data->packet_ack.payload[1] =
+ gnss_cfg_data->packet_buf.payload[1];
+ }
+ }
+ }
+
+ gnss_max_m10s_process_ubx(gnss_cfg_data, incoming, stored_class, stored_id);
+
+ gnss_cfg_data->ubx_frame_counter++;
+ } else if (gnss_cfg_data->current_sentence
+ == SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NMEA) { /// Process incoming NMEA mesages.
+ if ((gnss_cfg_data->nmea_byte_counter == 0) && (incoming != '$')) {
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE; /// Reset.
+ } else if ((gnss_cfg_data->nmea_byte_counter == 1) && (incoming != 'G')) {
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE; /// Reset.
+ } else if ((gnss_cfg_data->nmea_byte_counter >= 0)
+ && (gnss_cfg_data->nmea_byte_counter <= 5)) {
+ gnss_cfg_data->nmea_address_field[gnss_cfg_data->nmea_byte_counter] =
+ incoming; /// Store the start character and NMEA address field
+ }
+
+ if (gnss_cfg_data->nmea_byte_counter == 5) {
+ /// set gnss_cfg_data->signs_of_life to true if the NMEA header is valid
+ if (!gnss_cfg_data->signs_of_life) {
+ gnss_cfg_data->signs_of_life = gnss_max_m10s_is_nmea_header_valid(
+ gnss_cfg_data);
+ }
+
+ /// Check if automatic storage is available for this message
+ if (gnss_max_m10s_is_nmea_auto(gnss_cfg_data)) {
+ uint8_t *length_ptr =
+ gnss_max_m10s_get_nmea_working_length_ptr(gnss_cfg_data); /// Get a pointer to the working copy length
+ uint8_t *nmea_ptr = gnss_max_m10s_get_nmea_working_ptr(gnss_cfg_data); /// Get a pointer to the working copy NMEA data
+ uint8_t nmea_max_length = gnss_max_m10s_get_nmea_max_length(
+ gnss_cfg_data);
+ *length_ptr = 6; /// Set the working copy length
+
+ memset(nmea_ptr, 0, nmea_max_length); /// Clear the working copy
+
+ /// Copy the start character and address field into the working copy
+ memcpy(nmea_ptr, &gnss_cfg_data->nmea_address_field[0], 6);
+ }
+
+ /// Check if it should be passed to processNMEA
+ if (gnss_max_m10s_process_current_nmea(gnss_cfg_data)) {
+ for (uint8_t i = 0; i < 6; i++) {
+ /// Process the start character and address field
+ gnss_max_m10s_process_nmea(gnss_cfg_data->nmea_address_field[i],
+ gnss_cfg_data->nmea_data);
+ }
+ }
+ }
+
+ if ((gnss_cfg_data->nmea_byte_counter > 5)
+ || (gnss_cfg_data->nmea_byte_counter < 0)) {
+ if (gnss_max_m10s_is_nmea_auto(gnss_cfg_data)) {
+ uint8_t *length_ptr =
+ gnss_max_m10s_get_nmea_working_length_ptr(gnss_cfg_data); /// Get a pointer to the working copy length
+ uint8_t *nmea_ptr = gnss_max_m10s_get_nmea_working_ptr(gnss_cfg_data); /// Get a pointer to the working copy NMEA data
+ uint8_t nmea_max_length = gnss_max_m10s_get_nmea_max_length(
+ gnss_cfg_data);
+
+ if (*length_ptr < nmea_max_length) {
+ *(nmea_ptr + *length_ptr) = incoming; /// Store the character
+ *length_ptr = *length_ptr + 1; /// Increment the length
+
+ if (*length_ptr == nmea_max_length) {
+ /// For Debugging:
+
+ // printf("Process: NMEA buffer is full\r\n");
+ }
+ }
+ }
+
+ if (gnss_max_m10s_process_current_nmea(gnss_cfg_data)) {
+ gnss_max_m10s_process_nmea(incoming,
+ gnss_cfg_data->nmea_data);
+ }
+ }
+
+ if (incoming == '*') {
+ gnss_cfg_data->nmea_byte_counter = -5;
+ }
+
+ gnss_cfg_data->nmea_byte_counter++;
+
+ if (gnss_cfg_data->nmea_byte_counter
+ == gnss_cfg_data->max_nmea_byte_count) {
+ gnss_cfg_data->nmea_byte_counter = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE;
+ }
+
+ if (gnss_cfg_data->nmea_byte_counter == 0) {
+ if (gnss_max_m10s_is_nmea_auto(gnss_cfg_data)) {
+ uint8_t *working_length_ptr =
+ gnss_max_m10s_get_nmea_working_length_ptr(gnss_cfg_data); /// Get a pointer to the working copy length
+ uint8_t *working_nmea_ptr =
+ gnss_max_m10s_get_nmea_working_ptr(gnss_cfg_data); /// Get a pointer to the working copy NMEA data
+ uint8_t nmea_max_length = gnss_max_m10s_get_nmea_max_length(
+ gnss_cfg_data);
+
+ /// Check the checksum
+ uint8_t nmea_checksum = 0;
+ uint8_t chars_checked = 1; /// Start after the $
+ uint8_t this_char = '\0';
+
+ while ((chars_checked < (nmea_max_length - 1))
+ && (chars_checked < ((*working_length_ptr) - 4))
+ && (this_char != '*')) {
+ this_char = *(working_nmea_ptr + chars_checked); /// Get a char from the working copy
+ /// Ex-or the char into the checksum except '*'
+ if (this_char != '*') {
+ nmea_checksum ^= this_char;
+ }
+ chars_checked++;
+ }
+
+ if (this_char == '*') {
+ uint8_t expected_checksum_1 = (nmea_checksum >> 4) + '0';
+
+ if (expected_checksum_1 >= ':') {
+ expected_checksum_1 += 'A' - ':';
+ }
+ uint8_t expected_checksum_2 = (nmea_checksum & 0x0F) + '0';
+
+ if (expected_checksum_2 >= ':') {
+ expected_checksum_2 += 'A' - ':';
+ }
+
+ if ((expected_checksum_1 == *(working_nmea_ptr + chars_checked))
+ && (expected_checksum_2
+ == *(working_nmea_ptr + chars_checked + 1))) {
+ uint8_t *complete_length_ptr =
+ gnss_max_m10s_get_nmea_complete_length_ptr(gnss_cfg_data); /// Get a pointer to the complete copy length
+ uint8_t *complete_nmea_ptr =
+ gnss_max_m10s_get_complete_copy_nmea(gnss_cfg_data); /// Get a pointer to the complete copy NMEA data
+
+ memset(complete_nmea_ptr, 0, nmea_max_length); /// Clear the previous complete copy
+ memcpy(complete_nmea_ptr, working_nmea_ptr, *working_length_ptr); /// Copy the working copy into the complete copy
+
+ *complete_length_ptr = *working_length_ptr; /// Update the length
+ sl_max_m10s_nmea_automatic_flags_t *flags_ptr =
+ gnss_max_m10s_get_nmea_flags_ptr(gnss_cfg_data); /// Get a pointer to the flags
+ sl_max_m10s_nmea_automatic_flags_t flags_copy = *flags_ptr;
+
+ flags_copy.flags.bits.complete_copy_valid = 1; /// Set the complete copy valid flag
+ flags_copy.flags.bits.complete_copy_read = 0; /// Clear the complete copy read flag
+
+ *flags_ptr = flags_copy; /// Update the flags
+ }
+ }
+ }
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE; // All done!
+ }
+ }
+}
+
+uint32_t gnss_max_m10s_milli_sec()
+{
+ return sl_sleeptimer_get_tick_count();
+}
+
+static uint16_t gnss_max_m10s_file_buffer_space_available(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ return (FILE_BUFFER_SIZE - gnss_max_m10s_file_buffer_used(gnss_cfg_data));
+}
+
+static uint16_t gnss_max_m10s_file_buffer_used(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ if (gnss_cfg_data->file_buffer_head >= gnss_cfg_data->file_buffer_tail) {
+ return (gnss_cfg_data->file_buffer_head - gnss_cfg_data->file_buffer_tail);
+ } else {
+ return ((uint16_t)(((uint32_t)(gnss_cfg_data->file_buffer_head)
+ + (uint32_t)FILE_BUFFER_SIZE)
+ - (uint32_t)(gnss_cfg_data->file_buffer_tail)));
+ }
+}
+
+bool gnss_max_m10s_store_packet(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ uint16_t totalLength;
+ uint8_t sync_chars[] = { UBX_SYNCH_1, UBX_SYNCH_2 }; /// Store the two sync chars
+ uint8_t msg_length[2];
+
+ if ((gnss_cfg_data->ubx_file_buffer == NULL) || (FILE_BUFFER_SIZE == 0)) {
+ return false;
+ }
+
+ totalLength = msg->len + 8; /// Total length. Include sync chars, class, id, length and checksum bytes
+
+ if (totalLength > gnss_max_m10s_file_buffer_space_available(gnss_cfg_data)) {
+ return false;
+ }
+
+ gnss_max_m10s_write_file_buffer(gnss_cfg_data, sync_chars, 2);
+
+ /// Store the Class & ID
+ gnss_max_m10s_write_file_buffer(gnss_cfg_data, &msg->cls, 1);
+ gnss_max_m10s_write_file_buffer(gnss_cfg_data, &msg->id, 1);
+
+ /// Store the length
+ msg_length[0] = msg->len & 0xFF;
+ msg_length[1] = msg->len >> 8;
+
+ gnss_max_m10s_write_file_buffer(gnss_cfg_data, msg_length, 2);
+
+ /// Store the payload
+ gnss_max_m10s_write_file_buffer(gnss_cfg_data, msg->payload, msg->len);
+
+ /// Store the checksum
+ gnss_max_m10s_write_file_buffer(gnss_cfg_data, &msg->checksum_a, 1);
+ gnss_max_m10s_write_file_buffer(gnss_cfg_data, &msg->checksum_b, 1);
+
+ return true;
+}
+
+static void gnss_max_m10s_write_file_buffer(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *the_bytes,
+ uint16_t num_bytes)
+{
+ uint16_t bytes_before_wrapped_around = FILE_BUFFER_SIZE
+ - gnss_cfg_data->file_buffer_head;
+ uint16_t bytes_left_to_copy;
+ uint16_t bytes_in_buffer;
+
+ if (bytes_before_wrapped_around > num_bytes) {
+ bytes_before_wrapped_around = num_bytes;
+ }
+
+ /// Copy the data into the buffer
+ memcpy(&(gnss_cfg_data->ubx_file_buffer[gnss_cfg_data->file_buffer_head]),
+ the_bytes,
+ bytes_before_wrapped_around);
+
+ bytes_left_to_copy = num_bytes - bytes_before_wrapped_around;
+
+ if (bytes_left_to_copy > 0) {
+ memcpy(&(gnss_cfg_data->ubx_file_buffer[0]),
+ &the_bytes[bytes_before_wrapped_around],
+ bytes_left_to_copy);
+ gnss_cfg_data->file_buffer_head = bytes_left_to_copy;
+ } else {
+ gnss_cfg_data->file_buffer_head += num_bytes;
+ }
+
+ bytes_in_buffer = gnss_max_m10s_file_buffer_used(gnss_cfg_data);
+
+ if (bytes_in_buffer > gnss_cfg_data->file_buffer_max_avail) {
+ gnss_cfg_data->file_buffer_max_avail = bytes_in_buffer;
+ }
+}
+
+sl_status_t gnss_max_m10s_set_i2c_output(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t comSettings,
+ uint8_t layer,
+ uint16_t max_wait)
+{
+ uint8_t value;
+ sl_status_t result;
+
+ result = gnss_max_m10s_new_cfg_valset(gnss_cfg_data, layer);
+
+ value = (uint8_t) (comSettings & COM_TYPE_UBX) == 0 ? 0 : 1;
+ result &= gnss_max_m10s_add_cfg_valset(gnss_cfg_data,
+ UBLOX_CFG_I2C_OUTPORT_UBX,
+ &value, 1);
+
+ value = (uint8_t) (comSettings & COM_TYPE_NMEA) == 0 ? 0 : 1;
+ result &= gnss_max_m10s_add_cfg_valset(gnss_cfg_data,
+ UBLOX_CFG_I2C_OUTPORT_NMEA,
+ &value, 1);
+
+ result &= gnss_max_m10s_send_cfg_valset(gnss_cfg_data, max_wait);
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_new_cfg_valset(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t layer)
+{
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_CFG;
+ gnss_cfg_data->packet_cfg.id = UBX_CFG_VALSET;
+ gnss_cfg_data->packet_cfg.len = 4;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->num_cfg_keys = 0;
+
+ memset(gnss_cfg_data->msg_data.payload_cfg,
+ 0,
+ gnss_cfg_data->msg_data.packet_cfg_payloadsize);
+
+ gnss_cfg_data->msg_data.payload_cfg[0] = 0;
+ gnss_cfg_data->msg_data.payload_cfg[1] = layer;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_add_cfg_valset(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint32_t key,
+ uint8_t *value,
+ uint8_t N)
+{
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ if ((gnss_cfg_data->auto_send_at_space_remaining > 0)
+ && (gnss_cfg_data->packet_cfg.len
+ >= (gnss_cfg_data->msg_data.packet_cfg_payloadsize
+ - gnss_cfg_data->auto_send_at_space_remaining))) {
+ if (gnss_max_m10s_send_command(gnss_cfg_data,
+ GNSS_POLL_MAX_TIMEOUT,
+ false)
+ != SL_MAX_M10S_UBLOX_STATUS_DATA_SENT) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packet_cfg.len = 4;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->num_cfg_keys = 0;
+
+ memset(&(gnss_cfg_data->msg_data.payload_cfg[4]),
+ 0,
+ gnss_cfg_data->msg_data.packet_cfg_payloadsize - 4);
+ }
+
+ if (gnss_cfg_data->packet_cfg.len
+ >= (gnss_cfg_data->msg_data.packet_cfg_payloadsize - (4 + N))) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->num_cfg_keys == CFG_VALSET_MAX_KEYS) {
+ return SL_STATUS_FAIL;
+ }
+
+ key &= ~UBX_CFG_SIZE_MASK;
+
+ for (uint8_t i = 0; i < 4; i++) {
+ gnss_cfg_data->msg_data.payload_cfg[gnss_cfg_data->packet_cfg.len
+ + i] = key >> (8 * i);
+ }
+
+ for (uint8_t i = 0; i < N; i++) {
+ gnss_cfg_data->msg_data.payload_cfg[gnss_cfg_data->packet_cfg.len + i
+ + 4] = *value++;
+ }
+
+ gnss_cfg_data->packet_cfg.len = gnss_cfg_data->packet_cfg.len + 4 + N;
+ gnss_cfg_data->num_cfg_keys++;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_send_cfg_valset(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ if (0 == gnss_cfg_data->num_cfg_keys) {
+ return SL_STATUS_OK;
+ }
+
+ bool success = gnss_max_m10s_send_command(gnss_cfg_data,
+ max_wait,
+ false)
+ == SL_MAX_M10S_UBLOX_STATUS_DATA_SENT;
+
+ if (success) {
+ gnss_cfg_data->num_cfg_keys = 0;
+ }
+
+ return SL_STATUS_OK;
+}
+
+sl_status_t gnss_max_m10s_get_nav_pvt(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navstatus(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_navstatus_ubx(gnss_cfg_data, max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navepoch(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_navepoch_ubx(gnss_cfg_data,
+ max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navsat(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ if (SL_STATUS_OK
+ == gnss_max_m10s_set_packet_cfg_payload_size(gnss_cfg_data,
+ UBX_NAV_SAT_LEN)) {
+ return gnss_max_m10s_get_navsat_ubx(gnss_cfg_data, max_wait);
+ } else {
+ return SL_STATUS_FAIL;
+ }
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navsig(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ if (SL_STATUS_OK == gnss_max_m10s_set_packet_cfg_payload_size(gnss_cfg_data,
+ UBX_NAV_SAT_LEN))
+ {
+ return gnss_max_m10s_get_navsig_ubx(gnss_cfg_data, max_wait);
+ } else {
+ return SL_STATUS_FAIL;
+ }
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navdop(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_navdop_ubx(gnss_cfg_data, max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navposllh(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_navposllh_ubx(gnss_cfg_data, max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navtimels(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_navtimels_ubx(gnss_cfg_data, max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navtimeutc(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_navtimeutc_ubx(gnss_cfg_data, max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navclock(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_navclock_ubx(gnss_cfg_data, max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navvelned(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_navvelned_ubx(gnss_cfg_data, max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_fix_type(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *fix_type)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *fix_type = gnss_cfg_data->packetUBXNAVPVT->data.fixType;
+ } else {
+ status = gnss_max_m10s_get_quality_nmea(gnss_cfg_data, fix_type, max_wait);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_satellite_number(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *satellite)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *satellite = gnss_cfg_data->packetUBXNAVPVT->data.numSV;
+ } else {
+ status =
+ gnss_max_m10s_get_satellite_nmea(gnss_cfg_data, satellite, max_wait);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_longitude(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *longitude)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *longitude = gnss_cfg_data->packetUBXNAVPVT->data.lon;
+ } else {
+ status =
+ gnss_max_m10s_get_longitude_nmea(gnss_cfg_data, longitude, max_wait);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_latitude(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *latitude)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *latitude = gnss_cfg_data->packetUBXNAVPVT->data.lat;
+ } else {
+ status = gnss_max_m10s_get_latitude_nmea(gnss_cfg_data, latitude, max_wait);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_altitude_msl(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *altitude_msl)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *altitude_msl = gnss_cfg_data->packetUBXNAVPVT->data.hMSL;
+ } else {
+ status = gnss_max_m10s_get_altitude_msl_nmea(gnss_cfg_data,
+ altitude_msl,
+ max_wait);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_altitude(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *altitude)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *altitude = gnss_cfg_data->packetUBXNAVPVT->data.height;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_carrier_solution(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int8_t *carrier_solution)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *carrier_solution =
+ gnss_cfg_data->packetUBXNAVPVT->data.solution_flags.bits.carrSoln;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_differential_solution(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *differential_solution)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *differential_solution =
+ (bool)gnss_cfg_data->packetUBXNAVPVT->data.solution_flags.bits.diffSoln;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_head_vehicle_valid(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *head_vehicle_valid)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *head_vehicle_valid =
+ (bool)gnss_cfg_data->packetUBXNAVPVT->data.solution_flags.bits.
+ headVehValid;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_gnss_fix_ok(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *gnss_fix_ok)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *gnss_fix_ok =
+ (bool)gnss_cfg_data->packetUBXNAVPVT->data.solution_flags.bits.gnssFixOK;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_confirm_time(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *confirm_time)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *confirm_time =
+ (bool)gnss_cfg_data->packetUBXNAVPVT->data.confirm_flags.confirm_data.
+ confirmed_time;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_confirm_date(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *confirm_date)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *confirm_date =
+ (bool)gnss_cfg_data->packetUBXNAVPVT->data.confirm_flags.confirm_data.
+ confirmed_date;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_fully_resolved(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *fully_resolved)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *fully_resolved =
+ (bool)gnss_cfg_data->packetUBXNAVPVT->data.valid.bits.fullyResolved;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_invalid_data(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *invalid_data)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *invalid_data =
+ (bool)gnss_cfg_data->packetUBXNAVPVT->data.correction_flags.bits.
+ invalidLlh;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_time_of_week(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint32_t *time_of_week)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *time_of_week = gnss_cfg_data->packetUBXNAVPVT->data.iTOW;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_horizontal_accuracy(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *horizontal_accuracy)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *horizontal_accuracy = gnss_cfg_data->packetUBXNAVPVT->data.hAcc;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_vertical_accuracy(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *vertical_accuracy)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *vertical_accuracy = gnss_cfg_data->packetUBXNAVPVT->data.vAcc;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_ned_north(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *ned_north)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *ned_north = gnss_cfg_data->packetUBXNAVPVT->data.velN;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_ned_east(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *ned_east)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *ned_east = gnss_cfg_data->packetUBXNAVPVT->data.velE;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_ned_down(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *ned_down)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *ned_down = gnss_cfg_data->packetUBXNAVPVT->data.velD;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_magnetic_declination(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int16_t *magnetic_declination)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *magnetic_declination = gnss_cfg_data->packetUBXNAVPVT->data.magDec;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_magnetic_declination_accuracy(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint16_t *magnetic_accuracy)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *magnetic_accuracy = gnss_cfg_data->packetUBXNAVPVT->data.magAcc;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_heading_of_motion(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *head_of_motion)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *head_of_motion = gnss_cfg_data->packetUBXNAVPVT->data.headMot;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_ground_speed(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *ground_speed)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *ground_speed = gnss_cfg_data->packetUBXNAVPVT->data.gSpeed;
+ } else {
+ status =
+ gnss_max_m10s_get_speed_nmea(gnss_cfg_data, ground_speed, max_wait);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_speed_accuracy(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *speed_accuracy)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *speed_accuracy = gnss_cfg_data->packetUBXNAVPVT->data.sAcc;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_heading_accuracy(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *heading_accuracy)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *heading_accuracy = gnss_cfg_data->packetUBXNAVPVT->data.headAcc;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_positional_dillution(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int16_t *position_dillution)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *position_dillution = gnss_cfg_data->packetUBXNAVPVT->data.pDOP;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_head_vehicle(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *head_vehicle)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *head_vehicle = gnss_cfg_data->packetUBXNAVPVT->data.headVeh;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_day(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *day)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *day = gnss_cfg_data->packetUBXNAVPVT->data.day;
+ } else {
+ status = gnss_max_m10s_get_day_nmea(gnss_cfg_data, day, max_wait);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_month(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *month)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *month = gnss_cfg_data->packetUBXNAVPVT->data.month;
+ } else {
+ status = gnss_max_m10s_get_month_nmea(gnss_cfg_data, month, max_wait);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_year(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint16_t *year)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *year = gnss_cfg_data->packetUBXNAVPVT->data.year;
+ } else {
+ status = gnss_max_m10s_get_year_nmea(gnss_cfg_data, year, max_wait);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_hour(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *hour)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *hour = gnss_cfg_data->packetUBXNAVPVT->data.hour;
+ } else {
+ status = gnss_max_m10s_get_hour_nmea(gnss_cfg_data, hour, max_wait);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_minute(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *minute)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *minute = gnss_cfg_data->packetUBXNAVPVT->data.min;
+ } else {
+ status = gnss_max_m10s_get_min_nmea(gnss_cfg_data, minute, max_wait);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_seconds(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *seconds)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *seconds = gnss_cfg_data->packetUBXNAVPVT->data.sec;
+ } else {
+ status = gnss_max_m10s_get_second_nmea(gnss_cfg_data, seconds, max_wait);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_milliseconds(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint16_t *milli_seconds)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *milli_seconds = gnss_cfg_data->packetUBXNAVPVT->data.iTOW % 1000;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_nanoseconds(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *nano)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *nano = gnss_cfg_data->packetUBXNAVPVT->data.nano;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_valid_time(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *valid_time)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *valid_time = gnss_cfg_data->packetUBXNAVPVT->data.valid.bits.valid_time;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_valid_date(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ bool *valid_date)
+{
+ sl_status_t status;
+
+ if (gnss_cfg_data->protocol_type != SL_MAX_M10S_PROTOCOL_NMEA) {
+ status = gnss_max_m10s_get_navpvt_ubx(gnss_cfg_data, max_wait);
+
+ *valid_date = gnss_cfg_data->packetUBXNAVPVT->data.valid.bits.valid_date;
+ } else {
+ status = SL_STATUS_NOT_AVAILABLE;
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_geoid(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *geoid)
+{
+ if (gnss_cfg_data->protocol_type == SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_geoid_nmea(gnss_cfg_data, geoid, max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_horizontal_dilution(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ uint8_t *hdop)
+{
+ if (gnss_cfg_data->protocol_type == SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_horizontal_dilution_nmea(gnss_cfg_data,
+ hdop,
+ max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_course_over_ground(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ int32_t *course)
+{
+ if (gnss_cfg_data->protocol_type == SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_ground_course_nmea(gnss_cfg_data, course,
+ max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
+
+sl_status_t gnss_max_m10s_get_navigation_system(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait,
+ char *nav_system)
+{
+ if (gnss_cfg_data->protocol_type == SL_MAX_M10S_PROTOCOL_NMEA) {
+ return gnss_max_m10s_get_nav_system_nmea(gnss_cfg_data, nav_system,
+ max_wait);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+}
diff --git a/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_micro_nmea.c b/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_micro_nmea.c
new file mode 100644
index 00000000..d0b5b1a4
--- /dev/null
+++ b/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_micro_nmea.c
@@ -0,0 +1,682 @@
+/***************************************************************************//**
+ * @file gnss_max_m10s_micro_nmea.c
+ * @brief MAX_M10S GNSS receiver driver micro-NMEA related external APIs
+ * implementation.
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ * # Evaluation Quality
+ * This code has been minimally tested to ensure that it builds and is suitable
+ * as a demonstration for evaluation purposes only. This code will be maintained
+ * at the sole discretion of Silicon Labs.
+ ******************************************************************************/
+#include
+#include "gnss_max_m10s_micro_nmea.h"
+
+/**************************************************************************//**
+ * @brief To calculate the 10 raise to the power of input.
+ * @param[in] b : input digit for which the exponential value is calculated.
+ * @return long type calculated value.
+ *****************************************************************************/
+static long gnss_max_m10s_exp_10(uint8_t b);
+
+/**************************************************************************//**
+ * @brief To convert the input value in hexadecimal.
+ * @param[in] nibble : input value.
+ * @return hexadecimal value.
+ *****************************************************************************/
+static char gnss_max_m10s_to_hex(uint8_t nibble);
+
+/**************************************************************************//**
+ * @brief To skip a field from NMEA sentence.
+ * @param[in] s : pointer to NMEA filed.
+ * @return pointer to the next field of the NMEA sentence after the comma.
+ *****************************************************************************/
+static const char * gnss_max_m10s_skip_field(const char *s);
+
+/**************************************************************************//**
+ * @brief To parse an unsigned int type data from NMEA sentence.
+ * @param[in] s : pointer to NMEA filed.
+ * @param[in] len : length of the parsed data.
+ * @return unsigned int type data from the sentence.
+ *****************************************************************************/
+static unsigned int gnss_max_m10s_parse_unsigned_int(const char *s,
+ uint8_t len);
+
+/**************************************************************************//**
+ * @brief To parse an float type data from NMEA sentence.
+ * @param[in] s : pointer to NMEA field.
+ * @param[in] log_10_multiplier : value of multiplier.
+ * @param[in] eptr : pointer to return the position in the input string where parsing stopped .
+ * @param[in] result_valid : pointer to the valid result check.
+ * @return long type NMEA data.
+ *****************************************************************************/
+static long gnss_max_m10s_parse_float(const unsigned char *s,
+ uint8_t log_10_multiplier,
+ const char **eptr,
+ bool *result_valid);
+
+/**************************************************************************//**
+ * @brief To parse data from NMEA sentence in degree minute formate.
+ * @param[in] s : pointer to NMEA field.
+ * @param[in] deg_width : width of degree.
+ * @param[in] eptr : pointer to return the position in the input string where parsing stopped .
+ * @return data in degree minute format.
+ *****************************************************************************/
+static long gnss_max_m10s_parse_degree_minute(const char *s,
+ uint8_t deg_width,
+ const char **eptr);
+
+/**************************************************************************//**
+ * @brief To parse data from NMEA sentence.
+ * @param[in] s : pointer to NMEA field.
+ * @param[in] result : pointer to the field parsed.
+ * @param[in] len : length of the field.
+ * @return pointer to the field parsed.
+ *****************************************************************************/
+static const char * gnss_max_m10s_parse_field(const char *s,
+ char *result,
+ int len);
+
+/**************************************************************************//**
+ * @brief To generate checksum for NMEA sentence.
+ * @param[in] s : pointer to NMEA sentence.
+ * @param[out] checksum : To store the calculated checksum value.
+ * @return a pointer to the end of the string.
+ *****************************************************************************/
+static const char * gnss_max_m10s_generate_checksum(const char *s,
+ char *checksum);
+
+/**************************************************************************//**
+ * @brief To check generate checksum for NMEA sentence and calculated checksum.
+ * @param[in] s : pointer to NMEA sentence.
+ * @return true if checksum matches the calculated checksum.
+ *****************************************************************************/
+static bool gnss_max_m10s_test_checksum(const char *s);
+
+/**************************************************************************//**
+ * @brief To set the buffer allocated for micro nmea.
+ * @param[in] gnss_cfg_data : pointer to GNSS cfg data structure.
+ *****************************************************************************/
+static void gnss_max_m10s_set_buffer(sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief To check the end of field from NMEA sentence.
+ * @param[in] c : character from NMEA sentence.
+ * @return true if end of field is found.
+ * false if end of field is not found.
+ *****************************************************************************/
+static bool gnss_max_m10s_is_end_of_fields(char c);
+
+/**************************************************************************//**
+ * @brief To process the RMC type NMEA sentence.
+ * @param[in] s : character to be processed from NMEA sentence.
+ * @param[in] nmea_cfg_data : pointer to NMEA data.
+ * @return The following values are returned:
+ * - \ref true on success.
+ * - \ref false on failure.
+ *****************************************************************************/
+static bool gnss_max_m10s_process_rmc(const char *s,
+ sl_max_m10s_nmea_data_t *nmea_data);
+
+/**************************************************************************//**
+ * @brief To process the GGA type NMEA sentence.
+ * @param[in] s : character to be processed from NMEA sentence.
+ * @param[in] nmea_cfg_data : pointer to NMEA data.
+ * @return The following values are returned:
+ * - \ref true on success.
+ * - \ref false on failure.
+ *****************************************************************************/
+static bool gnss_max_m10s_process_gga(const char *s,
+ sl_max_m10s_nmea_data_t *nmea_data);
+
+static long gnss_max_m10s_exp_10(uint8_t b)
+{
+ long r = 1;
+ while (b--) {
+ r *= 10;
+ }
+ return r;
+}
+
+static char gnss_max_m10s_to_hex(uint8_t nibble)
+{
+ if (nibble >= 10) {
+ return nibble + 'A' - 10;
+ } else {
+ return nibble + '0';
+ }
+}
+
+static const char * gnss_max_m10s_skip_field(const char *s)
+{
+ if (s == NULL) {
+ return NULL;
+ }
+
+ while (!gnss_max_m10s_is_end_of_fields(*s)) {
+ if (*s == ',') {
+ /// Check next character
+ if (gnss_max_m10s_is_end_of_fields(*++s)) {
+ break;
+ } else {
+ return s;
+ }
+ }
+ ++s;
+ }
+
+ return NULL; /// End of string or valid sentence
+}
+
+static unsigned int gnss_max_m10s_parse_unsigned_int(const char *s,
+ uint8_t len)
+{
+ int r = 0;
+ while (len--) {
+ r = 10 * r + *s++ - '0';
+ }
+ return r;
+}
+
+static long gnss_max_m10s_parse_float(const unsigned char *s,
+ uint8_t log_10_multiplier,
+ const char **eptr,
+ bool *result_valid)
+{
+ int8_t neg = 1;
+ long r = 0;
+
+ if (result_valid) {
+ *result_valid = false;
+ }
+
+ while (isspace(*s)) {
+ ++s;
+ }
+
+ if (*s == '-') {
+ neg = -1;
+ ++s;
+ } else if (*s == '+') {
+ ++s;
+ }
+
+ while (isdigit(*s)) {
+ r = 10 * r + *s++ - '0';
+ if (result_valid) {
+ *result_valid = true;
+ }
+ }
+
+ r *= gnss_max_m10s_exp_10(log_10_multiplier);
+
+ if (*s == '.') {
+ ++s;
+ long frac = 0;
+ while (isdigit(*s) && log_10_multiplier) {
+ frac = 10 * frac + *s++ - '0';
+ --log_10_multiplier;
+ }
+ frac *= gnss_max_m10s_exp_10(log_10_multiplier);
+ r += frac;
+ }
+
+ r *= neg; /// Include effect of any minus sign
+
+ if (eptr) {
+ *eptr = gnss_max_m10s_skip_field((const char *)s);
+ }
+
+ return r;
+}
+
+static long gnss_max_m10s_parse_degree_minute(const char *s,
+ uint8_t deg_width,
+ const char **eptr)
+{
+ if (*s == ',') {
+ if (eptr) {
+ *eptr = gnss_max_m10s_skip_field(s);
+ }
+ return 0;
+ }
+ long r = gnss_max_m10s_parse_unsigned_int(s, deg_width) * 1000000L;
+ s += deg_width;
+ r += gnss_max_m10s_parse_float((unsigned char *)s, 6, eptr, NULL) / 60;
+ return r;
+}
+
+static const char * gnss_max_m10s_parse_field(const char *s,
+ char *result,
+ int len)
+{
+ if (s == NULL) {
+ return NULL;
+ }
+
+ int i = 0;
+ while (*s != ',' && !gnss_max_m10s_is_end_of_fields(*s)) {
+ if (result && (i++ < len)) {
+ *result++ = *s;
+ }
+ ++s;
+ }
+ if (result && (i < len)) {
+ *result = '\0';
+ }
+
+ if (*s == ',') {
+ return ++s; /// Location of start of next field
+ } else {
+ return NULL; /// End of string or valid sentence
+ }
+}
+
+static const char * gnss_max_m10s_generate_checksum(const char *s,
+ char *checksum)
+{
+ uint8_t c = 0;
+ /// Initial $ is omitted from checksum
+ if (*s == '$') {
+ ++s;
+ }
+
+ while (*s != '\0' && *s != '*') {
+ c ^= *s++;
+ }
+
+ if (checksum) {
+ checksum[0] = gnss_max_m10s_to_hex(c / 16);
+ checksum[1] = gnss_max_m10s_to_hex(c % 16);
+ }
+ return s;
+}
+
+static bool gnss_max_m10s_test_checksum(const char *s)
+{
+ char checksum[2];
+ const char *p = gnss_max_m10s_generate_checksum(s, checksum);
+ return *p == '*' && p[1] == checksum[0] && p[2] == checksum[1];
+}
+
+char gnss_max_m10s_nmea_get_nav_system(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->nav_system;
+}
+
+uint8_t gnss_max_m10s_nmea_get_num_satellites(
+ sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->num_sat;
+}
+
+uint8_t gnss_max_m10s_nmea_get_hdop(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->hdop;
+}
+
+bool gnss_max_m10s_nmea_is_valid(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->is_valid;
+}
+
+int32_t gnss_max_m10s_nmea_get_latitude(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->latitude;
+}
+
+int32_t gnss_max_m10s_nmea_get_longitude(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->longitude;
+}
+
+bool gnss_max_m10s_nmea_get_altitude_msl(int32_t *alt,
+ sl_max_m10s_nmea_data_t *nmea_data)
+{
+ if (nmea_data->altitude_valid) {
+ *alt = nmea_data->altitude;
+ }
+ return nmea_data->altitude_valid;
+}
+
+bool gnss_max_m10s_nmea_get_geoid_height(int32_t *alt,
+ sl_max_m10s_nmea_data_t *nmea_data)
+{
+ if (nmea_data->geoid_height_valid) {
+ *alt = nmea_data->geoid_height;
+ }
+
+ return nmea_data->geoid_height_valid;
+}
+
+uint16_t gnss_max_m10s_nmea_get_year(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->year;
+}
+
+uint8_t gnss_max_m10s_nmea_get_month(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->month;
+}
+
+uint8_t gnss_max_m10s_nmea_get_day(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->day;
+}
+
+uint8_t gnss_max_m10s_nmea_get_hour(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->hour;
+}
+
+uint8_t gnss_max_m10s_nmea_get_minute(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->minute;
+}
+
+uint8_t gnss_max_m10s_nmea_get_second(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->second;
+}
+
+int32_t gnss_max_m10s_nmea_get_speed(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->speed;
+}
+
+int32_t gnss_max_m10s_nmea_get_course(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ return nmea_data->course;
+}
+
+static bool gnss_max_m10s_is_end_of_fields(char c)
+{
+ return c == '*' || c == '\0' || c == '\r' || c == '\n';
+}
+
+void gnss_max_m10s_init_micro_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->nmea_data->talker_id = '\0';
+ memset(gnss_cfg_data->nmea_data->message_id, 0,
+ sizeof(gnss_cfg_data->nmea_data->message_id));
+ gnss_max_m10s_set_buffer(gnss_cfg_data);
+ gnss_max_m10s_clear_nmea_data(gnss_cfg_data->nmea_data);
+}
+
+static void gnss_max_m10s_set_buffer(sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->nmea_data->buffer_len = sizeof(gnss_cfg_data->nmea_buffer);
+ gnss_cfg_data->nmea_data->buffer = (char *)gnss_cfg_data->nmea_buffer;
+ gnss_cfg_data->nmea_data->ptr = gnss_cfg_data->nmea_data->buffer;
+
+ if (gnss_cfg_data->nmea_data->buffer_len) {
+ *gnss_cfg_data->nmea_data->ptr = '\0';
+ gnss_cfg_data->nmea_data->buffer[gnss_cfg_data->nmea_data->buffer_len
+ - 1] = '\0';
+ }
+}
+
+void gnss_max_m10s_clear_nmea_data(sl_max_m10s_nmea_data_t *nmea_data)
+{
+ nmea_data->nav_system = '\0';
+ nmea_data->num_sat = 0;
+ nmea_data->hdop = 255;
+ nmea_data->is_valid = false;
+ nmea_data->latitude = 999000000L;
+ nmea_data->longitude = 999000000L;
+ nmea_data->altitude = LONG_MIN;
+ nmea_data->speed = LONG_MIN;
+ nmea_data->course = LONG_MIN;
+ nmea_data->altitude_valid = false;
+ nmea_data->geoid_height_valid = false;
+ nmea_data->year = 0;
+ nmea_data->month = 0;
+ nmea_data->day = 0;
+ nmea_data->hour = 99;
+ nmea_data->minute = 99;
+ nmea_data->second = 99;
+}
+
+bool gnss_max_m10s_process_nmea(char c, sl_max_m10s_nmea_data_t *nmea_data)
+{
+ if ((nmea_data->buffer == NULL) || (nmea_data->buffer_len == 0)) {
+ return false;
+ }
+
+ if ((c == '\0') || (c == '\n') || (c == '\r')) {
+ *(nmea_data->ptr) = '\0';
+ nmea_data->ptr = nmea_data->buffer;
+
+ if ((*(nmea_data->buffer) == '$')
+ && gnss_max_m10s_test_checksum(nmea_data->buffer)) {
+ /// Valid message
+ const char *data;
+ if (nmea_data->buffer[1] == 'G') {
+ nmea_data->talker_id = nmea_data->buffer[2];
+ data = gnss_max_m10s_parse_field(&nmea_data->buffer[3],
+ &nmea_data->message_id[0],
+ sizeof(nmea_data->message_id));
+ } else {
+ nmea_data->talker_id = '\0';
+ data = gnss_max_m10s_parse_field(&nmea_data->buffer[1],
+ &nmea_data->message_id[0],
+ sizeof(nmea_data->message_id));
+ }
+
+ if ((data != NULL) && (strcmp(&nmea_data->message_id[0], "GGA") == 0)) {
+ return gnss_max_m10s_process_gga(data, nmea_data);
+ } else if ((data != NULL)
+ && (strcmp(&nmea_data->message_id[0], "RMC") == 0)) {
+ return gnss_max_m10s_process_rmc(data, nmea_data);
+ }
+ }
+
+ /// Return true for a complete, non-empty, sentence (even if not a valid one).
+ return *(nmea_data->buffer) != '\0';
+ } else {
+ *(nmea_data->ptr) = c;
+ if (nmea_data->ptr < &nmea_data->buffer[nmea_data->buffer_len - 1]) {
+ ++nmea_data->ptr;
+ }
+ }
+
+ return false;
+}
+
+static const char * gnss_max_m10s_parse_time(const char *s,
+ sl_max_m10s_nmea_data_t *nmea_data)
+{
+ if (*s == ',') {
+ return gnss_max_m10s_skip_field(s);
+ }
+
+ nmea_data->hour = gnss_max_m10s_parse_unsigned_int(s, 2);
+ nmea_data->minute = gnss_max_m10s_parse_unsigned_int(s + 2, 2);
+ nmea_data->second = gnss_max_m10s_parse_unsigned_int(s + 4, 2);
+
+ return gnss_max_m10s_skip_field(s + 9);
+}
+
+static const char * gnss_max_m10s_parse_date(const char *s,
+ sl_max_m10s_nmea_data_t *nmea_data)
+{
+ if (*s == ',') {
+ return gnss_max_m10s_skip_field(s);
+ }
+
+ nmea_data->day = gnss_max_m10s_parse_unsigned_int(s, 2);
+ nmea_data->month = gnss_max_m10s_parse_unsigned_int(s + 2, 2);
+ nmea_data->year = gnss_max_m10s_parse_unsigned_int(s + 4, 2) + 2000;
+
+ return gnss_max_m10s_skip_field(s + 6);
+}
+
+static bool gnss_max_m10s_process_gga(const char *s,
+ sl_max_m10s_nmea_data_t *nmea_data)
+{
+ nmea_data->nav_system = nmea_data->talker_id;
+
+ s = gnss_max_m10s_parse_time(s, nmea_data);
+
+ if (s == NULL) {
+ return false;
+ }
+
+ nmea_data->latitude = gnss_max_m10s_parse_degree_minute(s, 2, &s);
+ if (s == NULL) {
+ return false;
+ }
+
+ if (*s == ',') {
+ ++s;
+ } else {
+ if (*s == 'S') {
+ nmea_data->latitude *= -1;
+ }
+ s += 2; /// Skip N/S and comma
+ }
+
+ nmea_data->longitude = gnss_max_m10s_parse_degree_minute(s, 3, &s);
+ if (s == NULL) {
+ return false;
+ }
+
+ if (*s == ',') {
+ ++s;
+ } else {
+ if (*s == 'W') {
+ nmea_data->longitude *= -1;
+ }
+ s += 2; /// Skip E/W and comma
+ }
+
+ nmea_data->is_valid = (*s >= '1' && *s <= '5');
+
+ long tmp = gnss_max_m10s_parse_float((unsigned char *)s, 0, &s, NULL);
+ nmea_data->num_sat = (tmp > 255 ? 255 : (tmp < 0 ? 0 : tmp));
+
+ if (s == NULL) {
+ return false;
+ }
+
+ tmp = gnss_max_m10s_parse_float((unsigned char *)s, 1, &s, NULL);
+ nmea_data->hdop = (tmp > 255 || tmp < 0 ? 255 : tmp);
+
+ if (s == NULL) {
+ return false;
+ }
+
+ bool result_valid;
+ nmea_data->altitude = gnss_max_m10s_parse_float((unsigned char *)s,
+ 3,
+ &s,
+ &result_valid);
+
+ if (s == NULL) {
+ return false;
+ }
+
+ if (result_valid) {
+ nmea_data->altitude_valid = true;
+ }
+ s += 2; /// Skip M and comma
+ nmea_data->geoid_height = gnss_max_m10s_parse_float((unsigned char *)s,
+ 3,
+ &s,
+ &result_valid);
+
+ if (s == NULL) {
+ return false;
+ }
+
+ if (result_valid) {
+ nmea_data->geoid_height_valid = true;
+ }
+ return true;
+}
+
+static bool gnss_max_m10s_process_rmc(const char *s,
+ sl_max_m10s_nmea_data_t *nmea_data)
+{
+ nmea_data->nav_system = nmea_data->talker_id;
+
+ s = gnss_max_m10s_parse_time(s, nmea_data);
+
+ if (s == NULL) {
+ return false;
+ }
+
+ nmea_data->is_valid = (*s == 'A');
+ s += 2; /// Skip validity and comma
+
+ nmea_data->latitude = gnss_max_m10s_parse_degree_minute(s, 2, &s);
+ if (s == NULL) {
+ return false;
+ }
+
+ if (*s == ',') {
+ ++s;
+ } else {
+ if (*s == 'S') {
+ nmea_data->latitude *= -1;
+ }
+
+ s += 2; /// Skip N/S and comma
+ }
+
+ nmea_data->longitude = gnss_max_m10s_parse_degree_minute(s, 3, &s);
+
+ if (s == NULL) {
+ return false;
+ }
+
+ if (*s == ',') {
+ ++s;
+ } else {
+ if (*s == 'W') {
+ nmea_data->longitude *= -1;
+ }
+
+ s += 2; /// Skip E/W and comma
+ }
+
+ nmea_data->speed = gnss_max_m10s_parse_float((unsigned char *)s, 3, &s, NULL);
+
+ if (s == NULL) {
+ return false;
+ }
+
+ nmea_data->course =
+ gnss_max_m10s_parse_float((unsigned char *)s, 3, &s, NULL);
+
+ if (s == NULL) {
+ return false;
+ }
+
+ s = gnss_max_m10s_parse_date(s, nmea_data);
+ return true;
+}
diff --git a/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_nmea.c b/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_nmea.c
new file mode 100644
index 00000000..7fdcd825
--- /dev/null
+++ b/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_nmea.c
@@ -0,0 +1,684 @@
+/****************************************************************************//*
+ * @file gnss_max_m10s_nmea.c
+ * @brief MAX_M10S GNSS receiver driver external APIs implementation for NMEA
+ * sentence data
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ * # Evaluation Quality
+ * This code has been minimally tested to ensure that it builds and is suitable
+ * as a demonstration for evaluation purposes only. This code will be maintained
+ * at the sole discretion of Silicon Labs.
+ ******************************************************************************/
+#include
+#include "gnss_max_m10s_driver.h"
+#include "gnss_max_m10s_nmea.h"
+
+sl_status_t gnss_max_m10s_nmea_init(sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->nmea_data = malloc(sizeof(sl_max_m10s_nmea_data_t));
+
+ if (gnss_cfg_data->nmea_data != NULL) {
+ memset(gnss_cfg_data->nmea_data, 0, sizeof(sl_max_m10s_nmea_data_t));
+ gnss_cfg_data->processing_nmea.all = SL_MAX_M10S_FILTER_NMEA_ALL;
+ gnss_max_m10s_init_micro_nmea(gnss_cfg_data);
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+}
+
+bool gnss_max_m10s_is_nmea_header_valid(sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ if (gnss_cfg_data->nmea_address_field[0] != '*') {
+ return (false);
+ }
+ if (gnss_cfg_data->nmea_address_field[1] != 'G') {
+ return (false);
+ }
+
+ if (gnss_cfg_data->nmea_address_field[3] == 'G') {
+ if ((gnss_cfg_data->nmea_address_field[4] == 'G')
+ && (gnss_cfg_data->nmea_address_field[5] == 'A')) {
+ return (true);
+ }
+ }
+
+ if ((gnss_cfg_data->nmea_address_field[3] == 'R')
+ && (gnss_cfg_data->nmea_address_field[4] == 'M')
+ && (gnss_cfg_data->nmea_address_field[5] == 'C')) {
+ return (true);
+ }
+
+ return (false);
+}
+
+bool gnss_max_m10s_process_current_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ if (gnss_cfg_data->processing_nmea.bits.all == 1) {
+ return (true);
+ }
+
+ if (gnss_cfg_data->nmea_address_field[3] == 'G') {
+ if ((gnss_cfg_data->nmea_address_field[4] == 'G')
+ && (gnss_cfg_data->nmea_address_field[5] == 'A')
+ && (gnss_cfg_data->processing_nmea.bits.UBX_NMEA_GGA == 1)) {
+ return (true);
+ }
+ }
+
+ if ((gnss_cfg_data->nmea_address_field[3] == 'R')
+ && (gnss_cfg_data->nmea_address_field[4] == 'M')
+ && (gnss_cfg_data->nmea_address_field[5] == 'C')
+ && (gnss_cfg_data->processing_nmea.bits.UBX_NMEA_RMC == 1)) {
+ return (true);
+ }
+
+ return (false);
+}
+
+uint8_t gnss_max_m10s_get_nmea_max_length(sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ char nmea[] = "GPGGA";
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return SL_MAX_M10S_NMEA_GGA_MAX_LENGTH;
+ }
+
+ strcpy(nmea, "GNGGA");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return SL_MAX_M10S_NMEA_GGA_MAX_LENGTH;
+ }
+
+ strcpy(nmea, "GPRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return SL_MAX_M10S_NMEA_RMC_MAX_LENGTH;
+ }
+
+ strcpy(nmea, "GNRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return SL_MAX_M10S_NMEA_RMC_MAX_LENGTH;
+ }
+
+ return 0;
+}
+
+sl_max_m10s_nmea_automatic_flags_t * gnss_max_m10s_get_nmea_flags_ptr(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ char nmea[] = "GPGGA";
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGPGGA->automatic_flags;
+ }
+
+ strcpy(nmea, "GNGGA");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGNGGA->automatic_flags;
+ }
+
+ strcpy(nmea, "GPRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGPRMC->automatic_flags;
+ }
+
+ strcpy(nmea, "GNRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGNRMC->automatic_flags;
+ }
+
+ return NULL;
+}
+
+sl_status_t gnss_max_m10s_is_nmea_auto(sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ char nmea[] = "GPGGA";
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ if (gnss_cfg_data->storageNMEAGPGGA != NULL) {
+ return true;
+ }
+ }
+
+ strcpy(nmea, "GNGGA");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ if (gnss_cfg_data->storageNMEAGNGGA != NULL) {
+ return true;
+ }
+ }
+
+ strcpy(nmea, "GPRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ if (gnss_cfg_data->storageNMEAGPRMC != NULL) {
+ return true;
+ }
+ }
+
+ strcpy(nmea, "GNRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ if (gnss_cfg_data->storageNMEAGNRMC != NULL) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+uint8_t * gnss_max_m10s_get_nmea_working_length_ptr(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ char nmea[] = "GPGGA";
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGPGGA->working_copy.length;
+ }
+
+ strcpy(nmea, "GNGGA");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGNGGA->working_copy.length;
+ }
+
+ strcpy(nmea, "GPRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGPRMC->working_copy.length;
+ }
+
+ strcpy(nmea, "GNRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGNRMC->working_copy.length;
+ }
+
+ return NULL;
+}
+
+uint8_t * gnss_max_m10s_get_nmea_working_ptr(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ char nmea[] = "GPGGA";
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGPGGA->working_copy.nmea[0];
+ }
+
+ strcpy(nmea, "GNGGA");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGNGGA->working_copy.nmea[0];
+ }
+
+ strcpy(nmea, "GPRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGPRMC->working_copy.nmea[0];
+ }
+
+ strcpy(nmea, "GNRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGNRMC->working_copy.nmea[0];
+ }
+
+ return NULL;
+}
+
+uint8_t * gnss_max_m10s_get_nmea_complete_length_ptr(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ char nmea[] = "GPGGA";
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGPGGA->complete_copy.length;
+ }
+
+ strcpy(nmea, "GNGGA");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGNGGA->complete_copy.length;
+ }
+
+ strcpy(nmea, "GPRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGPRMC->complete_copy.length;
+ }
+
+ strcpy(nmea, "GNRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGNRMC->complete_copy.length;
+ }
+
+ return NULL;
+}
+
+uint8_t * gnss_max_m10s_get_complete_copy_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ char nmea[] = "GPGGA";
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGPGGA->complete_copy.nmea[0];
+ }
+
+ strcpy(nmea, "GNGGA");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGNGGA->complete_copy.nmea[0];
+ }
+
+ strcpy(nmea, "GPRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGPRMC->complete_copy.nmea[0];
+ }
+
+ strcpy(nmea, "GNRMC");
+ if (memcmp(nmea, &gnss_cfg_data->nmea_address_field[1], 5) == 0) {
+ return &gnss_cfg_data->storageNMEAGNRMC->complete_copy.nmea[0];
+ }
+
+ return NULL;
+}
+
+sl_status_t gnss_max_m10s_get_latitude_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *latitude,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *latitude = gnss_max_m10s_nmea_get_latitude(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_longitude_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *longitude,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status = gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *longitude = gnss_max_m10s_nmea_get_longitude(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_altitude_msl_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *altitude_msl,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ if (false == gnss_max_m10s_nmea_get_altitude_msl(altitude_msl,
+ gnss_cfg_data->nmea_data))
+ {
+ return SL_STATUS_FAIL;
+ }
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_geoid_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *geoid,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ if (false
+ == gnss_max_m10s_nmea_get_geoid_height(geoid,
+ gnss_cfg_data->nmea_data)) {
+ return SL_STATUS_FAIL;
+ }
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_quality_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *quality,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+ if (SL_STATUS_OK == status) {
+ *quality = gnss_max_m10s_nmea_is_valid(gnss_cfg_data->nmea_data);
+ }
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_satellite_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *num_sat,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+ if (SL_STATUS_OK == status) {
+ *num_sat = gnss_max_m10s_nmea_get_num_satellites(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_day_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *day,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *day = gnss_max_m10s_nmea_get_day(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_month_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *month,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *month = gnss_max_m10s_nmea_get_month(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_year_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t *year,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *year = gnss_max_m10s_nmea_get_year(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_hour_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *hour,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *hour = gnss_max_m10s_nmea_get_hour(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_min_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *min,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *min = gnss_max_m10s_nmea_get_minute(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_second_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *second,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *second = gnss_max_m10s_nmea_get_second(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_speed_nmea(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *speed,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *speed = gnss_max_m10s_nmea_get_speed(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_ground_course_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ int32_t *course,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *course = gnss_max_m10s_nmea_get_course(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_horizontal_dilution_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t *hdop,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *hdop = gnss_max_m10s_nmea_get_hdop(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_nav_system_nmea(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ char *nav_system,
+ uint16_t max_time)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint32_t start_time = 0;
+
+ start_time = gnss_max_m10s_milli_sec();
+
+ while (gnss_max_m10s_milli_sec() - start_time < max_time) {
+ status =
+ gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg),
+ 0,
+ 0);
+ }
+
+ if (SL_STATUS_OK == status) {
+ *nav_system = gnss_max_m10s_nmea_get_nav_system(gnss_cfg_data->nmea_data);
+ }
+
+ return status;
+}
diff --git a/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_ubx.c b/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_ubx.c
new file mode 100644
index 00000000..aa6c97af
--- /dev/null
+++ b/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_ubx.c
@@ -0,0 +1,2094 @@
+/***************************************************************************//**
+ * @file gnss_max_m10s_ubx.c
+ * @brief MAX_M10S GNSS receiver driver external APIs implementation for UBX
+ * sentence data
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ * # Evaluation Quality
+ * This code has been minimally tested to ensure that it builds and is suitable
+ * as a demonstration for evaluation purposes only. This code will be maintained
+ * at the sole discretion of Silicon Labs.
+ ******************************************************************************/
+#include
+#include "gnss_max_m10s_ubx.h"
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVPVT packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavpvt(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVSTATUS packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavstatus(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVSAT packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavsat(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVVELNED packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavvelned(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVSIG packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavsig(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVEOE packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavepoch(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVCLOCK packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavclock(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVDOP packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavdop(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVTIMELS packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavtimels(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVPOSLLH packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavposllh(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief initializes packet for UBXNAVTIMEUTC packet.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_init_packet_ubxnavtimeutc(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data);
+
+/**************************************************************************//**
+ * @brief Given a spot in the payload array, extract four bytes and build a long
+ * @param[in] msg : pointer to the payload
+ * @param[in] spot_to_start : starting spot for the extraction.
+ * @return long type data extracted from the payload.
+ *****************************************************************************/
+static uint32_t gnss_max_m10s_extract_long(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start);
+
+/**************************************************************************//**
+ * @brief Given a spot, extract a signed 8-bit value from the payload
+ * @param[in] msg : pointer to the payload
+ * @param[in] spot_to_start : starting spot for the extraction.
+ * @return char type data extracted from the payload.
+ *****************************************************************************/
+static int8_t gnss_max_m10s_extract_signed_char(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start);
+
+/**************************************************************************//**
+ * @brief Just so there is no ambiguity about whether a uint32_t will cast to
+ * a int32_t correctly
+ * @param[in] msg : pointer to the payload
+ * @param[in] spot_to_start : starting spot for the extraction.
+ * @return signed long type data extracted from the payload.
+ *****************************************************************************/
+static int32_t gnss_max_m10s_extract_signed_long(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start);
+
+/**************************************************************************//**
+ * @brief Given a spot in the payload array, extract two bytes and build an int
+ * @param[in] msg : pointer to the payload
+ * @param[in] spot_to_start : starting spot for the extraction.
+ * @return integer byte extracted from the payload.
+ *****************************************************************************/
+static uint16_t gnss_max_m10s_extract_int(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start);
+
+/**************************************************************************//**
+ * @brief check for the ambiguity about whether a uint16_t will cast to
+ * a int16_t correctly
+ * @param[in] msg : pointer to the payload
+ * @param[in] spot_to_start : starting spot for the extraction.
+ * @return signed integer byte extracted from the payload.
+ *****************************************************************************/
+static int16_t gnss_max_m10s_extract_signed_int(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start);
+
+/**************************************************************************//**
+ * @brief Get the latest Position/Velocity/Time solution.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_pvt(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the information about the upcoming leap second event
+ * if one is scheduled.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_nav_timels(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the information about the UTC time.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_nav_timeutc(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get geodetic position solution of the UBX data.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_nav_posllh(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the latest receiver navigation status.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_nav_status(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the satellite information tracked by GNSS receiver.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_nav_sat(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the signal information currently tracked by GNSS receiver.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_nav_sig(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the dilution of precision UBX data.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_nav_dop(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the navigation clock solution UBX data.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_nav_clock(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the velocity solution in NED frame UBX data.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_nav_velned(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+/**************************************************************************//**
+ * @brief Get the navigation end of epoch UBX data.
+ * @param[in] gnss_cfg_data : pointer to the structure
+ * containing GNSS configuration data.
+ * @param[in] max_wait : Timeout value.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ *****************************************************************************/
+static sl_status_t gnss_max_m10s_get_nav_epoch(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait);
+
+void gnss_max_m10s_process_ubx(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint8_t incoming,
+ uint8_t requested_class,
+ uint8_t requested_id)
+{
+ sl_max_m10s_ubx_packet_t *incomingUBX = NULL;
+ uint16_t maximum_payload_size;
+ bool overrun;
+
+ if (gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETCFG) {
+ maximum_payload_size = gnss_cfg_data->msg_data.packet_cfg_payloadsize;
+ incomingUBX = &(gnss_cfg_data->packet_cfg);
+ } else if (gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETAUTO) {
+ incomingUBX = &(gnss_cfg_data->packet_auto);
+
+ bool log_because_auto =
+ gnss_max_m10s_auto_lookup(gnss_cfg_data,
+ &maximum_payload_size);
+
+ if ((!log_because_auto)) {
+ maximum_payload_size = UBX_MAX_LENGTH;
+ }
+ } else if (gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETACK) {
+ incomingUBX = &(gnss_cfg_data->packet_ack);
+ maximum_payload_size = 2;
+ } else {
+ if (gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETBUF) {
+ incomingUBX = &(gnss_cfg_data->packet_buf);
+ } else if (gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETACK) {
+ incomingUBX = &(gnss_cfg_data->packet_ack);
+ }
+ maximum_payload_size = 2;
+ }
+
+ overrun = false;
+
+ if (incomingUBX->counter < (incomingUBX->len + 4)) {
+ gnss_max_m10s_add_to_checksum(gnss_cfg_data, incoming);
+ }
+
+ /// for UBX packet class
+ if (incomingUBX->counter == 0) {
+ incomingUBX->cls = incoming;
+ } else if (incomingUBX->counter == 1) { /// for UBX packet ID
+ incomingUBX->id = incoming;
+ } else if (incomingUBX->counter == 2) { /// for LSB of data length
+ incomingUBX->len = incoming;
+ } else if (incomingUBX->counter == 3) { /// for MSB of data length
+ incomingUBX->len |= incoming << 8;
+ } else if (incomingUBX->counter == incomingUBX->len + 4) { /// for checksum_a
+ incomingUBX->checksum_a = incoming;
+ } else if (incomingUBX->counter == incomingUBX->len + 5) { /// for checksum_b
+ incomingUBX->checksum_b = incoming;
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE;
+
+ if ((incomingUBX->checksum_a == gnss_cfg_data->rolling_checksum_a)
+ && (incomingUBX->checksum_b == gnss_cfg_data->rolling_checksum_b)) {
+ incomingUBX->valid = SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID;
+ gnss_cfg_data->signs_of_life = true;
+
+ if ((incomingUBX->cls == requested_class)
+ && (incomingUBX->id == requested_id)) {
+ incomingUBX->class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID;
+ } else if ((incomingUBX->cls == UBX_CLASS_ACK)
+ && (incomingUBX->id == UBX_ACK_ACK)
+ && (incomingUBX->payload[0] == requested_class)
+ && (incomingUBX->payload[1] == requested_id)) {
+ incomingUBX->class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_VALID;
+ } else if ((incomingUBX->cls == UBX_CLASS_ACK)
+ && (incomingUBX->id == UBX_CLASS_NACK)
+ && (incomingUBX->payload[0] == requested_class)
+ && (incomingUBX->payload[1] == requested_id)) {
+ incomingUBX->class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_NOTACKNOWLEDGED;
+ } else if ((gnss_max_m10s_auto_lookup(gnss_cfg_data,
+ NULL))) {
+ /// leave incomingUBX->class_and_id_match _unchanged
+ }
+
+ if (gnss_cfg_data->ignore_this_payload == false) {
+ gnss_max_m10s_process_ubx_packet(gnss_cfg_data, incomingUBX);
+ }
+ } else {
+ incomingUBX->valid = SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_VALID;
+
+ if ((incomingUBX->cls == requested_class)
+ && (incomingUBX->id == requested_id)) {
+ incomingUBX->class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_VALID;
+ } else if ((incomingUBX->cls == UBX_CLASS_ACK)
+ && (incomingUBX->payload[0] == requested_class)
+ && (incomingUBX->payload[1] == requested_id)) {
+ incomingUBX->class_and_id_match =
+ SL_MAX_M10S_UBLOX_PACKET_VALIDITY_NOT_VALID;
+ }
+ }
+
+ if (gnss_cfg_data->active_packet_buffer
+ == SL_MAX_M10S_UBLOX_PACKET_PACKETAUTO) {
+ free(gnss_cfg_data->msg_data.payload_auto);
+
+ gnss_cfg_data->msg_data.payload_auto = NULL;
+ gnss_cfg_data->packet_auto.payload = gnss_cfg_data->msg_data.payload_auto;
+ }
+ } else {
+ uint16_t starting_spot = incomingUBX->starting_spot;
+
+ if (gnss_max_m10s_auto_lookup(gnss_cfg_data, false)) {
+ starting_spot = 0;
+ }
+
+ /// Check if this is payload data which should be ignored
+ if (gnss_cfg_data->ignore_this_payload == false) {
+ if ((incomingUBX->counter - 4) >= starting_spot) {
+ if (((incomingUBX->counter - 4) - starting_spot)
+ < maximum_payload_size) {
+ incomingUBX->payload[(incomingUBX->counter - 4)
+ - starting_spot] = incoming; /// Store this byte into payload array
+ } else {
+ overrun = true;
+ }
+ }
+ }
+ }
+
+ if (overrun
+ || ((incomingUBX->counter == maximum_payload_size + 6)
+ && (gnss_cfg_data->ignore_this_payload == false))) {
+ gnss_cfg_data->current_sentence = SL_MAX_M10S_UBLOX_SENTENCE_TYPE_NONE;
+ }
+
+ incomingUBX->counter++;
+}
+
+void gnss_max_m10s_process_ubx_packet(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ if ((msg->id == UBX_NAV_PVT) && (msg->len == UBX_NAV_PVT_LEN)) {
+ sl_max_m10s_ubx_navpvt_process(gnss_cfg_data, msg);
+ } else if ((msg->id == UBX_NAV_STATUS) && (msg->len == UBX_NAV_STATUS_LEN)) {
+ sl_max_m10s_ubx_navstatus_process(gnss_cfg_data, msg);
+ } else if ((msg->id == UBX_NAV_DOP) && (msg->len == UBX_NAV_DOP_LEN)) {
+ sl_max_m10s_ubx_navdop_process(gnss_cfg_data, msg);
+ } else if ((msg->id == UBX_NAV_CLOCK) && (msg->len == UBX_NAV_CLOCK_LEN)) {
+ sl_max_m10s_ubx_navclock_process(gnss_cfg_data, msg);
+ } else if ((msg->id == UBX_NAV_EOE) && (msg->len == UBX_NAV_EOE_LEN)) {
+ sl_max_m10s_ubx_navepoch_process(gnss_cfg_data, msg);
+ } else if (msg->id == UBX_NAV_SAT) {
+ sl_max_m10s_ubx_navsat_process(gnss_cfg_data, msg);
+ } else if ((msg->id == UBX_NAV_TIMELS) && (msg->len == UBX_NAV_TIMELS_LEN)) {
+ sl_max_m10s_ubx_navtimels_process(gnss_cfg_data, msg);
+ } else if ((msg->id == UBX_NAV_TIMEUTC)
+ && (msg->len == UBX_NAV_TIMEUTC_LEN)) {
+ sl_max_m10s_ubx_navtimeutc_process(gnss_cfg_data, msg);
+ } else if (msg->id == UBX_NAV_SIG) {
+ sl_max_m10s_ubx_navsig_process(gnss_cfg_data, msg);
+ } else if ((msg->id == UBX_NAV_POSLLH) && (msg->len == UBX_NAV_POSLLH_LEN)) {
+ sl_max_m10s_ubx_navposllh_process(gnss_cfg_data, msg);
+ } else if ((msg->id == UBX_NAV_VELNED) && (msg->len == UBX_NAV_VELNED_LEN)) {
+ sl_max_m10s_ubx_navvelned_process(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navstatus_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVSTATUS != NULL) {
+ gnss_cfg_data->packetUBXNAVSTATUS->data.iTOW = gnss_max_m10s_extract_long(
+ msg,
+ 0);
+ gnss_cfg_data->packetUBXNAVSTATUS->data.gps_fix =
+ gnss_max_m10s_extract_byte(msg, 4);
+ gnss_cfg_data->packetUBXNAVSTATUS->data.flags.all =
+ gnss_max_m10s_extract_byte(msg, 5);
+ gnss_cfg_data->packetUBXNAVSTATUS->data.fix_status.all =
+ gnss_max_m10s_extract_byte(msg, 6);
+ gnss_cfg_data->packetUBXNAVSTATUS->data.flags_2.all =
+ gnss_max_m10s_extract_byte(msg, 7);
+ gnss_cfg_data->packetUBXNAVSTATUS->data.time_to_first_fix =
+ gnss_max_m10s_extract_long(msg, 8);
+ gnss_cfg_data->packetUBXNAVSTATUS->data.milli_sec_since_startup =
+ gnss_max_m10s_extract_long(msg, 12);
+
+ if ((gnss_cfg_data->packetUBXNAVSTATUS->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVSTATUS->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVSTATUS->callback_data->iTOW,
+ &gnss_cfg_data->packetUBXNAVSTATUS->data.iTOW,
+ sizeof(sl_max_m10s_ubx_nav_status_data_t));
+
+ gnss_cfg_data->packetUBXNAVSTATUS->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSTATUS->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navdop_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVDOP != NULL) {
+ gnss_cfg_data->packetUBXNAVDOP->data.iTOW = gnss_max_m10s_extract_long(msg,
+ 0);
+ gnss_cfg_data->packetUBXNAVDOP->data.geometric = gnss_max_m10s_extract_int(
+ msg,
+ 4);
+ gnss_cfg_data->packetUBXNAVDOP->data.position = gnss_max_m10s_extract_int(
+ msg,
+ 6);
+ gnss_cfg_data->packetUBXNAVDOP->data.time =
+ gnss_max_m10s_extract_int(msg, 8);
+ gnss_cfg_data->packetUBXNAVDOP->data.vertical = gnss_max_m10s_extract_int(
+ msg,
+ 10);
+ gnss_cfg_data->packetUBXNAVDOP->data.horizontal = gnss_max_m10s_extract_int(
+ msg,
+ 12);
+ gnss_cfg_data->packetUBXNAVDOP->data.north = gnss_max_m10s_extract_int(msg,
+ 14);
+ gnss_cfg_data->packetUBXNAVDOP->data.east = gnss_max_m10s_extract_int(msg,
+ 16);
+
+ if ((gnss_cfg_data->packetUBXNAVDOP->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVDOP->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVDOP->callback_data->iTOW,
+ &gnss_cfg_data->packetUBXNAVDOP->data.iTOW,
+ sizeof(sl_max_m10s_ubx_nav_dop_data_t));
+
+ gnss_cfg_data->packetUBXNAVDOP->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVDOP->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navclock_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVCLOCK != NULL) {
+ gnss_cfg_data->packetUBXNAVCLOCK->data.iTOW = gnss_max_m10s_extract_long(
+ msg,
+ 0);
+ gnss_cfg_data->packetUBXNAVCLOCK->data.clock_bias =
+ gnss_max_m10s_extract_signed_long(msg, 4);
+ gnss_cfg_data->packetUBXNAVCLOCK->data.clock_drift =
+ gnss_max_m10s_extract_signed_long(msg, 8);
+ gnss_cfg_data->packetUBXNAVCLOCK->data.time_accuracy =
+ gnss_max_m10s_extract_long(msg, 12);
+ gnss_cfg_data->packetUBXNAVCLOCK->data.freq_accuracy =
+ gnss_max_m10s_extract_long(msg, 16);
+
+ if ((gnss_cfg_data->packetUBXNAVCLOCK->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVCLOCK->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVCLOCK->callback_data->iTOW,
+ &gnss_cfg_data->packetUBXNAVCLOCK->data.iTOW,
+ sizeof(sl_max_m10s_ubx_nav_clock_data_t));
+
+ gnss_cfg_data->packetUBXNAVCLOCK->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVCLOCK->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navepoch_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVEOE != NULL) {
+ gnss_cfg_data->packetUBXNAVEOE->data.iTOW = gnss_max_m10s_extract_long(msg,
+ 0);
+ if ((gnss_cfg_data->packetUBXNAVEOE->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVEOE->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVEOE->callback_data->iTOW,
+ &gnss_cfg_data->packetUBXNAVEOE->data.iTOW,
+ sizeof(sl_max_m10s_ubx_nav_epoch_data_t));
+
+ gnss_cfg_data->packetUBXNAVEOE->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVEOE->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navsat_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVSAT != NULL) {
+ gnss_cfg_data->packetUBXNAVSAT->data.header.iTOW =
+ gnss_max_m10s_extract_long(msg, 0);
+ gnss_cfg_data->packetUBXNAVSAT->data.header.version =
+ gnss_max_m10s_extract_byte(msg, 4);
+ gnss_cfg_data->packetUBXNAVSAT->data.header.num_sv =
+ gnss_max_m10s_extract_byte(msg, 5);
+
+ /// The NAV SAT message could contain data for 255 SVs max.
+ for (uint16_t i = 0; (i < 255)
+ && (i < ((uint16_t)gnss_cfg_data->packetUBXNAVSAT->data.header.num_sv))
+ && ((i * 12) < (msg->len - 8)); i++) {
+ uint16_t offset = (i * 12) + 8;
+
+ gnss_cfg_data->packetUBXNAVSAT->data.blocks[i].gnss_id =
+ gnss_max_m10s_extract_byte(msg, offset + 0);
+ gnss_cfg_data->packetUBXNAVSAT->data.blocks[i].sv_id =
+ gnss_max_m10s_extract_byte(msg, offset + 1);
+ gnss_cfg_data->packetUBXNAVSAT->data.blocks[i].carrier_noise_ratio =
+ gnss_max_m10s_extract_byte(msg, offset + 2);
+ gnss_cfg_data->packetUBXNAVSAT->data.blocks[i].elevation =
+ gnss_max_m10s_extract_signed_char(msg, offset + 3);
+ gnss_cfg_data->packetUBXNAVSAT->data.blocks[i].azimuth =
+ gnss_max_m10s_extract_signed_int(msg, offset + 4);
+ gnss_cfg_data->packetUBXNAVSAT->data.blocks[i].pseudo_range =
+ gnss_max_m10s_extract_signed_int(msg, offset + 6);
+ gnss_cfg_data->packetUBXNAVSAT->data.blocks[i].flags.all =
+ gnss_max_m10s_extract_long(msg, offset + 8);
+ }
+
+ if ((gnss_cfg_data->packetUBXNAVSAT->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVSAT->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVSAT->callback_data->header.iTOW,
+ &gnss_cfg_data->packetUBXNAVSAT->data.header.iTOW,
+ sizeof(sl_max_m10s_ubx_navsat_data_t));
+
+ gnss_cfg_data->packetUBXNAVSAT->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSAT->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navsig_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVSIG != NULL) {
+ gnss_cfg_data->packetUBXNAVSIG->data.header.iTOW =
+ gnss_max_m10s_extract_long(msg, 0);
+ gnss_cfg_data->packetUBXNAVSIG->data.header.version =
+ gnss_max_m10s_extract_byte(msg, 4);
+ gnss_cfg_data->packetUBXNAVSIG->data.header.num_signals =
+ gnss_max_m10s_extract_byte(msg, 5);
+
+ /// The NAV SIG message could contain data for 92 signals max.
+ for (uint16_t i = 0; (i < 92)
+ && (i
+ < ((uint16_t)gnss_cfg_data->packetUBXNAVSIG->data.header.
+ num_signals))
+ && ((i * 16) < (msg->len - 8)); i++) {
+ uint16_t offset = (i * 16) + 8;
+
+ gnss_cfg_data->packetUBXNAVSIG->data.blocks[i].gnss_id =
+ gnss_max_m10s_extract_byte(msg, offset + 0);
+ gnss_cfg_data->packetUBXNAVSIG->data.blocks[i].sv_id =
+ gnss_max_m10s_extract_byte(msg, offset + 1);
+ gnss_cfg_data->packetUBXNAVSIG->data.blocks[i].sig_id =
+ gnss_max_m10s_extract_byte(msg, offset + 2);
+ gnss_cfg_data->packetUBXNAVSIG->data.blocks[i].freq_id =
+ gnss_max_m10s_extract_byte(msg, offset + 3);
+ gnss_cfg_data->packetUBXNAVSIG->data.blocks[i].psuedo_range =
+ gnss_max_m10s_extract_signed_int(msg, offset + 4);
+ gnss_cfg_data->packetUBXNAVSIG->data.blocks[i].carrier_noise_ratio =
+ gnss_max_m10s_extract_byte(msg, offset + 6);
+ gnss_cfg_data->packetUBXNAVSIG->data.blocks[i].quality_ind =
+ gnss_max_m10s_extract_byte(msg, offset + 7);
+ gnss_cfg_data->packetUBXNAVSIG->data.blocks[i].corr_source =
+ gnss_max_m10s_extract_byte(msg, offset + 8);
+ gnss_cfg_data->packetUBXNAVSIG->data.blocks[i].iono_model =
+ gnss_max_m10s_extract_byte(msg, offset + 9);
+ gnss_cfg_data->packetUBXNAVSIG->data.blocks[i].sig_flags.all =
+ gnss_max_m10s_extract_int(msg, offset + 10);
+ }
+
+ if ((gnss_cfg_data->packetUBXNAVSIG->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVSIG->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVSIG->callback_data->header.iTOW,
+ &gnss_cfg_data->packetUBXNAVSIG->data.header.iTOW,
+ sizeof(sl_max_m10s_ubx_navsig_data_t));
+
+ gnss_cfg_data->packetUBXNAVSIG->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSIG->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navtimels_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVTIMELS != NULL) {
+ gnss_cfg_data->packetUBXNAVTIMELS->data.iTOW = gnss_max_m10s_extract_long(
+ msg,
+ 0);
+ gnss_cfg_data->packetUBXNAVTIMELS->data.version =
+ gnss_max_m10s_extract_byte(msg, 4);
+ gnss_cfg_data->packetUBXNAVTIMELS->data.src_of_current_leap =
+ gnss_max_m10s_extract_byte(msg, 8);
+ gnss_cfg_data->packetUBXNAVTIMELS->data.current_leap_sec =
+ gnss_max_m10s_extract_signed_char(msg, 9);
+ gnss_cfg_data->packetUBXNAVTIMELS->data.src_of_leap_sec_change =
+ gnss_max_m10s_extract_byte(msg, 10);
+ gnss_cfg_data->packetUBXNAVTIMELS->data.leap_sec_change =
+ gnss_max_m10s_extract_signed_char(msg, 11);
+ gnss_cfg_data->packetUBXNAVTIMELS->data.time_to_leap_sec_event =
+ gnss_max_m10s_extract_signed_long(msg, 12);
+ gnss_cfg_data->packetUBXNAVTIMELS->data.date_of_leap_sec_gps_week =
+ gnss_max_m10s_extract_int(msg, 16);
+ gnss_cfg_data->packetUBXNAVTIMELS->data.day_of_leap_sec_gps =
+ gnss_max_m10s_extract_int(msg, 18);
+ gnss_cfg_data->packetUBXNAVTIMELS->data.valid.all =
+ gnss_max_m10s_extract_signed_char(msg, 23);
+
+ if ((gnss_cfg_data->packetUBXNAVTIMELS->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVTIMELS->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVTIMELS->callback_data->iTOW,
+ &gnss_cfg_data->packetUBXNAVTIMELS->data.iTOW,
+ sizeof(sl_max_m10s_ubx_nav_timels_data_t));
+
+ gnss_cfg_data->packetUBXNAVTIMELS->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVTIMELS->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navtimeutc_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVTIMEUTC != NULL) {
+ gnss_cfg_data->packetUBXNAVTIMEUTC->data.iTOW = gnss_max_m10s_extract_long(
+ msg,
+ 0);
+ gnss_cfg_data->packetUBXNAVTIMEUTC->data.time_accuracy =
+ gnss_max_m10s_extract_long(msg, 4);
+ gnss_cfg_data->packetUBXNAVTIMEUTC->data.nano =
+ gnss_max_m10s_extract_signed_long(msg, 8);
+ gnss_cfg_data->packetUBXNAVTIMEUTC->data.year = gnss_max_m10s_extract_int(
+ msg,
+ 12);
+ gnss_cfg_data->packetUBXNAVTIMEUTC->data.month = gnss_max_m10s_extract_byte(
+ msg,
+ 14);
+ gnss_cfg_data->packetUBXNAVTIMEUTC->data.day = gnss_max_m10s_extract_byte(
+ msg,
+ 15);
+ gnss_cfg_data->packetUBXNAVTIMEUTC->data.hour = gnss_max_m10s_extract_byte(
+ msg,
+ 16);
+ gnss_cfg_data->packetUBXNAVTIMEUTC->data.min = gnss_max_m10s_extract_byte(
+ msg,
+ 17);
+ gnss_cfg_data->packetUBXNAVTIMEUTC->data.sec = gnss_max_m10s_extract_byte(
+ msg,
+ 18);
+ gnss_cfg_data->packetUBXNAVTIMEUTC->data.valid.all =
+ gnss_max_m10s_extract_byte(msg, 19);
+
+ if ((gnss_cfg_data->packetUBXNAVTIMEUTC->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVTIMEUTC->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVTIMEUTC->callback_data->iTOW,
+ &gnss_cfg_data->packetUBXNAVTIMEUTC->data.iTOW,
+ sizeof(sl_max_m10s_ubx_nav_timeutc_data_t));
+
+ gnss_cfg_data->packetUBXNAVTIMEUTC->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVTIMEUTC->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navposllh_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVPOSLLH != NULL) {
+ gnss_cfg_data->packetUBXNAVPOSLLH->data.iTOW = gnss_max_m10s_extract_long(
+ msg,
+ 0);
+ gnss_cfg_data->packetUBXNAVPOSLLH->data.lon =
+ gnss_max_m10s_extract_signed_long(msg, 4);
+ gnss_cfg_data->packetUBXNAVPOSLLH->data.lat =
+ gnss_max_m10s_extract_signed_long(msg, 8);
+ gnss_cfg_data->packetUBXNAVPOSLLH->data.height =
+ gnss_max_m10s_extract_signed_long(msg, 12);
+ gnss_cfg_data->packetUBXNAVPOSLLH->data.hMSL =
+ gnss_max_m10s_extract_signed_long(msg, 16);
+ gnss_cfg_data->packetUBXNAVPOSLLH->data.h_acc = gnss_max_m10s_extract_long(
+ msg,
+ 20);
+ gnss_cfg_data->packetUBXNAVPOSLLH->data.v_acc = gnss_max_m10s_extract_long(
+ msg,
+ 24);
+
+ if ((gnss_cfg_data->packetUBXNAVPOSLLH->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVPOSLLH->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVPOSLLH->callback_data->iTOW,
+ &gnss_cfg_data->packetUBXNAVPOSLLH->data.iTOW,
+ sizeof(sl_max_m10s_ubx_nav_posllh_data_t));
+
+ gnss_cfg_data->packetUBXNAVPOSLLH->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVPOSLLH->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navvelned_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVVELNED != NULL) {
+ gnss_cfg_data->packetUBXNAVVELNED->data.iTOW = gnss_max_m10s_extract_long(
+ msg,
+ 0);
+ gnss_cfg_data->packetUBXNAVVELNED->data.velN =
+ gnss_max_m10s_extract_signed_long(msg, 4);
+ gnss_cfg_data->packetUBXNAVVELNED->data.velE =
+ gnss_max_m10s_extract_signed_long(msg, 8);
+ gnss_cfg_data->packetUBXNAVVELNED->data.velD =
+ gnss_max_m10s_extract_signed_long(msg, 12);
+ gnss_cfg_data->packetUBXNAVVELNED->data.speed = gnss_max_m10s_extract_long(
+ msg,
+ 16);
+ gnss_cfg_data->packetUBXNAVVELNED->data.ground_speed =
+ gnss_max_m10s_extract_long(msg, 20);
+ gnss_cfg_data->packetUBXNAVVELNED->data.heading =
+ gnss_max_m10s_extract_signed_long(msg, 24);
+ gnss_cfg_data->packetUBXNAVVELNED->data.speed_acc =
+ gnss_max_m10s_extract_long(msg, 28);
+ gnss_cfg_data->packetUBXNAVVELNED->data.course_acc =
+ gnss_max_m10s_extract_long(msg, 32);
+
+ if ((gnss_cfg_data->packetUBXNAVVELNED->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVVELNED->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVVELNED->callback_data->iTOW,
+ &gnss_cfg_data->packetUBXNAVVELNED->data.iTOW,
+ sizeof(sl_max_m10s_ubx_nav_posllh_data_t));
+
+ gnss_cfg_data->packetUBXNAVVELNED->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVVELNED->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+void sl_max_m10s_ubx_navpvt_process(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ sl_max_m10s_ubx_packet_t *msg)
+{
+ bool added_to_file_buffer = false;
+
+ if (gnss_cfg_data->packetUBXNAVPVT != NULL) {
+ gnss_cfg_data->packetUBXNAVPVT->data.fixType = gnss_max_m10s_extract_byte(
+ msg,
+ 20);
+ gnss_cfg_data->packetUBXNAVPVT->data.numSV = gnss_max_m10s_extract_byte(msg,
+ 23);
+ gnss_cfg_data->packetUBXNAVPVT->data.lon =
+ gnss_max_m10s_extract_signed_long(msg, 24);
+ gnss_cfg_data->packetUBXNAVPVT->data.lat =
+ gnss_max_m10s_extract_signed_long(msg, 28);
+ gnss_cfg_data->packetUBXNAVPVT->data.height =
+ gnss_max_m10s_extract_signed_long(msg, 32);
+ gnss_cfg_data->packetUBXNAVPVT->data.hMSL =
+ gnss_max_m10s_extract_signed_long(msg, 36);
+ gnss_cfg_data->packetUBXNAVPVT->data.hour = gnss_max_m10s_extract_byte(msg,
+ 8);
+ gnss_cfg_data->packetUBXNAVPVT->data.min =
+ gnss_max_m10s_extract_byte(msg, 9);
+ gnss_cfg_data->packetUBXNAVPVT->data.sec = gnss_max_m10s_extract_byte(msg,
+ 10);
+ gnss_cfg_data->packetUBXNAVPVT->data.nano =
+ gnss_max_m10s_extract_signed_long(msg, 16);
+ gnss_cfg_data->packetUBXNAVPVT->data.tAcc = gnss_max_m10s_extract_byte(msg,
+ 12);
+ gnss_cfg_data->packetUBXNAVPVT->data.year =
+ gnss_max_m10s_extract_int(msg, 4);
+ gnss_cfg_data->packetUBXNAVPVT->data.month = gnss_max_m10s_extract_byte(msg,
+ 6);
+ gnss_cfg_data->packetUBXNAVPVT->data.day =
+ gnss_max_m10s_extract_byte(msg, 7);
+ gnss_cfg_data->packetUBXNAVPVT->data.hAcc = gnss_max_m10s_extract_long(msg,
+ 40);
+ gnss_cfg_data->packetUBXNAVPVT->data.vAcc = gnss_max_m10s_extract_long(msg,
+ 42);
+ gnss_cfg_data->packetUBXNAVPVT->data.sAcc = gnss_max_m10s_extract_long(msg,
+ 68);
+ gnss_cfg_data->packetUBXNAVPVT->data.headAcc = gnss_max_m10s_extract_long(
+ msg,
+ 72);
+ gnss_cfg_data->packetUBXNAVPVT->data.velN =
+ gnss_max_m10s_extract_signed_long(msg, 48);
+ gnss_cfg_data->packetUBXNAVPVT->data.velE =
+ gnss_max_m10s_extract_signed_long(msg, 52);
+ gnss_cfg_data->packetUBXNAVPVT->data.velD =
+ gnss_max_m10s_extract_signed_long(msg, 56);
+ gnss_cfg_data->packetUBXNAVPVT->data.gSpeed =
+ gnss_max_m10s_extract_signed_long(msg, 60);
+ gnss_cfg_data->packetUBXNAVPVT->data.headMot =
+ gnss_max_m10s_extract_signed_long(msg, 68);
+ gnss_cfg_data->packetUBXNAVPVT->data.headVeh =
+ gnss_max_m10s_extract_signed_long(msg, 84);
+ gnss_cfg_data->packetUBXNAVPVT->data.magDec =
+ gnss_max_m10s_extract_signed_int(msg, 88);
+ gnss_cfg_data->packetUBXNAVPVT->data.magAcc = gnss_max_m10s_extract_int(msg,
+ 90);
+ gnss_cfg_data->packetUBXNAVPVT->data.pDOP = gnss_max_m10s_extract_int(msg,
+ 76);
+ gnss_cfg_data->packetUBXNAVPVT->data.valid.all = gnss_max_m10s_extract_byte(
+ msg,
+ 11);
+ gnss_cfg_data->packetUBXNAVPVT->data.confirm_flags.all =
+ gnss_max_m10s_extract_byte(msg, 22);
+ gnss_cfg_data->packetUBXNAVPVT->data.solution_flags.all =
+ gnss_max_m10s_extract_byte(msg, 21);
+ gnss_cfg_data->packetUBXNAVPVT->data.correction_flags.all =
+ gnss_max_m10s_extract_byte(msg, 78);
+
+ if ((gnss_cfg_data->packetUBXNAVPVT->callback_data != NULL)
+ && (gnss_cfg_data->packetUBXNAVPVT->automatic_flags.flags.bits.
+ callbackCopyValid == false)) {
+ memcpy(&gnss_cfg_data->packetUBXNAVPVT->callback_data->iTOW,
+ &gnss_cfg_data->packetUBXNAVPVT->data.iTOW,
+ sizeof(sl_max_m10s_ubx_nav_pvt_data_t));
+
+ gnss_cfg_data->packetUBXNAVPVT->automatic_flags.flags.bits.
+ callbackCopyValid = true;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVPVT->automatic_flags.flags.bits.
+ addToFileBuffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+ }
+
+ if (!added_to_file_buffer) {
+ added_to_file_buffer = gnss_max_m10s_store_packet(gnss_cfg_data, msg);
+ }
+}
+
+sl_status_t gnss_max_m10s_get_unique_id(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_SEC;
+ gnss_cfg_data->packet_cfg.id = UBX_SEC_UNIQID;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val != SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_FAIL;
+ }
+
+ /// Extract the data
+ gnss_cfg_data->packetUBXUNIQID->version =
+ gnss_max_m10s_extract_byte(&(gnss_cfg_data->packet_cfg),
+ 0);
+
+ /// For M10s version the unique id is 6 bytes, for F9 and M9 it will be 5 bytes.
+ for (uint8_t i = 0; i < 6; i++) {
+ gnss_cfg_data->packetUBXUNIQID->unique_id[i] =
+ gnss_max_m10s_extract_byte(&(gnss_cfg_data->packet_cfg),
+ i
+ + 4);
+ }
+
+ return SL_STATUS_OK;
+}
+
+sl_status_t gnss_max_m10s_get_navpvt_ubx(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVPVT == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavpvt(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_pvt(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_navepoch_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVEOE == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavepoch(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_nav_epoch(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_navtimels_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVTIMELS == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavtimels(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_nav_timels(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_navposllh_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVPOSLLH == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavposllh(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_nav_posllh(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_navtimeutc_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVTIMEUTC == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavtimeutc(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_nav_timeutc(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_navstatus_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVSTATUS == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavstatus(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_nav_status(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_navsat_ubx(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVSAT == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavsat(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_nav_sat(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_navsig_ubx(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVSIG == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavsig(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_nav_sig(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_navdop_ubx(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVDOP == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavdop(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_nav_dop(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_navclock_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVCLOCK == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavclock(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_nav_clock(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+sl_status_t gnss_max_m10s_get_navvelned_ubx(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ sl_status_t status = SL_STATUS_OK;
+
+ if (gnss_cfg_data->packetUBXNAVVELNED == NULL) {
+ status = gnss_max_m10s_init_packet_ubxnavvelned(gnss_cfg_data);
+
+ if (status != SL_STATUS_OK) {
+ return status;
+ }
+ }
+
+ status = gnss_max_m10s_get_nav_velned(gnss_cfg_data, max_wait);
+
+ return status;
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavpvt(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVPVT =
+ (sl_max_m10s_ubx_nav_pvt_t *)malloc(sizeof(sl_max_m10s_ubx_nav_pvt_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVPVT == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVPVT->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVPVT->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVPVT->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_get_pvt(sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVPVT == NULL) {
+ gnss_max_m10s_init_packet_ubxnavpvt(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVPVT == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVPVT->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVPVT->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVPVT->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVPVT->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_PVT;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavtimels(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVTIMELS = (sl_max_m10s_ubx_nav_timels_t *)malloc(
+ sizeof(sl_max_m10s_ubx_nav_timels_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVTIMELS == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVTIMELS->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVTIMELS->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVTIMELS->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavposllh(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVPOSLLH = (sl_max_m10s_ubx_nav_posllh_t *)malloc(
+ sizeof(sl_max_m10s_ubx_nav_posllh_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVPOSLLH == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVPOSLLH->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVPOSLLH->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVPOSLLH->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_get_nav_posllh(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVPOSLLH == NULL) {
+ gnss_max_m10s_init_packet_ubxnavposllh(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVPOSLLH == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVPOSLLH->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVPOSLLH->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVPOSLLH->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVPOSLLH->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_POSLLH;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static sl_status_t gnss_max_m10s_get_nav_timels(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVTIMELS == NULL) {
+ gnss_max_m10s_init_packet_ubxnavtimels(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVTIMELS == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVTIMELS->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVTIMELS->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVTIMELS->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVTIMELS->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_TIMELS;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavtimeutc(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVTIMEUTC = (sl_max_m10s_ubx_nav_timeutc_t *)malloc(
+ sizeof(sl_max_m10s_ubx_nav_timeutc_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVTIMEUTC == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVTIMEUTC->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVTIMEUTC->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVTIMEUTC->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_get_nav_timeutc(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVTIMEUTC == NULL) {
+ gnss_max_m10s_init_packet_ubxnavtimels(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVTIMEUTC == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVTIMEUTC->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVTIMEUTC->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVTIMEUTC->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVTIMEUTC->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_TIMEUTC;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavstatus(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVSTATUS = (sl_max_m10s_ubx_nav_status_t *)malloc(
+ sizeof(sl_max_m10s_ubx_nav_status_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVSTATUS == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVSTATUS->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVSTATUS->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVSTATUS->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavsat(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVSAT =
+ (sl_max_m10s_ubx_nav_sat_t *)malloc(sizeof(sl_max_m10s_ubx_nav_sat_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVSAT == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVSAT->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVSAT->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVSAT->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavsig(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVSIG =
+ (sl_max_m10s_ubx_navsig_t *)malloc(sizeof(sl_max_m10s_ubx_navsig_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVSIG == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVSIG->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVSIG->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVSIG->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavdop(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVDOP =
+ (sl_max_m10s_ubx_nav_dop_t *)malloc(sizeof(sl_max_m10s_ubx_nav_dop_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVDOP == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVDOP->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVDOP->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVDOP->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_get_nav_dop(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVDOP == NULL) {
+ gnss_max_m10s_init_packet_ubxnavdop(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVDOP == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVDOP->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVDOP->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVDOP->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVDOP->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_DOP;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavclock(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVCLOCK = (sl_max_m10s_ubx_nav_clock_t *)malloc(
+ sizeof(sl_max_m10s_ubx_nav_clock_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVCLOCK == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVCLOCK->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVCLOCK->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVCLOCK->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_get_nav_clock(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVCLOCK == NULL) {
+ gnss_max_m10s_init_packet_ubxnavclock(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVCLOCK == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVCLOCK->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVCLOCK->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVCLOCK->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVCLOCK->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_CLOCK;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavvelned(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVVELNED = (sl_max_m10s_ubx_nav_velned_t *)malloc(
+ sizeof(sl_max_m10s_ubx_nav_velned_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVVELNED == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVVELNED->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVVELNED->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVVELNED->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_get_nav_velned(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVVELNED == NULL) {
+ gnss_max_m10s_init_packet_ubxnavclock(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVVELNED == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVVELNED->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVVELNED->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVVELNED->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVVELNED->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_VELNED;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static sl_status_t gnss_max_m10s_init_packet_ubxnavepoch(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data)
+{
+ gnss_cfg_data->packetUBXNAVEOE =
+ (sl_max_m10s_ubx_nav_epoch_t *)malloc(sizeof(sl_max_m10s_ubx_nav_epoch_t)); /// Allocate RAM for the main struct
+
+ if (gnss_cfg_data->packetUBXNAVEOE == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ gnss_cfg_data->packetUBXNAVEOE->automatic_flags.flags.all = 0;
+ gnss_cfg_data->packetUBXNAVEOE->callback_pointer_ptr = NULL;
+ gnss_cfg_data->packetUBXNAVEOE->callback_data = NULL;
+
+ return SL_STATUS_OK;
+}
+
+static sl_status_t gnss_max_m10s_get_nav_epoch(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVEOE == NULL) {
+ gnss_max_m10s_init_packet_ubxnavepoch(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVEOE == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVEOE->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVEOE->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVEOE->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVEOE->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_EOE;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static sl_status_t gnss_max_m10s_get_nav_status(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVSTATUS == NULL) {
+ gnss_max_m10s_init_packet_ubxnavstatus(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSTATUS == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSTATUS->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVSTATUS->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVSTATUS->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVSTATUS->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_STATUS;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static sl_status_t gnss_max_m10s_get_nav_sat(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVSAT == NULL) {
+ gnss_max_m10s_init_packet_ubxnavsat(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSAT == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSAT->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVSAT->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVSAT->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVSAT->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_SAT;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static sl_status_t gnss_max_m10s_get_nav_sig(
+ sl_max_m10s_cfg_data_t *gnss_cfg_data,
+ uint16_t max_wait)
+{
+ if (gnss_cfg_data->packetUBXNAVSIG == NULL) {
+ gnss_max_m10s_init_packet_ubxnavsig(gnss_cfg_data);
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSIG == NULL) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (gnss_cfg_data->packetUBXNAVSIG->automatic_flags.flags.bits.automatic
+ && gnss_cfg_data->packetUBXNAVSIG->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return gnss_max_m10s_check_ublox_internal(gnss_cfg_data,
+ &(gnss_cfg_data->packet_cfg), 0,
+ 0);
+ } else if (gnss_cfg_data->packetUBXNAVSIG->automatic_flags.flags.bits.
+ automatic
+ && !gnss_cfg_data->packetUBXNAVSIG->automatic_flags.flags.bits.
+ implicitUpdate) {
+ return SL_STATUS_FAIL;
+ } else {
+ gnss_cfg_data->packet_cfg.cls = UBX_CLASS_NAV;
+ gnss_cfg_data->packet_cfg.id = UBX_NAV_SIG;
+ gnss_cfg_data->packet_cfg.len = 0;
+ gnss_cfg_data->packet_cfg.starting_spot = 0;
+ gnss_cfg_data->active_packet_buffer = SL_MAX_M10S_UBLOX_PACKET_PACKETCFG;
+
+ sl_max_m10s_ublox_status_e ret_val = gnss_max_m10s_send_command(
+ gnss_cfg_data,
+ max_wait,
+ false);
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_RECEIVED) {
+ return SL_STATUS_OK;
+ }
+
+ if (ret_val == SL_MAX_M10S_UBLOX_STATUS_DATA_OVERWRITTEN) {
+ return SL_STATUS_OK;
+ }
+
+ return SL_STATUS_FAIL;
+ }
+}
+
+static uint32_t gnss_max_m10s_extract_long(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start)
+{
+ uint32_t val = 0;
+
+ for (uint8_t i = 0; i < 4; i++) {
+ val |= (uint32_t)msg->payload[spot_to_start + i] << (8 * i);
+ }
+
+ return val;
+}
+
+int8_t gnss_max_m10s_extract_signed_char(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start)
+{
+ sl_max_m10s_unsigned_signed_8_t converter;
+ converter.unsigned8 = gnss_max_m10s_extract_byte(msg, spot_to_start);
+ return (converter.signed8);
+}
+
+static int32_t gnss_max_m10s_extract_signed_long(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start)
+{
+ sl_max_m10s_unsigned_signed_32_t converter;
+
+ converter.unsigned32 = gnss_max_m10s_extract_long(msg, spot_to_start);
+
+ return converter.signed32;
+}
+
+static uint16_t gnss_max_m10s_extract_int(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start)
+{
+ uint16_t val = (uint16_t)msg->payload[spot_to_start + 0] << 8 * 0;
+
+ val |= (uint16_t)msg->payload[spot_to_start + 1] << 8 * 1;
+
+ return val;
+}
+
+static int16_t gnss_max_m10s_extract_signed_int(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start)
+{
+ sl_max_m10s_unsigned_signed_16_t converter;
+
+ converter.unsigned16 = gnss_max_m10s_extract_int(msg, spot_to_start);
+
+ return converter.signed16;
+}
+
+uint8_t gnss_max_m10s_extract_byte(sl_max_m10s_ubx_packet_t *msg,
+ uint16_t spot_to_start)
+{
+ return (msg->payload[spot_to_start]);
+}
diff --git a/driver/public/silabs/micro_oled_ssd1306/config/micro_oled_ssd1306_config.h b/driver/public/silabs/micro_oled_ssd1306/config/micro_oled_ssd1306_config.h
index 850539f6..e43a1149 100644
--- a/driver/public/silabs/micro_oled_ssd1306/config/micro_oled_ssd1306_config.h
+++ b/driver/public/silabs/micro_oled_ssd1306/config/micro_oled_ssd1306_config.h
@@ -50,6 +50,26 @@ extern "C" {
#define OLED_DISPLAY_128_64 3
// <<< Use Configuration Wizard in Context Menu >>>
+
+//MICRO OLED I2C Configuration
+
+// MICRO OLED I2C UC Configuration
+// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC).
+// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration.
+// Default: 0
+#define MICRO_OLED_I2C__UC 0
+
+// Speed mode
+// <0=> Standard mode (100kbit/s)
+// <1=> Fast mode (400kbit/s)
+// <2=> Fast mode plus (1Mbit/s)
+// Default: 0
+#define MICRO_OLED_I2C_SPEED_MODE 0
+
+//
+//
+// <<< end of configuration section >>>
+
// Connection
// I2C Address <0x1..0x7E:0x1>
// Default: 0x3D
@@ -94,4 +114,4 @@ extern "C" {
}
#endif
-#endif /* SSD1306_I2C_CONFIG_H_ */
+#endif // SSD1306_I2C_CONFIG_H_
diff --git a/driver/public/silabs/micro_oled_ssd1306/inc/micro_oled_ssd1306.h b/driver/public/silabs/micro_oled_ssd1306/inc/micro_oled_ssd1306.h
index 4b844bc6..db733479 100644
--- a/driver/public/silabs/micro_oled_ssd1306/inc/micro_oled_ssd1306.h
+++ b/driver/public/silabs/micro_oled_ssd1306/inc/micro_oled_ssd1306.h
@@ -1,5 +1,5 @@
/***************************************************************************//**
- * @file ssd1306.h
+ * @file micro_oled_ssd1306.h
* @brief SSD1306 interface
*******************************************************************************
* # License
@@ -33,19 +33,19 @@
* at the sole discretion of Silicon Labs.
******************************************************************************/
-#ifndef SSD1306_H
-#define SSD1306_H
+#ifndef MICRO_OLED_SSD1306_H
+#define MICRO_OLED_SSD1306_H
#include
#include
#include "sl_status.h"
-#include "sl_i2cspm.h"
+#include "drv_i2c_master.h"
#ifdef __cplusplus
extern "C" {
#endif
-/* Fundamental Command */
+// Fundamental Command
#define SSD1306_SETCONTRAST 0x81
#define SSD1306_DISPLAYALLON_RESUME 0xA4
#define SSD1306_DISPLAYALLON 0xA5
@@ -54,7 +54,7 @@ extern "C" {
#define SSD1306_DISPLAYOFF 0xAE
#define SSD1306_DISPLAYON 0xAF
-/* Scrolling Command */
+// Scrolling Command
#define SSD1306_RIGHT_HORIZONTAL_SCROLL 0x26
#define SSD1306_LEFT_HORIZONTAL_SCROLL 0x27
#define SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL 0x29
@@ -63,7 +63,7 @@ extern "C" {
#define SSD1306_ACTIVATE_SCROLL 0x2F
#define SSD1306_SET_VERTICAL_SCROLL_AREA 0xA3
-/* Addressing Setting Command */
+// Addressing Setting Command
#define SSD1306_SETLOWCOLUMN 0x00
#define SSD1306_SETHIGHCOLUMN 0x10
#define SSD1306_MEMORYMODE 0x20
@@ -75,7 +75,7 @@ extern "C" {
#define SSD1306_VERTICAL_ADDRESSING_MODE 0x01
#define SSD1306_PAGE_ADDRESSING_MODE 0x02
-/* Hardware Configuration Command */
+// Hardware Configuration Command
#define SSD1306_SETSTARTLINE 0x40
#define SSD1306_SEGREMAP 0xA0
#define SSD1306_SETSEGMENTREMAP 0xA1
@@ -109,11 +109,26 @@ typedef struct ssd1306_t {
* @brief
* Initialization function for the ssd1306 device driver.
*
+ * @param[in] i2cspm_instance
+ * I2C instance
+ *
* @return
* If all operations completed sucessfully SL_STATUS_OK is returned. On
* failure a different status code is returned specifying the error.
*****************************************************************************/
-sl_status_t ssd1306_init(sl_i2cspm_t *i2c_handle);
+sl_status_t ssd1306_init(mikroe_i2c_handle_t i2cspm_instance);
+
+/***************************************************************************//**
+ * @brief
+ * This function sets the SPI instance used by platform functions
+ *
+ * @param[in] i2cspm_instance
+ * I2C instance
+ *
+ * @return
+ * SL_STATUS_OK if there are no errors.
+ ******************************************************************************/
+sl_status_t ssd1306_set_i2csmp_instance(mikroe_i2c_handle_t i2cspm_instance);
/**************************************************************************//**
* @brief
@@ -259,4 +274,4 @@ sl_status_t ssd1306_enable_display(bool on);
/** @} */
-#endif
+#endif // MICRO_OLED_SSD1306_H
diff --git a/driver/public/silabs/micro_oled_ssd1306/inc/micro_oled_ssd1306_i2c.h b/driver/public/silabs/micro_oled_ssd1306/inc/micro_oled_ssd1306_i2c.h
deleted file mode 100644
index 9df60361..00000000
--- a/driver/public/silabs/micro_oled_ssd1306/inc/micro_oled_ssd1306_i2c.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/***************************************************************************//**
- * @file ssd1306_i2c.h
- * @brief I2C abstraction used by SSD1306
- *******************************************************************************
- * # License
- * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
- *******************************************************************************
- *
- * 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.
- *
- *******************************************************************************
- * # Evaluation Quality
- * This code has been minimally tested to ensure that it builds and is suitable
- * as a demonstration for evaluation purposes only. This code will be maintained
- * at the sole discretion of Silicon Labs.
- ******************************************************************************/
-#ifndef SSD1306_I2C_H
-#define SSD1306_I2C_H
-
-#include "sl_status.h"
-#include "sl_i2cspm.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/***************************************************************************//**
- * @brief
- * Initialize the i2c interface.
- *
- * @detail
- * The driver instances will be initialized automatically,
- * during the sl_system_init() call in main.c.
- *****************************************************************************/
-void ssd1306_i2c_init(sl_i2cspm_t *i2c_handle);
-
-/***************************************************************************//**
- * @brief
- * Start an blocking command transmit transfer.
- *
- * @note
- * @n This function is blocking and returns when the transfer is complete.
- *
- * @param[in] command
- * Transmit command buffer.
- *
- * @param[in] len
- * Number of bytes in transfer.
- *
- * @return
- * @ref SL_STATUS_OK on success or @ref SL_STATUS_FAIL on failure
- ******************************************************************************/
-sl_status_t ssd1306_send_command(const void *cmd, uint32_t len);
-
-/***************************************************************************//**
- * @brief
- * Start an blocking data transmit transfer.
- *
- * @note
- * @n This function is blocking and returns when the transfer is complete.
- *
- * @param[in] data
- * Transmit data buffer.
- *
- * @param[in] count
- * Number of bytes in transfer.
- *
- * @return
- * @ref SL_STATUS_OK on success or @ref SL_STATUS_FAIL on failure
- ******************************************************************************/
-sl_status_t ssd1306_send_data(const void *data, uint32_t len);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/driver/public/silabs/micro_oled_ssd1306/inc/oled_display.h b/driver/public/silabs/micro_oled_ssd1306/inc/oled_display.h
index 1301b6ab..b274c0b7 100644
--- a/driver/public/silabs/micro_oled_ssd1306/inc/oled_display.h
+++ b/driver/public/silabs/micro_oled_ssd1306/inc/oled_display.h
@@ -37,7 +37,6 @@
#include
#include "sl_status.h"
-
#include "micro_oled_ssd1306.h"
#ifdef __cplusplus
@@ -86,4 +85,4 @@ const oled_display_t *oled_display_get(void);
}
#endif
-#endif
+#endif // OLED_DISPLAY_H
diff --git a/driver/public/silabs/micro_oled_ssd1306/src/micro_oled_ssd1306.c b/driver/public/silabs/micro_oled_ssd1306/src/micro_oled_ssd1306.c
index a1a81da3..0b87a180 100644
--- a/driver/public/silabs/micro_oled_ssd1306/src/micro_oled_ssd1306.c
+++ b/driver/public/silabs/micro_oled_ssd1306/src/micro_oled_ssd1306.c
@@ -1,5 +1,5 @@
/***************************************************************************//**
- * @file ssd1306.c
+ * @file micro_oled_ssd1306.c
* @brief SSD1306 interface
*******************************************************************************
* # License
@@ -33,19 +33,22 @@
* at the sole discretion of Silicon Labs.
******************************************************************************/
#include
-#include "micro_oled_ssd1306_i2c.h"
#include "micro_oled_ssd1306.h"
#include "micro_oled_ssd1306_config.h"
#define SSD1306_NUM_PAGES ((SSD1306_DISPLAY_HEIGHT + 7) / 8)
-/** ssd1306 instance. */
-static ssd1306_t ssd1306_instance = {
+typedef i2c_master_t micro_oled_i2c_t;
+
+static micro_oled_i2c_t micro_oled_i2c;
+
+// ssd1306 instance.
+static ssd1306_t ssd1306_instance = {
.width = SSD1306_DISPLAY_WIDTH,
.height = SSD1306_DISPLAY_HEIGHT,
};
-/** buffer used to initialize ssd1306. */
+// buffer used to initialize ssd1306.
const uint8_t cmd_buff[] = {
SSD1306_DISPLAYOFF,
SSD1306_SETDISPLAYCLOCKDIV, 0x80,
@@ -93,10 +96,18 @@ const uint8_t cmd_buff[] = {
SSD1306_DISPLAYON,
};
-/** Flag to monitor is this driver has been initialized. The ssd1306_instance
- * is only valid after initialized=true. */
+/**
+ * Flag to monitor is this driver has been initialized. The ssd1306_instance
+ * is only valid after initialized=true.
+ */
static bool initialized = false;
+static sl_status_t ssd1306_send_command(const void *cmd, uint32_t len);
+static sl_status_t ssd1306_send_data(const void *data, uint32_t len);
+static sl_status_t ssd1306_send(const void *data,
+ uint32_t len,
+ uint8_t command_type);
+
/**************************************************************************//**
* @brief
* Initialization function for the ssd1306 device driver.
@@ -105,16 +116,51 @@ static bool initialized = false;
* If all operations completed sucessfully SL_STATUS_OK is returned. On
* failure a different status code is returned specifying the error.
*****************************************************************************/
-sl_status_t ssd1306_init(sl_i2cspm_t *i2c_handle)
+sl_status_t ssd1306_init(mikroe_i2c_handle_t i2cspm_instance)
{
- sl_status_t sc;
+ i2c_master_config_t micro_oled_cfg;
const uint8_t *ptr = cmd_buff;
+ sl_status_t sc;
+
+ if (NULL == i2cspm_instance) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ // Configure default i2csmp instance
+ micro_oled_i2c.handle = i2cspm_instance;
+
+ i2c_master_configure_default(µ_oled_cfg);
+
+ micro_oled_cfg.addr = CONFIG_OLED_DISPLAY_ADDRESS;
+ micro_oled_cfg.timeout_pass_count = 0;
+
+#if (MICRO_OLED_I2C__UC == 1)
+ micro_oled_cfg.speed = MICRO_OLED_I2C_SPEED_MODE;
+#endif
+
+ if (i2c_master_open(µ_oled_i2c, µ_oled_cfg) == I2C_MASTER_ERROR) {
+ return SL_STATUS_INITIALIZATION;
+ }
- ssd1306_i2c_init(i2c_handle);
initialized = true;
+
sc = ssd1306_send_command(ptr, sizeof(cmd_buff));
+ if (sc != SL_STATUS_OK) {
+ return SL_STATUS_INITIALIZATION;
+ }
- return sc;
+ return SL_STATUS_OK;
+}
+
+sl_status_t ssd1306_set_i2csmp_instance(mikroe_i2c_handle_t i2cspm_instance)
+{
+ if (NULL == i2cspm_instance) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ micro_oled_i2c.handle = i2cspm_instance;
+
+ return SL_STATUS_OK;
}
/**************************************************************************//**
@@ -134,17 +180,17 @@ sl_status_t ssd1306_draw(const void *data)
static const uint8_t command_table[] = {
#ifdef SSD1306_USE_PAGE_ADDRESSING_MODE
- /* Set Lower Column Start Address for Page Addressing Mode */
+ // Set Lower Column Start Address for Page Addressing Mode
0x00,
- /* Set Higher Column Start Address for Page Addressing Mode */
+ // Set Higher Column Start Address for Page Addressing Mode
0x12
#else
- /* Set page start, end address + set page pointer to page start address */
+ // Set page start, end address + set page pointer to page start address
SSD1306_PAGEADDR, 0, (SSD1306_NUM_PAGES - 1),
- /* Set page start, end address + set page pointer to page start address */
+ // Set page start, end address + set page pointer to page start address
SSD1306_COLUMNADDR, 0, (SSD1306_DISPLAY_WIDTH - 1),
#endif
};
@@ -152,24 +198,24 @@ sl_status_t ssd1306_draw(const void *data)
const uint8_t *ptr = data;
uint8_t cmd;
- /* Get start address to draw from */
+ // Get start address to draw from
for (uint8_t i = 0; i < SSD1306_NUM_PAGES; i++) {
- /* Send update command and first line address */
- cmd = 0xB0 + i; /* Set the current RAM page address. */
+ // Send update command and first line address
+ cmd = 0xB0 + i; // Set the current RAM page address.
sc += ssd1306_send_command(&cmd, 1);
sc += ssd1306_send_command(command_table, sizeof(command_table));
- /* Send pixels for this page */
+ // Send pixels for this page
sc += ssd1306_send_data(ptr, SSD1306_DISPLAY_WIDTH);
ptr += SSD1306_DISPLAY_WIDTH;
}
#else
- /* Send commands to prepare data transfer from frame buffer */
+ // Send commands to prepare data transfer from frame buffer
sc += ssd1306_send_command(command_table, sizeof(command_table));
- /*Send frame buffer data*/
+ // Send frame buffer data
sc += ssd1306_send_data(data, (SSD1306_DISPLAY_WIDTH * SSD1306_NUM_PAGES));
#endif
if (sc != SL_STATUS_OK) {
@@ -187,7 +233,7 @@ sl_status_t ssd1306_draw(const void *data)
* Pointer to a SSD1306 structure or NULL if no SSD1306 is initialized
* yet.
*****************************************************************************/
-const ssd1306_t* ssd1306_get(void)
+const ssd1306_t *ssd1306_get(void)
{
if (initialized) {
return &ssd1306_instance;
@@ -435,3 +481,66 @@ sl_status_t ssd1306_enable_display(bool on)
return sc;
}
+
+/***************************************************************************//**
+ * @brief
+ * Start an blocking command transmit transfer.
+ *
+ * @note
+ * @n This function is blocking and returns when the transfer is complete.
+ *
+ * @param[in] command
+ * Transmit command buffer.
+ *
+ * @param[in] len
+ * Number of bytes in transfer.
+ *
+ * @return
+ * @ref SL_STATUS_OK on success or @ref SL_STATUS_FAIL on failure
+ ******************************************************************************/
+static sl_status_t ssd1306_send_command(const void *cmd, uint32_t len)
+{
+ return ssd1306_send(cmd, len, 0x00);
+}
+
+/***************************************************************************//**
+ * @brief
+ * Start an blocking data transmit transfer.
+ *
+ * @note
+ * @n This function is blocking and returns when the transfer is complete.
+ *
+ * @param[in] data
+ * Transmit data buffer.
+ *
+ * @param[in] count
+ * Number of bytes in transfer.
+ *
+ * @return
+ * @ref SL_STATUS_OK on success or @ref SL_STATUS_FAIL on failure
+ ******************************************************************************/
+static sl_status_t ssd1306_send_data(const void *data, uint32_t len)
+{
+ return ssd1306_send(data, len, 0x40);
+}
+
+static sl_status_t ssd1306_send(const void *data,
+ uint32_t len,
+ uint8_t command_type)
+{
+ uint8_t i2c_write_data[len + 1];
+ const uint8_t *ptr = data;
+
+ i2c_write_data[0] = command_type;
+ for (uint32_t i = 0; i < len; i++) {
+ i2c_write_data[i + 1] = ptr[i];
+ }
+
+ if (I2C_MASTER_SUCCESS != i2c_master_write(µ_oled_i2c,
+ i2c_write_data,
+ len + 1)) {
+ return SL_STATUS_TRANSMIT;
+ }
+
+ return SL_STATUS_OK;
+}
diff --git a/driver/public/silabs/micro_oled_ssd1306/src/micro_oled_ssd1306_i2c.c b/driver/public/silabs/micro_oled_ssd1306/src/micro_oled_ssd1306_i2c.c
deleted file mode 100644
index 4fe7a7ea..00000000
--- a/driver/public/silabs/micro_oled_ssd1306/src/micro_oled_ssd1306_i2c.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/***************************************************************************//**
- * @file ssd1306_i2c.c
- * @brief I2C abstraction used by SSD1306
- *******************************************************************************
- * # License
- * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
- *******************************************************************************
- *
- * 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.
- *
- *******************************************************************************
- * # Evaluation Quality
- * This code has been minimally tested to ensure that it builds and is suitable
- * as a demonstration for evaluation purposes only. This code will be maintained
- * at the sole discretion of Silicon Labs.
- ******************************************************************************/
-#include
-#include "micro_oled_ssd1306_i2c.h"
-#include "micro_oled_ssd1306_config.h"
-#include "sl_i2cspm.h"
-
-static sl_i2cspm_t *i2c_instance_handle = NULL;
-
-static sl_status_t ssd1306_send(const void *data,
- uint32_t len,
- uint8_t command_type);
-
-/***************************************************************************//**
- * @brief
- * Initialize the i2c interface.
- *
- * @detail
- * The driver instances will be initialized automatically,
- * during the sl_system_init() call in main.c.
- *****************************************************************************/
-void ssd1306_i2c_init(sl_i2cspm_t *i2c_handle)
-{
- i2c_instance_handle = i2c_handle;
-}
-
-/***************************************************************************//**
- * @brief
- * Start an blocking command transmit transfer.
- *
- * @note
- * @n This function is blocking and returns when the transfer is complete.
- *
- * @param[in] command
- * Transmit command buffer.
- *
- * @param[in] len
- * Number of bytes in transfer.
- *
- * @return
- * @ref SL_STATUS_OK on success or @ref SL_STATUS_FAIL on failure
- ******************************************************************************/
-sl_status_t ssd1306_send_command(const void *cmd, uint32_t len)
-{
- return ssd1306_send(cmd, len, 0x00);
-}
-
-/***************************************************************************//**
- * @brief
- * Start an blocking data transmit transfer.
- *
- * @note
- * @n This function is blocking and returns when the transfer is complete.
- *
- * @param[in] data
- * Transmit data buffer.
- *
- * @param[in] count
- * Number of bytes in transfer.
- *
- * @return
- * @ref SL_STATUS_OK on success or @ref SL_STATUS_FAIL on failure
- ******************************************************************************/
-sl_status_t ssd1306_send_data(const void *data, uint32_t len)
-{
- return ssd1306_send(data, len, 0x40);
-}
-
-static sl_status_t ssd1306_send(const void *data,
- uint32_t len,
- uint8_t command_type)
-{
- I2C_TransferSeq_TypeDef seq;
- I2C_TransferReturn_TypeDef ret;
- uint8_t i2c_write_data[len];
- uint8_t i2c_read_data[1];
- const uint8_t *ptr = data;
-
- if (NULL == i2c_instance_handle) {
- return SL_STATUS_INVALID_PARAMETER;
- }
-
- seq.addr = CONFIG_OLED_DISPLAY_ADDRESS << 1;
- seq.flags = I2C_FLAG_WRITE;
-
- i2c_write_data[0] = command_type;
- for (uint32_t i = 0; i < len; i++) {
- i2c_write_data[i + 1] = ptr[i];
- }
- seq.buf[0].data = i2c_write_data;
- seq.buf[0].len = len + 1;
-
- /* Select location/length of data to be read */
- seq.buf[1].data = i2c_read_data;
- seq.buf[1].len = 0;
- ret = I2CSPM_Transfer(i2c_instance_handle, &seq);
- if (ret != i2cTransferDone) {
- return SL_STATUS_TRANSMIT;
- }
-
- return SL_STATUS_OK;
-}
diff --git a/driver/public/silabs/micro_oled_ssd1306/src/oled_display.c b/driver/public/silabs/micro_oled_ssd1306/src/oled_display.c
index bd5ddd7c..96c4e7eb 100644
--- a/driver/public/silabs/micro_oled_ssd1306/src/oled_display.c
+++ b/driver/public/silabs/micro_oled_ssd1306/src/oled_display.c
@@ -36,7 +36,7 @@
#include "micro_oled_ssd1306_config.h"
#include "oled_display.h"
-/* This oled_frame_buffer is large enough to store one full frame. */
+// This oled_frame_buffer is large enough to store one full frame.
static uint8_t oled_frame_buffer[(SSD1306_DISPLAY_HEIGHT + 7) / 8
* SSD1306_DISPLAY_WIDTH];
@@ -65,9 +65,9 @@ static const oled_display_driver_api_t sl_memlcd_driver_api =
.stop_scroll = ssd1306_stop_scroll,
};
-/** Flag to monitor is this driver has been initialized. The
- * oled_display_instance
- * is only valid after initialized=true.
+/**
+ * Flag to monitor is this driver has been initialized.
+ * The oled_display_instance is only valid after initialized=true.
*/
static bool initialized = false;
@@ -101,7 +101,7 @@ static sl_status_t fill_screen(uint16_t color)
{
uint16_t i;
- /* Fill the display with the background color of the glib_context_t */
+ // Fill the display with the background color of the glib_context_t
for (i = 0; i < sizeof(oled_frame_buffer); i++) {
oled_frame_buffer[i] = color == 0 ? 0x00 : 0xFF;
}
diff --git a/driver/public/silabs/sparkfun_6dof_imu_bmi270/config/sparkfun_bmi270_config.h b/driver/public/silabs/sparkfun_6dof_imu_bmi270/config/sparkfun_bmi270_config.h
new file mode 100644
index 00000000..10079fc3
--- /dev/null
+++ b/driver/public/silabs/sparkfun_6dof_imu_bmi270/config/sparkfun_bmi270_config.h
@@ -0,0 +1,71 @@
+
+/***************************************************************************/ /**
+ * @file sparkfun_bmi270_config.h
+ * @brief sparkfun bmi270 configuration
+ *******************************************************************************
+ * # License
+ * Copyright 2024 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * 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.
+ *
+ *******************************************************************************
+ *
+ * EVALUATION QUALITY
+ * This code has been minimally tested to ensure that it builds with the
+ * specified dependency versions and is suitable as a demonstration for
+ * evaluation purposes only.
+ * This code will be maintained at the sole discretion of Silicon Labs.
+ *
+ ******************************************************************************/
+
+#ifndef SPARKFUN_BMI270_CONFIG_H
+#define SPARKFUN_BMI270_CONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+//SPARKFUN BMI270 I2C Configuration
+
+// SPARKFUN BMI270 I2C UC Configuration
+// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC).
+// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration.
+// Default: 0
+#define SPARKFUN_BMI270_I2C_UC 0
+
+// Speed mode
+// <0=> Standard mode (100kbit/s)
+// <1=> Fast mode (400kbit/s)
+// <2=> Fast mode plus (1Mbit/s)
+// Default: 0
+#define SPARKFUN_BMI270_I2C_SPEED_MODE 0
+
+//
+//
+// <<< end of configuration section >>>
+
+#ifdef __cplusplus
+}
+#endif
+#endif // SPARKFUN_BMI270_CONFIG_H
\ No newline at end of file
diff --git a/driver/public/silabs/sparkfun_6dof_imu_bmi270/inc/sparkfun_bmi270.h b/driver/public/silabs/sparkfun_6dof_imu_bmi270/inc/sparkfun_bmi270.h
new file mode 100644
index 00000000..ec92e7fa
--- /dev/null
+++ b/driver/public/silabs/sparkfun_6dof_imu_bmi270/inc/sparkfun_bmi270.h
@@ -0,0 +1,445 @@
+#ifndef SPARKFUN_BMI270_H_
+#define SPARKFUN_BMI270_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//// Includes
+#include "sl_status.h"
+#include "drv_i2c_master.h"
+
+/******************************************************************************/
+
+/*******************************************************************************
+ *************************** Defines / Macros ********************************
+ ******************************************************************************/
+///< Value used to clear BMI270_INIT_CTRL_REG
+#define CLR_INIT_CTRL_REG 0x00
+
+///< Value used to clear BMI270_POWER_CFG_REG to disable advance power mode
+#define DISABLE_ADV_POWER 0x00
+
+///< Value used to compare BMI270_INIT_STATUS_REG for successful initialization
+#define BMI270_INIT_SUCCESSFUL 0x01
+
+///< Value used to set BMI270_POWER_CFG_REG to disable advance power mode
+#define ENABLE_ADV_POWER 0x01
+
+///< Value used to set BMI270_INIT_CTRL_REG
+#define SET_INIT_CTRL_REG 0x01
+
+///< Value of gravitational force of earth in meter per second square (m/s^2)
+#define GRAVITY_EARTH 9.80665
+
+///< Value of chip-id of bmi270 sensor
+#define BMI270_CHIP_ID 0x24
+
+///< Value of slave address of bmi270 sensor
+#define BMI270_ADDR 0x68
+
+///< Value used to set BMI270_CMD_REG for soft reset of bmi270 sensor.
+#define SOFT_RESET_CMD 0xB6
+
+///< Value of chunk size of a configuration file for burst write
+#define CHUNK_SIZE 1024
+
+///< Value of delay counter for milli seconds delay
+#define MS_DELAY_COUNTER 4600
+
+/*******************************************************************************
+ ******************************** ENUMS ************************************
+ ******************************************************************************/
+/// @brief Enum for bmi270 commands
+typedef enum bmi270_commands {
+ ///< Register used to read chip ID of bmi270 sensor
+ BMI270_CHIP_IDENTIFY_CODE_REG = 0x00,
+
+ ///< Register used to read the accelerator reading
+ BMI270_ACC_X_LSB_ADDR = 0x0C,
+
+ ///< Register used to read the gyroscope reading
+ BMI270_GYR_X_LSB_ADDR = 0x12,
+
+ ///< Register used to read status of initialization of bmi270 sensor
+ BMI270_INIT_STATUS_REG = 0x21,
+
+ ///< Register used to configure accelerometer
+ BMI270_ACC_CONF_ADDR = 0x40,
+
+ ///< Register used to configure accelerometer range
+ BMI270_ACC_RANGE_REG = 0x41,
+
+ ///< Register used to configure gyroscope
+ BMI270_GYR_CONF_ADDR = 0x42,
+
+ ///< Register used to configure gyroscope range
+ BMI270_GYRO_RANGE_REG = 0x43,
+
+ ///< Register used to make bmi270 sensor ready to load configuration file
+ BMI270_INIT_CTRL_REG = 0x59,
+
+ ///< Register used to write Base address_0 of the initialization data
+ BMI270_INIT_ADDR_0_REG = 0x5B,
+
+ ///< Register used to write Base address_1 of the initialization data
+ BMI270_INIT_ADDR_1_REG = 0x5C,
+
+ ///< Register used to write configuration file in chunks
+ BMI270_INIT_DATA_REG = 0x5E,
+
+ ///< Register used to configuration advance power mode of bmi270 sensor
+ BMI270_POWER_CFG_REG = 0x7C,
+
+ ///< Register used to enable features of bmi270 sensor
+ BMI270_PWR_CTRL_ADDR = 0x7D,
+
+ ///< Register used to soft reset bmi270 sensor
+ BMI270_CMD_REG = 0x7E,
+
+ ///< Register used to read the temperature LSB reading
+ BMI270_TEMP0_REG = 0x22,
+
+ ///< Register used to read the temperature MSB reading
+ BMI270_TEMP1_REG = 0x23,
+} bmi270_commands_t;
+
+/// @brief Enum for bmi270 features
+typedef enum {
+ ///< Used to enable accelerometer feature
+ BMI270_FEATURE_GYRO = 0x02,
+
+ ///< Used to enable gyroscope feature
+ BMI270_FEATURE_ACC = 0x04,
+
+ ///< Used to enable temperature feature
+ BMI270_FEATURE_TEMP = 0x08
+} bmi270_feature_t;
+
+/// @brief Enum for bmi270 different accelerometer ranges
+typedef enum {
+ ///< Used to enable +/- 2G accelerometer range
+ BMI270_ACCEL_RANGE_2G = 0x00,
+
+ ///< Used to enable +/- 4G accelerometer range
+ BMI270_ACCEL_RANGE_4G = 0x01,
+
+ ///< Used to enable +/- 8G accelerometer range
+ BMI270_ACCEL_RANGE_8G = 0x02,
+
+ ///< Used to enable +/- 16G accelerometer range
+ BMI270_ACCEL_RANGE_16G = 0x03,
+} bmi270_accel_range_t;
+
+/// @brief Enum for bmi270 different accelerometer output data rate
+/// Bits 0-3 of ACC_CONF register address 0x40 is used for accelerometer ODR
+typedef enum {
+ ///< Used to enable 25/32 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_25_32_HZ = 0x01,
+
+ ///< Used to enable 25/16 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_25_16_HZ = 0x02,
+
+ ///< Used to enable 25/8 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_25_8_HZ = 0x03,
+
+ ///< Used to enable 25/4 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_25_4_HZ = 0x04,
+
+ ///< Used to enable 25/2 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_25_2_HZ = 0x05,
+
+ ///< Used to enable 25 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_25HZ = 0x06,
+
+ ///< Used to enable 50 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_50HZ = 0x07,
+
+ ///< Used to enable 100 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_100HZ = 0x08,
+
+ ///< Used to enable 200 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_200HZ = 0x09,
+
+ ///< Used to enable 400 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_400HZ = 0x0A,
+
+ ///< Used to enable 800 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_800HZ = 0x0B,
+
+ ///< Used to enable 1600 Hz accelerometer output data rate
+ BMI270_ACCEL_ODR_1600HZ = 0x0C,
+} bmi270_accel_odr_t;
+
+/// @brief Enum for bmi270 different accelerometer bandwidth
+/// Bits 4-6 of ACC_CONF register address 0x40 is used for accelerometer
+/// bandwidth
+typedef enum {
+ BMI270_ACCEL_OSR4_AVG1 = 0x00,
+ BMI270_ACCEL_OSR2_AVG2 = 0x01,
+ BMI270_ACCEL_NORM_AVG4 = 0x02,
+ BMI270_ACCEL_CIC_AVG8 = 0x03,
+ BMI270_ACCEL_RES_AVG16 = 0x04,
+ BMI270_ACCEL_RES_AVG32 = 0x05,
+ BMI270_ACCEL_RES_AVG64 = 0x06,
+ BMI270_ACCEL_RES_AVG128 = 0x07,
+}bmi270_accel_bwp_t;
+
+/// @brief Enum for bmi270 different accelerometer filter
+/// Bit 7 of ACC_CONF register address 0x40 is used for accelerometer filter
+typedef enum {
+ /// For Bit : 7 of ACC_CONF register address 0x40
+
+ ///< Used to enable accelerometer power optimize mode
+ BMI270_ACCEL_POWER_OPT = 0x00,
+
+ ///< Used to enable accelerometer performance optimize mode
+ BMI270_ACCEL_PERFO_OPT = 0x01,
+}bmi270_accel_filter_t;
+
+/// @brief Enum for bmi270 different gyroscope range in degree per second
+/// Bits 0-2 of GYR_RANGE register address 0x43 is used for gyroscope range
+typedef enum {
+ /// For Bit : 2...0 of GYR_RANGE register address 0x43
+
+ ///< Used to enable +/- 2000 DPS gyroscope range
+ BMI270_GYRO_RANGE_2000DPS = 0x00,
+
+ ///< Used to enable +/- 1000 DPS gyroscope range
+ BMI270_GYRO_RANGE_1000DPS = 0x01,
+
+ ///< Used to enable +/- 500 DPS gyroscope range
+ BMI270_GYRO_RANGE_500DPS = 0x02,
+
+ ///< Used to enable +/- 250 DPS gyroscope range
+ BMI270_GYRO_RANGE_250DPS = 0x03,
+
+ ///< Used to enable +/- 125 DPS gyroscope range
+ BMI270_GYRO_RANGE_125DPS = 0x04,
+} bmi270_gyro_range_t;
+
+/// @brief Enum for bmi270 different gyroscope output data rate
+/// Bits 0-3 of GYR_CONF register address 0x42 is used for gyroscope output data
+/// rate
+typedef enum {
+ ///< Used to enable 25Hz gyroscope output data rate
+ BMI270_GYRO_ODR_25HZ = 0x06,
+
+ ///< Used to enable 50Hz gyroscope output data rate
+ BMI270_GYRO_ODR_50HZ = 0x07,
+
+ ///< Used to enable 100Hz gyroscope output data rate
+ BMI270_GYRO_ODR_100HZ = 0x08,
+
+ ///< Used to enable 200Hz gyroscope output data rate
+ BMI270_GYRO_ODR_200HZ = 0x09,
+
+ ///< Used to enable 400Hz gyroscope output data rate
+ BMI270_GYRO_ODR_400HZ = 0x0a,
+
+ ///< Used to enable 800Hz gyroscope output data rate
+ BMI270_GYRO_ODR_800HZ = 0x0b,
+
+ ///< Used to enable 1600Hz gyroscope output data rate
+ BMI270_GYRO_ODR_1600HZ = 0x0c,
+
+ ///< Used to enable 3200Hz gyroscope output data rate
+ BMI270_GYRO_ODR_3200HZ = 0x0d,
+} bmi270_gyro_odr_t;
+
+/// @brief Enum for bmi270 different gyroscope bandwidth
+/// Bits 4-5 of GYR_CONF register address 0x42 is used for gyroscope bandwidth
+typedef enum {
+ BMI270_GYRO_BWP_OSR4 = 0x00,
+ BMI270_GYRO_BWP_OSR2 = 0x01,
+ BMI270_GYRO_BWP_NORMAL = 0x02,
+} bmi270_gyro_bwp_t;
+
+/// @brief Enum for bmi270 different gyroscope noise mode
+/// Bit 6 of GYR_CONF register address 0x42 is used for noise mode
+typedef enum {
+ ///< Used to enable power optimized gyroscope noise mode
+ BMI270_GYRO_N_POWER_OPT = 0x00,
+
+ ///< Used to enable performance optimized gyroscope noise mode
+ BMI270_GYRO_N_PERFO_OPT = 0x01,
+}bmi270_gyro_noise_t;
+
+/// @brief Enum for bmi270 different gyroscope filter mode
+/// Bit 7 of GYR_CONF register address 0x42 is used for filter mode
+typedef enum {
+ ///< Used to enable power optimized gyroscope filter mode
+ BMI270_GYRO_F_POWER_OPT = 0x00,
+
+ ///< Used to enable performance optimized gyroscope filter mode
+ BMI270_GYRO_F_PERFO_OPT = 0x01,
+}bmi270_gyro_filter_t;
+
+/// @brief Accelerometer Configuration Structure
+typedef struct {
+ ///< Used to set output data rate of accelerometer
+ bmi270_accel_odr_t odr;
+
+ ///< Used to set range of accelerometer
+ bmi270_accel_range_t range;
+
+ ///< Used to set bandwidth of accelerometer
+ bmi270_accel_bwp_t bw;
+
+ ///< Used to set filter mode of accelerometer
+ bmi270_accel_filter_t filter;
+} bmi270_accel_config_t;
+
+/// @brief Gyroscope Configuration Structure
+typedef struct {
+ ///< Used to set output data rate of gyroscope
+ bmi270_gyro_odr_t odr;
+
+ ///< Used to set measurement range of gyroscope
+ bmi270_gyro_range_t range;
+
+ ///< Used to set bandwidth of gyroscope
+ bmi270_gyro_bwp_t bw;
+
+ ///< Used to set power mode of gyroscope
+ bmi270_gyro_noise_t noise;
+
+ ///< Used to set filter mode of gyroscope
+ bmi270_gyro_filter_t filter;
+} bmi270_gyro_config_t;
+
+/// @brief Enable features of bmi270 sensor Structure
+typedef struct {
+ ///< Used to set features of bmi270 sensor (set using ORing)
+ uint8_t features;
+} bmi270_enable_features_t;
+
+/// @brief to store the BMI270 sensor configuration data
+typedef struct {
+ ///< Used to enables features of bmi270 sensor
+ bmi270_enable_features_t enable_features;
+
+ ///< Used to set the configuration of accelerometer
+ bmi270_accel_config_t acc_config;
+
+ ///< Used to set the configuration of gyroscope
+ bmi270_gyro_config_t gyro_config;
+
+ ///< Used to set I2C instance used by the user
+ mikroe_i2c_handle_t i2c_instance;
+
+ ///< Used to set Value of slave address of bmi270 sensor
+ uint8_t bmi270_slave_address;
+} bmi270_cfg_data_t;
+
+// -----------------------------------------------------------------------------
+// Prototypes
+
+/*******************************************************************************
+ * @brief Initialize and probe BMI270 sensor.
+ * @param[in] bmi_cfg_data : pointer to store the BMI270 sensor configuration
+ * data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_init(bmi270_cfg_data_t *bmi_cfg_data);
+
+/*******************************************************************************
+ * @brief Reset BMI270 sensor.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_reset(void);
+
+/*******************************************************************************
+ * @brief Check presence of BMI270 sensor on I2C bus.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * - \ref SL_STATUS_NOT_AVAILABLE on device not available
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_is_present(void);
+
+/*******************************************************************************
+ * @brief Enable and disable advance power mode of BMI270 sensor.
+ * @param[in] value : data to be write.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_update_advance_power_mode(uint8_t value);
+
+/*******************************************************************************
+ * @brief Enable and configure default features of BMI270 sensor.
+ * @param[in] bmi_cfg_data : pointer to store the BMI270 sensor configuration
+ * data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * @note This API must be called after 'sparkfun_bmi270_init'.
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_enable_and_config_features(
+ bmi270_cfg_data_t *bmi_cfg_data);
+
+/*******************************************************************************
+ * @brief Read readings of accelerometer in BMI270 sensor.
+ * @param[in] bmi_cfg_data : pointer to store the BMI270 sensor configuration
+ * data.
+ * @param[out] acc_buffer : A pointer to accelerometer buffer.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * - \ref SL_STATUS_NOT_AVAILABLE on feature not available due to software
+ * configuration.
+ * @note This API must be called after
+ * 'sparkfun_bmi270_enable_and_config_features'.
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_read_acc_reading(bmi270_cfg_data_t *bmi_cfg_data,
+ double *acc_buffer);
+
+/*******************************************************************************
+ * @brief Read readings of gyroscope in BMI270 sensor.
+ * @param[in] bmi_cfg_data : pointer to store the BMI270 sensor configuration
+ * data.
+ * @param[out] gyro_buffer : A pointer to gyroscope buffer.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * - \ref SL_STATUS_NOT_AVAILABLE on feature not available due to software
+ * configuration.
+ * @note This API must be called after
+ * 'sparkfun_bmi270_enable_and_config_features'.
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_read_gyro_reading(bmi270_cfg_data_t *bmi_cfg_data,
+ double *gyro_buffer);
+
+/*******************************************************************************
+ * @brief Read readings of temperature in BMI270 sensor.
+ * @param[in] bmi_cfg_data : pointer to store the BMI270 sensor configuration
+ * data.
+ * @param[out] temperature_reading : A pointer to store temperature data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ * - \ref SL_STATUS_NOT_AVAILABLE on feature not available due to software
+ * configuration.
+ * @note
+ * 1. If the gyroscope is enabled, the temperature reading is updated every
+ * 10 ms (+/- 12%). Otherwise, the temperature is updated every 1.28 s.
+ * 2. This API must be called after
+ * 'sparkfun_bmi270_enable_and_config_features'.
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_read_temp_reading(bmi270_cfg_data_t *bmi_cfg_data,
+ double *temperature_reading);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SPARKFUN_BMI270_H_ */
+
+/******************************************************************************/
+/* EOF */
+/******************************************************************************/
diff --git a/driver/public/silabs/sparkfun_6dof_imu_bmi270/src/sparkfun_bmi270.c b/driver/public/silabs/sparkfun_6dof_imu_bmi270/src/sparkfun_bmi270.c
new file mode 100644
index 00000000..0ec2ecba
--- /dev/null
+++ b/driver/public/silabs/sparkfun_6dof_imu_bmi270/src/sparkfun_bmi270.c
@@ -0,0 +1,1747 @@
+#include "sparkfun_bmi270.h"
+#include "sparkfun_bmi270_config.h"
+
+/*******************************************************************************
+ * @brief BMI270 configuration file
+ ******************************************************************************/
+static const uint8_t bmi270_config_file[] = {
+ 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x3d, 0xb1, 0xc8, 0x2e, 0x00, 0x2e, 0x80,
+ 0x2e, 0x91, 0x03, 0x80, 0x2e, 0xbc,
+ 0xb0, 0x80, 0x2e, 0xa3, 0x03, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x00, 0xb0,
+ 0x50, 0x30, 0x21, 0x2e, 0x59, 0xf5,
+ 0x10, 0x30, 0x21, 0x2e, 0x6a, 0xf5, 0x80, 0x2e, 0x3b, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x19, 0x01, 0x00, 0x22,
+ 0x00, 0x75, 0x00, 0x00, 0x10, 0x00, 0x10, 0xd1, 0x00, 0xb3, 0x43, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0xe0, 0x5f, 0x00, 0x00, 0x00,
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x19, 0x00, 0x00, 0x88, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
+ 0xe0, 0xaa, 0x38, 0x05, 0xe0, 0x90, 0x30, 0xfa, 0x00, 0x96, 0x00, 0x4b, 0x09,
+ 0x11, 0x00, 0x11, 0x00, 0x02, 0x00,
+ 0x2d, 0x01, 0xd4, 0x7b, 0x3b, 0x01, 0xdb, 0x7a, 0x04, 0x00, 0x3f, 0x7b, 0xcd,
+ 0x6c, 0xc3, 0x04, 0x85, 0x09, 0xc3,
+ 0x04, 0xec, 0xe6, 0x0c, 0x46, 0x01, 0x00, 0x27, 0x00, 0x19, 0x00, 0x96, 0x00,
+ 0xa0, 0x00, 0x01, 0x00, 0x0c, 0x00,
+ 0xf0, 0x3c, 0x00, 0x01, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00,
+ 0x00, 0x32, 0x00, 0x05, 0x00, 0xee,
+ 0x06, 0x04, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x04, 0x00, 0xa8, 0x05, 0xee, 0x06,
+ 0x00, 0x04, 0xbc, 0x02, 0xb3, 0x00,
+ 0x85, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xb4, 0x00, 0x01, 0x00, 0xb9, 0x00, 0x01, 0x00, 0x98, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x2e, 0x00, 0xc1, 0xfd, 0x2d, 0xde,
+ 0x00, 0xeb, 0x00, 0xda, 0x00, 0x00, 0x0c, 0xff, 0x0f, 0x00, 0x04, 0xc0, 0x00,
+ 0x5b, 0xf5, 0xc9, 0x01, 0x1e, 0xf2,
+ 0x80, 0x00, 0x3f, 0xff, 0x19, 0xf4, 0x58, 0xf5, 0x66, 0xf5, 0x64, 0xf5, 0xc0,
+ 0xf1, 0xf0, 0x00, 0xe0, 0x00, 0xcd,
+ 0x01, 0xd3, 0x01, 0xdb, 0x01, 0xff, 0x7f, 0xff, 0x01, 0xe4, 0x00, 0x74, 0xf7,
+ 0xf3, 0x00, 0xfa, 0x00, 0xff, 0x3f,
+ 0xca, 0x03, 0x6c, 0x38, 0x56, 0xfe, 0x44, 0xfd, 0xbc, 0x02, 0xf9, 0x06, 0x00,
+ 0xfc, 0x12, 0x02, 0xae, 0x01, 0x58,
+ 0xfa, 0x9a, 0xfd, 0x77, 0x05, 0xbb, 0x02, 0x96, 0x01, 0x95, 0x01, 0x7f, 0x01,
+ 0x82, 0x01, 0x89, 0x01, 0x87, 0x01,
+ 0x88, 0x01, 0x8a, 0x01, 0x8c, 0x01, 0x8f, 0x01, 0x8d, 0x01, 0x92, 0x01, 0x91,
+ 0x01, 0xdd, 0x00, 0x9f, 0x01, 0x7e,
+ 0x01, 0xdb, 0x00, 0xb6, 0x01, 0x70, 0x69, 0x26, 0xd3, 0x9c, 0x07, 0x1f, 0x05,
+ 0x9d, 0x00, 0x00, 0x08, 0xbc, 0x05,
+ 0x37, 0xfa, 0xa2, 0x01, 0xaa, 0x01, 0xa1, 0x01, 0xa8, 0x01, 0xa0, 0x01, 0xa8,
+ 0x05, 0xb4, 0x01, 0xb4, 0x01, 0xce,
+ 0x00, 0xd0, 0x00, 0xfc, 0x00, 0xc5, 0x01, 0xff, 0xfb, 0xb1, 0x00, 0x00, 0x38,
+ 0x00, 0x30, 0xfd, 0xf5, 0xfc, 0xf5,
+ 0xcd, 0x01, 0xa0, 0x00, 0x5f, 0xff, 0x00, 0x40, 0xff, 0x00, 0x00, 0x80, 0x6d,
+ 0x0f, 0xeb, 0x00, 0x7f, 0xff, 0xc2,
+ 0xf5, 0x68, 0xf7, 0xb3, 0xf1, 0x67, 0x0f, 0x5b, 0x0f, 0x61, 0x0f, 0x80, 0x0f,
+ 0x58, 0xf7, 0x5b, 0xf7, 0x83, 0x0f,
+ 0x86, 0x00, 0x72, 0x0f, 0x85, 0x0f, 0xc6, 0xf1, 0x7f, 0x0f, 0x6c, 0xf7, 0x00,
+ 0xe0, 0x00, 0xff, 0xd1, 0xf5, 0x87,
+ 0x0f, 0x8a, 0x0f, 0xff, 0x03, 0xf0, 0x3f, 0x8b, 0x00, 0x8e, 0x00, 0x90, 0x00,
+ 0xb9, 0x00, 0x2d, 0xf5, 0xca, 0xf5,
+ 0xcb, 0x01, 0x20, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x30, 0x50, 0x98, 0x2e,
+ 0xd7, 0x0e, 0x50, 0x32, 0x98, 0x2e, 0xfa, 0x03, 0x00, 0x30, 0xf0, 0x7f, 0x00,
+ 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0x00,
+ 0x2e, 0x01, 0x80, 0x08, 0xa2, 0xfb, 0x2f, 0x98, 0x2e, 0xba, 0x03, 0x21, 0x2e,
+ 0x19, 0x00, 0x01, 0x2e, 0xee, 0x00,
+ 0x00, 0xb2, 0x07, 0x2f, 0x01, 0x2e, 0x19, 0x00, 0x00, 0xb2, 0x03, 0x2f, 0x01,
+ 0x50, 0x03, 0x52, 0x98, 0x2e, 0x07,
+ 0xcc, 0x01, 0x2e, 0xdd, 0x00, 0x00, 0xb2, 0x27, 0x2f, 0x05, 0x2e, 0x8a, 0x00,
+ 0x05, 0x52, 0x98, 0x2e, 0xc7, 0xc1,
+ 0x03, 0x2e, 0xe9, 0x00, 0x40, 0xb2, 0xf0, 0x7f, 0x08, 0x2f, 0x01, 0x2e, 0x19,
+ 0x00, 0x00, 0xb2, 0x04, 0x2f, 0x00,
+ 0x30, 0x21, 0x2e, 0xe9, 0x00, 0x98, 0x2e, 0xb4, 0xb1, 0x01, 0x2e, 0x18, 0x00,
+ 0x00, 0xb2, 0x10, 0x2f, 0x05, 0x50,
+ 0x98, 0x2e, 0x4d, 0xc3, 0x05, 0x50, 0x98, 0x2e, 0x5a, 0xc7, 0x98, 0x2e, 0xf9,
+ 0xb4, 0x98, 0x2e, 0x54, 0xb2, 0x98,
+ 0x2e, 0x67, 0xb6, 0x98, 0x2e, 0x17, 0xb2, 0x10, 0x30, 0x21, 0x2e, 0x77, 0x00,
+ 0x01, 0x2e, 0xef, 0x00, 0x00, 0xb2,
+ 0x04, 0x2f, 0x98, 0x2e, 0x7a, 0xb7, 0x00, 0x30, 0x21, 0x2e, 0xef, 0x00, 0x01,
+ 0x2e, 0xd4, 0x00, 0x04, 0xae, 0x0b,
+ 0x2f, 0x01, 0x2e, 0xdd, 0x00, 0x00, 0xb2, 0x07, 0x2f, 0x05, 0x52, 0x98, 0x2e,
+ 0x8e, 0x0e, 0x00, 0xb2, 0x02, 0x2f,
+ 0x10, 0x30, 0x21, 0x2e, 0x7d, 0x00, 0x01, 0x2e, 0x7d, 0x00, 0x00, 0x90, 0x90,
+ 0x2e, 0xf1, 0x02, 0x01, 0x2e, 0xd7,
+ 0x00, 0x00, 0xb2, 0x04, 0x2f, 0x98, 0x2e, 0x2f, 0x0e, 0x00, 0x30, 0x21, 0x2e,
+ 0x7b, 0x00, 0x01, 0x2e, 0x7b, 0x00,
+ 0x00, 0xb2, 0x12, 0x2f, 0x01, 0x2e, 0xd4, 0x00, 0x00, 0x90, 0x02, 0x2f, 0x98,
+ 0x2e, 0x1f, 0x0e, 0x09, 0x2d, 0x98,
+ 0x2e, 0x81, 0x0d, 0x01, 0x2e, 0xd4, 0x00, 0x04, 0x90, 0x02, 0x2f, 0x50, 0x32,
+ 0x98, 0x2e, 0xfa, 0x03, 0x00, 0x30,
+ 0x21, 0x2e, 0x7b, 0x00, 0x01, 0x2e, 0x7c, 0x00, 0x00, 0xb2, 0x90, 0x2e, 0x09,
+ 0x03, 0x01, 0x2e, 0x7c, 0x00, 0x01,
+ 0x31, 0x01, 0x08, 0x00, 0xb2, 0x04, 0x2f, 0x98, 0x2e, 0x47, 0xcb, 0x10, 0x30,
+ 0x21, 0x2e, 0x77, 0x00, 0x81, 0x30,
+ 0x01, 0x2e, 0x7c, 0x00, 0x01, 0x08, 0x00, 0xb2, 0x61, 0x2f, 0x03, 0x2e, 0x89,
+ 0x00, 0x01, 0x2e, 0xd4, 0x00, 0x98,
+ 0xbc, 0x98, 0xb8, 0x05, 0xb2, 0x0f, 0x58, 0x23, 0x2f, 0x07, 0x90, 0x09, 0x54,
+ 0x00, 0x30, 0x37, 0x2f, 0x15, 0x41,
+ 0x04, 0x41, 0xdc, 0xbe, 0x44, 0xbe, 0xdc, 0xba, 0x2c, 0x01, 0x61, 0x00, 0x0f,
+ 0x56, 0x4a, 0x0f, 0x0c, 0x2f, 0xd1,
+ 0x42, 0x94, 0xb8, 0xc1, 0x42, 0x11, 0x30, 0x05, 0x2e, 0x6a, 0xf7, 0x2c, 0xbd,
+ 0x2f, 0xb9, 0x80, 0xb2, 0x08, 0x22,
+ 0x98, 0x2e, 0xc3, 0xb7, 0x21, 0x2d, 0x61, 0x30, 0x23, 0x2e, 0xd4, 0x00, 0x98,
+ 0x2e, 0xc3, 0xb7, 0x00, 0x30, 0x21,
+ 0x2e, 0x5a, 0xf5, 0x18, 0x2d, 0xe1, 0x7f, 0x50, 0x30, 0x98, 0x2e, 0xfa, 0x03,
+ 0x0f, 0x52, 0x07, 0x50, 0x50, 0x42,
+ 0x70, 0x30, 0x0d, 0x54, 0x42, 0x42, 0x7e, 0x82, 0xe2, 0x6f, 0x80, 0xb2, 0x42,
+ 0x42, 0x05, 0x2f, 0x21, 0x2e, 0xd4,
+ 0x00, 0x10, 0x30, 0x98, 0x2e, 0xc3, 0xb7, 0x03, 0x2d, 0x60, 0x30, 0x21, 0x2e,
+ 0xd4, 0x00, 0x01, 0x2e, 0xd4, 0x00,
+ 0x06, 0x90, 0x18, 0x2f, 0x01, 0x2e, 0x76, 0x00, 0x0b, 0x54, 0x07, 0x52, 0xe0,
+ 0x7f, 0x98, 0x2e, 0x7a, 0xc1, 0xe1,
+ 0x6f, 0x08, 0x1a, 0x40, 0x30, 0x08, 0x2f, 0x21, 0x2e, 0xd4, 0x00, 0x20, 0x30,
+ 0x98, 0x2e, 0xaf, 0xb7, 0x50, 0x32,
+ 0x98, 0x2e, 0xfa, 0x03, 0x05, 0x2d, 0x98, 0x2e, 0x38, 0x0e, 0x00, 0x30, 0x21,
+ 0x2e, 0xd4, 0x00, 0x00, 0x30, 0x21,
+ 0x2e, 0x7c, 0x00, 0x18, 0x2d, 0x01, 0x2e, 0xd4, 0x00, 0x03, 0xaa, 0x01, 0x2f,
+ 0x98, 0x2e, 0x45, 0x0e, 0x01, 0x2e,
+ 0xd4, 0x00, 0x3f, 0x80, 0x03, 0xa2, 0x01, 0x2f, 0x00, 0x2e, 0x02, 0x2d, 0x98,
+ 0x2e, 0x5b, 0x0e, 0x30, 0x30, 0x98,
+ 0x2e, 0xce, 0xb7, 0x00, 0x30, 0x21, 0x2e, 0x7d, 0x00, 0x50, 0x32, 0x98, 0x2e,
+ 0xfa, 0x03, 0x01, 0x2e, 0x77, 0x00,
+ 0x00, 0xb2, 0x24, 0x2f, 0x98, 0x2e, 0xf5, 0xcb, 0x03, 0x2e, 0xd5, 0x00, 0x11,
+ 0x54, 0x01, 0x0a, 0xbc, 0x84, 0x83,
+ 0x86, 0x21, 0x2e, 0xc9, 0x01, 0xe0, 0x40, 0x13, 0x52, 0xc4, 0x40, 0x82, 0x40,
+ 0xa8, 0xb9, 0x52, 0x42, 0x43, 0xbe,
+ 0x53, 0x42, 0x04, 0x0a, 0x50, 0x42, 0xe1, 0x7f, 0xf0, 0x31, 0x41, 0x40, 0xf2,
+ 0x6f, 0x25, 0xbd, 0x08, 0x08, 0x02,
+ 0x0a, 0xd0, 0x7f, 0x98, 0x2e, 0xa8, 0xcf, 0x06, 0xbc, 0xd1, 0x6f, 0xe2, 0x6f,
+ 0x08, 0x0a, 0x80, 0x42, 0x98, 0x2e,
+ 0x58, 0xb7, 0x00, 0x30, 0x21, 0x2e, 0xee, 0x00, 0x21, 0x2e, 0x77, 0x00, 0x21,
+ 0x2e, 0xdd, 0x00, 0x80, 0x2e, 0xf4,
+ 0x01, 0x1a, 0x24, 0x22, 0x00, 0x80, 0x2e, 0xec, 0x01, 0x10, 0x50, 0xfb, 0x7f,
+ 0x98, 0x2e, 0xf3, 0x03, 0x57, 0x50,
+ 0xfb, 0x6f, 0x01, 0x30, 0x71, 0x54, 0x11, 0x42, 0x42, 0x0e, 0xfc, 0x2f, 0xc0,
+ 0x2e, 0x01, 0x42, 0xf0, 0x5f, 0x80,
+ 0x2e, 0x00, 0xc1, 0xfd, 0x2d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x9a, 0x01,
+ 0x34, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x20, 0x50, 0xe7, 0x7f, 0xf6, 0x7f, 0x06, 0x32, 0x0f, 0x2e, 0x61,
+ 0xf5, 0xfe, 0x09, 0xc0, 0xb3, 0x04,
+ 0x2f, 0x17, 0x30, 0x2f, 0x2e, 0xef, 0x00, 0x2d, 0x2e, 0x61, 0xf5, 0xf6, 0x6f,
+ 0xe7, 0x6f, 0xe0, 0x5f, 0xc8, 0x2e,
+ 0x20, 0x50, 0xe7, 0x7f, 0xf6, 0x7f, 0x46, 0x30, 0x0f, 0x2e, 0xa4, 0xf1, 0xbe,
+ 0x09, 0x80, 0xb3, 0x06, 0x2f, 0x0d,
+ 0x2e, 0xd4, 0x00, 0x84, 0xaf, 0x02, 0x2f, 0x16, 0x30, 0x2d, 0x2e, 0x7b, 0x00,
+ 0x86, 0x30, 0x2d, 0x2e, 0x60, 0xf5,
+ 0xf6, 0x6f, 0xe7, 0x6f, 0xe0, 0x5f, 0xc8, 0x2e, 0x01, 0x2e, 0x77, 0xf7, 0x09,
+ 0xbc, 0x0f, 0xb8, 0x00, 0xb2, 0x10,
+ 0x50, 0xfb, 0x7f, 0x10, 0x30, 0x0b, 0x2f, 0x03, 0x2e, 0x8a, 0x00, 0x96, 0xbc,
+ 0x9f, 0xb8, 0x40, 0xb2, 0x05, 0x2f,
+ 0x03, 0x2e, 0x68, 0xf7, 0x9e, 0xbc, 0x9f, 0xb8, 0x40, 0xb2, 0x07, 0x2f, 0x03,
+ 0x2e, 0x7e, 0x00, 0x41, 0x90, 0x01,
+ 0x2f, 0x98, 0x2e, 0xdc, 0x03, 0x03, 0x2c, 0x00, 0x30, 0x21, 0x2e, 0x7e, 0x00,
+ 0xfb, 0x6f, 0xf0, 0x5f, 0xb8, 0x2e,
+ 0x20, 0x50, 0xe0, 0x7f, 0xfb, 0x7f, 0x00, 0x2e, 0x27, 0x50, 0x98, 0x2e, 0x3b,
+ 0xc8, 0x29, 0x50, 0x98, 0x2e, 0xa7,
+ 0xc8, 0x01, 0x50, 0x98, 0x2e, 0x55, 0xcc, 0xe1, 0x6f, 0x2b, 0x50, 0x98, 0x2e,
+ 0xe0, 0xc9, 0xfb, 0x6f, 0x00, 0x30,
+ 0xe0, 0x5f, 0x21, 0x2e, 0x7e, 0x00, 0xb8, 0x2e, 0x73, 0x50, 0x01, 0x30, 0x57,
+ 0x54, 0x11, 0x42, 0x42, 0x0e, 0xfc,
+ 0x2f, 0xb8, 0x2e, 0x21, 0x2e, 0x59, 0xf5, 0x10, 0x30, 0xc0, 0x2e, 0x21, 0x2e,
+ 0x4a, 0xf1, 0x90, 0x50, 0xf7, 0x7f,
+ 0xe6, 0x7f, 0xd5, 0x7f, 0xc4, 0x7f, 0xb3, 0x7f, 0xa1, 0x7f, 0x90, 0x7f, 0x82,
+ 0x7f, 0x7b, 0x7f, 0x98, 0x2e, 0x35,
+ 0xb7, 0x00, 0xb2, 0x90, 0x2e, 0x97, 0xb0, 0x03, 0x2e, 0x8f, 0x00, 0x07, 0x2e,
+ 0x91, 0x00, 0x05, 0x2e, 0xb1, 0x00,
+ 0x3f, 0xba, 0x9f, 0xb8, 0x01, 0x2e, 0xb1, 0x00, 0xa3, 0xbd, 0x4c, 0x0a, 0x05,
+ 0x2e, 0xb1, 0x00, 0x04, 0xbe, 0xbf,
+ 0xb9, 0xcb, 0x0a, 0x4f, 0xba, 0x22, 0xbd, 0x01, 0x2e, 0xb3, 0x00, 0xdc, 0x0a,
+ 0x2f, 0xb9, 0x03, 0x2e, 0xb8, 0x00,
+ 0x0a, 0xbe, 0x9a, 0x0a, 0xcf, 0xb9, 0x9b, 0xbc, 0x01, 0x2e, 0x97, 0x00, 0x9f,
+ 0xb8, 0x93, 0x0a, 0x0f, 0xbc, 0x91,
+ 0x0a, 0x0f, 0xb8, 0x90, 0x0a, 0x25, 0x2e, 0x18, 0x00, 0x05, 0x2e, 0xc1, 0xf5,
+ 0x2e, 0xbd, 0x2e, 0xb9, 0x01, 0x2e,
+ 0x19, 0x00, 0x31, 0x30, 0x8a, 0x04, 0x00, 0x90, 0x07, 0x2f, 0x01, 0x2e, 0xd4,
+ 0x00, 0x04, 0xa2, 0x03, 0x2f, 0x01,
+ 0x2e, 0x18, 0x00, 0x00, 0xb2, 0x0c, 0x2f, 0x19, 0x50, 0x05, 0x52, 0x98, 0x2e,
+ 0x4d, 0xb7, 0x05, 0x2e, 0x78, 0x00,
+ 0x80, 0x90, 0x10, 0x30, 0x01, 0x2f, 0x21, 0x2e, 0x78, 0x00, 0x25, 0x2e, 0xdd,
+ 0x00, 0x98, 0x2e, 0x3e, 0xb7, 0x00,
+ 0xb2, 0x02, 0x30, 0x01, 0x30, 0x04, 0x2f, 0x01, 0x2e, 0x19, 0x00, 0x00, 0xb2,
+ 0x00, 0x2f, 0x21, 0x30, 0x01, 0x2e,
+ 0xea, 0x00, 0x08, 0x1a, 0x0e, 0x2f, 0x23, 0x2e, 0xea, 0x00, 0x33, 0x30, 0x1b,
+ 0x50, 0x0b, 0x09, 0x01, 0x40, 0x17,
+ 0x56, 0x46, 0xbe, 0x4b, 0x08, 0x4c, 0x0a, 0x01, 0x42, 0x0a, 0x80, 0x15, 0x52,
+ 0x01, 0x42, 0x00, 0x2e, 0x01, 0x2e,
+ 0x18, 0x00, 0x00, 0xb2, 0x1f, 0x2f, 0x03, 0x2e, 0xc0, 0xf5, 0xf0, 0x30, 0x48,
+ 0x08, 0x47, 0xaa, 0x74, 0x30, 0x07,
+ 0x2e, 0x7a, 0x00, 0x61, 0x22, 0x4b, 0x1a, 0x05, 0x2f, 0x07, 0x2e, 0x66, 0xf5,
+ 0xbf, 0xbd, 0xbf, 0xb9, 0xc0, 0x90,
+ 0x0b, 0x2f, 0x1d, 0x56, 0x2b, 0x30, 0xd2, 0x42, 0xdb, 0x42, 0x01, 0x04, 0xc2,
+ 0x42, 0x04, 0xbd, 0xfe, 0x80, 0x81,
+ 0x84, 0x23, 0x2e, 0x7a, 0x00, 0x02, 0x42, 0x02, 0x32, 0x25, 0x2e, 0x62, 0xf5,
+ 0x05, 0x2e, 0xd6, 0x00, 0x81, 0x84,
+ 0x25, 0x2e, 0xd6, 0x00, 0x02, 0x31, 0x25, 0x2e, 0x60, 0xf5, 0x05, 0x2e, 0x8a,
+ 0x00, 0x0b, 0x50, 0x90, 0x08, 0x80,
+ 0xb2, 0x0b, 0x2f, 0x05, 0x2e, 0xca, 0xf5, 0xf0, 0x3e, 0x90, 0x08, 0x25, 0x2e,
+ 0xca, 0xf5, 0x05, 0x2e, 0x59, 0xf5,
+ 0xe0, 0x3f, 0x90, 0x08, 0x25, 0x2e, 0x59, 0xf5, 0x90, 0x6f, 0xa1, 0x6f, 0xb3,
+ 0x6f, 0xc4, 0x6f, 0xd5, 0x6f, 0xe6,
+ 0x6f, 0xf7, 0x6f, 0x7b, 0x6f, 0x82, 0x6f, 0x70, 0x5f, 0xc8, 0x2e, 0xc0, 0x50,
+ 0x90, 0x7f, 0xe5, 0x7f, 0xd4, 0x7f,
+ 0xc3, 0x7f, 0xb1, 0x7f, 0xa2, 0x7f, 0x87, 0x7f, 0xf6, 0x7f, 0x7b, 0x7f, 0x00,
+ 0x2e, 0x01, 0x2e, 0x60, 0xf5, 0x60,
+ 0x7f, 0x98, 0x2e, 0x35, 0xb7, 0x02, 0x30, 0x63, 0x6f, 0x15, 0x52, 0x50, 0x7f,
+ 0x62, 0x7f, 0x5a, 0x2c, 0x02, 0x32,
+ 0x1a, 0x09, 0x00, 0xb3, 0x14, 0x2f, 0x00, 0xb2, 0x03, 0x2f, 0x09, 0x2e, 0x18,
+ 0x00, 0x00, 0x91, 0x0c, 0x2f, 0x43,
+ 0x7f, 0x98, 0x2e, 0x97, 0xb7, 0x1f, 0x50, 0x02, 0x8a, 0x02, 0x32, 0x04, 0x30,
+ 0x25, 0x2e, 0x64, 0xf5, 0x15, 0x52,
+ 0x50, 0x6f, 0x43, 0x6f, 0x44, 0x43, 0x25, 0x2e, 0x60, 0xf5, 0xd9, 0x08, 0xc0,
+ 0xb2, 0x36, 0x2f, 0x98, 0x2e, 0x3e,
+ 0xb7, 0x00, 0xb2, 0x06, 0x2f, 0x01, 0x2e, 0x19, 0x00, 0x00, 0xb2, 0x02, 0x2f,
+ 0x50, 0x6f, 0x00, 0x90, 0x0a, 0x2f,
+ 0x01, 0x2e, 0x79, 0x00, 0x00, 0x90, 0x19, 0x2f, 0x10, 0x30, 0x21, 0x2e, 0x79,
+ 0x00, 0x00, 0x30, 0x98, 0x2e, 0xdc,
+ 0x03, 0x13, 0x2d, 0x01, 0x2e, 0xc3, 0xf5, 0x0c, 0xbc, 0x0f, 0xb8, 0x12, 0x30,
+ 0x10, 0x04, 0x03, 0xb0, 0x26, 0x25,
+ 0x21, 0x50, 0x03, 0x52, 0x98, 0x2e, 0x4d, 0xb7, 0x10, 0x30, 0x21, 0x2e, 0xee,
+ 0x00, 0x02, 0x30, 0x60, 0x7f, 0x25,
+ 0x2e, 0x79, 0x00, 0x60, 0x6f, 0x00, 0x90, 0x05, 0x2f, 0x00, 0x30, 0x21, 0x2e,
+ 0xea, 0x00, 0x15, 0x50, 0x21, 0x2e,
+ 0x64, 0xf5, 0x15, 0x52, 0x23, 0x2e, 0x60, 0xf5, 0x02, 0x32, 0x50, 0x6f, 0x00,
+ 0x90, 0x02, 0x2f, 0x03, 0x30, 0x27,
+ 0x2e, 0x78, 0x00, 0x07, 0x2e, 0x60, 0xf5, 0x1a, 0x09, 0x00, 0x91, 0xa3, 0x2f,
+ 0x19, 0x09, 0x00, 0x91, 0xa0, 0x2f,
+ 0x90, 0x6f, 0xa2, 0x6f, 0xb1, 0x6f, 0xc3, 0x6f, 0xd4, 0x6f, 0xe5, 0x6f, 0x7b,
+ 0x6f, 0xf6, 0x6f, 0x87, 0x6f, 0x40,
+ 0x5f, 0xc8, 0x2e, 0xc0, 0x50, 0xe7, 0x7f, 0xf6, 0x7f, 0x26, 0x30, 0x0f, 0x2e,
+ 0x61, 0xf5, 0x2f, 0x2e, 0x7c, 0x00,
+ 0x0f, 0x2e, 0x7c, 0x00, 0xbe, 0x09, 0xa2, 0x7f, 0x80, 0x7f, 0x80, 0xb3, 0xd5,
+ 0x7f, 0xc4, 0x7f, 0xb3, 0x7f, 0x91,
+ 0x7f, 0x7b, 0x7f, 0x0b, 0x2f, 0x23, 0x50, 0x1a, 0x25, 0x12, 0x40, 0x42, 0x7f,
+ 0x74, 0x82, 0x12, 0x40, 0x52, 0x7f,
+ 0x00, 0x2e, 0x00, 0x40, 0x60, 0x7f, 0x98, 0x2e, 0x6a, 0xd6, 0x81, 0x30, 0x01,
+ 0x2e, 0x7c, 0x00, 0x01, 0x08, 0x00,
+ 0xb2, 0x42, 0x2f, 0x03, 0x2e, 0x89, 0x00, 0x01, 0x2e, 0x89, 0x00, 0x97, 0xbc,
+ 0x06, 0xbc, 0x9f, 0xb8, 0x0f, 0xb8,
+ 0x00, 0x90, 0x23, 0x2e, 0xd8, 0x00, 0x10, 0x30, 0x01, 0x30, 0x2a, 0x2f, 0x03,
+ 0x2e, 0xd4, 0x00, 0x44, 0xb2, 0x05,
+ 0x2f, 0x47, 0xb2, 0x00, 0x30, 0x2d, 0x2f, 0x21, 0x2e, 0x7c, 0x00, 0x2b, 0x2d,
+ 0x03, 0x2e, 0xfd, 0xf5, 0x9e, 0xbc,
+ 0x9f, 0xb8, 0x40, 0x90, 0x14, 0x2f, 0x03, 0x2e, 0xfc, 0xf5, 0x99, 0xbc, 0x9f,
+ 0xb8, 0x40, 0x90, 0x0e, 0x2f, 0x03,
+ 0x2e, 0x49, 0xf1, 0x25, 0x54, 0x4a, 0x08, 0x40, 0x90, 0x08, 0x2f, 0x98, 0x2e,
+ 0x35, 0xb7, 0x00, 0xb2, 0x10, 0x30,
+ 0x03, 0x2f, 0x50, 0x30, 0x21, 0x2e, 0xd4, 0x00, 0x10, 0x2d, 0x98, 0x2e, 0xaf,
+ 0xb7, 0x00, 0x30, 0x21, 0x2e, 0x7c,
+ 0x00, 0x0a, 0x2d, 0x05, 0x2e, 0x69, 0xf7, 0x2d, 0xbd, 0x2f, 0xb9, 0x80, 0xb2,
+ 0x01, 0x2f, 0x21, 0x2e, 0x7d, 0x00,
+ 0x23, 0x2e, 0x7c, 0x00, 0xe0, 0x31, 0x21, 0x2e, 0x61, 0xf5, 0xf6, 0x6f, 0xe7,
+ 0x6f, 0x80, 0x6f, 0xa2, 0x6f, 0xb3,
+ 0x6f, 0xc4, 0x6f, 0xd5, 0x6f, 0x7b, 0x6f, 0x91, 0x6f, 0x40, 0x5f, 0xc8, 0x2e,
+ 0x60, 0x51, 0x0a, 0x25, 0x36, 0x88,
+ 0xf4, 0x7f, 0xeb, 0x7f, 0x00, 0x32, 0x31, 0x52, 0x32, 0x30, 0x13, 0x30, 0x98,
+ 0x2e, 0x15, 0xcb, 0x0a, 0x25, 0x33,
+ 0x84, 0xd2, 0x7f, 0x43, 0x30, 0x05, 0x50, 0x2d, 0x52, 0x98, 0x2e, 0x95, 0xc1,
+ 0xd2, 0x6f, 0x27, 0x52, 0x98, 0x2e,
+ 0xd7, 0xc7, 0x2a, 0x25, 0xb0, 0x86, 0xc0, 0x7f, 0xd3, 0x7f, 0xaf, 0x84, 0x29,
+ 0x50, 0xf1, 0x6f, 0x98, 0x2e, 0x4d,
+ 0xc8, 0x2a, 0x25, 0xae, 0x8a, 0xaa, 0x88, 0xf2, 0x6e, 0x2b, 0x50, 0xc1, 0x6f,
+ 0xd3, 0x6f, 0xf4, 0x7f, 0x98, 0x2e,
+ 0xb6, 0xc8, 0xe0, 0x6e, 0x00, 0xb2, 0x32, 0x2f, 0x33, 0x54, 0x83, 0x86, 0xf1,
+ 0x6f, 0xc3, 0x7f, 0x04, 0x30, 0x30,
+ 0x30, 0xf4, 0x7f, 0xd0, 0x7f, 0xb2, 0x7f, 0xe3, 0x30, 0xc5, 0x6f, 0x56, 0x40,
+ 0x45, 0x41, 0x28, 0x08, 0x03, 0x14,
+ 0x0e, 0xb4, 0x08, 0xbc, 0x82, 0x40, 0x10, 0x0a, 0x2f, 0x54, 0x26, 0x05, 0x91,
+ 0x7f, 0x44, 0x28, 0xa3, 0x7f, 0x98,
+ 0x2e, 0xd9, 0xc0, 0x08, 0xb9, 0x33, 0x30, 0x53, 0x09, 0xc1, 0x6f, 0xd3, 0x6f,
+ 0xf4, 0x6f, 0x83, 0x17, 0x47, 0x40,
+ 0x6c, 0x15, 0xb2, 0x6f, 0xbe, 0x09, 0x75, 0x0b, 0x90, 0x42, 0x45, 0x42, 0x51,
+ 0x0e, 0x32, 0xbc, 0x02, 0x89, 0xa1,
+ 0x6f, 0x7e, 0x86, 0xf4, 0x7f, 0xd0, 0x7f, 0xb2, 0x7f, 0x04, 0x30, 0x91, 0x6f,
+ 0xd6, 0x2f, 0xeb, 0x6f, 0xa0, 0x5e,
+ 0xb8, 0x2e, 0x03, 0x2e, 0x97, 0x00, 0x1b, 0xbc, 0x60, 0x50, 0x9f, 0xbc, 0x0c,
+ 0xb8, 0xf0, 0x7f, 0x40, 0xb2, 0xeb,
+ 0x7f, 0x2b, 0x2f, 0x03, 0x2e, 0x7f, 0x00, 0x41, 0x40, 0x01, 0x2e, 0xc8, 0x00,
+ 0x01, 0x1a, 0x11, 0x2f, 0x37, 0x58,
+ 0x23, 0x2e, 0xc8, 0x00, 0x10, 0x41, 0xa0, 0x7f, 0x38, 0x81, 0x01, 0x41, 0xd0,
+ 0x7f, 0xb1, 0x7f, 0x98, 0x2e, 0x64,
+ 0xcf, 0xd0, 0x6f, 0x07, 0x80, 0xa1, 0x6f, 0x11, 0x42, 0x00, 0x2e, 0xb1, 0x6f,
+ 0x01, 0x42, 0x11, 0x30, 0x01, 0x2e,
+ 0xfc, 0x00, 0x00, 0xa8, 0x03, 0x30, 0xcb, 0x22, 0x4a, 0x25, 0x01, 0x2e, 0x7f,
+ 0x00, 0x3c, 0x89, 0x35, 0x52, 0x05,
+ 0x54, 0x98, 0x2e, 0xc4, 0xce, 0xc1, 0x6f, 0xf0, 0x6f, 0x98, 0x2e, 0x95, 0xcf,
+ 0x04, 0x2d, 0x01, 0x30, 0xf0, 0x6f,
+ 0x98, 0x2e, 0x95, 0xcf, 0xeb, 0x6f, 0xa0, 0x5f, 0xb8, 0x2e, 0x03, 0x2e, 0xb3,
+ 0x00, 0x02, 0x32, 0xf0, 0x30, 0x03,
+ 0x31, 0x30, 0x50, 0x8a, 0x08, 0x08, 0x08, 0xcb, 0x08, 0xe0, 0x7f, 0x80, 0xb2,
+ 0xf3, 0x7f, 0xdb, 0x7f, 0x25, 0x2f,
+ 0x03, 0x2e, 0xca, 0x00, 0x41, 0x90, 0x04, 0x2f, 0x01, 0x30, 0x23, 0x2e, 0xca,
+ 0x00, 0x98, 0x2e, 0x3f, 0x03, 0xc0,
+ 0xb2, 0x05, 0x2f, 0x03, 0x2e, 0xda, 0x00, 0x00, 0x30, 0x41, 0x04, 0x23, 0x2e,
+ 0xda, 0x00, 0x98, 0x2e, 0x92, 0xb2,
+ 0x10, 0x25, 0xf0, 0x6f, 0x00, 0xb2, 0x05, 0x2f, 0x01, 0x2e, 0xda, 0x00, 0x02,
+ 0x30, 0x10, 0x04, 0x21, 0x2e, 0xda,
+ 0x00, 0x40, 0xb2, 0x01, 0x2f, 0x23, 0x2e, 0xc8, 0x01, 0xdb, 0x6f, 0xe0, 0x6f,
+ 0xd0, 0x5f, 0x80, 0x2e, 0x95, 0xcf,
+ 0x01, 0x30, 0xe0, 0x6f, 0x98, 0x2e, 0x95, 0xcf, 0x11, 0x30, 0x23, 0x2e, 0xca,
+ 0x00, 0xdb, 0x6f, 0xd0, 0x5f, 0xb8,
+ 0x2e, 0xd0, 0x50, 0x0a, 0x25, 0x33, 0x84, 0x55, 0x50, 0xd2, 0x7f, 0xe2, 0x7f,
+ 0x03, 0x8c, 0xc0, 0x7f, 0xbb, 0x7f,
+ 0x00, 0x30, 0x05, 0x5a, 0x39, 0x54, 0x51, 0x41, 0xa5, 0x7f, 0x96, 0x7f, 0x80,
+ 0x7f, 0x98, 0x2e, 0xd9, 0xc0, 0x05,
+ 0x30, 0xf5, 0x7f, 0x20, 0x25, 0x91, 0x6f, 0x3b, 0x58, 0x3d, 0x5c, 0x3b, 0x56,
+ 0x98, 0x2e, 0x67, 0xcc, 0xc1, 0x6f,
+ 0xd5, 0x6f, 0x52, 0x40, 0x50, 0x43, 0xc1, 0x7f, 0xd5, 0x7f, 0x10, 0x25, 0x98,
+ 0x2e, 0xfe, 0xc9, 0x10, 0x25, 0x98,
+ 0x2e, 0x74, 0xc0, 0x86, 0x6f, 0x30, 0x28, 0x92, 0x6f, 0x82, 0x8c, 0xa5, 0x6f,
+ 0x6f, 0x52, 0x69, 0x0e, 0x39, 0x54,
+ 0xdb, 0x2f, 0x19, 0xa0, 0x15, 0x30, 0x03, 0x2f, 0x00, 0x30, 0x21, 0x2e, 0x81,
+ 0x01, 0x0a, 0x2d, 0x01, 0x2e, 0x81,
+ 0x01, 0x05, 0x28, 0x42, 0x36, 0x21, 0x2e, 0x81, 0x01, 0x02, 0x0e, 0x01, 0x2f,
+ 0x98, 0x2e, 0xf3, 0x03, 0x57, 0x50,
+ 0x12, 0x30, 0x01, 0x40, 0x98, 0x2e, 0xfe, 0xc9, 0x51, 0x6f, 0x0b, 0x5c, 0x8e,
+ 0x0e, 0x3b, 0x6f, 0x57, 0x58, 0x02,
+ 0x30, 0x21, 0x2e, 0x95, 0x01, 0x45, 0x6f, 0x2a, 0x8d, 0xd2, 0x7f, 0xcb, 0x7f,
+ 0x13, 0x2f, 0x02, 0x30, 0x3f, 0x50,
+ 0xd2, 0x7f, 0xa8, 0x0e, 0x0e, 0x2f, 0xc0, 0x6f, 0x53, 0x54, 0x02, 0x00, 0x51,
+ 0x54, 0x42, 0x0e, 0x10, 0x30, 0x59,
+ 0x52, 0x02, 0x30, 0x01, 0x2f, 0x00, 0x2e, 0x03, 0x2d, 0x50, 0x42, 0x42, 0x42,
+ 0x12, 0x30, 0xd2, 0x7f, 0x80, 0xb2,
+ 0x03, 0x2f, 0x00, 0x30, 0x21, 0x2e, 0x80, 0x01, 0x12, 0x2d, 0x01, 0x2e, 0xc9,
+ 0x00, 0x02, 0x80, 0x05, 0x2e, 0x80,
+ 0x01, 0x11, 0x30, 0x91, 0x28, 0x00, 0x40, 0x25, 0x2e, 0x80, 0x01, 0x10, 0x0e,
+ 0x05, 0x2f, 0x01, 0x2e, 0x7f, 0x01,
+ 0x01, 0x90, 0x01, 0x2f, 0x98, 0x2e, 0xf3, 0x03, 0x00, 0x2e, 0xa0, 0x41, 0x01,
+ 0x90, 0xa6, 0x7f, 0x90, 0x2e, 0xe3,
+ 0xb4, 0x01, 0x2e, 0x95, 0x01, 0x00, 0xa8, 0x90, 0x2e, 0xe3, 0xb4, 0x5b, 0x54,
+ 0x95, 0x80, 0x82, 0x40, 0x80, 0xb2,
+ 0x02, 0x40, 0x2d, 0x8c, 0x3f, 0x52, 0x96, 0x7f, 0x90, 0x2e, 0xc2, 0xb3, 0x29,
+ 0x0e, 0x76, 0x2f, 0x01, 0x2e, 0xc9,
+ 0x00, 0x00, 0x40, 0x81, 0x28, 0x45, 0x52, 0xb3, 0x30, 0x98, 0x2e, 0x0f, 0xca,
+ 0x5d, 0x54, 0x80, 0x7f, 0x00, 0x2e,
+ 0xa1, 0x40, 0x72, 0x7f, 0x82, 0x80, 0x82, 0x40, 0x60, 0x7f, 0x98, 0x2e, 0xfe,
+ 0xc9, 0x10, 0x25, 0x98, 0x2e, 0x74,
+ 0xc0, 0x62, 0x6f, 0x05, 0x30, 0x87, 0x40, 0xc0, 0x91, 0x04, 0x30, 0x05, 0x2f,
+ 0x05, 0x2e, 0x83, 0x01, 0x80, 0xb2,
+ 0x14, 0x30, 0x00, 0x2f, 0x04, 0x30, 0x05, 0x2e, 0xc9, 0x00, 0x73, 0x6f, 0x81,
+ 0x40, 0xe2, 0x40, 0x69, 0x04, 0x11,
+ 0x0f, 0xe1, 0x40, 0x16, 0x30, 0xfe, 0x29, 0xcb, 0x40, 0x02, 0x2f, 0x83, 0x6f,
+ 0x83, 0x0f, 0x22, 0x2f, 0x47, 0x56,
+ 0x13, 0x0f, 0x12, 0x30, 0x77, 0x2f, 0x49, 0x54, 0x42, 0x0e, 0x12, 0x30, 0x73,
+ 0x2f, 0x00, 0x91, 0x0a, 0x2f, 0x01,
+ 0x2e, 0x8b, 0x01, 0x19, 0xa8, 0x02, 0x30, 0x6c, 0x2f, 0x63, 0x50, 0x00, 0x2e,
+ 0x17, 0x42, 0x05, 0x42, 0x68, 0x2c,
+ 0x12, 0x30, 0x0b, 0x25, 0x08, 0x0f, 0x50, 0x30, 0x02, 0x2f, 0x21, 0x2e, 0x83,
+ 0x01, 0x03, 0x2d, 0x40, 0x30, 0x21,
+ 0x2e, 0x83, 0x01, 0x2b, 0x2e, 0x85, 0x01, 0x5a, 0x2c, 0x12, 0x30, 0x00, 0x91,
+ 0x2b, 0x25, 0x04, 0x2f, 0x63, 0x50,
+ 0x02, 0x30, 0x17, 0x42, 0x17, 0x2c, 0x02, 0x42, 0x98, 0x2e, 0xfe, 0xc9, 0x10,
+ 0x25, 0x98, 0x2e, 0x74, 0xc0, 0x05,
+ 0x2e, 0xc9, 0x00, 0x81, 0x84, 0x5b, 0x30, 0x82, 0x40, 0x37, 0x2e, 0x83, 0x01,
+ 0x02, 0x0e, 0x07, 0x2f, 0x5f, 0x52,
+ 0x40, 0x30, 0x62, 0x40, 0x41, 0x40, 0x91, 0x0e, 0x01, 0x2f, 0x21, 0x2e, 0x83,
+ 0x01, 0x05, 0x30, 0x2b, 0x2e, 0x85,
+ 0x01, 0x12, 0x30, 0x36, 0x2c, 0x16, 0x30, 0x15, 0x25, 0x81, 0x7f, 0x98, 0x2e,
+ 0xfe, 0xc9, 0x10, 0x25, 0x98, 0x2e,
+ 0x74, 0xc0, 0x19, 0xa2, 0x16, 0x30, 0x15, 0x2f, 0x05, 0x2e, 0x97, 0x01, 0x80,
+ 0x6f, 0x82, 0x0e, 0x05, 0x2f, 0x01,
+ 0x2e, 0x86, 0x01, 0x06, 0x28, 0x21, 0x2e, 0x86, 0x01, 0x0b, 0x2d, 0x03, 0x2e,
+ 0x87, 0x01, 0x5f, 0x54, 0x4e, 0x28,
+ 0x91, 0x42, 0x00, 0x2e, 0x82, 0x40, 0x90, 0x0e, 0x01, 0x2f, 0x21, 0x2e, 0x88,
+ 0x01, 0x02, 0x30, 0x13, 0x2c, 0x05,
+ 0x30, 0xc0, 0x6f, 0x08, 0x1c, 0xa8, 0x0f, 0x16, 0x30, 0x05, 0x30, 0x5b, 0x50,
+ 0x09, 0x2f, 0x02, 0x80, 0x2d, 0x2e,
+ 0x82, 0x01, 0x05, 0x42, 0x05, 0x80, 0x00, 0x2e, 0x02, 0x42, 0x3e, 0x80, 0x00,
+ 0x2e, 0x06, 0x42, 0x02, 0x30, 0x90,
+ 0x6f, 0x3e, 0x88, 0x01, 0x40, 0x04, 0x41, 0x4c, 0x28, 0x01, 0x42, 0x07, 0x80,
+ 0x10, 0x25, 0x24, 0x40, 0x00, 0x40,
+ 0x00, 0xa8, 0xf5, 0x22, 0x23, 0x29, 0x44, 0x42, 0x7a, 0x82, 0x7e, 0x88, 0x43,
+ 0x40, 0x04, 0x41, 0x00, 0xab, 0xf5,
+ 0x23, 0xdf, 0x28, 0x43, 0x42, 0xd9, 0xa0, 0x14, 0x2f, 0x00, 0x90, 0x02, 0x2f,
+ 0xd2, 0x6f, 0x81, 0xb2, 0x05, 0x2f,
+ 0x63, 0x54, 0x06, 0x28, 0x90, 0x42, 0x85, 0x42, 0x09, 0x2c, 0x02, 0x30, 0x5b,
+ 0x50, 0x03, 0x80, 0x29, 0x2e, 0x7e,
+ 0x01, 0x2b, 0x2e, 0x82, 0x01, 0x05, 0x42, 0x12, 0x30, 0x2b, 0x2e, 0x83, 0x01,
+ 0x45, 0x82, 0x00, 0x2e, 0x40, 0x40,
+ 0x7a, 0x82, 0x02, 0xa0, 0x08, 0x2f, 0x63, 0x50, 0x3b, 0x30, 0x15, 0x42, 0x05,
+ 0x42, 0x37, 0x80, 0x37, 0x2e, 0x7e,
+ 0x01, 0x05, 0x42, 0x12, 0x30, 0x01, 0x2e, 0xc9, 0x00, 0x02, 0x8c, 0x40, 0x40,
+ 0x84, 0x41, 0x7a, 0x8c, 0x04, 0x0f,
+ 0x03, 0x2f, 0x01, 0x2e, 0x8b, 0x01, 0x19, 0xa4, 0x04, 0x2f, 0x2b, 0x2e, 0x82,
+ 0x01, 0x98, 0x2e, 0xf3, 0x03, 0x12,
+ 0x30, 0x81, 0x90, 0x61, 0x52, 0x08, 0x2f, 0x65, 0x42, 0x65, 0x42, 0x43, 0x80,
+ 0x39, 0x84, 0x82, 0x88, 0x05, 0x42,
+ 0x45, 0x42, 0x85, 0x42, 0x05, 0x43, 0x00, 0x2e, 0x80, 0x41, 0x00, 0x90, 0x90,
+ 0x2e, 0xe1, 0xb4, 0x65, 0x54, 0xc1,
+ 0x6f, 0x80, 0x40, 0x00, 0xb2, 0x43, 0x58, 0x69, 0x50, 0x44, 0x2f, 0x55, 0x5c,
+ 0xb7, 0x87, 0x8c, 0x0f, 0x0d, 0x2e,
+ 0x96, 0x01, 0xc4, 0x40, 0x36, 0x2f, 0x41, 0x56, 0x8b, 0x0e, 0x2a, 0x2f, 0x0b,
+ 0x52, 0xa1, 0x0e, 0x0a, 0x2f, 0x05,
+ 0x2e, 0x8f, 0x01, 0x14, 0x25, 0x98, 0x2e, 0xfe, 0xc9, 0x4b, 0x54, 0x02, 0x0f,
+ 0x69, 0x50, 0x05, 0x30, 0x65, 0x54,
+ 0x15, 0x2f, 0x03, 0x2e, 0x8e, 0x01, 0x4d, 0x5c, 0x8e, 0x0f, 0x3a, 0x2f, 0x05,
+ 0x2e, 0x8f, 0x01, 0x98, 0x2e, 0xfe,
+ 0xc9, 0x4f, 0x54, 0x82, 0x0f, 0x05, 0x30, 0x69, 0x50, 0x65, 0x54, 0x30, 0x2f,
+ 0x6d, 0x52, 0x15, 0x30, 0x42, 0x8c,
+ 0x45, 0x42, 0x04, 0x30, 0x2b, 0x2c, 0x84, 0x43, 0x6b, 0x52, 0x42, 0x8c, 0x00,
+ 0x2e, 0x85, 0x43, 0x15, 0x30, 0x24,
+ 0x2c, 0x45, 0x42, 0x8e, 0x0f, 0x20, 0x2f, 0x0d, 0x2e, 0x8e, 0x01, 0xb1, 0x0e,
+ 0x1c, 0x2f, 0x23, 0x2e, 0x8e, 0x01,
+ 0x1a, 0x2d, 0x0e, 0x0e, 0x17, 0x2f, 0xa1, 0x0f, 0x15, 0x2f, 0x23, 0x2e, 0x8d,
+ 0x01, 0x13, 0x2d, 0x98, 0x2e, 0x74,
+ 0xc0, 0x43, 0x54, 0xc2, 0x0e, 0x0a, 0x2f, 0x65, 0x50, 0x04, 0x80, 0x0b, 0x30,
+ 0x06, 0x82, 0x0b, 0x42, 0x79, 0x80,
+ 0x41, 0x40, 0x12, 0x30, 0x25, 0x2e, 0x8c, 0x01, 0x01, 0x42, 0x05, 0x30, 0x69,
+ 0x50, 0x65, 0x54, 0x84, 0x82, 0x43,
+ 0x84, 0xbe, 0x8c, 0x84, 0x40, 0x86, 0x41, 0x26, 0x29, 0x94, 0x42, 0xbe, 0x8e,
+ 0xd5, 0x7f, 0x19, 0xa1, 0x43, 0x40,
+ 0x0b, 0x2e, 0x8c, 0x01, 0x84, 0x40, 0xc7, 0x41, 0x5d, 0x29, 0x27, 0x29, 0x45,
+ 0x42, 0x84, 0x42, 0xc2, 0x7f, 0x01,
+ 0x2f, 0xc0, 0xb3, 0x1d, 0x2f, 0x05, 0x2e, 0x94, 0x01, 0x99, 0xa0, 0x01, 0x2f,
+ 0x80, 0xb3, 0x13, 0x2f, 0x80, 0xb3,
+ 0x18, 0x2f, 0xc0, 0xb3, 0x16, 0x2f, 0x12, 0x40, 0x01, 0x40, 0x92, 0x7f, 0x98,
+ 0x2e, 0x74, 0xc0, 0x92, 0x6f, 0x10,
+ 0x0f, 0x20, 0x30, 0x03, 0x2f, 0x10, 0x30, 0x21, 0x2e, 0x7e, 0x01, 0x0a, 0x2d,
+ 0x21, 0x2e, 0x7e, 0x01, 0x07, 0x2d,
+ 0x20, 0x30, 0x21, 0x2e, 0x7e, 0x01, 0x03, 0x2d, 0x10, 0x30, 0x21, 0x2e, 0x7e,
+ 0x01, 0xc2, 0x6f, 0x01, 0x2e, 0xc9,
+ 0x00, 0xbc, 0x84, 0x02, 0x80, 0x82, 0x40, 0x00, 0x40, 0x90, 0x0e, 0xd5, 0x6f,
+ 0x02, 0x2f, 0x15, 0x30, 0x98, 0x2e,
+ 0xf3, 0x03, 0x41, 0x91, 0x05, 0x30, 0x07, 0x2f, 0x67, 0x50, 0x3d, 0x80, 0x2b,
+ 0x2e, 0x8f, 0x01, 0x05, 0x42, 0x04,
+ 0x80, 0x00, 0x2e, 0x05, 0x42, 0x02, 0x2c, 0x00, 0x30, 0x00, 0x30, 0xa2, 0x6f,
+ 0x98, 0x8a, 0x86, 0x40, 0x80, 0xa7,
+ 0x05, 0x2f, 0x98, 0x2e, 0xf3, 0x03, 0xc0, 0x30, 0x21, 0x2e, 0x95, 0x01, 0x06,
+ 0x25, 0x1a, 0x25, 0xe2, 0x6f, 0x76,
+ 0x82, 0x96, 0x40, 0x56, 0x43, 0x51, 0x0e, 0xfb, 0x2f, 0xbb, 0x6f, 0x30, 0x5f,
+ 0xb8, 0x2e, 0x01, 0x2e, 0xb8, 0x00,
+ 0x01, 0x31, 0x41, 0x08, 0x40, 0xb2, 0x20, 0x50, 0xf2, 0x30, 0x02, 0x08, 0xfb,
+ 0x7f, 0x01, 0x30, 0x10, 0x2f, 0x05,
+ 0x2e, 0xcc, 0x00, 0x81, 0x90, 0xe0, 0x7f, 0x03, 0x2f, 0x23, 0x2e, 0xcc, 0x00,
+ 0x98, 0x2e, 0x55, 0xb6, 0x98, 0x2e,
+ 0x1d, 0xb5, 0x10, 0x25, 0xfb, 0x6f, 0xe0, 0x6f, 0xe0, 0x5f, 0x80, 0x2e, 0x95,
+ 0xcf, 0x98, 0x2e, 0x95, 0xcf, 0x10,
+ 0x30, 0x21, 0x2e, 0xcc, 0x00, 0xfb, 0x6f, 0xe0, 0x5f, 0xb8, 0x2e, 0x00, 0x51,
+ 0x05, 0x58, 0xeb, 0x7f, 0x2a, 0x25,
+ 0x89, 0x52, 0x6f, 0x5a, 0x89, 0x50, 0x13, 0x41, 0x06, 0x40, 0xb3, 0x01, 0x16,
+ 0x42, 0xcb, 0x16, 0x06, 0x40, 0xf3,
+ 0x02, 0x13, 0x42, 0x65, 0x0e, 0xf5, 0x2f, 0x05, 0x40, 0x14, 0x30, 0x2c, 0x29,
+ 0x04, 0x42, 0x08, 0xa1, 0x00, 0x30,
+ 0x90, 0x2e, 0x52, 0xb6, 0xb3, 0x88, 0xb0, 0x8a, 0xb6, 0x84, 0xa4, 0x7f, 0xc4,
+ 0x7f, 0xb5, 0x7f, 0xd5, 0x7f, 0x92,
+ 0x7f, 0x73, 0x30, 0x04, 0x30, 0x55, 0x40, 0x42, 0x40, 0x8a, 0x17, 0xf3, 0x08,
+ 0x6b, 0x01, 0x90, 0x02, 0x53, 0xb8,
+ 0x4b, 0x82, 0xad, 0xbe, 0x71, 0x7f, 0x45, 0x0a, 0x09, 0x54, 0x84, 0x7f, 0x98,
+ 0x2e, 0xd9, 0xc0, 0xa3, 0x6f, 0x7b,
+ 0x54, 0xd0, 0x42, 0xa3, 0x7f, 0xf2, 0x7f, 0x60, 0x7f, 0x20, 0x25, 0x71, 0x6f,
+ 0x75, 0x5a, 0x77, 0x58, 0x79, 0x5c,
+ 0x75, 0x56, 0x98, 0x2e, 0x67, 0xcc, 0xb1, 0x6f, 0x62, 0x6f, 0x50, 0x42, 0xb1,
+ 0x7f, 0xb3, 0x30, 0x10, 0x25, 0x98,
+ 0x2e, 0x0f, 0xca, 0x84, 0x6f, 0x20, 0x29, 0x71, 0x6f, 0x92, 0x6f, 0xa5, 0x6f,
+ 0x76, 0x82, 0x6a, 0x0e, 0x73, 0x30,
+ 0x00, 0x30, 0xd0, 0x2f, 0xd2, 0x6f, 0xd1, 0x7f, 0xb4, 0x7f, 0x98, 0x2e, 0x2b,
+ 0xb7, 0x15, 0xbd, 0x0b, 0xb8, 0x02,
+ 0x0a, 0xc2, 0x6f, 0xc0, 0x7f, 0x98, 0x2e, 0x2b, 0xb7, 0x15, 0xbd, 0x0b, 0xb8,
+ 0x42, 0x0a, 0xc0, 0x6f, 0x08, 0x17,
+ 0x41, 0x18, 0x89, 0x16, 0xe1, 0x18, 0xd0, 0x18, 0xa1, 0x7f, 0x27, 0x25, 0x16,
+ 0x25, 0x98, 0x2e, 0x79, 0xc0, 0x8b,
+ 0x54, 0x90, 0x7f, 0xb3, 0x30, 0x82, 0x40, 0x80, 0x90, 0x0d, 0x2f, 0x7d, 0x52,
+ 0x92, 0x6f, 0x98, 0x2e, 0x0f, 0xca,
+ 0xb2, 0x6f, 0x90, 0x0e, 0x06, 0x2f, 0x8b, 0x50, 0x14, 0x30, 0x42, 0x6f, 0x51,
+ 0x6f, 0x14, 0x42, 0x12, 0x42, 0x01,
+ 0x42, 0x00, 0x2e, 0x31, 0x6f, 0x98, 0x2e, 0x74, 0xc0, 0x41, 0x6f, 0x80, 0x7f,
+ 0x98, 0x2e, 0x74, 0xc0, 0x82, 0x6f,
+ 0x10, 0x04, 0x43, 0x52, 0x01, 0x0f, 0x05, 0x2e, 0xcb, 0x00, 0x00, 0x30, 0x04,
+ 0x30, 0x21, 0x2f, 0x51, 0x6f, 0x43,
+ 0x58, 0x8c, 0x0e, 0x04, 0x30, 0x1c, 0x2f, 0x85, 0x88, 0x41, 0x6f, 0x04, 0x41,
+ 0x8c, 0x0f, 0x04, 0x30, 0x16, 0x2f,
+ 0x84, 0x88, 0x00, 0x2e, 0x04, 0x41, 0x04, 0x05, 0x8c, 0x0e, 0x04, 0x30, 0x0f,
+ 0x2f, 0x82, 0x88, 0x31, 0x6f, 0x04,
+ 0x41, 0x04, 0x05, 0x8c, 0x0e, 0x04, 0x30, 0x08, 0x2f, 0x83, 0x88, 0x00, 0x2e,
+ 0x04, 0x41, 0x8c, 0x0f, 0x04, 0x30,
+ 0x02, 0x2f, 0x21, 0x2e, 0xad, 0x01, 0x14, 0x30, 0x00, 0x91, 0x14, 0x2f, 0x03,
+ 0x2e, 0xa1, 0x01, 0x41, 0x90, 0x0e,
+ 0x2f, 0x03, 0x2e, 0xad, 0x01, 0x14, 0x30, 0x4c, 0x28, 0x23, 0x2e, 0xad, 0x01,
+ 0x46, 0xa0, 0x06, 0x2f, 0x81, 0x84,
+ 0x8d, 0x52, 0x48, 0x82, 0x82, 0x40, 0x21, 0x2e, 0xa1, 0x01, 0x42, 0x42, 0x5c,
+ 0x2c, 0x02, 0x30, 0x05, 0x2e, 0xaa,
+ 0x01, 0x80, 0xb2, 0x02, 0x30, 0x55, 0x2f, 0x03, 0x2e, 0xa9, 0x01, 0x92, 0x6f,
+ 0xb3, 0x30, 0x98, 0x2e, 0x0f, 0xca,
+ 0xb2, 0x6f, 0x90, 0x0f, 0x00, 0x30, 0x02, 0x30, 0x4a, 0x2f, 0xa2, 0x6f, 0x87,
+ 0x52, 0x91, 0x00, 0x85, 0x52, 0x51,
+ 0x0e, 0x02, 0x2f, 0x00, 0x2e, 0x43, 0x2c, 0x02, 0x30, 0xc2, 0x6f, 0x7f, 0x52,
+ 0x91, 0x0e, 0x02, 0x30, 0x3c, 0x2f,
+ 0x51, 0x6f, 0x81, 0x54, 0x98, 0x2e, 0xfe, 0xc9, 0x10, 0x25, 0xb3, 0x30, 0x21,
+ 0x25, 0x98, 0x2e, 0x0f, 0xca, 0x32,
+ 0x6f, 0xc0, 0x7f, 0xb3, 0x30, 0x12, 0x25, 0x98, 0x2e, 0x0f, 0xca, 0x42, 0x6f,
+ 0xb0, 0x7f, 0xb3, 0x30, 0x12, 0x25,
+ 0x98, 0x2e, 0x0f, 0xca, 0xb2, 0x6f, 0x90, 0x28, 0x83, 0x52, 0x98, 0x2e, 0xfe,
+ 0xc9, 0xc2, 0x6f, 0x90, 0x0f, 0x00,
+ 0x30, 0x02, 0x30, 0x1d, 0x2f, 0x05, 0x2e, 0xa1, 0x01, 0x80, 0xb2, 0x12, 0x30,
+ 0x0f, 0x2f, 0x42, 0x6f, 0x03, 0x2e,
+ 0xab, 0x01, 0x91, 0x0e, 0x02, 0x30, 0x12, 0x2f, 0x52, 0x6f, 0x03, 0x2e, 0xac,
+ 0x01, 0x91, 0x0f, 0x02, 0x30, 0x0c,
+ 0x2f, 0x21, 0x2e, 0xaa, 0x01, 0x0a, 0x2c, 0x12, 0x30, 0x03, 0x2e, 0xcb, 0x00,
+ 0x8d, 0x58, 0x08, 0x89, 0x41, 0x40,
+ 0x11, 0x43, 0x00, 0x43, 0x25, 0x2e, 0xa1, 0x01, 0xd4, 0x6f, 0x8f, 0x52, 0x00,
+ 0x43, 0x3a, 0x89, 0x00, 0x2e, 0x10,
+ 0x43, 0x10, 0x43, 0x61, 0x0e, 0xfb, 0x2f, 0x03, 0x2e, 0xa0, 0x01, 0x11, 0x1a,
+ 0x02, 0x2f, 0x02, 0x25, 0x21, 0x2e,
+ 0xa0, 0x01, 0xeb, 0x6f, 0x00, 0x5f, 0xb8, 0x2e, 0x91, 0x52, 0x10, 0x30, 0x02,
+ 0x30, 0x95, 0x56, 0x52, 0x42, 0x4b,
+ 0x0e, 0xfc, 0x2f, 0x8d, 0x54, 0x88, 0x82, 0x93, 0x56, 0x80, 0x42, 0x53, 0x42,
+ 0x40, 0x42, 0x42, 0x86, 0x83, 0x54,
+ 0xc0, 0x2e, 0xc2, 0x42, 0x00, 0x2e, 0xa3, 0x52, 0x00, 0x51, 0x52, 0x40, 0x47,
+ 0x40, 0x1a, 0x25, 0x01, 0x2e, 0x97,
+ 0x00, 0x8f, 0xbe, 0x72, 0x86, 0xfb, 0x7f, 0x0b, 0x30, 0x7c, 0xbf, 0xa5, 0x50,
+ 0x10, 0x08, 0xdf, 0xba, 0x70, 0x88,
+ 0xf8, 0xbf, 0xcb, 0x42, 0xd3, 0x7f, 0x6c, 0xbb, 0xfc, 0xbb, 0xc5, 0x0a, 0x90,
+ 0x7f, 0x1b, 0x7f, 0x0b, 0x43, 0xc0,
+ 0xb2, 0xe5, 0x7f, 0xb7, 0x7f, 0xa6, 0x7f, 0xc4, 0x7f, 0x90, 0x2e, 0x1c, 0xb7,
+ 0x07, 0x2e, 0xd2, 0x00, 0xc0, 0xb2,
+ 0x0b, 0x2f, 0x97, 0x52, 0x01, 0x2e, 0xcd, 0x00, 0x82, 0x7f, 0x98, 0x2e, 0xbb,
+ 0xcc, 0x0b, 0x30, 0x37, 0x2e, 0xd2,
+ 0x00, 0x82, 0x6f, 0x90, 0x6f, 0x1a, 0x25, 0x00, 0xb2, 0x8b, 0x7f, 0x14, 0x2f,
+ 0xa6, 0xbd, 0x25, 0xbd, 0xb6, 0xb9,
+ 0x2f, 0xb9, 0x80, 0xb2, 0xd4, 0xb0, 0x0c, 0x2f, 0x99, 0x54, 0x9b, 0x56, 0x0b,
+ 0x30, 0x0b, 0x2e, 0xb1, 0x00, 0xa1,
+ 0x58, 0x9b, 0x42, 0xdb, 0x42, 0x6c, 0x09, 0x2b, 0x2e, 0xb1, 0x00, 0x8b, 0x42,
+ 0xcb, 0x42, 0x86, 0x7f, 0x73, 0x84,
+ 0xa7, 0x56, 0xc3, 0x08, 0x39, 0x52, 0x05, 0x50, 0x72, 0x7f, 0x63, 0x7f, 0x98,
+ 0x2e, 0xc2, 0xc0, 0xe1, 0x6f, 0x62,
+ 0x6f, 0xd1, 0x0a, 0x01, 0x2e, 0xcd, 0x00, 0xd5, 0x6f, 0xc4, 0x6f, 0x72, 0x6f,
+ 0x97, 0x52, 0x9d, 0x5c, 0x98, 0x2e,
+ 0x06, 0xcd, 0x23, 0x6f, 0x90, 0x6f, 0x99, 0x52, 0xc0, 0xb2, 0x04, 0xbd, 0x54,
+ 0x40, 0xaf, 0xb9, 0x45, 0x40, 0xe1,
+ 0x7f, 0x02, 0x30, 0x06, 0x2f, 0xc0, 0xb2, 0x02, 0x30, 0x03, 0x2f, 0x9b, 0x5c,
+ 0x12, 0x30, 0x94, 0x43, 0x85, 0x43,
+ 0x03, 0xbf, 0x6f, 0xbb, 0x80, 0xb3, 0x20, 0x2f, 0x06, 0x6f, 0x26, 0x01, 0x16,
+ 0x6f, 0x6e, 0x03, 0x45, 0x42, 0xc0,
+ 0x90, 0x29, 0x2e, 0xce, 0x00, 0x9b, 0x52, 0x14, 0x2f, 0x9b, 0x5c, 0x00, 0x2e,
+ 0x93, 0x41, 0x86, 0x41, 0xe3, 0x04,
+ 0xae, 0x07, 0x80, 0xab, 0x04, 0x2f, 0x80, 0x91, 0x0a, 0x2f, 0x86, 0x6f, 0x73,
+ 0x0f, 0x07, 0x2f, 0x83, 0x6f, 0xc0,
+ 0xb2, 0x04, 0x2f, 0x54, 0x42, 0x45, 0x42, 0x12, 0x30, 0x04, 0x2c, 0x11, 0x30,
+ 0x02, 0x2c, 0x11, 0x30, 0x11, 0x30,
+ 0x02, 0xbc, 0x0f, 0xb8, 0xd2, 0x7f, 0x00, 0xb2, 0x0a, 0x2f, 0x01, 0x2e, 0xfc,
+ 0x00, 0x05, 0x2e, 0xc7, 0x01, 0x10,
+ 0x1a, 0x02, 0x2f, 0x21, 0x2e, 0xc7, 0x01, 0x03, 0x2d, 0x02, 0x2c, 0x01, 0x30,
+ 0x01, 0x30, 0xb0, 0x6f, 0x98, 0x2e,
+ 0x95, 0xcf, 0xd1, 0x6f, 0xa0, 0x6f, 0x98, 0x2e, 0x95, 0xcf, 0xe2, 0x6f, 0x9f,
+ 0x52, 0x01, 0x2e, 0xce, 0x00, 0x82,
+ 0x40, 0x50, 0x42, 0x0c, 0x2c, 0x42, 0x42, 0x11, 0x30, 0x23, 0x2e, 0xd2, 0x00,
+ 0x01, 0x30, 0xb0, 0x6f, 0x98, 0x2e,
+ 0x95, 0xcf, 0xa0, 0x6f, 0x01, 0x30, 0x98, 0x2e, 0x95, 0xcf, 0x00, 0x2e, 0xfb,
+ 0x6f, 0x00, 0x5f, 0xb8, 0x2e, 0x83,
+ 0x86, 0x01, 0x30, 0x00, 0x30, 0x94, 0x40, 0x24, 0x18, 0x06, 0x00, 0x53, 0x0e,
+ 0x4f, 0x02, 0xf9, 0x2f, 0xb8, 0x2e,
+ 0xa9, 0x52, 0x00, 0x2e, 0x60, 0x40, 0x41, 0x40, 0x0d, 0xbc, 0x98, 0xbc, 0xc0,
+ 0x2e, 0x01, 0x0a, 0x0f, 0xb8, 0xab,
+ 0x52, 0x53, 0x3c, 0x52, 0x40, 0x40, 0x40, 0x4b, 0x00, 0x82, 0x16, 0x26, 0xb9,
+ 0x01, 0xb8, 0x41, 0x40, 0x10, 0x08,
+ 0x97, 0xb8, 0x01, 0x08, 0xc0, 0x2e, 0x11, 0x30, 0x01, 0x08, 0x43, 0x86, 0x25,
+ 0x40, 0x04, 0x40, 0xd8, 0xbe, 0x2c,
+ 0x0b, 0x22, 0x11, 0x54, 0x42, 0x03, 0x80, 0x4b, 0x0e, 0xf6, 0x2f, 0xb8, 0x2e,
+ 0x9f, 0x50, 0x10, 0x50, 0xad, 0x52,
+ 0x05, 0x2e, 0xd3, 0x00, 0xfb, 0x7f, 0x00, 0x2e, 0x13, 0x40, 0x93, 0x42, 0x41,
+ 0x0e, 0xfb, 0x2f, 0x98, 0x2e, 0xa5,
+ 0xb7, 0x98, 0x2e, 0x87, 0xcf, 0x01, 0x2e, 0xd9, 0x00, 0x00, 0xb2, 0xfb, 0x6f,
+ 0x0b, 0x2f, 0x01, 0x2e, 0x69, 0xf7,
+ 0xb1, 0x3f, 0x01, 0x08, 0x01, 0x30, 0xf0, 0x5f, 0x23, 0x2e, 0xd9, 0x00, 0x21,
+ 0x2e, 0x69, 0xf7, 0x80, 0x2e, 0x7a,
+ 0xb7, 0xf0, 0x5f, 0xb8, 0x2e, 0x01, 0x2e, 0xc0, 0xf8, 0x03, 0x2e, 0xfc, 0xf5,
+ 0x15, 0x54, 0xaf, 0x56, 0x82, 0x08,
+ 0x0b, 0x2e, 0x69, 0xf7, 0xcb, 0x0a, 0xb1, 0x58, 0x80, 0x90, 0xdd, 0xbe, 0x4c,
+ 0x08, 0x5f, 0xb9, 0x59, 0x22, 0x80,
+ 0x90, 0x07, 0x2f, 0x03, 0x34, 0xc3, 0x08, 0xf2, 0x3a, 0x0a, 0x08, 0x02, 0x35,
+ 0xc0, 0x90, 0x4a, 0x0a, 0x48, 0x22,
+ 0xc0, 0x2e, 0x23, 0x2e, 0xfc, 0xf5, 0x10, 0x50, 0xfb, 0x7f, 0x98, 0x2e, 0x56,
+ 0xc7, 0x98, 0x2e, 0x49, 0xc3, 0x10,
+ 0x30, 0xfb, 0x6f, 0xf0, 0x5f, 0x21, 0x2e, 0xcc, 0x00, 0x21, 0x2e, 0xca, 0x00,
+ 0xb8, 0x2e, 0x03, 0x2e, 0xd3, 0x00,
+ 0x16, 0xb8, 0x02, 0x34, 0x4a, 0x0c, 0x21, 0x2e, 0x2d, 0xf5, 0xc0, 0x2e, 0x23,
+ 0x2e, 0xd3, 0x00, 0x03, 0xbc, 0x21,
+ 0x2e, 0xd5, 0x00, 0x03, 0x2e, 0xd5, 0x00, 0x40, 0xb2, 0x10, 0x30, 0x21, 0x2e,
+ 0x77, 0x00, 0x01, 0x30, 0x05, 0x2f,
+ 0x05, 0x2e, 0xd8, 0x00, 0x80, 0x90, 0x01, 0x2f, 0x23, 0x2e, 0x6f, 0xf5, 0xc0,
+ 0x2e, 0x21, 0x2e, 0xd9, 0x00, 0x11,
+ 0x30, 0x81, 0x08, 0x01, 0x2e, 0x6a, 0xf7, 0x71, 0x3f, 0x23, 0xbd, 0x01, 0x08,
+ 0x02, 0x0a, 0xc0, 0x2e, 0x21, 0x2e,
+ 0x6a, 0xf7, 0x30, 0x25, 0x00, 0x30, 0x21, 0x2e, 0x5a, 0xf5, 0x10, 0x50, 0x21,
+ 0x2e, 0x7b, 0x00, 0x21, 0x2e, 0x7c,
+ 0x00, 0xfb, 0x7f, 0x98, 0x2e, 0xc3, 0xb7, 0x40, 0x30, 0x21, 0x2e, 0xd4, 0x00,
+ 0xfb, 0x6f, 0xf0, 0x5f, 0x03, 0x25,
+ 0x80, 0x2e, 0xaf, 0xb7, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x01, 0x2e, 0x5d, 0xf7, 0x08, 0xbc,
+ 0x80, 0xac, 0x0e, 0xbb, 0x02, 0x2f,
+ 0x00, 0x30, 0x41, 0x04, 0x82, 0x06, 0xc0, 0xa4, 0x00, 0x30, 0x11, 0x2f, 0x40,
+ 0xa9, 0x03, 0x2f, 0x40, 0x91, 0x0d,
+ 0x2f, 0x00, 0xa7, 0x0b, 0x2f, 0x80, 0xb3, 0xb3, 0x58, 0x02, 0x2f, 0x90, 0xa1,
+ 0x26, 0x13, 0x20, 0x23, 0x80, 0x90,
+ 0x10, 0x30, 0x01, 0x2f, 0xcc, 0x0e, 0x00, 0x2f, 0x00, 0x30, 0xb8, 0x2e, 0xb5,
+ 0x50, 0x18, 0x08, 0x08, 0xbc, 0x88,
+ 0xb6, 0x0d, 0x17, 0xc6, 0xbd, 0x56, 0xbc, 0xb7, 0x58, 0xda, 0xba, 0x04, 0x01,
+ 0x1d, 0x0a, 0x10, 0x50, 0x05, 0x30,
+ 0x32, 0x25, 0x45, 0x03, 0xfb, 0x7f, 0xf6, 0x30, 0x21, 0x25, 0x98, 0x2e, 0x37,
+ 0xca, 0x16, 0xb5, 0x9a, 0xbc, 0x06,
+ 0xb8, 0x80, 0xa8, 0x41, 0x0a, 0x0e, 0x2f, 0x80, 0x90, 0x02, 0x2f, 0x2d, 0x50,
+ 0x48, 0x0f, 0x09, 0x2f, 0xbf, 0xa0,
+ 0x04, 0x2f, 0xbf, 0x90, 0x06, 0x2f, 0xb7, 0x54, 0xca, 0x0f, 0x03, 0x2f, 0x00,
+ 0x2e, 0x02, 0x2c, 0xb7, 0x52, 0x2d,
+ 0x52, 0xf2, 0x33, 0x98, 0x2e, 0xd9, 0xc0, 0xfb, 0x6f, 0xf1, 0x37, 0xc0, 0x2e,
+ 0x01, 0x08, 0xf0, 0x5f, 0xbf, 0x56,
+ 0xb9, 0x54, 0xd0, 0x40, 0xc4, 0x40, 0x0b, 0x2e, 0xfd, 0xf3, 0xbf, 0x52, 0x90,
+ 0x42, 0x94, 0x42, 0x95, 0x42, 0x05,
+ 0x30, 0xc1, 0x50, 0x0f, 0x88, 0x06, 0x40, 0x04, 0x41, 0x96, 0x42, 0xc5, 0x42,
+ 0x48, 0xbe, 0x73, 0x30, 0x0d, 0x2e,
+ 0xd8, 0x00, 0x4f, 0xba, 0x84, 0x42, 0x03, 0x42, 0x81, 0xb3, 0x02, 0x2f, 0x2b,
+ 0x2e, 0x6f, 0xf5, 0x06, 0x2d, 0x05,
+ 0x2e, 0x77, 0xf7, 0xbd, 0x56, 0x93, 0x08, 0x25, 0x2e, 0x77, 0xf7, 0xbb, 0x54,
+ 0x25, 0x2e, 0xc2, 0xf5, 0x07, 0x2e,
+ 0xfd, 0xf3, 0x42, 0x30, 0xb4, 0x33, 0xda, 0x0a, 0x4c, 0x00, 0x27, 0x2e, 0xfd,
+ 0xf3, 0x43, 0x40, 0xd4, 0x3f, 0xdc,
+ 0x08, 0x43, 0x42, 0x00, 0x2e, 0x00, 0x2e, 0x43, 0x40, 0x24, 0x30, 0xdc, 0x0a,
+ 0x43, 0x42, 0x04, 0x80, 0x03, 0x2e,
+ 0xfd, 0xf3, 0x4a, 0x0a, 0x23, 0x2e, 0xfd, 0xf3, 0x61, 0x34, 0xc0, 0x2e, 0x01,
+ 0x42, 0x00, 0x2e, 0x60, 0x50, 0x1a,
+ 0x25, 0x7a, 0x86, 0xe0, 0x7f, 0xf3, 0x7f, 0x03, 0x25, 0xc3, 0x52, 0x41, 0x84,
+ 0xdb, 0x7f, 0x33, 0x30, 0x98, 0x2e,
+ 0x16, 0xc2, 0x1a, 0x25, 0x7d, 0x82, 0xf0, 0x6f, 0xe2, 0x6f, 0x32, 0x25, 0x16,
+ 0x40, 0x94, 0x40, 0x26, 0x01, 0x85,
+ 0x40, 0x8e, 0x17, 0xc4, 0x42, 0x6e, 0x03, 0x95, 0x42, 0x41, 0x0e, 0xf4, 0x2f,
+ 0xdb, 0x6f, 0xa0, 0x5f, 0xb8, 0x2e,
+ 0xb0, 0x51, 0xfb, 0x7f, 0x98, 0x2e, 0xe8, 0x0d, 0x5a, 0x25, 0x98, 0x2e, 0x0f,
+ 0x0e, 0xcb, 0x58, 0x32, 0x87, 0xc4,
+ 0x7f, 0x65, 0x89, 0x6b, 0x8d, 0xc5, 0x5a, 0x65, 0x7f, 0xe1, 0x7f, 0x83, 0x7f,
+ 0xa6, 0x7f, 0x74, 0x7f, 0xd0, 0x7f,
+ 0xb6, 0x7f, 0x94, 0x7f, 0x17, 0x30, 0xc7, 0x52, 0xc9, 0x54, 0x51, 0x7f, 0x00,
+ 0x2e, 0x85, 0x6f, 0x42, 0x7f, 0x00,
+ 0x2e, 0x51, 0x41, 0x45, 0x81, 0x42, 0x41, 0x13, 0x40, 0x3b, 0x8a, 0x00, 0x40,
+ 0x4b, 0x04, 0xd0, 0x06, 0xc0, 0xac,
+ 0x85, 0x7f, 0x02, 0x2f, 0x02, 0x30, 0x51, 0x04, 0xd3, 0x06, 0x41, 0x84, 0x05,
+ 0x30, 0x5d, 0x02, 0xc9, 0x16, 0xdf,
+ 0x08, 0xd3, 0x00, 0x8d, 0x02, 0xaf, 0xbc, 0xb1, 0xb9, 0x59, 0x0a, 0x65, 0x6f,
+ 0x11, 0x43, 0xa1, 0xb4, 0x52, 0x41,
+ 0x53, 0x41, 0x01, 0x43, 0x34, 0x7f, 0x65, 0x7f, 0x26, 0x31, 0xe5, 0x6f, 0xd4,
+ 0x6f, 0x98, 0x2e, 0x37, 0xca, 0x32,
+ 0x6f, 0x75, 0x6f, 0x83, 0x40, 0x42, 0x41, 0x23, 0x7f, 0x12, 0x7f, 0xf6, 0x30,
+ 0x40, 0x25, 0x51, 0x25, 0x98, 0x2e,
+ 0x37, 0xca, 0x14, 0x6f, 0x20, 0x05, 0x70, 0x6f, 0x25, 0x6f, 0x69, 0x07, 0xa2,
+ 0x6f, 0x31, 0x6f, 0x0b, 0x30, 0x04,
+ 0x42, 0x9b, 0x42, 0x8b, 0x42, 0x55, 0x42, 0x32, 0x7f, 0x40, 0xa9, 0xc3, 0x6f,
+ 0x71, 0x7f, 0x02, 0x30, 0xd0, 0x40,
+ 0xc3, 0x7f, 0x03, 0x2f, 0x40, 0x91, 0x15, 0x2f, 0x00, 0xa7, 0x13, 0x2f, 0x00,
+ 0xa4, 0x11, 0x2f, 0x84, 0xbd, 0x98,
+ 0x2e, 0x79, 0xca, 0x55, 0x6f, 0xb7, 0x54, 0x54, 0x41, 0x82, 0x00, 0xf3, 0x3f,
+ 0x45, 0x41, 0xcb, 0x02, 0xf6, 0x30,
+ 0x98, 0x2e, 0x37, 0xca, 0x35, 0x6f, 0xa4, 0x6f, 0x41, 0x43, 0x03, 0x2c, 0x00,
+ 0x43, 0xa4, 0x6f, 0x35, 0x6f, 0x17,
+ 0x30, 0x42, 0x6f, 0x51, 0x6f, 0x93, 0x40, 0x42, 0x82, 0x00, 0x41, 0xc3, 0x00,
+ 0x03, 0x43, 0x51, 0x7f, 0x00, 0x2e,
+ 0x94, 0x40, 0x41, 0x41, 0x4c, 0x02, 0xc4, 0x6f, 0xd1, 0x56, 0x63, 0x0e, 0x74,
+ 0x6f, 0x51, 0x43, 0xa5, 0x7f, 0x8a,
+ 0x2f, 0x09, 0x2e, 0xd8, 0x00, 0x01, 0xb3, 0x21, 0x2f, 0xcb, 0x58, 0x90, 0x6f,
+ 0x13, 0x41, 0xb6, 0x6f, 0xe4, 0x7f,
+ 0x00, 0x2e, 0x91, 0x41, 0x14, 0x40, 0x92, 0x41, 0x15, 0x40, 0x17, 0x2e, 0x6f,
+ 0xf5, 0xb6, 0x7f, 0xd0, 0x7f, 0xcb,
+ 0x7f, 0x98, 0x2e, 0x00, 0x0c, 0x07, 0x15, 0xc2, 0x6f, 0x14, 0x0b, 0x29, 0x2e,
+ 0x6f, 0xf5, 0xc3, 0xa3, 0xc1, 0x8f,
+ 0xe4, 0x6f, 0xd0, 0x6f, 0xe6, 0x2f, 0x14, 0x30, 0x05, 0x2e, 0x6f, 0xf5, 0x14,
+ 0x0b, 0x29, 0x2e, 0x6f, 0xf5, 0x18,
+ 0x2d, 0xcd, 0x56, 0x04, 0x32, 0xb5, 0x6f, 0x1c, 0x01, 0x51, 0x41, 0x52, 0x41,
+ 0xc3, 0x40, 0xb5, 0x7f, 0xe4, 0x7f,
+ 0x98, 0x2e, 0x1f, 0x0c, 0xe4, 0x6f, 0x21, 0x87, 0x00, 0x43, 0x04, 0x32, 0xcf,
+ 0x54, 0x5a, 0x0e, 0xef, 0x2f, 0x15,
+ 0x54, 0x09, 0x2e, 0x77, 0xf7, 0x22, 0x0b, 0x29, 0x2e, 0x77, 0xf7, 0xfb, 0x6f,
+ 0x50, 0x5e, 0xb8, 0x2e, 0x10, 0x50,
+ 0x01, 0x2e, 0xd4, 0x00, 0x00, 0xb2, 0xfb, 0x7f, 0x51, 0x2f, 0x01, 0xb2, 0x48,
+ 0x2f, 0x02, 0xb2, 0x42, 0x2f, 0x03,
+ 0x90, 0x56, 0x2f, 0xd7, 0x52, 0x79, 0x80, 0x42, 0x40, 0x81, 0x84, 0x00, 0x40,
+ 0x42, 0x42, 0x98, 0x2e, 0x93, 0x0c,
+ 0xd9, 0x54, 0xd7, 0x50, 0xa1, 0x40, 0x98, 0xbd, 0x82, 0x40, 0x3e, 0x82, 0xda,
+ 0x0a, 0x44, 0x40, 0x8b, 0x16, 0xe3,
+ 0x00, 0x53, 0x42, 0x00, 0x2e, 0x43, 0x40, 0x9a, 0x02, 0x52, 0x42, 0x00, 0x2e,
+ 0x41, 0x40, 0x15, 0x54, 0x4a, 0x0e,
+ 0x3a, 0x2f, 0x3a, 0x82, 0x00, 0x30, 0x41, 0x40, 0x21, 0x2e, 0x85, 0x0f, 0x40,
+ 0xb2, 0x0a, 0x2f, 0x98, 0x2e, 0xb1,
+ 0x0c, 0x98, 0x2e, 0x45, 0x0e, 0x98, 0x2e, 0x5b, 0x0e, 0xfb, 0x6f, 0xf0, 0x5f,
+ 0x00, 0x30, 0x80, 0x2e, 0xce, 0xb7,
+ 0xdd, 0x52, 0xd3, 0x54, 0x42, 0x42, 0x4f, 0x84, 0x73, 0x30, 0xdb, 0x52, 0x83,
+ 0x42, 0x1b, 0x30, 0x6b, 0x42, 0x23,
+ 0x30, 0x27, 0x2e, 0xd7, 0x00, 0x37, 0x2e, 0xd4, 0x00, 0x21, 0x2e, 0xd6, 0x00,
+ 0x7a, 0x84, 0x17, 0x2c, 0x42, 0x42,
+ 0x30, 0x30, 0x21, 0x2e, 0xd4, 0x00, 0x12, 0x2d, 0x21, 0x30, 0x00, 0x30, 0x23,
+ 0x2e, 0xd4, 0x00, 0x21, 0x2e, 0x7b,
+ 0xf7, 0x0b, 0x2d, 0x17, 0x30, 0x98, 0x2e, 0x51, 0x0c, 0xd5, 0x50, 0x0c, 0x82,
+ 0x72, 0x30, 0x2f, 0x2e, 0xd4, 0x00,
+ 0x25, 0x2e, 0x7b, 0xf7, 0x40, 0x42, 0x00, 0x2e, 0xfb, 0x6f, 0xf0, 0x5f, 0xb8,
+ 0x2e, 0x70, 0x50, 0x0a, 0x25, 0x39,
+ 0x86, 0xfb, 0x7f, 0xe1, 0x32, 0x62, 0x30, 0x98, 0x2e, 0xc2, 0xc4, 0xb5, 0x56,
+ 0xa5, 0x6f, 0xab, 0x08, 0x91, 0x6f,
+ 0x4b, 0x08, 0xdf, 0x56, 0xc4, 0x6f, 0x23, 0x09, 0x4d, 0xba, 0x93, 0xbc, 0x8c,
+ 0x0b, 0xd1, 0x6f, 0x0b, 0x09, 0xcb,
+ 0x52, 0xe1, 0x5e, 0x56, 0x42, 0xaf, 0x09, 0x4d, 0xba, 0x23, 0xbd, 0x94, 0x0a,
+ 0xe5, 0x6f, 0x68, 0xbb, 0xeb, 0x08,
+ 0xbd, 0xb9, 0x63, 0xbe, 0xfb, 0x6f, 0x52, 0x42, 0xe3, 0x0a, 0xc0, 0x2e, 0x43,
+ 0x42, 0x90, 0x5f, 0xd1, 0x50, 0x03,
+ 0x2e, 0x25, 0xf3, 0x13, 0x40, 0x00, 0x40, 0x9b, 0xbc, 0x9b, 0xb4, 0x08, 0xbd,
+ 0xb8, 0xb9, 0x98, 0xbc, 0xda, 0x0a,
+ 0x08, 0xb6, 0x89, 0x16, 0xc0, 0x2e, 0x19, 0x00, 0x62, 0x02, 0x10, 0x50, 0xfb,
+ 0x7f, 0x98, 0x2e, 0x81, 0x0d, 0x01,
+ 0x2e, 0xd4, 0x00, 0x31, 0x30, 0x08, 0x04, 0xfb, 0x6f, 0x01, 0x30, 0xf0, 0x5f,
+ 0x23, 0x2e, 0xd6, 0x00, 0x21, 0x2e,
+ 0xd7, 0x00, 0xb8, 0x2e, 0x01, 0x2e, 0xd7, 0x00, 0x03, 0x2e, 0xd6, 0x00, 0x48,
+ 0x0e, 0x01, 0x2f, 0x80, 0x2e, 0x1f,
+ 0x0e, 0xb8, 0x2e, 0xe3, 0x50, 0x21, 0x34, 0x01, 0x42, 0x82, 0x30, 0xc1, 0x32,
+ 0x25, 0x2e, 0x62, 0xf5, 0x01, 0x00,
+ 0x22, 0x30, 0x01, 0x40, 0x4a, 0x0a, 0x01, 0x42, 0xb8, 0x2e, 0xe3, 0x54, 0xf0,
+ 0x3b, 0x83, 0x40, 0xd8, 0x08, 0xe5,
+ 0x52, 0x83, 0x42, 0x00, 0x30, 0x83, 0x30, 0x50, 0x42, 0xc4, 0x32, 0x27, 0x2e,
+ 0x64, 0xf5, 0x94, 0x00, 0x50, 0x42,
+ 0x40, 0x42, 0xd3, 0x3f, 0x84, 0x40, 0x7d, 0x82, 0xe3, 0x08, 0x40, 0x42, 0x83,
+ 0x42, 0xb8, 0x2e, 0xdd, 0x52, 0x00,
+ 0x30, 0x40, 0x42, 0x7c, 0x86, 0xb9, 0x52, 0x09, 0x2e, 0x70, 0x0f, 0xbf, 0x54,
+ 0xc4, 0x42, 0xd3, 0x86, 0x54, 0x40,
+ 0x55, 0x40, 0x94, 0x42, 0x85, 0x42, 0x21, 0x2e, 0xd7, 0x00, 0x42, 0x40, 0x25,
+ 0x2e, 0xfd, 0xf3, 0xc0, 0x42, 0x7e,
+ 0x82, 0x05, 0x2e, 0x7d, 0x00, 0x80, 0xb2, 0x14, 0x2f, 0x05, 0x2e, 0x89, 0x00,
+ 0x27, 0xbd, 0x2f, 0xb9, 0x80, 0x90,
+ 0x02, 0x2f, 0x21, 0x2e, 0x6f, 0xf5, 0x0c, 0x2d, 0x07, 0x2e, 0x71, 0x0f, 0x14,
+ 0x30, 0x1c, 0x09, 0x05, 0x2e, 0x77,
+ 0xf7, 0xbd, 0x56, 0x47, 0xbe, 0x93, 0x08, 0x94, 0x0a, 0x25, 0x2e, 0x77, 0xf7,
+ 0xe7, 0x54, 0x50, 0x42, 0x4a, 0x0e,
+ 0xfc, 0x2f, 0xb8, 0x2e, 0x50, 0x50, 0x02, 0x30, 0x43, 0x86, 0xe5, 0x50, 0xfb,
+ 0x7f, 0xe3, 0x7f, 0xd2, 0x7f, 0xc0,
+ 0x7f, 0xb1, 0x7f, 0x00, 0x2e, 0x41, 0x40, 0x00, 0x40, 0x48, 0x04, 0x98, 0x2e,
+ 0x74, 0xc0, 0x1e, 0xaa, 0xd3, 0x6f,
+ 0x14, 0x30, 0xb1, 0x6f, 0xe3, 0x22, 0xc0, 0x6f, 0x52, 0x40, 0xe4, 0x6f, 0x4c,
+ 0x0e, 0x12, 0x42, 0xd3, 0x7f, 0xeb,
+ 0x2f, 0x03, 0x2e, 0x86, 0x0f, 0x40, 0x90, 0x11, 0x30, 0x03, 0x2f, 0x23, 0x2e,
+ 0x86, 0x0f, 0x02, 0x2c, 0x00, 0x30,
+ 0xd0, 0x6f, 0xfb, 0x6f, 0xb0, 0x5f, 0xb8, 0x2e, 0x40, 0x50, 0xf1, 0x7f, 0x0a,
+ 0x25, 0x3c, 0x86, 0xeb, 0x7f, 0x41,
+ 0x33, 0x22, 0x30, 0x98, 0x2e, 0xc2, 0xc4, 0xd3, 0x6f, 0xf4, 0x30, 0xdc, 0x09,
+ 0x47, 0x58, 0xc2, 0x6f, 0x94, 0x09,
+ 0xeb, 0x58, 0x6a, 0xbb, 0xdc, 0x08, 0xb4, 0xb9, 0xb1, 0xbd, 0xe9, 0x5a, 0x95,
+ 0x08, 0x21, 0xbd, 0xf6, 0xbf, 0x77,
+ 0x0b, 0x51, 0xbe, 0xf1, 0x6f, 0xeb, 0x6f, 0x52, 0x42, 0x54, 0x42, 0xc0, 0x2e,
+ 0x43, 0x42, 0xc0, 0x5f, 0x50, 0x50,
+ 0xf5, 0x50, 0x31, 0x30, 0x11, 0x42, 0xfb, 0x7f, 0x7b, 0x30, 0x0b, 0x42, 0x11,
+ 0x30, 0x02, 0x80, 0x23, 0x33, 0x01,
+ 0x42, 0x03, 0x00, 0x07, 0x2e, 0x80, 0x03, 0x05, 0x2e, 0xd3, 0x00, 0x23, 0x52,
+ 0xe2, 0x7f, 0xd3, 0x7f, 0xc0, 0x7f,
+ 0x98, 0x2e, 0xb6, 0x0e, 0xd1, 0x6f, 0x08, 0x0a, 0x1a, 0x25, 0x7b, 0x86, 0xd0,
+ 0x7f, 0x01, 0x33, 0x12, 0x30, 0x98,
+ 0x2e, 0xc2, 0xc4, 0xd1, 0x6f, 0x08, 0x0a, 0x00, 0xb2, 0x0d, 0x2f, 0xe3, 0x6f,
+ 0x01, 0x2e, 0x80, 0x03, 0x51, 0x30,
+ 0xc7, 0x86, 0x23, 0x2e, 0x21, 0xf2, 0x08, 0xbc, 0xc0, 0x42, 0x98, 0x2e, 0xa5,
+ 0xb7, 0x00, 0x2e, 0x00, 0x2e, 0xd0,
+ 0x2e, 0xb0, 0x6f, 0x0b, 0xb8, 0x03, 0x2e, 0x1b, 0x00, 0x08, 0x1a, 0xb0, 0x7f,
+ 0x70, 0x30, 0x04, 0x2f, 0x21, 0x2e,
+ 0x21, 0xf2, 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0x98, 0x2e, 0x6d, 0xc0, 0x98,
+ 0x2e, 0x5d, 0xc0, 0xed, 0x50, 0x98,
+ 0x2e, 0x44, 0xcb, 0xef, 0x50, 0x98, 0x2e, 0x46, 0xc3, 0xf1, 0x50, 0x98, 0x2e,
+ 0x53, 0xc7, 0x35, 0x50, 0x98, 0x2e,
+ 0x64, 0xcf, 0x10, 0x30, 0x98, 0x2e, 0xdc, 0x03, 0x20, 0x26, 0xc0, 0x6f, 0x02,
+ 0x31, 0x12, 0x42, 0xab, 0x33, 0x0b,
+ 0x42, 0x37, 0x80, 0x01, 0x30, 0x01, 0x42, 0xf3, 0x37, 0xf7, 0x52, 0xfb, 0x50,
+ 0x44, 0x40, 0xa2, 0x0a, 0x42, 0x42,
+ 0x8b, 0x31, 0x09, 0x2e, 0x5e, 0xf7, 0xf9, 0x54, 0xe3, 0x08, 0x83, 0x42, 0x1b,
+ 0x42, 0x23, 0x33, 0x4b, 0x00, 0xbc,
+ 0x84, 0x0b, 0x40, 0x33, 0x30, 0x83, 0x42, 0x0b, 0x42, 0xe0, 0x7f, 0xd1, 0x7f,
+ 0x98, 0x2e, 0x58, 0xb7, 0xd1, 0x6f,
+ 0x80, 0x30, 0x40, 0x42, 0x03, 0x30, 0xe0, 0x6f, 0xf3, 0x54, 0x04, 0x30, 0x00,
+ 0x2e, 0x00, 0x2e, 0x01, 0x89, 0x62,
+ 0x0e, 0xfa, 0x2f, 0x43, 0x42, 0x11, 0x30, 0xfb, 0x6f, 0xc0, 0x2e, 0x01, 0x42,
+ 0xb0, 0x5f, 0xc1, 0x4a, 0x00, 0x00,
+ 0x6d, 0x57, 0x00, 0x00, 0x77, 0x8e, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xd3,
+ 0xff, 0xff, 0xff, 0xe5, 0xff, 0xff,
+ 0xff, 0xee, 0xe1, 0xff, 0xff, 0x7c, 0x13, 0x00, 0x00, 0x46, 0xe6, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
+ 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
+ 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
+ 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
+ 0x2e, 0x00, 0xc1
+};
+
+static i2c_master_t bmi270;
+
+// -----------------------------------------------------------------------------
+// Prototypes
+// -----------------------------------------------------------------------------
+static void sparkfun_bmi270_generate_ms_delay(uint32_t period);
+static sl_status_t sparkfun_bmi270_reg_write(uint8_t *tx_buffer,
+ uint32_t tx_len);
+static sl_status_t sparkfun_bmi270_reg_read(uint8_t address,
+ uint8_t *rx_buffer,
+ uint32_t rx_len);
+static sl_status_t sparkfun_bmi270_update_init_ctrl_reg(uint8_t value);
+static sl_status_t sparkfun_bmi270_upload_config_file(
+ const uint8_t *config_data,
+ uint16_t index,
+ uint16_t write_len);
+static sl_status_t sparkfun_bmi270_write_config_file(void);
+static sl_status_t sparkfun_bmi270_check_init_status(void);
+static sl_status_t sparkfun_bmi270_enable_features(
+ bmi270_cfg_data_t *bmi_cfg_data);
+static uint8_t sparkfun_bmi270_set_config_acc_value(uint8_t odr, uint8_t bwp,
+ uint8_t filter);
+static sl_status_t sparkfun_bmi270_config_acc(bmi270_cfg_data_t *bmi_cfg_data);
+static sl_status_t sparkfun_bmi270_config_acc_range(
+ bmi270_cfg_data_t *bmi_cfg_data);
+static void sparkfun_bmi270_convert_raw_to_acc_meter_per_sec(int16_t *raw_data,
+ double *acc_data);
+static uint8_t sparkfun_bmi270_set_config_gyro_value(uint8_t odr,
+ uint8_t bwp,
+ uint8_t noise,
+ uint8_t filter);
+static sl_status_t sparkfun_bmi270_config_gyro(bmi270_cfg_data_t *bmi_cfg_data);
+static sl_status_t sparkfun_bmi270_config_gyro_range(
+ bmi270_cfg_data_t *bmi_cfg_data);
+static void sparkfun_bmi270_convert_raw_to_gyro_degree_per_sec(
+ int16_t *raw_data,
+ double *gyro_data);
+
+/*******************************************************************************
+ * @brief Gives delay in milliseconds
+ * @param[in] period : value of delay in milliseconds
+ ******************************************************************************/
+static void sparkfun_bmi270_generate_ms_delay(uint32_t period)
+{
+ sl_sleeptimer_delay_millisecond(period);
+}
+
+/*******************************************************************************
+ * @brief Write the register of BMI270 sensor.
+ * @param[in] write_buffer : write_buffer A pointer to transmit data buffer
+ * @param[in] length_of_write_buffer : length of a write buffer.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_TRANSMIT on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_reg_write(uint8_t *tx_buffer,
+ uint32_t tx_len)
+{
+ if ((bmi270.handle == NULL) || (NULL == tx_buffer)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ if (I2C_MASTER_SUCCESS != i2c_master_write(&bmi270,
+ tx_buffer,
+ tx_len)) {
+ return SL_STATUS_TRANSMIT;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * @brief Read the register of BMI270 sensor.
+ * @param[in] address : Register address.
+ * @param[in] rx_buffer : A pointer to receive data buffer
+ * @param[in] rx_len : Data length in number of bytes
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_TRANSMIT on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_reg_read(uint8_t address,
+ uint8_t *rx_buffer,
+ uint32_t rx_len)
+{
+ if ((bmi270.handle == NULL) || (NULL == rx_buffer)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&bmi270,
+ &address,
+ 1,
+ rx_buffer,
+ rx_len)) {
+ return SL_STATUS_TRANSMIT;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * @brief Initialized and de-initialized upload of config file in BMI270 sensor.
+ * @param[in] value : data to be write.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_update_init_ctrl_reg(uint8_t value)
+{
+ sl_status_t status;
+ uint8_t tx_buffer[2] = { BMI270_INIT_CTRL_REG, value };
+
+ if (bmi270.handle == NULL) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ status = sparkfun_bmi270_reg_write(tx_buffer, sizeof(tx_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * @brief Upload configuration file in chunk in BMI270 sensor.
+ * @param[in] config_data : configuration file array pointer.
+ * @param[in] index : index of a starting element of a configuration file.
+ * @param[in] write_len : length of a chunk.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_upload_config_file(
+ const uint8_t *config_data,
+ uint16_t index,
+ uint16_t write_len)
+{
+ sl_status_t status;
+ uint8_t init_data_addr[2] = { 0 };
+ uint8_t tx_buffer[2] = { 0 };
+ uint8_t chunk_buffer[write_len + 1];
+
+ if ((config_data == NULL) || (bmi270.handle == NULL)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ /// copy register address in chunk data
+ chunk_buffer[0] = BMI270_INIT_DATA_REG;
+
+ /// copy chunk data from 1st byte of configuration data buffer
+ memcpy(&chunk_buffer[1], config_data, write_len);
+
+ /// store 0 to 3 bits of base address of initialized data in first byte
+ init_data_addr[0] = (uint8_t)((index / 2) & 0x0F);
+
+ /// store 4 to 11 bits of base address of initialized data in second byte
+ init_data_addr[1] = (uint8_t)((index / 2) >> 4);
+
+ tx_buffer[0] = BMI270_INIT_ADDR_0_REG;
+ tx_buffer[1] = init_data_addr[0];
+
+ status = sparkfun_bmi270_reg_write(tx_buffer, sizeof(tx_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ tx_buffer[0] = BMI270_INIT_ADDR_1_REG;
+ tx_buffer[1] = init_data_addr[1];
+
+ status = sparkfun_bmi270_reg_write(tx_buffer, sizeof(tx_buffer));
+
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ } else {
+ /// Burst write configuration file data corresponding to user set length
+ status = sparkfun_bmi270_reg_write(chunk_buffer, sizeof(chunk_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * @brief Start operation to upload config file in BMI270 sensor.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_write_config_file(void)
+{
+ sl_status_t status = SL_STATUS_OK;
+ uint16_t config_file_index;
+ uint16_t config_size = sizeof(bmi270_config_file);
+
+ if (bmi270.handle == NULL) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ /// Write the configuration file
+ for (config_file_index = 0; config_file_index < config_size;
+ config_file_index += CHUNK_SIZE) {
+ status =
+ sparkfun_bmi270_upload_config_file(
+ &(bmi270_config_file[config_file_index]),
+ config_file_index,
+ CHUNK_SIZE);
+
+ if (status != SL_STATUS_OK) {
+ break;
+ }
+ }
+
+ return status;
+}
+
+/*******************************************************************************
+ * @brief Check status of BMI270 sensor.
+ * @param[in] address : Address of register.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_check_init_status(void)
+{
+ sl_status_t status;
+ uint8_t rx_buffer = 0;
+
+ if (bmi270.handle == NULL) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ status =
+ sparkfun_bmi270_reg_read(BMI270_INIT_STATUS_REG, &rx_buffer,
+ sizeof(rx_buffer));
+
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (BMI270_INIT_SUCCESSFUL != rx_buffer) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * @brief Enable feature of BMI270 sensor.
+ * @param[in] bmi_cfg_data : pointer to store the BMI270 sensor configuration
+ * data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_enable_features(
+ bmi270_cfg_data_t *bmi_cfg_data)
+{
+ sl_status_t status;
+ uint8_t tx_buffer[2];
+
+ if ((bmi270.handle == NULL) || (bmi_cfg_data == NULL)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ tx_buffer[0] = BMI270_PWR_CTRL_ADDR;
+ tx_buffer[1] = bmi_cfg_data->enable_features.features;
+
+ status = sparkfun_bmi270_reg_write(tx_buffer, sizeof(tx_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * @brief Set the configuration of accelerometer in one byte.
+ * @param[in] odr : output data rate value.
+ * @param[in] bwp : bandwidth value.
+ * @param[in] filter : filter value.
+ * @return The following value are returned:
+ * - \ref one byte.
+ ******************************************************************************/
+static uint8_t sparkfun_bmi270_set_config_acc_value(uint8_t odr,
+ uint8_t bwp,
+ uint8_t filter)
+{
+ /// Mask to keep only the lower 4 bits
+ odr = odr & 0x0F;
+
+ /// Mask to keep only the lower 3 bits and shift left by 4 bits
+ bwp = (bwp & 0x07) << 4;
+
+ /// Mask to keep only the lower 1 bit and shift left by 7 bits
+ filter = (filter & 0x01) << 7;
+
+ return (odr | bwp | filter);
+}
+
+/*******************************************************************************
+ * @brief Set the configuration of accelerometer to the BMI270
+ * @param[in] bmi_cfg_data : pointer to store the BMI270 sensor configuration
+ * data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_config_acc(bmi270_cfg_data_t *bmi_cfg_data)
+{
+ sl_status_t status;
+
+ if ((bmi270.handle == NULL) || (bmi_cfg_data == NULL)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ uint8_t config_value = sparkfun_bmi270_set_config_acc_value(
+ bmi_cfg_data->acc_config.odr,
+ bmi_cfg_data->acc_config.bw,
+ bmi_cfg_data->acc_config.filter);
+
+ uint8_t tx_buffer[2] = { BMI270_ACC_CONF_ADDR, config_value };
+
+ status = sparkfun_bmi270_reg_write(tx_buffer, sizeof(tx_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * @brief Set the range of accelerometer to the BMI270.
+ * @param[in] bmi_cfg_data : pointer to store the BMI270 sensor configuration
+ * data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_config_acc_range(
+ bmi270_cfg_data_t *bmi_cfg_data)
+{
+ sl_status_t status;
+ uint8_t tx_buffer[2];
+
+ if ((bmi270.handle == NULL) || (bmi_cfg_data == NULL)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ tx_buffer[0] = BMI270_ACC_RANGE_REG;
+ tx_buffer[1] = bmi_cfg_data->acc_config.range;
+
+ status = sparkfun_bmi270_reg_write(tx_buffer, sizeof(tx_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * @brief Convert raw int16_t data of accelerometer in double m/s^2 in BMI270
+ * sensor.
+ * @param[in] raw_data : A address of raw data buffer of accelerometer.
+ * @param[in] acc_data : A address of buffer containing converted reading in
+ * m/s^2.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static void sparkfun_bmi270_convert_raw_to_acc_meter_per_sec(int16_t *raw_data,
+ double *acc_data)
+{
+ bmi270_accel_range_t range = BMI270_ACCEL_RANGE_2G;
+ double scaling_factor;
+
+ if ((NULL == raw_data) || (NULL == acc_data)) {
+ return;
+ }
+
+ switch (range) {
+ case BMI270_ACCEL_RANGE_2G:
+ scaling_factor = (2 * GRAVITY_EARTH) / 32768.0;
+ break;
+
+ case BMI270_ACCEL_RANGE_4G:
+ scaling_factor = (4 * GRAVITY_EARTH) / 32768.0;
+ break;
+
+ case BMI270_ACCEL_RANGE_8G:
+ scaling_factor = (8 * GRAVITY_EARTH) / 32768.0;
+ break;
+
+ case BMI270_ACCEL_RANGE_16G:
+ scaling_factor = (16 * GRAVITY_EARTH) / 32768.0;
+ break;
+
+ default:
+ scaling_factor = 0;
+ break;
+ }
+
+ acc_data[0] = raw_data[0] * scaling_factor;
+ acc_data[1] = raw_data[1] * scaling_factor;
+ acc_data[2] = raw_data[2] * scaling_factor;
+}
+
+/*******************************************************************************
+ * @brief Set the configuration of gyroscope in one byte.
+ * @param[in] odr : output data rate value.
+ * @param[in] bwp : bandwidth value.
+ * @param[in] noise : noise value.
+ * @param[in] filter : filter value.
+ * @return The following values are returned:
+ * - \ref one byte.
+ ******************************************************************************/
+static uint8_t sparkfun_bmi270_set_config_gyro_value(uint8_t odr,
+ uint8_t bwp,
+ uint8_t noise,
+ uint8_t filter)
+{
+ /// Mask to keep only the lower 4 bits
+ odr = odr & 0x0F;
+
+ /// Mask to keep only the lower 2 bits and shift left by 4 bits
+ bwp = (bwp & 0x03) << 4;
+
+ /// Mask to keep only the lower 1 bit and shift left by 6 bits
+ noise = (noise & 0x01) << 6;
+
+ /// Mask to keep only the lower 1 bit and shift left by 7 bits
+ filter = (filter & 0x01) << 7;
+
+ return (odr | bwp | noise | filter);
+}
+
+/*******************************************************************************
+ * @brief Set the configuration of gyroscope to BMI270.
+ * @param[in] bmi_cfg_data : pointer to store the BMI270 sensor configuration
+ * data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_config_gyro(bmi270_cfg_data_t *bmi_cfg_data)
+{
+ uint8_t tx_buffer[2];
+ sl_status_t status;
+ uint8_t config_value;
+
+ if ((bmi270.handle == NULL) || (bmi_cfg_data == NULL)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ config_value = sparkfun_bmi270_set_config_gyro_value(
+ bmi_cfg_data->gyro_config.odr,
+ bmi_cfg_data->gyro_config.bw,
+ bmi_cfg_data->gyro_config.noise,
+ bmi_cfg_data->gyro_config.filter);
+
+ tx_buffer[0] = BMI270_GYR_CONF_ADDR;
+ tx_buffer[1] = config_value;
+
+ status = sparkfun_bmi270_reg_write(tx_buffer, sizeof(tx_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * @brief Set the range of gyroscope.
+ * @param[in] bmi_cfg_data : pointer to store the BMI270 sensor configuration
+ * data.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static sl_status_t sparkfun_bmi270_config_gyro_range(
+ bmi270_cfg_data_t *bmi_cfg_data)
+{
+ sl_status_t status;
+ uint8_t tx_buffer[2];
+
+ if ((bmi270.handle == NULL) || (bmi_cfg_data == NULL)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ tx_buffer[0] = BMI270_GYRO_RANGE_REG;
+ tx_buffer[1] = bmi_cfg_data->gyro_config.range;
+
+ status = sparkfun_bmi270_reg_write(tx_buffer, sizeof(tx_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * @brief Convert raw int16_t data of gyroscope in double degree/s in BMI270
+ * sensor.
+ * @param[in] raw_data : A address of raw data buffer of gyroscope.
+ * @param[in] acc_data : A address of buffer containing converted reading in
+ * degree/s.
+ * @return The following values are returned:
+ * - \ref SL_STATUS_OK on success.
+ * - \ref SL_STATUS_FAIL on failure.
+ ******************************************************************************/
+static void sparkfun_bmi270_convert_raw_to_gyro_degree_per_sec(
+ int16_t *raw_data,
+ double *gyro_data)
+{
+ bmi270_gyro_range_t range = BMI270_GYRO_RANGE_2000DPS;
+ double scaling_factor;
+
+ if ((NULL == raw_data) || (NULL == gyro_data)) {
+ return;
+ }
+
+ switch (range) {
+ case BMI270_GYRO_RANGE_2000DPS:
+ scaling_factor = 2000.0 / 32768.0;
+ break;
+
+ case BMI270_GYRO_RANGE_1000DPS:
+ scaling_factor = 1000.0 / 32768.0;
+ break;
+
+ case BMI270_GYRO_RANGE_500DPS:
+ scaling_factor = 500.0 / 32768.0;
+ break;
+
+ case BMI270_GYRO_RANGE_250DPS:
+ scaling_factor = 250.0 / 32768.0;
+ break;
+
+ case BMI270_GYRO_RANGE_125DPS:
+ scaling_factor = 125.0 / 32768.0;
+ break;
+
+ default:
+ scaling_factor = 0;
+ break;
+ }
+
+ gyro_data[0] = raw_data[0] * scaling_factor;
+ gyro_data[1] = raw_data[1] * scaling_factor;
+ gyro_data[2] = raw_data[2] * scaling_factor;
+}
+
+// -----------------------------------------------------------------------------
+// Public Function
+// -----------------------------------------------------------------------------
+
+/*******************************************************************************
+ * Function to initialize and probe BMI270 sensor
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_init(bmi270_cfg_data_t *bmi_cfg_data)
+{
+ sl_status_t status;
+
+ if ((bmi_cfg_data->bmi270_slave_address != BMI270_ADDR)
+ || (NULL == bmi_cfg_data)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ i2c_master_config_t i2c_cfg;
+ i2c_master_configure_default(&i2c_cfg);
+ i2c_cfg.speed = I2C_MASTER_SPEED_STANDARD;
+ i2c_cfg.scl = HAL_PIN_NC;
+ i2c_cfg.sda = HAL_PIN_NC;
+ i2c_cfg.addr = bmi_cfg_data->bmi270_slave_address;
+
+#if (SPARKFUN_BMI270_I2C_UC == 1)
+ i2c_cfg.speed = SPARKFUN_BMI270_I2C_SPEED_MODE;
+#endif
+
+ bmi270.handle = bmi_cfg_data->i2c_instance;
+
+ if (i2c_master_open(&bmi270, &i2c_cfg) == I2C_MASTER_ERROR) {
+ return SL_STATUS_INITIALIZATION;
+ }
+
+ /// reset the sensor
+ status = sparkfun_bmi270_reset();
+ if (status != SL_STATUS_OK) {
+ return SL_STATUS_FAIL;
+ }
+
+ /// As per data-sheet, need delay >= 2ms to make I2C operational
+ sparkfun_bmi270_generate_ms_delay(5);
+
+ /// connect a sensor
+ status = sparkfun_bmi270_is_present();
+ if (status != SL_STATUS_OK) {
+ return SL_STATUS_FAIL;
+ }
+
+ /// As per data-sheet, need delay >= 450us.
+ sparkfun_bmi270_generate_ms_delay(1);
+
+ /// disable advance power mode
+ status = sparkfun_bmi270_update_advance_power_mode(DISABLE_ADV_POWER);
+ if (status != SL_STATUS_OK) {
+ return SL_STATUS_FAIL;
+ }
+
+ /// make sensor ready to load configuration file
+ status = sparkfun_bmi270_update_init_ctrl_reg(CLR_INIT_CTRL_REG);
+ if (status != SL_STATUS_OK) {
+ return SL_STATUS_FAIL;
+ }
+
+ /// write config file
+ status = sparkfun_bmi270_write_config_file();
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ /// config file loaded
+ status = sparkfun_bmi270_update_init_ctrl_reg(SET_INIT_CTRL_REG);
+ if (status != SL_STATUS_OK) {
+ return SL_STATUS_FAIL;
+ }
+
+ /// As per data-sheet, need delay >= 20us.
+ sparkfun_bmi270_generate_ms_delay(100);
+
+ /// check initialization status
+ status = sparkfun_bmi270_check_init_status();
+ if (status != SL_STATUS_OK) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * Function to reset bmi270 sensor
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_reset(void)
+{
+ sl_status_t status;
+ uint8_t tx_buffer[2] = { BMI270_CMD_REG, SOFT_RESET_CMD };
+
+ if (bmi270.handle == NULL) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ status = sparkfun_bmi270_reg_write(tx_buffer, sizeof(tx_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * Check presence of BMI270 sensor on I2C bus.
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_is_present(void)
+{
+ sl_status_t status;
+ uint8_t rx_buffer = 0;
+
+ if (bmi270.handle == NULL) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ status = sparkfun_bmi270_reg_read(BMI270_CHIP_IDENTIFY_CODE_REG,
+ &rx_buffer,
+ sizeof(rx_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ if (BMI270_CHIP_ID != rx_buffer) {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * Function to update advance power mode of bmi270 sensor
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_update_advance_power_mode(uint8_t value)
+{
+ sl_status_t status;
+ uint8_t tx_buffer[2] = { BMI270_POWER_CFG_REG, value };
+
+ if (bmi270.handle == NULL) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ status = sparkfun_bmi270_reg_write(tx_buffer, sizeof(tx_buffer));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * Function to enable and configure default features of BMI270 sensor.
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_enable_and_config_features(
+ bmi270_cfg_data_t *bmi_cfg_data)
+{
+ sl_status_t status;
+
+ if ((bmi270.handle == NULL) || (NULL == bmi_cfg_data)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ /// enable features of bmi270 sensor
+ status = sparkfun_bmi270_enable_features(bmi_cfg_data);
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ /// check whether accelerometer is enabled
+ if (bmi_cfg_data->enable_features.features & BMI270_FEATURE_ACC) {
+ /// configure range of accelerometer
+ status = sparkfun_bmi270_config_acc_range(bmi_cfg_data);
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ /// configure various parameters of accelerometer
+ status = sparkfun_bmi270_config_acc(bmi_cfg_data);
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+ }
+
+ /// check whether gyroscope is enabled
+ if (bmi_cfg_data->enable_features.features & BMI270_FEATURE_GYRO) {
+ /// configure range of gyroscope
+ status = sparkfun_bmi270_config_gyro_range(bmi_cfg_data);
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ /// configure various parameters of gyroscope
+ status = sparkfun_bmi270_config_gyro(bmi_cfg_data);
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * Function to read accelerometer reading
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_read_acc_reading(bmi270_cfg_data_t *bmi_cfg_data,
+ double *acc_buffer)
+{
+ sl_status_t status;
+ uint8_t raw_acc_buff[6]; /// < basic raw buffer
+ int16_t raw_acc_buff_conv[3]; /// < converted raw buffer
+
+ if ((bmi270.handle == NULL) || (acc_buffer == NULL)
+ || (bmi_cfg_data == NULL)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ if (bmi_cfg_data->enable_features.features & BMI270_FEATURE_ACC) {
+ /// Read accelerometer data
+ status = sparkfun_bmi270_reg_read(BMI270_ACC_X_LSB_ADDR,
+ raw_acc_buff,
+ sizeof(raw_acc_buff));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ raw_acc_buff_conv[0] = (int16_t)((raw_acc_buff[1] << 8) | raw_acc_buff[0]);
+ raw_acc_buff_conv[1] = (int16_t)((raw_acc_buff[3] << 8) | raw_acc_buff[2]);
+ raw_acc_buff_conv[2] = (int16_t)((raw_acc_buff[5] << 8) | raw_acc_buff[4]);
+
+ /// convert raw accelerometer data to meter per second square
+ sparkfun_bmi270_convert_raw_to_acc_meter_per_sec(raw_acc_buff_conv,
+ acc_buffer);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * Function to read gyroscope reading
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_read_gyro_reading(bmi270_cfg_data_t *bmi_cfg_data,
+ double *gyro_buffer)
+{
+ sl_status_t status;
+ uint8_t raw_gyro_buff[6]; /// < basic raw buffer
+ int16_t raw_gyro_buff_conv[3]; /// < converted raw buffer
+
+ if ((bmi270.handle == NULL) || (gyro_buffer == NULL)
+ || (bmi_cfg_data == NULL)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ if (bmi_cfg_data->enable_features.features & BMI270_FEATURE_GYRO) {
+ /// Read gyroscope data
+ status = sparkfun_bmi270_reg_read(BMI270_GYR_X_LSB_ADDR,
+ raw_gyro_buff,
+ sizeof(raw_gyro_buff));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ raw_gyro_buff_conv[0] =
+ (int16_t)((raw_gyro_buff[1] << 8) | raw_gyro_buff[0]);
+ raw_gyro_buff_conv[1] =
+ (int16_t)((raw_gyro_buff[3] << 8) | raw_gyro_buff[2]);
+ raw_gyro_buff_conv[2] =
+ (int16_t)((raw_gyro_buff[5] << 8) | raw_gyro_buff[4]);
+
+ /// convert raw gyroscope data to degree per second
+ sparkfun_bmi270_convert_raw_to_gyro_degree_per_sec(raw_gyro_buff_conv,
+ gyro_buffer);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+
+ return SL_STATUS_OK;
+}
+
+/*******************************************************************************
+ * Function to read temperature reading
+ ******************************************************************************/
+sl_status_t sparkfun_bmi270_read_temp_reading(bmi270_cfg_data_t *bmi_cfg_data,
+ double *temperature_reading)
+{
+ sl_status_t status;
+ uint8_t raw_temp0; /// < raw data of temperature 0 (LSB)
+ uint8_t raw_temp1; /// < raw data of temperature 1 (MSB)
+ int16_t traw; /// < raw data of temperature
+
+ if ((bmi270.handle == NULL) || (temperature_reading == NULL)
+ || (bmi_cfg_data == NULL)) {
+ return SL_STATUS_INVALID_PARAMETER;
+ }
+
+ if ((bmi_cfg_data->enable_features.features & BMI270_FEATURE_TEMP)
+ || (bmi_cfg_data->enable_features.features & BMI270_FEATURE_GYRO)) {
+ status =
+ sparkfun_bmi270_reg_read(BMI270_TEMP0_REG, &raw_temp0, sizeof(raw_temp0));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ status =
+ sparkfun_bmi270_reg_read(BMI270_TEMP1_REG, &raw_temp1, sizeof(raw_temp1));
+ if (SL_STATUS_OK != status) {
+ return SL_STATUS_FAIL;
+ }
+
+ traw = (int16_t)((raw_temp1 << 8) | raw_temp0);
+
+ *temperature_reading = 23.0 + ((double)traw / 512.0);
+ } else {
+ return SL_STATUS_NOT_AVAILABLE;
+ }
+
+ return SL_STATUS_OK;
+}
diff --git a/templates.xml b/templates.xml
index e07cb47b..0d5179d7 100644
--- a/templates.xml
+++ b/templates.xml
@@ -14,6 +14,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -59,6 +74,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -89,6 +119,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -134,6 +179,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -373,7 +433,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -509,6 +584,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1544,4 +1634,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/third_party_hw_drivers.slce b/third_party_hw_drivers.slce
index 2190a591..3e81f036 100644
--- a/third_party_hw_drivers.slce
+++ b/third_party_hw_drivers.slce
@@ -1,11 +1,11 @@
id: third_party_hw_drivers
label: Third Party Hardware Drivers
description: >
- Third Party Hardware Driver extension for the Gecko SDK Suite
-version: 2.0.2
+ Third Party Hardware Driver extension for the Gecko and Wiseconnect SDKs.
+version: 3.0.0
sdk:
id: gecko_sdk
- version: 4.4.0
+ version: 4.4.3
component_path:
- path: "driver/component/drivers/mikroe"
- path: "driver/component/drivers/silabs"
diff --git a/third_party_hw_drivers.slsdk b/third_party_hw_drivers.slsdk
index 29140365..13f02dfa 100644
--- a/third_party_hw_drivers.slsdk
+++ b/third_party_hw_drivers.slsdk
@@ -1,10 +1,10 @@
# Properties file for Simplicity Studio metadata
id=uc.extension.third_party_hw_drivers
-version=2.0.2
+version=3.0.0
label=Third Party Hardware Drivers
description=Third Party Hardware Drivers
prop.file.templatesFile=templates.xml
-prop.subLabel=Third\\ Party\\ Hardware\\ Drivers\\ 2.0.2
+prop.subLabel=Third\\ Party\\ Hardware\\ Drivers\\ 3.0.0
diff --git a/utilities/postbuild_profile/wiseconnect_soc.slpb b/utilities/postbuild_profile/wiseconnect_soc.slpb
new file mode 100644
index 00000000..b97f8c87
--- /dev/null
+++ b/utilities/postbuild_profile/wiseconnect_soc.slpb
@@ -0,0 +1,20 @@
+parameters:
+- name: "build_dir"
+constants:
+- name: "project_name"
+ value: "wiseconnect_soc"
+steps:
+- task: "create_rps"
+ input: "{{build_dir}}/{{project_name}}.out"
+ map: "{{build_dir}}/{{project_name}}.map"
+ app-version: "1"
+ output: "{{build_dir}}/{{project_name}}.rps"
+- task: "convert"
+ input: "{{build_dir}}/{{project_name}}.rps"
+ output: "{{build_dir}}/{{project_name}}.hex"
+- task: "convert"
+ input: "{{build_dir}}/{{project_name}}.rps"
+ output: "{{build_dir}}/{{project_name}}.s37"
+- task: "convert"
+ input: "{{build_dir}}/{{project_name}}.rps"
+ output: "{{build_dir}}/{{project_name}}_isp.bin"