Zephyr API Documentation
3.7.0
A Scalable Open Source RTOS
|
Hardware Information Interface. More...
Functions | |
ssize_t | hwinfo_get_device_id (uint8_t *buffer, size_t length) |
Copy the device id to a buffer. | |
int | hwinfo_get_device_eui64 (uint8_t *buffer) |
Copy the device EUI64 to a buffer. | |
int | hwinfo_get_reset_cause (uint32_t *cause) |
Retrieve cause of device reset. | |
int | hwinfo_clear_reset_cause (void) |
Clear cause of device reset. | |
int | hwinfo_get_supported_reset_cause (uint32_t *supported) |
Get supported reset cause flags. | |
Reset cause flags | |
#define | RESET_PIN BIT(0) |
External pin. | |
#define | RESET_SOFTWARE BIT(1) |
Software reset. | |
#define | RESET_BROWNOUT BIT(2) |
Brownout (drop in voltage) | |
#define | RESET_POR BIT(3) |
Power-on reset (POR) | |
#define | RESET_WATCHDOG BIT(4) |
Watchdog timer expiration. | |
#define | RESET_DEBUG BIT(5) |
Debug event. | |
#define | RESET_SECURITY BIT(6) |
Security violation. | |
#define | RESET_LOW_POWER_WAKE BIT(7) |
Waking up from low power mode. | |
#define | RESET_CPU_LOCKUP BIT(8) |
CPU lock-up detected. | |
#define | RESET_PARITY BIT(9) |
Parity error. | |
#define | RESET_PLL BIT(10) |
PLL error. | |
#define | RESET_CLOCK BIT(11) |
Clock error. | |
#define | RESET_HARDWARE BIT(12) |
Hardware reset. | |
#define | RESET_USER BIT(13) |
User reset. | |
#define | RESET_TEMPERATURE BIT(14) |
Temperature reset. | |
Hardware Information Interface.
#define RESET_BROWNOUT BIT(2) |
#include <zephyr/drivers/hwinfo.h>
Brownout (drop in voltage)
#define RESET_CLOCK BIT(11) |
#include <zephyr/drivers/hwinfo.h>
Clock error.
#define RESET_CPU_LOCKUP BIT(8) |
#include <zephyr/drivers/hwinfo.h>
CPU lock-up detected.
#define RESET_DEBUG BIT(5) |
#include <zephyr/drivers/hwinfo.h>
Debug event.
#define RESET_HARDWARE BIT(12) |
#include <zephyr/drivers/hwinfo.h>
Hardware reset.
#define RESET_LOW_POWER_WAKE BIT(7) |
#include <zephyr/drivers/hwinfo.h>
Waking up from low power mode.
#define RESET_PARITY BIT(9) |
#include <zephyr/drivers/hwinfo.h>
Parity error.
#define RESET_PIN BIT(0) |
#include <zephyr/drivers/hwinfo.h>
External pin.
#define RESET_PLL BIT(10) |
#include <zephyr/drivers/hwinfo.h>
PLL error.
#define RESET_POR BIT(3) |
#include <zephyr/drivers/hwinfo.h>
Power-on reset (POR)
#define RESET_SECURITY BIT(6) |
#include <zephyr/drivers/hwinfo.h>
Security violation.
#define RESET_SOFTWARE BIT(1) |
#include <zephyr/drivers/hwinfo.h>
Software reset.
#define RESET_TEMPERATURE BIT(14) |
#include <zephyr/drivers/hwinfo.h>
Temperature reset.
#define RESET_USER BIT(13) |
#include <zephyr/drivers/hwinfo.h>
User reset.
#define RESET_WATCHDOG BIT(4) |
#include <zephyr/drivers/hwinfo.h>
Watchdog timer expiration.
int hwinfo_clear_reset_cause | ( | void | ) |
#include <zephyr/drivers/hwinfo.h>
Clear cause of device reset.
Clears reset cause flags.
zero | if successful. |
-ENOSYS | if there is no implementation for the particular device. |
any | negative value on driver specific errors. |
int hwinfo_get_device_eui64 | ( | uint8_t * | buffer | ) |
#include <zephyr/drivers/hwinfo.h>
Copy the device EUI64 to a buffer.
This routine copies the device EUI64 (8 bytes) to the buffer. The EUI64 depends on the hardware and is guaranteed unique.
buffer | Buffer of 8 bytes to write the ID to. |
zero | if successful. |
-ENOSYS | if there is no implementation for the particular device. |
any | negative value on driver specific errors. |
#include <zephyr/drivers/hwinfo.h>
Copy the device id to a buffer.
This routine copies "length" number of bytes of the device ID to the buffer. If the device ID is smaller than length, the rest of the buffer is left unchanged. The ID depends on the hardware and is not guaranteed unique.
Drivers are responsible for ensuring that the ID data structure is a sequence of bytes. The returned ID value is not supposed to be interpreted based on vendor-specific assumptions of byte order. It should express the identifier as a raw byte sequence, doing any endian conversion necessary so that a hex representation of the bytes produces the intended serial number.
buffer | Buffer to write the ID to. |
length | Max length of the buffer. |
size | of the device ID copied. |
-ENOSYS | if there is no implementation for the particular device. |
any | negative value on driver specific errors. |
int hwinfo_get_reset_cause | ( | uint32_t * | cause | ) |
#include <zephyr/drivers/hwinfo.h>
Retrieve cause of device reset.
cause | OR'd reset cause flags |
This routine retrieves the flags that indicate why the device was reset.
On some platforms the reset cause flags accumulate between successive resets and this routine may return multiple flags indicating all reset causes since the device was powered on. If you need to retrieve the cause only for the most recent reset call hwinfo_clear_reset_cause
after calling this routine to clear the hardware flags before the next reset event.
Successive calls to this routine will return the same value, unless hwinfo_clear_reset_cause
has been called.
zero | if successful. |
-ENOSYS | if there is no implementation for the particular device. |
any | negative value on driver specific errors. |
int hwinfo_get_supported_reset_cause | ( | uint32_t * | supported | ) |
#include <zephyr/drivers/hwinfo.h>
Get supported reset cause flags.
supported | OR'd reset cause flags that are supported |
Retrieves all reset_cause
flags that are supported by this device.
zero | if successful. |
-ENOSYS | if there is no implementation for the particular device. |
any | negative value on driver specific errors. |