Commit graph

57 commits

Author SHA1 Message Date
Daniel Leung
9f02eeadf8 serial: allow callback setting to be exclusive
Both the IRQ API and Asynchronous API support callback.
However, since they are both interrupt driven, having
callbacks on both API would interfere with each other
in almost all cases. So this adds a kconfig to signal
that the callbacks should be exclusive to each other.
In other words, if one is set, the other should not
be active. Drivers implementing both APIs have been
updated to remove the callbacks from the other API.
Though, this still leaves the option to disable
the kconfig and allows both APIs to have callbacks
if one desires.

Fixes #48606

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-07-18 11:13:02 +00:00
Mike Fikes
c59b04299f doc: isotp introduce CF abbreviation
Introduce the CF abbreviation as is done for
other abbreviations (like FF) before first use.

Signed-off-by: Mike Fikes <mike@fikesfarm.com>
2023-07-16 07:32:24 -04:00
Aaron Massey
e1401fcf5e emul: Add SBS Gauge emulator backend_api
In order to support easier setup of test scenarios with fuel gauge
emulators, we should expose an API that can change internal emulator state.

Add a minimal fuel gauge emulator backend API for setting the charging
current and voltage with a sample implementation in the emul_sbs_gauge with
an associated driver test.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-07-07 09:22:20 +02:00
Tomasz Bursztyka
1b51be4ba0 doc/pcie: Add basic entry for PCIe doxygen documentation
This has been missing so let's add it.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2023-06-17 07:58:41 -04:00
Benjamin Cabé
46f7c044c0 doc: i2c: fixed non-working link to I2C spec
Fixed improperly formatted link to I2C spec.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-06-07 04:40:47 -04:00
Benjamin Cabé
21c1a61551 doc: peripherals: fix bad link to Display API
fixed incorrect link reference to Display API

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-06-07 04:40:47 -04:00
Andrei Emeltchenko
21f59903c7 doc: smbus: Correct SMBus documentation
Fix syntax errors in the documentation.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-06-01 18:04:58 -04:00
Jamie McCrae
71e7cf888d doc: api: Add auxdisplay as unstable API
Adds the new auxiliary display peripheral as an unstable API.

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2023-05-26 23:05:58 +02:00
Jamie McCrae
71e10e743c doc: hardware: peripheral: Add auxdisplay documentation
Adds base auxdisplay documentation.

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2023-05-26 23:05:58 +02:00
Yuval Peress
5ab14730f5 sensors: Add async read/decode documentation
Add documentation about the new async read and decode APIs including
some rough examples.

Signed-off-by: Yuval Peress <peress@google.com>
2023-05-26 11:04:54 -05:00
Keith Short
a6af1dd43d docs: bc12: Update for charging mode operation
Add details for using charging mode and add the BC1.2 emulator API
information to the document.

Signed-off-by: Keith Short <keithshort@google.com>
2023-05-08 09:57:56 +02:00
Yuval Peress
d162bdb202 bbram: Add documentation
- Add doxygen group and improve documentation for bbram.h
- Add a bbram section under peripherals in the main doc/ directory

Fixes #55257

Signed-off-by: Yuval Peress <peress@google.com>
2023-05-05 10:57:01 -05:00
Bjarki Arge Andreasen
84569f8f33 doc/hardware/peripherals/rtc.rst: Refine docs
Fixed spelling mistakes, added links in place of
highlighted text where appropriate and switched
unformatted blocks with bash commands to bash
code blocks.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-04-20 11:43:35 +02:00
Gerard Marull-Paretas
da9059bcf7 doc: regulators: improve introduction
Improve and update driver class introduction. Removed some outdated
information about on/off, mention PMICs, generalize *-supply properties,
etc.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-12 16:43:23 +02:00
Bjarki Arge Andreasen
ae36da516a boards/posix/native_posix: Add emulated RTC device driver
The emulated RTC device driver is used to emulate a real
RTC device. Note that it is not a replacement for the
native_rtc module, which is used to control simulated time,
get time from the host system, etc.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-04-04 17:03:38 +02:00
Bjarki Arge Andreasen
ac697d153d tests/drivers/rtc: Add unit tests for RTC devices
This test suite adds tests for the following:

- Setting and getting time
- Validating time is incrementing correctly
- Validating behavior of alarms with callback disabled
- Validating behavior of alarms with callback enabled
- Validating update callback

The test suite uses the devicetree  alias rtc to find
the device to test.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-04-04 17:03:38 +02:00
Bjarki Arge Andreasen
b557a1d711 include/drivers: Add RTC API header and handlers
This commit adds the rtc.h header file which contains
API functions for real-time-clocks, which are low power
devices which track and represent broken-down time.

It also changes one line of doxygen documentation in the
maxim_ds3132.h file to place it in its own group.

