Vybhav Kadaba
/
EV-PRO-MW1001_Development
added wait_us(31) in admw_spi.cpp to support hibernation mode
inc/admw_log.h@60:363fffe5bd22, 2020-03-16 (annotated)
- Committer:
- Vkadaba
- Date:
- Mon Mar 16 09:54:36 2020 +0000
- Revision:
- 60:363fffe5bd22
- Parent:
- 5:0728bde67bdb
Added wait_us(31) in admw_spi.cpp when hibernation mode is enabled
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Vkadaba | 5:0728bde67bdb | 1 | /* |
Vkadaba | 5:0728bde67bdb | 2 | Copyright 2019 (c) Analog Devices, Inc. |
Vkadaba | 5:0728bde67bdb | 3 | |
Vkadaba | 5:0728bde67bdb | 4 | All rights reserved. |
Vkadaba | 5:0728bde67bdb | 5 | |
Vkadaba | 5:0728bde67bdb | 6 | Redistribution and use in source and binary forms, with or without |
Vkadaba | 5:0728bde67bdb | 7 | modification, are permitted provided that the following conditions are met: |
Vkadaba | 5:0728bde67bdb | 8 | - Redistributions of source code must retain the above copyright |
Vkadaba | 5:0728bde67bdb | 9 | notice, this list of conditions and the following disclaimer. |
Vkadaba | 5:0728bde67bdb | 10 | - Redistributions in binary form must reproduce the above copyright |
Vkadaba | 5:0728bde67bdb | 11 | notice, this list of conditions and the following disclaimer in |
Vkadaba | 5:0728bde67bdb | 12 | the documentation and/or other materials provided with the |
Vkadaba | 5:0728bde67bdb | 13 | distribution. |
Vkadaba | 5:0728bde67bdb | 14 | - Neither the name of Analog Devices, Inc. nor the names of its |
Vkadaba | 5:0728bde67bdb | 15 | contributors may be used to endorse or promote products derived |
Vkadaba | 5:0728bde67bdb | 16 | from this software without specific prior written permission. |
Vkadaba | 5:0728bde67bdb | 17 | - The use of this software may or may not infringe the patent rights |
Vkadaba | 5:0728bde67bdb | 18 | of one or more patent holders. This license does not release you |
Vkadaba | 5:0728bde67bdb | 19 | from the requirement that you obtain separate licenses from these |
Vkadaba | 5:0728bde67bdb | 20 | patent holders to use this software. |
Vkadaba | 5:0728bde67bdb | 21 | - Use of the software either in source or binary form, must be run |
Vkadaba | 5:0728bde67bdb | 22 | on or directly connected to an Analog Devices Inc. component. |
Vkadaba | 5:0728bde67bdb | 23 | |
Vkadaba | 5:0728bde67bdb | 24 | THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR |
Vkadaba | 5:0728bde67bdb | 25 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, |
Vkadaba | 5:0728bde67bdb | 26 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
Vkadaba | 5:0728bde67bdb | 27 | IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, |
Vkadaba | 5:0728bde67bdb | 28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
Vkadaba | 5:0728bde67bdb | 29 | LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR |
Vkadaba | 5:0728bde67bdb | 30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Vkadaba | 5:0728bde67bdb | 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Vkadaba | 5:0728bde67bdb | 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Vkadaba | 5:0728bde67bdb | 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Vkadaba | 5:0728bde67bdb | 34 | */ |
Vkadaba | 5:0728bde67bdb | 35 | |
Vkadaba | 5:0728bde67bdb | 36 | /*! |
Vkadaba | 5:0728bde67bdb | 37 | ****************************************************************************** |
Vkadaba | 5:0728bde67bdb | 38 | * @file: admw_log.h |
Vkadaba | 5:0728bde67bdb | 39 | * @brief: ADMW OS-dependent wrapper layer for log functions |
Vkadaba | 5:0728bde67bdb | 40 | *----------------------------------------------------------------------------- |
Vkadaba | 5:0728bde67bdb | 41 | */ |
Vkadaba | 5:0728bde67bdb | 42 | |
Vkadaba | 5:0728bde67bdb | 43 | #ifndef __ADMW_LOG_H__ |
Vkadaba | 5:0728bde67bdb | 44 | #define __ADMW_LOG_H__ |
Vkadaba | 5:0728bde67bdb | 45 | |
Vkadaba | 5:0728bde67bdb | 46 | #include "inc/admw_types.h" |
Vkadaba | 5:0728bde67bdb | 47 | |
Vkadaba | 5:0728bde67bdb | 48 | /*! @ingroup ADMW_Host */ |
Vkadaba | 5:0728bde67bdb | 49 | |
Vkadaba | 5:0728bde67bdb | 50 | /*! @addtogroup ADMW_Log ADMW Host Logging functions |
Vkadaba | 5:0728bde67bdb | 51 | * @{ |
Vkadaba | 5:0728bde67bdb | 52 | */ |
Vkadaba | 5:0728bde67bdb | 53 | |
Vkadaba | 5:0728bde67bdb | 54 | /*! Macro function for logging an error message */ |
Vkadaba | 5:0728bde67bdb | 55 | #define ADMW_LOG_ERROR(...) \ |
Vkadaba | 5:0728bde67bdb | 56 | admw_Log(ADMW_LOG_LEVEL_ERROR, "[ERROR] " __VA_ARGS__) |
Vkadaba | 5:0728bde67bdb | 57 | /*! Macro function for logging a warning message */ |
Vkadaba | 5:0728bde67bdb | 58 | #define ADMW_LOG_WARN(...) \ |
Vkadaba | 5:0728bde67bdb | 59 | admw_Log(ADMW_LOG_LEVEL_WARN, "[WARN] " __VA_ARGS__) |
Vkadaba | 5:0728bde67bdb | 60 | /*! Macro function for logging an information message */ |
Vkadaba | 5:0728bde67bdb | 61 | #define ADMW_LOG_INFO(...) \ |
Vkadaba | 5:0728bde67bdb | 62 | admw_Log(ADMW_LOG_LEVEL_INFO, "[INFO] " __VA_ARGS__) |
Vkadaba | 5:0728bde67bdb | 63 | /*! Macro function for logging a debug message */ |
Vkadaba | 5:0728bde67bdb | 64 | #define ADMW_LOG_DEBUG(...) \ |
Vkadaba | 5:0728bde67bdb | 65 | admw_Log(ADMW_LOG_LEVEL_DEBUG, "[DEBUG] " __VA_ARGS__) |
Vkadaba | 5:0728bde67bdb | 66 | |
Vkadaba | 5:0728bde67bdb | 67 | /*! |
Vkadaba | 5:0728bde67bdb | 68 | * Log message priority levels |
Vkadaba | 5:0728bde67bdb | 69 | */ |
Vkadaba | 5:0728bde67bdb | 70 | typedef enum |
Vkadaba | 5:0728bde67bdb | 71 | { |
Vkadaba | 5:0728bde67bdb | 72 | ADMW_LOG_LEVEL_ERROR = 0, /*!< Error message priority */ |
Vkadaba | 5:0728bde67bdb | 73 | ADMW_LOG_LEVEL_WARN, /*!< Warning message priority */ |
Vkadaba | 5:0728bde67bdb | 74 | ADMW_LOG_LEVEL_INFO, /*!< Information message priority */ |
Vkadaba | 5:0728bde67bdb | 75 | ADMW_LOG_LEVEL_DEBUG, /*!< Debug message priority */ |
Vkadaba | 5:0728bde67bdb | 76 | } ADMW_LOG_LEVEL; |
Vkadaba | 5:0728bde67bdb | 77 | |
Vkadaba | 5:0728bde67bdb | 78 | |
Vkadaba | 5:0728bde67bdb | 79 | #ifdef __cplusplus |
Vkadaba | 5:0728bde67bdb | 80 | extern "C" |
Vkadaba | 5:0728bde67bdb | 81 | { |
Vkadaba | 5:0728bde67bdb | 82 | #endif |
Vkadaba | 5:0728bde67bdb | 83 | |
Vkadaba | 5:0728bde67bdb | 84 | /*! |
Vkadaba | 5:0728bde67bdb | 85 | * @brief Initialise the Log interface and allocate resources. |
Vkadaba | 5:0728bde67bdb | 86 | * |
Vkadaba | 5:0728bde67bdb | 87 | * @return Status |
Vkadaba | 5:0728bde67bdb | 88 | * - #ADMW_SUCCESS Call completed successfully. |
Vkadaba | 5:0728bde67bdb | 89 | * - #ADMW_NO_MEM Failed to allocate memory for device context. |
Vkadaba | 5:0728bde67bdb | 90 | */ |
Vkadaba | 5:0728bde67bdb | 91 | ADMW_RESULT admw_LogOpen( |
Vkadaba | 5:0728bde67bdb | 92 | ADMW_PLATFORM_LOG_CONFIG *pConfig); |
Vkadaba | 5:0728bde67bdb | 93 | |
Vkadaba | 5:0728bde67bdb | 94 | /*! |
Vkadaba | 5:0728bde67bdb | 95 | * @brief Close the Log interface and free resources. |
Vkadaba | 5:0728bde67bdb | 96 | */ |
Vkadaba | 5:0728bde67bdb | 97 | void admw_LogClose(void); |
Vkadaba | 5:0728bde67bdb | 98 | |
Vkadaba | 5:0728bde67bdb | 99 | /*! |
Vkadaba | 5:0728bde67bdb | 100 | * @brief Set the minimum priority level for the log messages. |
Vkadaba | 5:0728bde67bdb | 101 | * |
Vkadaba | 5:0728bde67bdb | 102 | * @param[in] maxLevel priority level |
Vkadaba | 5:0728bde67bdb | 103 | * |
Vkadaba | 5:0728bde67bdb | 104 | * @details Sets the log priority level. Messages with priority lower |
Vkadaba | 5:0728bde67bdb | 105 | that this level will not be passed to the log interface. |
Vkadaba | 5:0728bde67bdb | 106 | */ |
Vkadaba | 5:0728bde67bdb | 107 | void admw_LogLevel( |
Vkadaba | 5:0728bde67bdb | 108 | ADMW_LOG_LEVEL maxLevel); |
Vkadaba | 5:0728bde67bdb | 109 | |
Vkadaba | 5:0728bde67bdb | 110 | /*! |
Vkadaba | 5:0728bde67bdb | 111 | * @brief Print a log message to the platform log interface. |
Vkadaba | 5:0728bde67bdb | 112 | * |
Vkadaba | 5:0728bde67bdb | 113 | * @param[in] level Log message priority level |
Vkadaba | 5:0728bde67bdb | 114 | * @param[in] format Format string and variable argument list, if any |
Vkadaba | 5:0728bde67bdb | 115 | */ |
Vkadaba | 5:0728bde67bdb | 116 | void admw_Log( |
Vkadaba | 5:0728bde67bdb | 117 | ADMW_LOG_LEVEL level, |
Vkadaba | 5:0728bde67bdb | 118 | const char * format, |
Vkadaba | 5:0728bde67bdb | 119 | ...); |
Vkadaba | 5:0728bde67bdb | 120 | |
Vkadaba | 5:0728bde67bdb | 121 | #ifdef __cplusplus |
Vkadaba | 5:0728bde67bdb | 122 | } |
Vkadaba | 5:0728bde67bdb | 123 | #endif |
Vkadaba | 5:0728bde67bdb | 124 | |
Vkadaba | 5:0728bde67bdb | 125 | /*! |
Vkadaba | 5:0728bde67bdb | 126 | * @} |
Vkadaba | 5:0728bde67bdb | 127 | */ |
Vkadaba | 5:0728bde67bdb | 128 | |
Vkadaba | 5:0728bde67bdb | 129 | #endif /* __ADMW_LOG_H__ */ |