v2.0.0
error.h
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _PICO_ERROR_H
8#define _PICO_ERROR_H
9
10#ifndef __ASSEMBLER__
11
22 enum pico_error_codes {
23 PICO_OK = 0,
24 PICO_ERROR_NONE = 0,
25 PICO_ERROR_GENERIC = -1,
26 PICO_ERROR_TIMEOUT = -2,
27 PICO_ERROR_NO_DATA = -3,
28 PICO_ERROR_NOT_PERMITTED = -4,
29 PICO_ERROR_INVALID_ARG = -5,
30 PICO_ERROR_IO = -6,
31 PICO_ERROR_BADAUTH = -7,
32 PICO_ERROR_CONNECT_FAILED = -8,
33 PICO_ERROR_INSUFFICIENT_RESOURCES = -9,
34 PICO_ERROR_INVALID_ADDRESS = -10,
35 PICO_ERROR_BAD_ALIGNMENT = -11,
36 PICO_ERROR_INVALID_STATE = -12,
37 PICO_ERROR_BUFFER_TOO_SMALL = -13,
38 PICO_ERROR_PRECONDITION_NOT_MET = -14,
39 PICO_ERROR_MODIFIED_DATA = -15,
40 PICO_ERROR_INVALID_DATA = -16,
41 PICO_ERROR_NOT_FOUND = -17,
42 PICO_ERROR_UNSUPPORTED_MODIFICATION = -18,
43 PICO_ERROR_LOCK_REQUIRED = -19,
44 PICO_ERROR_VERSION_MISMATCH = -20,
45 PICO_ERROR_RESOURCE_IN_USE = -21
46};
47
48#endif // !__ASSEMBLER__
49
50#endif
pico_error_codes
pico_error_codes
Common return codes from pico_sdk methods that return a status.
Definition: error.h:22
PICO_ERROR_NONE
@ PICO_ERROR_NONE
No error; the operation succeeded.
Definition: error.h:24
PICO_ERROR_NOT_PERMITTED
@ PICO_ERROR_NOT_PERMITTED
Permission violation e.g. write to read-only flash partition, or security violation.
Definition: error.h:28
PICO_ERROR_MODIFIED_DATA
@ PICO_ERROR_MODIFIED_DATA
Cached data was determined to be inconsistent with the actual version of the data.
Definition: error.h:39
PICO_ERROR_CONNECT_FAILED
@ PICO_ERROR_CONNECT_FAILED
The connection failed.
Definition: error.h:32
PICO_ERROR_NOT_FOUND
@ PICO_ERROR_NOT_FOUND
Attempted to access something that does not exist; or, a search failed.
Definition: error.h:41
PICO_ERROR_INVALID_STATE
@ PICO_ERROR_INVALID_STATE
Something happened or failed to happen in the past, and consequently we (currently) can't service the...
Definition: error.h:36
PICO_ERROR_IO
@ PICO_ERROR_IO
An I/O error occurred.
Definition: error.h:30
PICO_ERROR_GENERIC
@ PICO_ERROR_GENERIC
An unspecified error occurred.
Definition: error.h:25
PICO_ERROR_BADAUTH
@ PICO_ERROR_BADAUTH
The authorization failed due to bad credentials.
Definition: error.h:31
PICO_ERROR_INSUFFICIENT_RESOURCES
@ PICO_ERROR_INSUFFICIENT_RESOURCES
Dynamic allocation of resources failed.
Definition: error.h:33
PICO_ERROR_VERSION_MISMATCH
@ PICO_ERROR_VERSION_MISMATCH
A version mismatch occurred (e.g. trying to run PIO version 1 code on RP2040)
Definition: error.h:44
PICO_ERROR_UNSUPPORTED_MODIFICATION
@ PICO_ERROR_UNSUPPORTED_MODIFICATION
Write is impossible based on previous writes; e.g. attempted to clear an OTP bit.
Definition: error.h:42
PICO_ERROR_PRECONDITION_NOT_MET
@ PICO_ERROR_PRECONDITION_NOT_MET
The call failed because another function must be called first.
Definition: error.h:38
PICO_OK
@ PICO_OK
No error; the operation succeeded.
Definition: error.h:23
PICO_ERROR_NO_DATA
@ PICO_ERROR_NO_DATA
Attempt for example to read from an empty buffer/FIFO.
Definition: error.h:27
PICO_ERROR_RESOURCE_IN_USE
@ PICO_ERROR_RESOURCE_IN_USE
The call could not proceed because requires resourcesw were unavailable.
Definition: error.h:45
PICO_ERROR_INVALID_ADDRESS
@ PICO_ERROR_INVALID_ADDRESS
Address argument was out-of-bounds or was determined to be an address that the caller may not access.
Definition: error.h:34
PICO_ERROR_BAD_ALIGNMENT
@ PICO_ERROR_BAD_ALIGNMENT
Address was mis-aligned (usually not on word boundary)
Definition: error.h:35
PICO_ERROR_INVALID_DATA
@ PICO_ERROR_INVALID_DATA
A data structure failed to validate.
Definition: error.h:40
PICO_ERROR_INVALID_ARG
@ PICO_ERROR_INVALID_ARG
Argument is outside of range of supported values`.
Definition: error.h:29
PICO_ERROR_BUFFER_TOO_SMALL
@ PICO_ERROR_BUFFER_TOO_SMALL
A user-allocated buffer was too small to hold the result or working state of this function.
Definition: error.h:37
PICO_ERROR_LOCK_REQUIRED
@ PICO_ERROR_LOCK_REQUIRED
A required lock is not owned.
Definition: error.h:43
PICO_ERROR_TIMEOUT
@ PICO_ERROR_TIMEOUT
The function failed due to timeout.
Definition: error.h:26