The handlers for use of the API from userspace is also
added with this commit.

The API is split into one mandatory section, setting and
getting time, and three optional sections, alarms, update
event callback, and clock calibration.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-04-04 17:03:38 +02:00
Keith Short
24d5bac58f docs: Add BC1.2 driver documentation
Add BC1.2 driver documentation landing page.

Signed-off-by: Keith Short <keithshort@google.com>
2023-03-30 17:34:36 -04:00
Andrei Emeltchenko
3a6f64b872 doc: edac: Update EDAC / IBECC documentation
Update EDAC documentation and add IBECC documentation.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-03-30 17:33:41 -04:00
Henrik Brix Andersen
4d9e131151 doc: peripherals: fuel_gauge: align title with the rest of the docs
Align the title for the fuel gauge peripheral API with the rest of the
documentation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-30 13:38:41 +00:00
Henrik Brix Andersen
281871ca4d doc: peripherals: sort ToC according to subpage titles
Sort the peripherals table of contents according to the titles of the pages
included.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-29 09:48:13 +00:00
Henrik Brix Andersen
0ae32479b7 doc: peripherals: unify title strings
Unify the peripheral documentation title strings to the format
"<class> [(acronym)] [Bus]".

Including both the full name of the peripheral class and an acronym makes
the documentation more user friendly as some of the acronyms are less
well-known than others.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-29 09:48:13 +00:00
Andrei Emeltchenko
90e6bf8e9f smbus: doc: Add Documentation for SMBus subsystem API
Add some basic documentation and API reference for SMBus.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-03-22 08:16:23 -04:00
Jamie McCrae
69cb35e3ac doc: Add retained memory API and mark as experimental
Adds the the retained memory API to the list and marks it as
experimental.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-20 15:02:09 +01:00
Fabio Baltieri
2815f96440 drivers: move gpio_keys from gpio to input
Port the gpio_keys_zephyr driver from the gpio subsystem with a
dedicated API to the input subsystem reporting input events.

Move the test as well, simplify the cases a bit since the API is simpler
now.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-03-14 17:15:09 -04:00
Dawid Niedzwiecki
2d0a784c41 subsys/mgmt/ec_host_cmd: rework Host Command support
Rework the Host Command support. It includes:
-change API to backend
-change a way of defining rx and tx buffers
-fix synchronization between the handler and backend layer
-simplify the HC handler

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-02-28 10:42:23 +01:00
Dawid Niedzwiecki
b2674a4b34 subsys/mgmt/ec_host_cmd: rename peripheral to backend
Follow naming pattern in the subsystems(logging or shell) and name
the layer between generic handler and peripheral driver "backend".

The name doesn't suit that well to the SHI backend, because there isn't
SHI API itself and the SHI interface is used only for the host
communication. So the backend code includes the peripheral driver itself.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-02-28 10:42:23 +01:00
Kush Nayak
40b6e65782 fix: doc: canbus: fix tx callback function name typo in code snippet
In the `can_send()` example code snippet, it passed the
`can_tx_callback_t` parameter as `tx_irq_callback` even though the
function name was previously defined in the snippet as `tx_callback`.
The parameter passed has been updated to `tx_callback` to maintain
consistency with existing code.

Signed-off-by: Kush Nayak <kushnayak123@gmail.com>
2023-02-24 09:13:33 +01:00
Gerard Marull-Paretas
a1e983fef0 drivers: pinmux: drop driver class
Pinctrl is the new pinmux.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-02-23 16:56:04 -05:00
Daniel Leung
e4903e0664 doc: release-notes/3.3: add bits on I3C
This adds a few bits on I3C subsystem.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-02-16 19:02:06 +09:00
Martin Jäger
fcf1170290 doc: peripherals: can: fix can_filter mask variable name
The member variable was renamed from id_mask to mask in #51361, but
the docs were not adjusted accordingly.

Signed-off-by: Martin Jäger <martin@libre.solar>
2023-02-16 19:01:30 +09:00
Al Semjonovs
4858d995c6 gpio: Include GPIO_KEYS in documentation
Add gpio_keys_interface to GPIO documentation

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2023-01-04 10:36:00 +01:00
Gerard Marull-Paretas
e0c8de1e39 drivers: regulator: fixed: simplify implementation
Remove regulator-fixed-sync specialization, create a single driver that
is always synchronous. The asynchronous part is rarely/never used, so
let's keep things simple for now.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-30 15:49:30 +01:00
Aaron Massey
5fa1abf1cb fuel_gauge: Add basic stub API doc.
Add a short stub doc as a placeholder for future documentation on the fuel
gauge API.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2022-11-19 17:56:05 -05:00
Henrik Brix Andersen
f8a88cdb27 drivers: can: use flags fields for can_frame and can_filter structs
The can_frame and can_filter structs support a number of different flags
(standard/extended CAN ID type, Remote Transmission Request, CAN-FD format,
Bit Rate Switch, ...). Each of these flags is represented as a discrete bit
in the given structure.

