Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
message.h@9:f286301109fb, 2021-10-27 (annotated)
- Committer:
- nsheth
- Date:
- Wed Oct 27 21:17:37 2021 +0000
- Revision:
- 9:f286301109fb
- Parent:
- 6:7d8f30b3bc57
- Child:
- 11:071709f5f7d4
Minor refactoriing
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| nsheth | 9:f286301109fb | 1 | /* Copyright (c) 2021 Analog Devices, Inc. All rights reserved. |
| nsheth | 9:f286301109fb | 2 | |
| nsheth | 9:f286301109fb | 3 | Redistribution and use in source and binary forms, with or without modification, |
| nsheth | 9:f286301109fb | 4 | are permitted provided that the following conditions are met: |
| nsheth | 9:f286301109fb | 5 | - Redistributions of source code must retain the above copyright notice, |
| nsheth | 9:f286301109fb | 6 | this list of conditions and the following disclaimer. |
| nsheth | 9:f286301109fb | 7 | - Redistributions in binary form must reproduce the above copyright notice, |
| nsheth | 9:f286301109fb | 8 | this list of conditions and the following disclaimer in the documentation |
| nsheth | 9:f286301109fb | 9 | and/or other materials provided with the distribution. |
| nsheth | 9:f286301109fb | 10 | - Modified versions of the software must be conspicuously marked as such. |
| nsheth | 9:f286301109fb | 11 | - This software is licensed solely and exclusively for use with processors/products |
| nsheth | 9:f286301109fb | 12 | manufactured by or for Analog Devices, Inc. |
| nsheth | 9:f286301109fb | 13 | - This software may not be combined or merged with other code in any manner |
| nsheth | 9:f286301109fb | 14 | that would cause the software to become subject to terms and conditions which |
| nsheth | 9:f286301109fb | 15 | differ from those listed here. |
| nsheth | 9:f286301109fb | 16 | - Neither the name of Analog Devices, Inc. nor the names of its contributors |
| nsheth | 9:f286301109fb | 17 | may be used to endorse or promote products derived from this software without |
| nsheth | 9:f286301109fb | 18 | specific prior written permission. |
| nsheth | 9:f286301109fb | 19 | - The use of this software may or may not infringe the patent rights of one or |
| nsheth | 9:f286301109fb | 20 | more patent holders. This license does not release you from the requirement |
| nsheth | 9:f286301109fb | 21 | that you obtain separate licenses from these patent holders to use this software. |
| nsheth | 9:f286301109fb | 22 | |
| nsheth | 9:f286301109fb | 23 | THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND |
| nsheth | 9:f286301109fb | 24 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, |
| nsheth | 9:f286301109fb | 25 | TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN |
| nsheth | 9:f286301109fb | 26 | NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
| nsheth | 9:f286301109fb | 27 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES |
| nsheth | 9:f286301109fb | 28 | (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL |
| nsheth | 9:f286301109fb | 29 | PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| nsheth | 9:f286301109fb | 30 | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| nsheth | 9:f286301109fb | 31 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| nsheth | 9:f286301109fb | 32 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| nsheth | 9:f286301109fb | 33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| nsheth | 9:f286301109fb | 34 | |
| nsheth | 9:f286301109fb | 35 | 2021-01-10-7CBSD SLA |
| nsheth | 9:f286301109fb | 36 | */ |
| nsheth | 3:81d1980d45aa | 37 | /** |
| nsheth | 3:81d1980d45aa | 38 | * @file message.h |
| nsheth | 3:81d1980d45aa | 39 | * @brief Defines for message |
| nsheth | 3:81d1980d45aa | 40 | * @{ |
| nsheth | 3:81d1980d45aa | 41 | */ |
| nsheth | 3:81d1980d45aa | 42 | |
| nsheth | 3:81d1980d45aa | 43 | #ifndef __MESSAGE_H__ |
| nsheth | 3:81d1980d45aa | 44 | #define __MESSAGE_H__ |
| nsheth | 3:81d1980d45aa | 45 | |
| nsheth | 3:81d1980d45aa | 46 | /*============= I N C L U D E S =============*/ |
| nsheth | 3:81d1980d45aa | 47 | #include <stdarg.h> |
| nsheth | 3:81d1980d45aa | 48 | #include <stdbool.h> |
| nsheth | 3:81d1980d45aa | 49 | #include <stdint.h> |
| nsheth | 3:81d1980d45aa | 50 | #include <stdio.h> |
| nsheth | 3:81d1980d45aa | 51 | /*============= D E F I N E S =============*/ |
| nsheth | 3:81d1980d45aa | 52 | /** Maximum message size value */ |
| nsheth | 3:81d1980d45aa | 53 | #define MAX_MSG_SIZE 128 |
| nsheth | 3:81d1980d45aa | 54 | |
| nsheth | 3:81d1980d45aa | 55 | /** No Warning */ |
| nsheth | 3:81d1980d45aa | 56 | #define NO_WARN 0 |
| nsheth | 3:81d1980d45aa | 57 | /** DDS & NCO Frequency are not equal warning */ |
| nsheth | 3:81d1980d45aa | 58 | #define DDS_NCO_FREQ_WARN 1 |
| nsheth | 3:81d1980d45aa | 59 | /** Calibration failed warning */ |
| nsheth | 3:81d1980d45aa | 60 | #define CAL_LOAD_FAIL_WARN 2 |
| nsheth | 3:81d1980d45aa | 61 | /** Autorange disabled warning */ |
| nsheth | 3:81d1980d45aa | 62 | #define AUTORANGE_DISABLE_WARN 4 |
| nsheth | 3:81d1980d45aa | 63 | /** Autorange failed warning */ |
| nsheth | 3:81d1980d45aa | 64 | #define AUTORANGE_FAIL_WARN 8 |
| nsheth | 3:81d1980d45aa | 65 | /** Sweep count warning */ |
| nsheth | 3:81d1980d45aa | 66 | #define SWEEPCOUNT_WARN 16 |
| nsheth | 3:81d1980d45aa | 67 | /** Magnitude limit warning */ |
| nsheth | 3:81d1980d45aa | 68 | #define MAG_EXCEED_WARN 32 |
| nsheth | 3:81d1980d45aa | 69 | /** Offset limit warning */ |
| nsheth | 3:81d1980d45aa | 70 | #define OFFSET_LIMITED_WARN 64 |
| nsheth | 3:81d1980d45aa | 71 | /** Positive offset exceed warning */ |
| nsheth | 3:81d1980d45aa | 72 | #define OFFSET_POS_EXCEED_WARN 128 |
| nsheth | 3:81d1980d45aa | 73 | /** Negative offset exceed warning */ |
| nsheth | 3:81d1980d45aa | 74 | #define OFFSET_NEG_EXCEED_WARN 256 |
| nsheth | 3:81d1980d45aa | 75 | |
| nsheth | 3:81d1980d45aa | 76 | //#define ENABLE_DEBUG |
| nsheth | 3:81d1980d45aa | 77 | |
| nsheth | 3:81d1980d45aa | 78 | /** Prints Info Message */ |
| nsheth | 6:7d8f30b3bc57 | 79 | #define INFO_MSG(X) printf("%s\n\r", X); |
| nsheth | 3:81d1980d45aa | 80 | /** Prints warn message */ |
| nsheth | 6:7d8f30b3bc57 | 81 | #define WARN_MSG(X) printf("Warn : \n\r", X); |
| nsheth | 3:81d1980d45aa | 82 | /** Prints error message */ |
| nsheth | 6:7d8f30b3bc57 | 83 | #define ERROR_MSG(X) printf("Error : %s\n\r", X); |
| nsheth | 3:81d1980d45aa | 84 | |
| nsheth | 3:81d1980d45aa | 85 | #endif /* __MESSAGE_H__ */ |
| nsheth | 3:81d1980d45aa | 86 | |
| nsheth | 3:81d1980d45aa | 87 | /** |
| nsheth | 3:81d1980d45aa | 88 | * @} |
| nsheth | 3:81d1980d45aa | 89 | */ |
