Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SL-UP]modified to support si917 #346

Draft
wants to merge 1 commit into
base: release_2.5-1.4
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@
#include <platform/CHIPDeviceLayer.h>

#ifdef USE_SPARKFUN_AIR_QUALITY_SENSOR
#include "sl_i2cspm_instances.h"
#include <sparkfun_sgp40.h>

#if (defined(SLI_SI917))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This define is set to true for the SoC and NCP configuration. Wouldn't work for the efr32 + 917 NCP

Copy link
Contributor Author

@Sarthak-Shaha Sarthak-Shaha Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkardous-silabs What is the correct way to verify if its a 917 soc device?
#if SLI_SI91X_MCU_INTERFACE ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the app is not available for NCP combinations.
We do not support Sparkfun sensor with CSA.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SLI_SI91X_MCU_INTERFACE is the define for SoC.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the customer issue that brought this feature to light; nothing prevent a customer to have efr+917ncp and try to use the airquality sensor feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include "sl_i2c_instances.h"
#include "rsi_debug.h"

#define I2C_INSTANCE_USED SL_I2C2
static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED;
#else
#include "sl_i2cspm_instances.h"
#endif //(defined(SLI_SI917))
static mikroe_i2c_handle_t app_i2c_instance = NULL;
#endif // USE_SPARKFUN_AIR_QUALITY_SENSOR

namespace {
Expand All @@ -50,9 +60,14 @@ namespace AirQualitySensor {
sl_status_t Init()
{
sl_status_t status = SL_STATUS_FAIL;
#if (defined(SLI_SI917))
app_i2c_instance = &i2c_instance;
#else
app_i2c_instance = sl_i2cspm_qwiic;
#endif

#ifdef USE_SPARKFUN_AIR_QUALITY_SENSOR
status = sparkfun_sgp40_init(sl_i2cspm_qwiic);
status = sparkfun_sgp40_init(app_i2c_instance);
VerifyOrReturnError(status == SL_STATUS_OK, SL_STATUS_FAIL);
initialized = true;

Expand Down
Loading