This design pattern requires every user of these structs to initialize all
of these flags to either 0 or 1, which does not scale well for future flag
additions.

Some of these flags have associated enumerations to be used for assignment,
some do not. CAN drivers and protocols tend to rely on the logical value of
the flag instead of using the enumeration, leading to a very fragile
API. The enumerations are used inconsistently between the can_frame and
can_filter structures, which further complicates the API.

Instead, convert these flags to bitfields with separate flag definitions
for the can_frame and can_filter structures. This API allows for future
extensions without having to revisit existing users of the two
structures. Furthermore, this allows driver to easily check for unsupported
flags in the respective API calls.

As this change leads to the "id_mask" field of the can_filter to be the
only mask present in that structure, rename it to "mask" for simplicity.

Fixes: #50776

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-10-25 16:32:10 +02:00
Sam Hurst
76730da1a2 doc: add API documentation for USB-C VBUS Driver
This commit adds the USB-C driver API documentation in peripherals section
of the reference guide. The USB-C VBUS API is declared experimental.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2022-10-22 18:38:35 -04:00
Tomasz Moń
5c42b42116 doc: Add missing kconfig option prefix
Kconfig options have to be prefixed with :kconfig:option: in order to
appear as links in generated html output.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2022-10-13 13:16:06 -04:00
Stephanos Ioannidis
4cf129e13b doc: peripherals: i2c: Fix incorrect hyperlink references
This commit fixes incorrect external hyperlink references.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
2352f7470b doc: peripherals: tcpc: Fix incorrect hyperlink references
This commit fixes incorrect external hyperlink references.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Henrik Brix Andersen
8a2b26a004 doc: hardware: peripherals: canbus: controller: add start/stop calls
Add calls to can_stop()/can_start() to the CAN controller documentation
code snippet.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-09-13 16:06:50 +00:00
Daniel Leung
16b22fa46a doc: i3c: add a few bits about the new I3C API
This adds a fews bits about the newly introduced I3C API
for I3C controller.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-09-09 17:42:33 -04:00
Henrik Brix Andersen
795280e2a2 samples: drivers: can: rename the CAN counter sample
Rename the CAN controller "counter" sample to make room for more CAN
related samples.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-09-06 09:56:57 +02:00
Gerard Marull-Paretas
a202341958 devices: constify device pointers initialized at compile time
Many device pointers are initialized at compile and never changed. This
means that the device pointer can be constified (immutable).

Automated using:

```
perl -i -pe 's/const struct device \*(?!const)(.*)= DEVICE/const struct
device *const $1= DEVICE/g' **/*.c
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-22 17:08:26 +02:00
Henrik Brix Andersen
13c75417ba drivers: can: remove z prefix from public CAN API types
Remove the "z" prefix from the public CAN controller API types as this
makes them appear as internal APIs.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-08-18 10:19:29 +02:00
Thomas Stranger
cbd79250e3 doc: add api documentation for w1 driver
This commit adds the w1 driver API documentation in peripherals section
of the reference guide.
The 1-Wire API is declared as unstable in the API overview.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-07-05 23:06:45 +02:00
Tom Burdick
88ca215eed i2c: Update API terminology
Updates the API and types to match updated I2C terminology. Replaces master
with controller and slave with target.

Updates all drivers to match the changed macros, types, and API signatures.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-06-29 17:51:31 +02:00
Tom Burdick
19f8ba6a04 docs: i2c: Documentation terminology updated
The i2c terminology has been updated as such master is now controller,
and slave is now target. Updates all doc comments and doc pages to use
updated terminology. Does not change types or API definitions.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-06-29 17:51:31 +02:00
Mark Holden
44c388fb33 coredump: drivers: Add coredump device
Add a pseudo device diver with device tree bindings for coredump.
The device tree bindings exposes memory address/size values to be
included in any dump. And the driver exposes an API to add/remove
dump memory regions at runtime.

Signed-off-by: Mark Holden <mholden@fb.com>
2022-06-05 14:28:34 +02:00
Andrei-Edward Popa
d82c10f197 include: drivers: changed API function names for reset controller
assert API function needed to be changed because of newlib assert
macro name conflict

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
2022-05-26 13:02:19 -07:00
Yasushi SHOJI
bc35b1340c doc: uart: Make sure uart_poll_in is non-blocking
The documentation has wrongly stated that the function uart_poll_in() is
also a blocking function.  The uart_poll_out() is indeed a blocking
function but uart_poll_in() has never been since day one.

Make it clear that the uart_poll_in() is a NON-blocking function, and
uart_poll_out() IS a blocking.

This fixes #45468.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2022-05-13 10:03:31 -07:00