In order to be consistent with what is possible in Devicetree, always
take a period in nanoseconds. Other scales or units may be specified by
using, e.g., the PWM_MSEC() macros (all of them converting down to
nanoseconds). This change then deletes the "_nsec" and "_usec" versions
of the pwm_set call.
Note that this change limits the period to UINT32_MAX nanoseconds,
~4.3s. PWM is, in generali, used with periods below the second so it
should not be a problem.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
- add `channel-gpios` property with GPIO assignments for PWM channels
to `sw_pwm` nodes
- update PWM related macros to refer to channels instead of pins
- remove no longer needed inclusion of boards/arm/bbc_microbit/board.h
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Fix spelling errors in assorted .rst files. The errors were found
using a tool called 'codespell'.
Signed-off-by: Aleksandar Markovic <aleksandar.markovic.sa@gmail.com>
The autoconf.h header is not required because the definitions present in
the file are exposed using the compiler `-imacros` flag.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This is a follow-up to commit cf6a58d3f6.
Restore the "nordic,nrf-ipc" compatible property in mbox nodes for both
nRF5340 cores and use it together with the new "nordic,mbox-nrf-ipc"
one. This way either the MBOX or the IPM driver can be used for these
nodes without further modifications. This eliminates the need to use
overlays in quite a few cases, so remove all those no longer needed
ones (which are also a bit confusing now as they refer to no longer
existing ipc@2a000 and ipc@41012000 nodes).
Restore also the ipc node label removed in the commit mentioned above,
as the label is used in validation of base addresses of nRF DT nodes.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Some names of the test cases are duplicated within the project.
This commit contains the proposed names of the test scenarios.
Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
Add a new callback structure for Bluetooth authentication
This struct is meant to replace the information-only
callbacks in bt_conn_auth_cb. The reason for this is that
due to the nature of bt_conn_auth_cb, it can only be registered
once. To allow mulitple users gain information about pairing
and bond deletions, this new struct is needed.
Samples, tests, etc. are updated to use the new struct.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The nrf52840dk_nrf52840 board has been ported to pinctrl, so there's no
need to keep duplicated definitions in the sample anymore.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Extend the macro with checks for DT properties related to pin
assignments that are defined but would be ignored, depending on
whether PINCTRL is enabled or not, what presumably indicates
a resulting configuration different from what the user expects.
Add also a possibility to indicate that the pinctrl-1 property
should not be checked because the caller does not support the
sleep state.
Rename the macro so that its name better reflects its function.
Update accordingly all drivers that use it.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The pm_constraint_* APIs were effectively used by the policy manager
only. This patch renames the API to the policy namespace and makes its
naming more explicit:
- pm_constraint_set -> pm_policy_state_lock_get()
- pm_constraint_release -> pm_policy_state_lock_put()
- pm_constraint_get -> pm_policy_state_lock_is_active()
The reason for these changes is that constraints can be of many types:
allow/disallow states, impose latency requirements, etc. The new naming
also makes explicit that the API calls will influence the PM policy
behavior.
All drivers and documentation have been updated accordingly.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Use NRF_DT_GPIOS_TO_PSEL() in calls to nRF GPIO HAL functions as they
need a psel value, a pin number combined with the corresponding GPIO
port number, not only the pin number as provided by DT_GPIO_PIN().
This way buttons connected to pins in the P1 port can also be handled
properly.
Replace also DT_NODELABEL(button0) with DT_ALIAS(sw0) for consistency
with other samples that use the standard button.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Reserve the upper 8 bits of gpio_dt_flags_t for SoC specific flags and
move the non-standard, hardware-specific GPIO devicetree flags (IO
voltage level, drive strength, debounce filter) from the generic
dt-bindings/gpio/gpio.h header to SoC specific dt-bindings headers.
Some of the SoC specific dt-bindings flags take up more bits than
necessary in order to retain backwards compatibility with the deprecated
GPIO flags. The width of these fields can be reduced/optimized once the
deprecated flags are removed.
Remove hardcoded use of GPIO_INT_DEBOUNCE in GPIO client drivers. This
flag can now be set in the devicetree for boards/SoCs with debounce
filter support. The SoC specific debounce flags have had the _INT part
of their name removed since these flag must be passed to
gpio_pin_configure(), not gpio_pin_interrupt_configure().
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
According to Kconfig guidelines, boolean prompts must not start with
"Enable...". The following command has been used to automate the changes
in this patch:
sed -i "s/bool \"[Ee]nables\? \(\w\)/bool \"\U\1/g" **/Kconfig*
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add build assertions that will ensure that every peripheral for
which a driver instance is created has some pins assigned to it.
Neither pinctrl-0 nor *-pin properties can be currently marked as
required in devicetree, so these assertions will help users avoid
invalid configurations where it could be hard to figure out why
the UART is not working.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This sample application uses the STM32 USB TCPC Driver to create a USBC
Sink Application for the STM32G081b_eval board.
Signed-off-by: Sam Hurst <sbh1187@gmail.com>
Kconfig options now belong to the Kconfig domain, therefore, the
:kconfig:option: role needs to be used.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The sample cannot spin in an infinity loop because the idle thread will
not run and consequently the forced state will not be used.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Add sample which demonstrates how RTC clocks are synchronized
between application and network core.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Various obsolote and misnamed platfomrs in test filters theat went
undetected for a while.
Fixes#41222
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add a sample that can be used to see the nRF LED matrix display driver
in action and that will prove that the driver is buildable for both the
bbc_microbit_v2 and bbc_microbit boards.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
samples/boards/pine64_pinetime has the same functionality as the more
general samples/basic/button application with the board specific
driver `pinetime-key-out`.
Signed-off-by: Casper Meijn <casper@meijn.net>
Many documents relied on single quotes to create references, e.g.
`my_reference`. This is possible because `default_role = "any"` is
enabled in Sphinx conf.py. However, this method comes with its problems:
- It mixes all domains together, so it's not clear to what are you
referencing: a document? a Kconfig option? a C function?...
- It creates inconsistencies: in some places explicit roles are used
(e.g. :ref:`my_page`) while in some others not.
- _Conflictis_ with markdown. Single quotes are used for literals in
Markdown, so people tend to use the same syntax in Sphinx, even though
it has a different purpose.
Usages have been found using `git grep ' `[^`]*` ' -- **/*.rst`.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Rename PM_STATE_DT_ITEMS_LEN to DT_NUM_CPU_POWER_STATES to make its
purpose more clear. This macro could be made part of a Devicetree API
for PM in the future.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Rename the PM_STATE_INFO_DT_ITEMS_LIST macro to
PM_STATE_INFO_LIST_FROM_DT_CPU to make its purpose more clear. Similar
naming scheme is found e.g. in the GPIO API.
Associated internal macros and docstrings have been adjusted, too.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Remove this line because the pm_device_busy_set function will
prevent the system to enter low power.
This sample application wants to.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
The device PM subsystem _depends_ on device, not vice-versa. Devices
only hold a reference to struct pm_device now, and initialize this
reference with the value provided in Z_DEVICE_DEFINE. This requirement
can be solved with a forward struct declaration, meaning there is no
need to include device PM headers.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a sample that shows how dynamic pin control can be useful to remap a
peripheral to a different set of pins.
NOTE: default pin configuration is provided for the nRF52840-DK board.
Such configuration will be removed once all nRF-based boards are ported
to pinctrl.
Thanks to Francesco for documentation suggestions.
Co-authored-by: Francesco D. Servidio <francesco.servidio@nordicsemi.no>
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Since drivers implement a callback based on action and not the state,
we should be using the API based on the action instead of the one based
on the state.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Remove option CONFIG_USB_UART_CONSOLE where it has no influence
or enable CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR without taking
a detour through CONFIG_USB_UART_CONSOLE.
Check the compatibility of chosen property instead
of usage of CONFIG_USB_UART_CONSOLE option.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Change pm_power_state_force to receive which cpu the state should be
forced. Also, it changed the API behavior to force the given state only
when the idle thread for that core is executed.
In a multicore environment force arbitrarily a core to suspend is not
safe because the kernel cannot infer what that cpu is running and how it
impacts the overall system, for example, if it is holding a lock that is
required by a thread that is running in another cpu.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Convert remaining tests and samples to using find_package() instead of
literally including the CMake boilerplate code.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit adds const modifier in second argument for
sensor trigger handler.
There is no reason to modify this data and this change
would allow to store trigger configuration also in FLASH.
Fixes: #38929
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
THis patch fixes multiple issues when referencing to the C domain. In
some cases there were typos (e.g. missing :), in some others no domain
syntax was used for referencing, etc.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>