Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
hwinfo.h
Go to the documentation of this file.
1
7/*
8 * Copyright (c) 2018 Alexander Wachter
9 *
10 * SPDX-License-Identifier: Apache-2.0
11 */
12
13#ifndef ZEPHYR_INCLUDE_DRIVERS_HWINFO_H_
14#define ZEPHYR_INCLUDE_DRIVERS_HWINFO_H_
15
23#include <zephyr/types.h>
24#include <sys/types.h>
25#include <stddef.h>
26#include <errno.h>
27#include <kernel.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#define RESET_PIN BIT(0)
34#define RESET_SOFTWARE BIT(1)
35#define RESET_BROWNOUT BIT(2)
36#define RESET_POR BIT(3)
37#define RESET_WATCHDOG BIT(4)
38#define RESET_DEBUG BIT(5)
39#define RESET_SECURITY BIT(6)
40#define RESET_LOW_POWER_WAKE BIT(7)
41#define RESET_CPU_LOCKUP BIT(8)
42#define RESET_PARITY BIT(9)
43#define RESET_PLL BIT(10)
44#define RESET_CLOCK BIT(11)
45
66__syscall ssize_t hwinfo_get_device_id(uint8_t *buffer, size_t length);
67
68ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length);
69
90__syscall int hwinfo_get_reset_cause(uint32_t *cause);
91
92int z_impl_hwinfo_get_reset_cause(uint32_t *cause);
93
103__syscall int hwinfo_clear_reset_cause(void);
104
105int z_impl_hwinfo_clear_reset_cause(void);
106
119
120int z_impl_hwinfo_get_supported_reset_cause(uint32_t *supported);
121
126#ifdef __cplusplus
127}
128#endif
129
130#include <syscalls/hwinfo.h>
131
132#endif /* ZEPHYR_INCLUDE_DRIVERS_HWINFO_H_ */
System error numbers.
ssize_t hwinfo_get_device_id(uint8_t *buffer, size_t length)
Copy the device id 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.
static ZTEST_BMEM char buffer[8]
Test mailbox enhance capabilities.
Definition: test_mbox_api.c:566
__SIZE_TYPE__ ssize_t
Definition: types.h:28
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58