The application may want to know the configured mode without inspecting
Kconfig macros; this is important for proper management of BASELINE
which is mode-dependent.
It also may need to know the version of the hardware and firmware, as
the behavior of application firmware 2.0 is significantly better than
version 1.1.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This mode is documented as producing a raw result every 250 ms that the
application must convert to eCO2 and eTVOC readings. In practice
application firmware 2.0 appears to convert the readings as with all
other rates.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Expose the entire content of the ALG_RESULT_DATA block to the
application, primarily so the status and error flags can be seen. With
those available the application has the ability to detect that a stale
result has been provided so sensor_fetch_sample() can return -EAGAIN in
this case instead of -EIO, and it doesn't need to block which is
annoying.
This should also make the sensor usable on older Nordic Thingy:52
devices with outdated CCS811 application firmware that doesn't properly
implement the DATA_READY bit.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Accurate estimate of gas presence requires temperature and humidity
data. Add API to update these values.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Use CMSIS-standard bit mask and offset macros. Rename the field to more
closely match the data sheet. Use slightly less magic numbers for the
scale multipliers.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Proper use of the CCS811 requires maintenance of the BASELINE
register value measured in clean air at various points in the sensor
life cycle. The sensor driver abstraction has no facility to support
this, so add an application header with functions to fetch and update
the register value.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Add the standard suite of trigger configuration options. Add driver
support for the DATA_READY and THRESHOLD triggers. Note cross-module
dependency as configuring the trigger requires a controlled modification
of the sensor registers and the sensor driver API doesn't support this.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The original implementation relied on the DATA_READY bit of the STATUS
register to indicate when a reading was available. This bit remains
clear for the first several readings produced by the CCS811.
When INT_DATARDY is set in MEAS_MODE the nINT signal will remain
asserted until ALG_RESULT_DATA is read. If this is treated as a LEVEL
signal, which is the common case in Zephyr, gating the read of
ALG_RESULT_DATA on DATA_READY means the signal will never be cleared,
and the interrupt callback will be repeated immediately.
Since the STATUS register value is part of the ALG_RESULT_DATA block
just read the whole thing, and provide its content to the user only if
the DATA_READY bit is set.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The CCS811 has a measurement lifecycle that includes certain timing
constraints, including that calibration constants should not be applied
until the conditioning period has completed. If a device resets but the
CCS811 remains the process of inspecting current state and initializing
the device properly can be complicated.
Simplify this by forcing a reset of the device when the driver is
initialized. Should this cause hardship the necessary logic and
infrastructure to record time-of-last-reset across reboots and verify
measurement mode/baseline consistency can be added at that point.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Read the status and error in one function that provides its own
diagnostics.
Also change name of register to match datasheet.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The CCS811 can be in either boot mode (after powerup) or application
mode, and these modes have distinct register maps that share only some
content. The register written to switch from boot mode to application
mode is not available in application mode, so don't write to it in that
case.
Also respect the required timeout between APP_START and next I2C
operation.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Allow application to choose the measurement rate.
Measurement mode 4 (250 ms rate) is not supported because it we have no
support for processing the raw data it produces.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Asserting the WAKEn increases current draw. Turn it off when I2C is
not being used.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.
This symbol is already enabled indirectly through being selected by
NET_L2_IEEE802154_RFD, which is enabled in the configuration file.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.
This symbol is enabled through being selected by other symbols.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.
This symbol is enabled through being selected by SOC_ATOM in
soc/x86/atom/Kconfig.soc.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Fix error in calculation of the minimum discardable buffer size. For
the LE Advertising Report the maximum payload is 31 bytes plus
additional data in the event gives an event size of 41 bytes (given that
num_reports is 1). Since this is a meta event we need to include the
sub-event code, plus the event header of 2 bytes. Total of 44 bytes.
This is a regression from afa9c42d75 where we forgot th 1 byte for the
RSSI that is appended after the data. Easy to miss since it is not part
of the struct.
Fix error in calculation of the num complete buffer size. Here we forgot
to include the 2 byte event header.
This is a regression from 89981b07c8.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
should_write() returns False for properties that are skipped in
write_properties(). Shortens write_properties() a bit.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
RTT backend was treating synchronous mode (LOG_IMMEDIATE) and panic
mode in the same way. That lead to decreased bandwidth since after
each transfer operation backend was pending until RTT data is read by
the host. It is vital only in panic mode to ensure that device do not
reset before all data is read by the host. In synchronous mode that
degrades performance significantly.
Added distinction between those two modes.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The amount of lock regions differs between different sam0 MCUs.
saml10: 2
saml11: 4
samd2x: 16
saml2x: 16
samd5x: 32
ASF does not provide a definition for this, so create a new one
in dts.
Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
This adds support for the flash peripheral found in the SAME5x/SAMD5x
line of MCUs.
The peripheral is very simmilar to the one found on SAMD2x with only
a few register names changed.
Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Refactors the mcux gpt driver to use generated device tree macros
directly. Removes now unused dts fixup macros from i.mx rt socs.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Refactors the mcux igpio driver to use generated device tree macros
directly. Removes now unused dts fixup macros from i.mx rt socs.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Refactors the mcux lpuart driver to use generated device tree macros
directly. Removes now unused dts fixup macros from i.mx rt and kinetis
socs.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Refactors the mcux lpi2c driver to use generated device tree macros
directly. Removes now unused dts fixup macros from i.mx rt and kinetis
socs.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This change prevents zephyr LL specific configurations to show up when
using an out of tree BLE controller.
BT_CTLR_ASSERT_HANDLER is used outside the controller as well,
so this is kept as is.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.
This symbol is select'ed automatically by the X86_MMU, ARM_MPU, and
ARC_MPU symbols.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Adds BME280 SPI chip select pin control if chip select is
configured for the device in the device tree.
Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
This shield adds analog and digital sensors to a TI LaunchPad
development kit. Currently only the ADXL362 accelerometer is supported.
This is useful for exercising the SPI interface. The analog sensors will
be useful if we add support for the sensor controller and ADC in the
future.
Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
Add BoosterPack connector information to the DTS of the CC1352 and
CC26x2 LaunchPad boards. This allows shields (e.g. BoosterPacks) to use
aliases for the connector interfaces and mappings for the GPIOs. This is
similar to what is being done for the Arduino connectors.
Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
This header is found on TI LaunchPad development kits and BoosterPack
expansion modules. This binding allows boards to define mappings from
header pins to device GPIOs.
Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.
This symbol is enabled through being select'ed by SOC_SERIES_IMX_6X_M4,
SOC_SERIES_IMX7_M4, and SOC_SERIES_IMX_RT.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.
These configuration files all enable UART_CONSOLE, which selects
CONSOLE_HAS_DRIVER.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Add documentation for why connection objects are still in use during the
disconnected callback and document error code when starting connectable
advertiser with no free connection object available.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Remove re-using connection objects in disconnected state when creating
directed advertiser or establishing a connection as a central using
direct connection procedure.
This makes the API mores consistent it terms of which connection roles
can be started from the disconnected callback.
This also avoids a central connection object being re-used for a
connection as a peripheral instead and vice versa.
When attempting to create a new connection the API would returning
a valid connection object if there is already an existing connection
object.
This existing connection object could be either in the process of
establishing the connection or already connected.
Returning the connection object in this would give the false impression
that the stack has initiated connection procedure, when in fact it just
returned an existing connection object.
The application has the ability to check for existing connection objects
using the bt_conn_lookup_addr_le API.
Add warning plus comment possible scenarios why the a valid connection
object might exists. Most important is to explain why a valid connection
object exists during the disconnected callback.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Reserve conn object for undirected connectable advertiser. This means we
won't have a situation where we start a connectable advertise but will
fail to allocate a connection object for it in the connection complete
event.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Reserve a connection object when starting the auto-initiator using the
controller whitelist.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix bt_conn_create_aute_le returning the wrong error code when bt_init
has not been called yet. This is inconsistent with the rest of the API
functions.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>