Bumped Mbed FW version to 01.20.0080

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers platform.h Source File

platform.h

Go to the documentation of this file.
00001 /*
00002 Copyright 2019 (c) Analog Devices, Inc.
00003 
00004 All rights reserved.
00005 
00006 Redistribution and use in source and binary forms, with or without
00007 modification, are permitted provided that the following conditions are met:
00008   - Redistributions of source code must retain the above copyright
00009     notice, this list of conditions and the following disclaimer.
00010   - Redistributions in binary form must reproduce the above copyright
00011     notice, this list of conditions and the following disclaimer in
00012     the documentation and/or other materials provided with the
00013     distribution.
00014   - Neither the name of Analog Devices, Inc. nor the names of its
00015     contributors may be used to endorse or promote products derived
00016     from this software without specific prior written permission.
00017   - The use of this software may or may not infringe the patent rights
00018     of one or more patent holders. This license does not release you
00019     from the requirement that you obtain separate licenses from these
00020     patent holders to use this software.
00021   - Use of the software either in source or binary form, must be run
00022     on or directly connected to an Analog Devices Inc. component.
00023 
00024 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
00025 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
00026 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00027 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
00028 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00029 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
00030 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034  */
00035 
00036 /*!
00037  ******************************************************************************
00038  * @file:  platform.h
00039  * @brief: platform-specific type definitions for ADMW1001
00040  *-----------------------------------------------------------------------------
00041  */
00042 #ifndef __PLATFORM_H__
00043 #define __PLATFORM_H__
00044 
00045 #include "admw_api.h"
00046 #include "admw1001/admw1001_api.h"
00047 
00048 #if defined (__MBED__)
00049 
00050 #  include <mbed.h>
00051 
00052 #  if defined(TARGET_NUCLEO_F411RE)
00053 #    define PLATFORM_SPI_MOSI           D11
00054 #    define PLATFORM_SPI_MISO           D12
00055 #    define PLATFORM_SPI_SCK            D13
00056 #    define PLATFORM_SPI_CS             D10
00057 #    define PLATFORM_SPI_WAKEUP         D8
00058 #    define PLATFORM_GPIO_RESET         D6
00059 #    define PLATFORM_GPIO_ALERT_ERROR   D3
00060 #    define PLATFORM_GPIO_DATAREADY     D4
00061 #    define PLATFORM_LOG_TX             D1
00062 #    define PLATFORM_LOG_RX             D0
00063 #  elif defined(TARGET_ADUCM4050)
00064 #    define PLATFORM_SPI_MOSI           D11
00065 #    define PLATFORM_SPI_MISO           D12
00066 #    define PLATFORM_SPI_SCK            D13
00067 #    define PLATFORM_SPI_CS             D10
00068 #    define PLATFORM_GPIO_RESET         D6
00069 #    define PLATFORM_GPIO_ALERT_ERROR   D3
00070 #    define PLATFORM_GPIO_DATAREADY     D5
00071 #    define PLATFORM_LOG_TX             D0
00072 #    define PLATFORM_LOG_RX             D1
00073 #  else
00074 #    error "Unknown target device"
00075 #  endif
00076 
00077 #  define PLATFORM_CONNECTION_INFO                  \
00078     {                                               \
00079         .type = ADMW_CONNECTION_TYPE_SPI,           \
00080         .spi = {                                    \
00081             .mosiPin    = PLATFORM_SPI_MOSI,        \
00082             .misoPin    = PLATFORM_SPI_MISO,        \
00083             .sckPin     = PLATFORM_SPI_SCK,         \
00084             .csPin      = PLATFORM_SPI_CS,          \
00085             .wakeupPin  = PLATFORM_SPI_WAKEUP,       \
00086             .maxSpeedHz = 1000000,                  \
00087         },                                          \
00088         .gpio = {                                   \
00089             .resetPin     = PLATFORM_GPIO_RESET,    \
00090             .alertErrorPin= PLATFORM_GPIO_ALERT_ERROR,\
00091             .datareadyPin = PLATFORM_GPIO_DATAREADY,\
00092         },                                          \
00093         .log = {                                    \
00094             .txPin        = PLATFORM_LOG_TX,        \
00095             .rxPin        = PLATFORM_LOG_RX,        \
00096             .baudRate     = 115200,                 \
00097             .disableLogs  = false,                  \
00098         } \
00099     }
00100 
00101 #else
00102 #  error "Unknown host platform"
00103 #endif
00104 
00105 #endif /* __PLATFORM_H__ */
00106