Mbed FW update

Committer:
Vkadaba
Date:
Thu Oct 03 09:36:16 2019 +0000
Revision:
29:713c24b07795
Parent:
25:b278a215cf3b
Child:
45:f5f553b8c0d5
SPI lines names changed to D pin names

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Vkadaba 15:b5d57daeb7c0 1 /*
Vkadaba 15:b5d57daeb7c0 2 Copyright 2019 (c) Analog Devices, Inc.
Vkadaba 15:b5d57daeb7c0 3
Vkadaba 15:b5d57daeb7c0 4 All rights reserved.
Vkadaba 15:b5d57daeb7c0 5
Vkadaba 15:b5d57daeb7c0 6 Redistribution and use in source and binary forms, with or without
Vkadaba 15:b5d57daeb7c0 7 modification, are permitted provided that the following conditions are met:
Vkadaba 15:b5d57daeb7c0 8 - Redistributions of source code must retain the above copyright
Vkadaba 15:b5d57daeb7c0 9 notice, this list of conditions and the following disclaimer.
Vkadaba 15:b5d57daeb7c0 10 - Redistributions in binary form must reproduce the above copyright
Vkadaba 15:b5d57daeb7c0 11 notice, this list of conditions and the following disclaimer in
Vkadaba 15:b5d57daeb7c0 12 the documentation and/or other materials provided with the
Vkadaba 15:b5d57daeb7c0 13 distribution.
Vkadaba 15:b5d57daeb7c0 14 - Neither the name of Analog Devices, Inc. nor the names of its
Vkadaba 15:b5d57daeb7c0 15 contributors may be used to endorse or promote products derived
Vkadaba 15:b5d57daeb7c0 16 from this software without specific prior written permission.
Vkadaba 15:b5d57daeb7c0 17 - The use of this software may or may not infringe the patent rights
Vkadaba 15:b5d57daeb7c0 18 of one or more patent holders. This license does not release you
Vkadaba 15:b5d57daeb7c0 19 from the requirement that you obtain separate licenses from these
Vkadaba 15:b5d57daeb7c0 20 patent holders to use this software.
Vkadaba 15:b5d57daeb7c0 21 - Use of the software either in source or binary form, must be run
Vkadaba 15:b5d57daeb7c0 22 on or directly connected to an Analog Devices Inc. component.
Vkadaba 15:b5d57daeb7c0 23
Vkadaba 15:b5d57daeb7c0 24 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
Vkadaba 15:b5d57daeb7c0 25 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
Vkadaba 15:b5d57daeb7c0 26 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
Vkadaba 15:b5d57daeb7c0 27 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
Vkadaba 15:b5d57daeb7c0 28 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Vkadaba 15:b5d57daeb7c0 29 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
Vkadaba 15:b5d57daeb7c0 30 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Vkadaba 15:b5d57daeb7c0 31 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Vkadaba 15:b5d57daeb7c0 32 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Vkadaba 15:b5d57daeb7c0 33 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Vkadaba 15:b5d57daeb7c0 34 */
Vkadaba 15:b5d57daeb7c0 35
Vkadaba 15:b5d57daeb7c0 36 /*!
Vkadaba 15:b5d57daeb7c0 37 ******************************************************************************
Vkadaba 15:b5d57daeb7c0 38 * @file: platform.h
Vkadaba 15:b5d57daeb7c0 39 * @brief: platform-specific type definitions for ADMW1001
Vkadaba 15:b5d57daeb7c0 40 *-----------------------------------------------------------------------------
Vkadaba 15:b5d57daeb7c0 41 */
ADIJake 0:85855ecd3257 42 #ifndef __PLATFORM_H__
ADIJake 0:85855ecd3257 43 #define __PLATFORM_H__
ADIJake 0:85855ecd3257 44
Vkadaba 5:0728bde67bdb 45 #include "admw_api.h"
Vkadaba 5:0728bde67bdb 46 #include "admw1001/admw1001_api.h"
ADIJake 0:85855ecd3257 47
ADIJake 0:85855ecd3257 48 #if defined (__MBED__)
ADIJake 0:85855ecd3257 49
ADIJake 0:85855ecd3257 50 # include <mbed.h>
ADIJake 0:85855ecd3257 51
ADIJake 0:85855ecd3257 52 # if defined(TARGET_NUCLEO_F411RE)
Vkadaba 29:713c24b07795 53 # define PLATFORM_SPI_MOSI D11
Vkadaba 29:713c24b07795 54 # define PLATFORM_SPI_MISO D12
Vkadaba 29:713c24b07795 55 # define PLATFORM_SPI_SCK D13
Vkadaba 25:b278a215cf3b 56 # define PLATFORM_SPI_CS D10
Vkadaba 25:b278a215cf3b 57 # define PLATFORM_GPIO_RESET D6
Vkadaba 25:b278a215cf3b 58 # define PLATFORM_GPIO_ALERT_ERROR D3
Vkadaba 25:b278a215cf3b 59 # define PLATFORM_GPIO_DATAREADY D4
Vkadaba 25:b278a215cf3b 60 # define PLATFORM_LOG_TX D1
Vkadaba 25:b278a215cf3b 61 # define PLATFORM_LOG_RX D0
ADIJake 0:85855ecd3257 62 # elif defined(TARGET_ADUCM4050)
Vkadaba 29:713c24b07795 63 # define PLATFORM_SPI_MOSI D11
Vkadaba 29:713c24b07795 64 # define PLATFORM_SPI_MISO D12
Vkadaba 29:713c24b07795 65 # define PLATFORM_SPI_SCK D13
Vkadaba 25:b278a215cf3b 66 # define PLATFORM_SPI_CS D10
Vkadaba 25:b278a215cf3b 67 # define PLATFORM_GPIO_RESET D6
Vkadaba 25:b278a215cf3b 68 # define PLATFORM_GPIO_ALERT_ERROR D3
Vkadaba 25:b278a215cf3b 69 # define PLATFORM_GPIO_DATAREADY D5
Vkadaba 25:b278a215cf3b 70 # define PLATFORM_LOG_TX D0
Vkadaba 25:b278a215cf3b 71 # define PLATFORM_LOG_RX D1
ADIJake 0:85855ecd3257 72 # else
ADIJake 0:85855ecd3257 73 # error "Unknown target device"
ADIJake 0:85855ecd3257 74 # endif
ADIJake 0:85855ecd3257 75
ADIJake 0:85855ecd3257 76 # define PLATFORM_CONNECTION_INFO \
ADIJake 0:85855ecd3257 77 { \
Vkadaba 25:b278a215cf3b 78 .type = ADMW_CONNECTION_TYPE_SPI, \
ADIJake 0:85855ecd3257 79 .spi = { \
ADIJake 0:85855ecd3257 80 .mosiPin = PLATFORM_SPI_MOSI, \
ADIJake 0:85855ecd3257 81 .misoPin = PLATFORM_SPI_MISO, \
ADIJake 0:85855ecd3257 82 .sckPin = PLATFORM_SPI_SCK, \
ADIJake 0:85855ecd3257 83 .csPin = PLATFORM_SPI_CS, \
ADIJake 0:85855ecd3257 84 .maxSpeedHz = 1600000, \
ADIJake 0:85855ecd3257 85 }, \
ADIJake 0:85855ecd3257 86 .gpio = { \
ADIJake 0:85855ecd3257 87 .resetPin = PLATFORM_GPIO_RESET, \
Vkadaba 29:713c24b07795 88 .alertErrorPin= PLATFORM_GPIO_ALERT_ERROR,\
ADIJake 0:85855ecd3257 89 .datareadyPin = PLATFORM_GPIO_DATAREADY,\
ADIJake 0:85855ecd3257 90 }, \
ADIJake 0:85855ecd3257 91 .log = { \
ADIJake 0:85855ecd3257 92 .txPin = PLATFORM_LOG_TX, \
ADIJake 0:85855ecd3257 93 .rxPin = PLATFORM_LOG_RX, \
ADIJake 0:85855ecd3257 94 .baudRate = 115200, \
ADIJake 0:85855ecd3257 95 .disableLogs = false, \
ADIJake 0:85855ecd3257 96 } \
ADIJake 0:85855ecd3257 97 }
ADIJake 0:85855ecd3257 98
ADIJake 0:85855ecd3257 99 #else
ADIJake 0:85855ecd3257 100 # error "Unknown host platform"
ADIJake 0:85855ecd3257 101 #endif
ADIJake 0:85855ecd3257 102
ADIJake 0:85855ecd3257 103 #endif /* __PLATFORM_H__ */
ADIJake 0:85855ecd3257 104