zephyr/doc/reference
Peter Bigot 72ebf70543 device: refactor to simplify maintenance
DEVICE_AND_API_INIT and DEVICE_DEFINE are identical except that
DEVICE_DEFINE adds a parameter providing the device pm control
function, while DEVICE_AND_API_INIT does not.  This requires duplicate
implementations where if CONFIG_DEVICE_POWER_MANAGEMENT is enabled
then DEVICE_AND_API_INIT delegates to DEVICE_DEFINE with a dummy pm
control function, and if it is not enabled then DEVICE_DEFINE discards
the parameter and delegates to DEVICE_AND_API_INIT.

DEVICE_INIT is like DEVICE_AND_API_INIT but doesn't provide an API.

Clean this up by refactoring so that DEVICE_DEFINE is the core
implementation, providing with and without device power management
right next to each other where they can be compared and maintained.
Redefine DEVICE_INIT and DEVICE_AND_API_INIT delegate to
DEVICE_DEFINE.

Also remove duplicate code by extracting the variations due to
enabling device power management into macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-22 13:37:07 +02:00
..
audio doc: reference: Move i2s reference to Audio section 2020-06-12 10:29:24 -04:00
bluetooth Bluetooth: doc: Include gap.h and addr.h in documentation build 2020-04-30 13:34:28 +02:00
crypto doc: reference: Clean up and restructure a bit 2020-03-18 11:47:24 +01:00
devicetree doc: dts: simplify DT_INST documentation 2020-05-26 22:32:34 +02:00
display doc: reference: Clean up and restructure a bit 2020-03-18 11:47:24 +01:00
drivers device: refactor to simplify maintenance 2020-06-22 13:37:07 +02:00
file_system doc: reference: Clean up and restructure a bit 2020-03-18 11:47:24 +01:00
kernel zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
logging logging: Clarify that hexdump messages have no function prefix 2020-06-16 19:05:51 +02:00
misc doc: reference: misc: highlight userspace restriction on sys_notify 2020-05-20 10:34:17 +02:00
networking net: lwm2m: Add ObjLnk resource type support 2020-06-15 22:13:34 +03:00
peripherals doc: reference: Move i2s reference to Audio section 2020-06-12 10:29:24 -04:00
power_management zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
random doc: reference: Clean up and restructure a bit 2020-03-18 11:47:24 +01:00
resource_management sys: onoff: redesign to meet changed needs 2020-04-22 16:52:47 +02:00
settings doc: reference: Clean up and restructure a bit 2020-03-18 11:47:24 +01:00
shell zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
storage storage: add stream flash library 2020-05-06 11:14:00 +02:00
usb USB: Add driver and PID for Bluetooth H4 2020-04-20 21:59:47 +03:00
usermode zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
util api: promote sys/util.h to experimental 2020-06-18 19:38:10 +02:00
index.rst api: promote sys/util.h to experimental 2020-06-18 19:38:10 +02:00
overview.rst api: promote sys/util.h to experimental 2020-06-18 19:38:10 +02:00
terminology.rst doc: reference: terminology: refine API attributes 2020-04-22 17:39:56 +02:00