Add simple helper macro so users can define a CCCD with a write cb
without having to combine BT_GATT_CCC_MANAGED() and
BT_GATT_CCC_INITIALIZER() themselves.
Unlike the changed callback the write callback has a return value
that can be used to reject the write request.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
The tmp116 sensor driver also supports tmp117 and tmp119. Therefore rename
to indicate that is supports a range of tmp devices.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Support parsing and serializing of struct fields that are defined as a
char array.
Use the token JSON_TOK_STRING_BUF to parse and serialize a string for a
char array, for example:
struct foo {
const char *str;
char str_buf[30];
};
struct json_obj_descr foo_descr[] = {
JSON_OBJ_DESCR_PRIM(struct foo, str, JSON_TOK_STRING),
JSON_OBJ_DESCR_PRIM(struct foo, str_buf, JSON_TOK_STRING_BUF),
};
The struct 'json_obj_descr' now has an additional union member 'field'
to store the size of the struct field, which is used with the token
'JSON_TOK_STRING_BUF' to determine the element size.
Fixes: #65200
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
The i.MXRT10xx series have configurable GPIO pull strengths.
These are available for configuration in the pinctrl system, but not for
regular GPIO use.
This commit adds SOC-series specific GPIO configuration bits for selecting
weak or strong GPIO pulls, similar to drive strengths available from other
GPIO pin configuration examples.
This has been tested on a custom i.MXRT1062 product.
Signed-off-by: Stefan Giroux <stefan.g@feniex.com>
This reverts commit ee05087935.
Since all devices now support nrf_clock HAL as of nrfx 3.10
Signed-off-by: Robert Robinson <robert.robinson@nordicsemi.no>
Allow compiler optimizations to remove High-Speed handling code. Knowing
that maximum operating speed is Full-Speed allows to reduce bulk buffers
from 512 to 64 bytes. More RAM optimizations are possible but this
commit only gets the low hanging fruits.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Add a way to assign the dynamic address for a primary controller. This
is the address that is broadcasted out with the ccc DEFTGTS, and is the
address that secondary controllers use to communicate with the primary
controller.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Up to now, the handling of type float was offloaded to the users of the
JSON utility, with the token JSON_TOK_FLOAT.
Improve handling of floating point types and support the types 'float'
and 'double' in a built-in way so that they can be directly parsed to
and serialized from variables (of type float or double).
The types are serialized in the shortest representation, either as a
decimal number or in scientific notation:
* float (with JSON_TOK_FLOAT_FP): encoded with maximal 9 digits
* double (with JSON_TOK_DOUBLE_FP): encoded with maximal 16 digits
* NaN, Infinity, -Infinity: encoded and decoded as:
{"nan_val":NaN,"inf_pos":Infinity,"inf_neg":-Infinity}
Enable the floating point functionality with the Kconfig option:
JSON_LIBRARY_FP_SUPPORT=y
It requires a libc implementation with support for floating point
functions: strtof(), strtod(), isnan() and isinf().
Fixes: #59412
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
The recent change to spi.h doc merged a bit too early on accident and
some oddities were left over, fix them, including:
- Weird command causing strange broken topics section in output
- spi_iodev_api should probably be hidden, looks strange in its own
section on the doc output
- Fix return values of transceive based functions to match transceive
description
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Added support to gicv3 driver to utilize the
extended SPI MMIO registers introduced in
GICv3.1 for the extended SPI range.
Documentation for the Extended Shared
Peripheral Interrupts extension can be found
in the ARM General Interrupt Controller
Architecture Specification:
https://developer.arm.com/documentation/ihi0069/latest/
Signed-off-by: Adam Openshaw <quic_adamo@quicinc.com>
Renamed the drv8424 stepper driver to indicate its support of the drv8424,
drv8425, drv8426, drv8434 and drv8436 stepper controllors. Also made the
microstep pins optional. All test files are renamed as well.
Signed-off-by: Jan Behrens <jan.behrens@navimatix.de>
Renamed fault event to be more in line with other events and added it to
the stepper shell.
Makes the event callback trigger function of the step-dir implementation
non-static so that step-dir stepper drivers can use it to trigger events
themself.
Signed-off-by: Jan Behrens <jan.behrens@navimatix.de>
ADC output values can have noise, even if the input is 0V. Add a noise
threshold so that raw ADC readings below the threshold can be zeroed
out. By default the threshold is disabled.
Signed-off-by: Jordan Yates <jordan@embeint.com>
only accept new connections until the configured value for concurrent
connections is reached. Also set the backlog of the listening socket
to the configured value.
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
Add bt_ccp_client_get_bearers that will return the bearers of
a client so that the application can always retrieve them if they
do not store them from the discovery callback.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This renames the STM32_PWR_WKUP_PIN_SRC_x symbols to better match
their meaning. It also adds a new symbol (STM32_PWR_WKUP_PIN_NOT_MUXED)
for SoCs without wake-up mux support.
Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
Introduce macro to check for valid microstep resolution in stepper api
Use this macro in tmc50xx driver. Stepper api tests adjusted in order to
accomodate the not implemented stepper api functions.
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
In case of a single core it resolves to 0. In many cases it reduces
code size and execution time compared to reading id in runtime.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add support for fixed GPIO routes that don't have a configurable
route register, but still require mode configuration and enabling.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Add a new absolute timeout construction macro that operates on seconds.
It has the same semantics as `K_TIMEOUT_ABS_MS`, `K_TIMEOUT_ABS_US`,
etc.
Signed-off-by: Jordan Yates <jordan@embeint.com>
When compiling in C++, the designated-initializer error:
Either all initializer clauses should be designated
or none of them should be
Will occur due to an extra pair of braces in the Z_JSON_DESCR_OBJ() macro.
Remove the extra pare of braces which allows the code to compile and
function in both C and C++.
Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
Add support for processing the Fault Status Registers and recoverable
data abort for the cortex A7.
Based on Cortex-A7 MPCore Technical Reference Manual (ARM DDI 0406).
(see https://developer.arm.com/documentation/ddi0406)
Signed-off-by: Julien Racki <julien.racki@st.com>
We can't use the timer.h as the arm timer
is within the soc and does not have an address.
Instead we use the armv8_timer.h, renaming it to armv7_v8_timer.h
for the Cortex-A7 as the cp15 access are compatible.
Signed-off-by: Julien Racki <julien.racki@st.com>
`extern "C"` is not a valid language linkage for declaring
`int main(...)`, as per the ISO C++ Standard Specification.
This fixes the violations of -Wmain, and brings Zephyr
closer to valid C++.
See the C++ standard wording here:
https://eel.is/c++draft/basic.start.main#3.sentence-5
See also the clang warning -Wmain:
https://clang.llvm.org/docs/DiagnosticsReference.html#wmain
However, for freestanding code (i.e. with -ffreestanding),
main has no special meaning, and we need to prevent name
mangling. So allow this forward linkage when not hosted.
This only applies to C++ as these linkage declarations only
exist inside __cplusplus guards.
Signed-off-by: Jordan R Abrahams-Whitehead <ajordanr@google.com>
When building with clang it reports:
tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c:69:22: error: variable
'test_response_read_data_start' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
static const uint8_t test_response_read_data_start[5] = {
^
tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c:73:22: error: variable
'test_response_read_data_end' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
static const uint8_t test_response_read_data_end[1] = {
^
The values of test_response_read_data_start and
test_response_read_data_end are not actually used anywhere in the tests.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
The error occur when discoverying br devices and need to send request_name
for many found devices.
In system work queue task, bt_hci_inquiry_complete->
report_discovery_results is called, then request_name is called for all
the found devices. The controller gives HCI_Remote_Name_Request_Complete
event for every name request result and one buf is allocated from
hci_rx_pool to save HCI_Remote_Name_Request_Complete. When system work
queue task is blocked to call request_name for every device, many
HCI_Remote_Name_Request_Complete are received for the already sent
request_name, it uses up all the buf of hci_rx_pool, then the bt_rx_thread
task is blocked to get buf from hci_rx_pool when next
HCI_Remote_Name_Request_Complete is received, meanwhile the next
request_name send hci cmd and wait the result, but the hci status/complete
event can't be received because the bt_rx_thread is blocked and
bt_uart_isr is kept in the state to receive last
HCI_Remote_Name_Request_Complete, then bt_dev.ncmd_sem is not released,
then the next request_name send hci cmd again, but the bt_dev.ncmd_sem is
invalid, then bt_hci_cmd_send_sync fail and assert.
resolve it by requesting name one by one.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
If the AG works as Data Channel Acceptor, the ACL conn cannot be known
by the application of AG. Similar with HF, add ACL conn as the first
parameter to the `connected` callback of AG.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add function `bt_hfp_hf_connect` to initialize the Service Level
Connection establishment procedure.
Add function `bt_hfp_hf_disconnect` to release the Service Level
Connection.
Clear HF object if the RFCOMM is disconnected.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>