Eval-TempSense-ARDZ application code
Dependencies: platform_drivers ADT73xx-ADT74xx
app_config.h@1:af9efbb9e9c5, 2019-08-28 (annotated)
- Committer:
- EndaKilgarriff
- Date:
- Wed Aug 28 15:38:19 2019 +0000
- Revision:
- 1:af9efbb9e9c5
Inital Commit for Eval-TempSense-ARDZ
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
EndaKilgarriff | 1:af9efbb9e9c5 | 1 | /*************************************************************************//** |
EndaKilgarriff | 1:af9efbb9e9c5 | 2 | * @file app_config.h |
EndaKilgarriff | 1:af9efbb9e9c5 | 3 | * @brief Configuration file of AD5686 firmware example program |
EndaKilgarriff | 1:af9efbb9e9c5 | 4 | * @author ssmith (sean.smith@analog.com) |
EndaKilgarriff | 1:af9efbb9e9c5 | 5 | ****************************************************************************** |
EndaKilgarriff | 1:af9efbb9e9c5 | 6 | * Copyright (c) 2019 Analog Devices, Inc. |
EndaKilgarriff | 1:af9efbb9e9c5 | 7 | * |
EndaKilgarriff | 1:af9efbb9e9c5 | 8 | * All rights reserved. |
EndaKilgarriff | 1:af9efbb9e9c5 | 9 | * |
EndaKilgarriff | 1:af9efbb9e9c5 | 10 | * Redistribution and use in source and binary forms, with or without |
EndaKilgarriff | 1:af9efbb9e9c5 | 11 | * modification, are permitted provided that the following conditions are met: |
EndaKilgarriff | 1:af9efbb9e9c5 | 12 | * - Redistributions of source code must retain the above copyright notice, |
EndaKilgarriff | 1:af9efbb9e9c5 | 13 | * this list of conditions and the following disclaimer. |
EndaKilgarriff | 1:af9efbb9e9c5 | 14 | * - Redistributions in binary form must reproduce the above copyright notice, |
EndaKilgarriff | 1:af9efbb9e9c5 | 15 | * this list of conditions and the following disclaimer in the documentation |
EndaKilgarriff | 1:af9efbb9e9c5 | 16 | * and/or other materials provided with the distribution. |
EndaKilgarriff | 1:af9efbb9e9c5 | 17 | * - Modified versions of the software must be conspicuously marked as such. |
EndaKilgarriff | 1:af9efbb9e9c5 | 18 | * - This software is licensed solely and exclusively for use with |
EndaKilgarriff | 1:af9efbb9e9c5 | 19 | * processors/products manufactured by or for Analog Devices, Inc. |
EndaKilgarriff | 1:af9efbb9e9c5 | 20 | * - This software may not be combined or merged with other code in any manner |
EndaKilgarriff | 1:af9efbb9e9c5 | 21 | * that would cause the software to become subject to terms and |
EndaKilgarriff | 1:af9efbb9e9c5 | 22 | * conditions which differ from those listed here. |
EndaKilgarriff | 1:af9efbb9e9c5 | 23 | * - Neither the name of Analog Devices, Inc. nor the names of its |
EndaKilgarriff | 1:af9efbb9e9c5 | 24 | * contributors may be used to endorse or promote products derived |
EndaKilgarriff | 1:af9efbb9e9c5 | 25 | * from this software without specific prior written permission. |
EndaKilgarriff | 1:af9efbb9e9c5 | 26 | * - The use of this software may or may not infringe the patent rights |
EndaKilgarriff | 1:af9efbb9e9c5 | 27 | * of one or more patent holders. This license does not release you from |
EndaKilgarriff | 1:af9efbb9e9c5 | 28 | * the requirement that you obtain separate licenses from these patent |
EndaKilgarriff | 1:af9efbb9e9c5 | 29 | * holders to use this software. |
EndaKilgarriff | 1:af9efbb9e9c5 | 30 | * |
EndaKilgarriff | 1:af9efbb9e9c5 | 31 | * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" |
EndaKilgarriff | 1:af9efbb9e9c5 | 32 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
EndaKilgarriff | 1:af9efbb9e9c5 | 33 | * NON-INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A |
EndaKilgarriff | 1:af9efbb9e9c5 | 34 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, |
EndaKilgarriff | 1:af9efbb9e9c5 | 35 | * INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
EndaKilgarriff | 1:af9efbb9e9c5 | 36 | * SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES |
EndaKilgarriff | 1:af9efbb9e9c5 | 37 | * (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF |
EndaKilgarriff | 1:af9efbb9e9c5 | 38 | * INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE |
EndaKilgarriff | 1:af9efbb9e9c5 | 39 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
EndaKilgarriff | 1:af9efbb9e9c5 | 40 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
EndaKilgarriff | 1:af9efbb9e9c5 | 41 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
EndaKilgarriff | 1:af9efbb9e9c5 | 42 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
EndaKilgarriff | 1:af9efbb9e9c5 | 43 | * POSSIBILITY OF SUCH DAMAGE. |
EndaKilgarriff | 1:af9efbb9e9c5 | 44 | * |
EndaKilgarriff | 1:af9efbb9e9c5 | 45 | * 20180927-7CBSD SLA |
EndaKilgarriff | 1:af9efbb9e9c5 | 46 | *****************************************************************************/ |
EndaKilgarriff | 1:af9efbb9e9c5 | 47 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 48 | #ifndef _APP_CONFIG_H_ |
EndaKilgarriff | 1:af9efbb9e9c5 | 49 | #define _APP_CONFIG_H_ |
EndaKilgarriff | 1:af9efbb9e9c5 | 50 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 51 | #include <stdint.h> |
EndaKilgarriff | 1:af9efbb9e9c5 | 52 | #include "PinNames.h" |
EndaKilgarriff | 1:af9efbb9e9c5 | 53 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 54 | #include "platform_drivers.h" |
EndaKilgarriff | 1:af9efbb9e9c5 | 55 | #ifdef __cplusplus |
EndaKilgarriff | 1:af9efbb9e9c5 | 56 | extern "C" |
EndaKilgarriff | 1:af9efbb9e9c5 | 57 | { |
EndaKilgarriff | 1:af9efbb9e9c5 | 58 | #endif |
EndaKilgarriff | 1:af9efbb9e9c5 | 59 | #ifdef __cplusplus |
EndaKilgarriff | 1:af9efbb9e9c5 | 60 | #include "adt7420.h" |
EndaKilgarriff | 1:af9efbb9e9c5 | 61 | } |
EndaKilgarriff | 1:af9efbb9e9c5 | 62 | #endif |
EndaKilgarriff | 1:af9efbb9e9c5 | 63 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 64 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 65 | #ifndef ACTIVE_DEVICE |
EndaKilgarriff | 1:af9efbb9e9c5 | 66 | /** |
EndaKilgarriff | 1:af9efbb9e9c5 | 67 | #define your chosen device here from the |
EndaKilgarriff | 1:af9efbb9e9c5 | 68 | adt7420_type (adt7420.h) enum |
EndaKilgarriff | 1:af9efbb9e9c5 | 69 | */ |
EndaKilgarriff | 1:af9efbb9e9c5 | 70 | #define ACTIVE_DEVICE ID_ADT7320 |
EndaKilgarriff | 1:af9efbb9e9c5 | 71 | #endif // ! |
EndaKilgarriff | 1:af9efbb9e9c5 | 72 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 73 | /** |
EndaKilgarriff | 1:af9efbb9e9c5 | 74 | ADT7420 is a 7-bit I2C address |
EndaKilgarriff | 1:af9efbb9e9c5 | 75 | MBED API uses 8-bit addresses |
EndaKilgarriff | 1:af9efbb9e9c5 | 76 | */ |
EndaKilgarriff | 1:af9efbb9e9c5 | 77 | #define EXTERNAL_I2C 0x49<<1 |
EndaKilgarriff | 1:af9efbb9e9c5 | 78 | #define INTERNAL_I2C 0x48<<1 |
EndaKilgarriff | 1:af9efbb9e9c5 | 79 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 80 | /** |
EndaKilgarriff | 1:af9efbb9e9c5 | 81 | ChipSelect index definition for |
EndaKilgarriff | 1:af9efbb9e9c5 | 82 | PinName array in main.cpp |
EndaKilgarriff | 1:af9efbb9e9c5 | 83 | */ |
EndaKilgarriff | 1:af9efbb9e9c5 | 84 | #define EXTERNAL_SPI 1 |
EndaKilgarriff | 1:af9efbb9e9c5 | 85 | #define INTERNAL_SPI 0 |
EndaKilgarriff | 1:af9efbb9e9c5 | 86 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 87 | /** |
EndaKilgarriff | 1:af9efbb9e9c5 | 88 | The ADI SDP_K1 can be used with both arduino headers |
EndaKilgarriff | 1:af9efbb9e9c5 | 89 | or the 120-pin SDP connector found on ADI evaluation |
EndaKilgarriff | 1:af9efbb9e9c5 | 90 | boards. The default is the SDP connector |
EndaKilgarriff | 1:af9efbb9e9c5 | 91 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 92 | Uncomment the ARDUINO #define above to enable the ARDUINO connector |
EndaKilgarriff | 1:af9efbb9e9c5 | 93 | */ |
EndaKilgarriff | 1:af9efbb9e9c5 | 94 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 95 | #define ARDUINO |
EndaKilgarriff | 1:af9efbb9e9c5 | 96 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 97 | #ifdef ARDUINO |
EndaKilgarriff | 1:af9efbb9e9c5 | 98 | #define I2C_SCL D15 |
EndaKilgarriff | 1:af9efbb9e9c5 | 99 | #define I2C_SDA D14 |
EndaKilgarriff | 1:af9efbb9e9c5 | 100 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 101 | #define SPI_CS D10 |
EndaKilgarriff | 1:af9efbb9e9c5 | 102 | #define SPI_MISO D12 |
EndaKilgarriff | 1:af9efbb9e9c5 | 103 | #define SPI_MOSI D11 |
EndaKilgarriff | 1:af9efbb9e9c5 | 104 | #define SPI_SCK D13 |
EndaKilgarriff | 1:af9efbb9e9c5 | 105 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 106 | #define SPI_CSE D9 |
EndaKilgarriff | 1:af9efbb9e9c5 | 107 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 108 | #else |
EndaKilgarriff | 1:af9efbb9e9c5 | 109 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 110 | #define I2C_SCL SDP_I2C_SCL |
EndaKilgarriff | 1:af9efbb9e9c5 | 111 | #define I2C_SDA SDP_I2C_SDA |
EndaKilgarriff | 1:af9efbb9e9c5 | 112 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 113 | #define SPI_CS SDP_SPI_CS_A |
EndaKilgarriff | 1:af9efbb9e9c5 | 114 | #define SPI_MISO SDP_SPI_MISO |
EndaKilgarriff | 1:af9efbb9e9c5 | 115 | #define SPI_MOSI SDP_SPI_MOSI |
EndaKilgarriff | 1:af9efbb9e9c5 | 116 | #define SPI_SCK SDP_SPI_SCK |
EndaKilgarriff | 1:af9efbb9e9c5 | 117 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 118 | #define SPI_CSE SDP_SPI_CS_B |
EndaKilgarriff | 1:af9efbb9e9c5 | 119 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 120 | #endif |
EndaKilgarriff | 1:af9efbb9e9c5 | 121 | |
EndaKilgarriff | 1:af9efbb9e9c5 | 122 | #endif //_APP_CONFIG_H_ |