t
Fork of mbed-dev by
targets/TARGET_Atmel/TARGET_SAM_CortexM4/utils/status_codes.h@178:c26431f84b0d, 2017-11-09 (annotated)
- Committer:
- amithy
- Date:
- Thu Nov 09 22:14:37 2017 +0000
- Revision:
- 178:c26431f84b0d
- Parent:
- 149:156823d33999
test export
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 107:414e9c822e99 | 1 | /** |
mbed_official | 107:414e9c822e99 | 2 | * \file |
mbed_official | 107:414e9c822e99 | 3 | * |
mbed_official | 107:414e9c822e99 | 4 | * \brief Status code definitions. |
mbed_official | 107:414e9c822e99 | 5 | * |
mbed_official | 107:414e9c822e99 | 6 | * This file defines various status codes returned by functions, |
mbed_official | 107:414e9c822e99 | 7 | * indicating success or failure as well as what kind of failure. |
mbed_official | 107:414e9c822e99 | 8 | * |
mbed_official | 107:414e9c822e99 | 9 | * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. |
mbed_official | 107:414e9c822e99 | 10 | * |
mbed_official | 107:414e9c822e99 | 11 | * \asf_license_start |
mbed_official | 107:414e9c822e99 | 12 | * |
mbed_official | 107:414e9c822e99 | 13 | * \page License |
mbed_official | 107:414e9c822e99 | 14 | * |
mbed_official | 107:414e9c822e99 | 15 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 107:414e9c822e99 | 16 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 107:414e9c822e99 | 17 | * |
mbed_official | 107:414e9c822e99 | 18 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 107:414e9c822e99 | 19 | * this list of conditions and the following disclaimer. |
mbed_official | 107:414e9c822e99 | 20 | * |
mbed_official | 107:414e9c822e99 | 21 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 107:414e9c822e99 | 22 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 107:414e9c822e99 | 23 | * and/or other materials provided with the distribution. |
mbed_official | 107:414e9c822e99 | 24 | * |
mbed_official | 107:414e9c822e99 | 25 | * 3. The name of Atmel may not be used to endorse or promote products derived |
mbed_official | 107:414e9c822e99 | 26 | * from this software without specific prior written permission. |
mbed_official | 107:414e9c822e99 | 27 | * |
mbed_official | 107:414e9c822e99 | 28 | * 4. This software may only be redistributed and used in connection with an |
mbed_official | 107:414e9c822e99 | 29 | * Atmel microcontroller product. |
mbed_official | 107:414e9c822e99 | 30 | * |
mbed_official | 107:414e9c822e99 | 31 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED |
mbed_official | 107:414e9c822e99 | 32 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
mbed_official | 107:414e9c822e99 | 33 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE |
mbed_official | 107:414e9c822e99 | 34 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR |
mbed_official | 107:414e9c822e99 | 35 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 107:414e9c822e99 | 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
mbed_official | 107:414e9c822e99 | 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
mbed_official | 107:414e9c822e99 | 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
mbed_official | 107:414e9c822e99 | 39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
mbed_official | 107:414e9c822e99 | 40 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
mbed_official | 107:414e9c822e99 | 41 | * POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 107:414e9c822e99 | 42 | * |
mbed_official | 107:414e9c822e99 | 43 | * \asf_license_stop |
mbed_official | 107:414e9c822e99 | 44 | * |
mbed_official | 107:414e9c822e99 | 45 | */ |
mbed_official | 107:414e9c822e99 | 46 | /* |
mbed_official | 107:414e9c822e99 | 47 | * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> |
mbed_official | 107:414e9c822e99 | 48 | */ |
mbed_official | 107:414e9c822e99 | 49 | |
mbed_official | 107:414e9c822e99 | 50 | #ifndef STATUS_CODES_H_INCLUDED |
mbed_official | 107:414e9c822e99 | 51 | #define STATUS_CODES_H_INCLUDED |
mbed_official | 107:414e9c822e99 | 52 | |
mbed_official | 107:414e9c822e99 | 53 | /* Note: this is a local workaround to avoid a pre-processor clash due to the |
mbed_official | 107:414e9c822e99 | 54 | * lwIP macro ERR_TIMEOUT. */ |
mbed_official | 107:414e9c822e99 | 55 | #if defined(__LWIP_ERR_H__) && defined(ERR_TIMEOUT) |
mbed_official | 107:414e9c822e99 | 56 | #if (ERR_TIMEOUT != -3) |
mbed_official | 107:414e9c822e99 | 57 | |
mbed_official | 107:414e9c822e99 | 58 | /* Internal check to make sure that the later restore of lwIP's ERR_TIMEOUT |
mbed_official | 107:414e9c822e99 | 59 | * macro is set to the correct value. Note that it is highly improbable that |
mbed_official | 107:414e9c822e99 | 60 | * this value ever changes in lwIP. */ |
mbed_official | 107:414e9c822e99 | 61 | #error ASF developers: check lwip err.h new value for ERR_TIMEOUT |
mbed_official | 107:414e9c822e99 | 62 | #endif |
mbed_official | 107:414e9c822e99 | 63 | #undef ERR_TIMEOUT |
mbed_official | 107:414e9c822e99 | 64 | #endif |
mbed_official | 107:414e9c822e99 | 65 | |
mbed_official | 107:414e9c822e99 | 66 | /** |
mbed_official | 107:414e9c822e99 | 67 | * Status code that may be returned by shell commands and protocol |
mbed_official | 107:414e9c822e99 | 68 | * implementations. |
mbed_official | 107:414e9c822e99 | 69 | * |
mbed_official | 107:414e9c822e99 | 70 | * \note Any change to these status codes and the corresponding |
mbed_official | 107:414e9c822e99 | 71 | * message strings is strictly forbidden. New codes can be added, |
mbed_official | 107:414e9c822e99 | 72 | * however, but make sure that any message string tables are updated |
mbed_official | 107:414e9c822e99 | 73 | * at the same time. |
mbed_official | 107:414e9c822e99 | 74 | */ |
mbed_official | 107:414e9c822e99 | 75 | enum status_code { |
mbed_official | 107:414e9c822e99 | 76 | STATUS_OK = 0, //!< Success |
mbed_official | 107:414e9c822e99 | 77 | STATUS_ERR_BUSY = 0x19, |
mbed_official | 107:414e9c822e99 | 78 | STATUS_ERR_DENIED = 0x1C, |
mbed_official | 107:414e9c822e99 | 79 | STATUS_ERR_TIMEOUT = 0x12, |
mbed_official | 107:414e9c822e99 | 80 | ERR_IO_ERROR = -1, //!< I/O error |
mbed_official | 107:414e9c822e99 | 81 | ERR_FLUSHED = -2, //!< Request flushed from queue |
mbed_official | 107:414e9c822e99 | 82 | ERR_TIMEOUT = -3, //!< Operation timed out |
mbed_official | 107:414e9c822e99 | 83 | ERR_BAD_DATA = -4, //!< Data integrity check failed |
mbed_official | 107:414e9c822e99 | 84 | ERR_PROTOCOL = -5, //!< Protocol error |
mbed_official | 107:414e9c822e99 | 85 | ERR_UNSUPPORTED_DEV = -6, //!< Unsupported device |
mbed_official | 107:414e9c822e99 | 86 | ERR_NO_MEMORY = -7, //!< Insufficient memory |
mbed_official | 107:414e9c822e99 | 87 | ERR_INVALID_ARG = -8, //!< Invalid argument |
mbed_official | 107:414e9c822e99 | 88 | ERR_BAD_ADDRESS = -9, //!< Bad address |
mbed_official | 107:414e9c822e99 | 89 | ERR_BUSY = -10, //!< Resource is busy |
mbed_official | 107:414e9c822e99 | 90 | ERR_BAD_FORMAT = -11, //!< Data format not recognized |
mbed_official | 107:414e9c822e99 | 91 | ERR_NO_TIMER = -12, //!< No timer available |
mbed_official | 107:414e9c822e99 | 92 | ERR_TIMER_ALREADY_RUNNING = -13, //!< Timer already running |
mbed_official | 107:414e9c822e99 | 93 | ERR_TIMER_NOT_RUNNING = -14, //!< Timer not running |
mbed_official | 107:414e9c822e99 | 94 | ERR_ABORTED = -15, //!< Operation aborted by user |
mbed_official | 107:414e9c822e99 | 95 | /** |
mbed_official | 107:414e9c822e99 | 96 | * \brief Operation in progress |
mbed_official | 107:414e9c822e99 | 97 | * |
mbed_official | 107:414e9c822e99 | 98 | * This status code is for driver-internal use when an operation |
mbed_official | 107:414e9c822e99 | 99 | * is currently being performed. |
mbed_official | 107:414e9c822e99 | 100 | * |
mbed_official | 107:414e9c822e99 | 101 | * \note Drivers should never return this status code to any |
mbed_official | 107:414e9c822e99 | 102 | * callers. It is strictly for internal use. |
mbed_official | 107:414e9c822e99 | 103 | */ |
mbed_official | 107:414e9c822e99 | 104 | OPERATION_IN_PROGRESS = -128, |
mbed_official | 107:414e9c822e99 | 105 | }; |
mbed_official | 107:414e9c822e99 | 106 | |
mbed_official | 107:414e9c822e99 | 107 | typedef enum status_code status_code_t; |
mbed_official | 107:414e9c822e99 | 108 | |
mbed_official | 107:414e9c822e99 | 109 | #if defined(__LWIP_ERR_H__) |
mbed_official | 107:414e9c822e99 | 110 | #define ERR_TIMEOUT -3 |
mbed_official | 107:414e9c822e99 | 111 | #endif |
mbed_official | 107:414e9c822e99 | 112 | |
mbed_official | 107:414e9c822e99 | 113 | #endif /* STATUS_CODES_H_INCLUDED */ |