Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Hardware Information Interface. More...
Macros | |
#define | RESET_PIN BIT(0) |
#define | RESET_SOFTWARE BIT(1) |
#define | RESET_BROWNOUT BIT(2) |
#define | RESET_POR BIT(3) |
#define | RESET_WATCHDOG BIT(4) |
#define | RESET_DEBUG BIT(5) |
#define | RESET_SECURITY BIT(6) |
#define | RESET_LOW_POWER_WAKE BIT(7) |
#define | RESET_CPU_LOCKUP BIT(8) |
#define | RESET_PARITY BIT(9) |
#define | RESET_PLL BIT(10) |
#define | RESET_CLOCK BIT(11) |
Functions | |
ssize_t | hwinfo_get_device_id (uint8_t *buffer, size_t length) |
Copy the device id to a buffer. More... | |
int | hwinfo_get_reset_cause (uint32_t *cause) |
Retrieve cause of device reset. More... | |
int | hwinfo_clear_reset_cause (void) |
Clear cause of device reset. More... | |
int | hwinfo_get_supported_reset_cause (uint32_t *supported) |
Get supported reset cause flags. More... | |
Hardware Information Interface.
#define RESET_BROWNOUT BIT(2) |
#include <include/drivers/hwinfo.h>
#define RESET_CLOCK BIT(11) |
#include <include/drivers/hwinfo.h>
#define RESET_CPU_LOCKUP BIT(8) |
#include <include/drivers/hwinfo.h>
#define RESET_DEBUG BIT(5) |
#include <include/drivers/hwinfo.h>
#define RESET_LOW_POWER_WAKE BIT(7) |
#include <include/drivers/hwinfo.h>
#define RESET_PARITY BIT(9) |
#include <include/drivers/hwinfo.h>
#define RESET_PIN BIT(0) |
#include <include/drivers/hwinfo.h>
#define RESET_PLL BIT(10) |
#include <include/drivers/hwinfo.h>
#define RESET_POR BIT(3) |
#include <include/drivers/hwinfo.h>
#define RESET_SECURITY BIT(6) |
#include <include/drivers/hwinfo.h>
#define RESET_SOFTWARE BIT(1) |
#include <include/drivers/hwinfo.h>
#define RESET_WATCHDOG BIT(4) |
#include <include/drivers/hwinfo.h>
int hwinfo_clear_reset_cause | ( | void | ) |
#include <include/drivers/hwinfo.h>
Clear cause of device reset.
Clears reset cause flags.
zero | if successful. |
-ENOTSUP | if there is no implementation for the particular device. |
any | negative value on driver specific errors. |
#include <include/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 then 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. |
-ENOTSUP | 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 <include/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. |
-ENOTSUP | 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 <include/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. |
-ENOTSUP | if there is no implementation for the particular device. |
any | negative value on driver specific errors. |