Mbed FW update

Committer:
ADIJake
Date:
Mon Apr 01 11:09:52 2019 +0000
Revision:
0:85855ecd3257
Child:
1:63dd03580de4
Initial Commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ADIJake 0:85855ecd3257 1 #ifndef __PLATFORM_H__
ADIJake 0:85855ecd3257 2 #define __PLATFORM_H__
ADIJake 0:85855ecd3257 3
ADIJake 0:85855ecd3257 4 #include "adi_sense_api.h"
ADIJake 0:85855ecd3257 5 #include "adi_sense_1000/adi_sense_1000_api.h"
ADIJake 0:85855ecd3257 6
ADIJake 0:85855ecd3257 7 #if defined (__MBED__)
ADIJake 0:85855ecd3257 8
ADIJake 0:85855ecd3257 9 # include <mbed.h>
ADIJake 0:85855ecd3257 10
ADIJake 0:85855ecd3257 11 # if defined(TARGET_NUCLEO_F411RE)
ADIJake 0:85855ecd3257 12 # define PLATFORM_SPI_MOSI SPI_MOSI
ADIJake 0:85855ecd3257 13 # define PLATFORM_SPI_MISO SPI_MISO
ADIJake 0:85855ecd3257 14 # define PLATFORM_SPI_SCK SPI_SCK
ADIJake 0:85855ecd3257 15 # define PLATFORM_SPI_CS D10
ADIJake 0:85855ecd3257 16 # define PLATFORM_GPIO_RESET D6
ADIJake 0:85855ecd3257 17 # define PLATFORM_GPIO_ERROR D3
ADIJake 0:85855ecd3257 18 # define PLATFORM_GPIO_ALERT D4
ADIJake 0:85855ecd3257 19 # define PLATFORM_GPIO_DATAREADY D5
ADIJake 0:85855ecd3257 20 # define PLATFORM_LOG_TX D1
ADIJake 0:85855ecd3257 21 # define PLATFORM_LOG_RX D0
ADIJake 0:85855ecd3257 22 # elif defined(TARGET_ADUCM4050)
ADIJake 0:85855ecd3257 23 # define PLATFORM_SPI_MOSI SPI0_MOSI
ADIJake 0:85855ecd3257 24 # define PLATFORM_SPI_MISO SPI0_MISO
ADIJake 0:85855ecd3257 25 # define PLATFORM_SPI_SCK SPI0_SCLK
ADIJake 0:85855ecd3257 26 # define PLATFORM_SPI_CS D10
ADIJake 0:85855ecd3257 27 # define PLATFORM_GPIO_RESET D6
ADIJake 0:85855ecd3257 28 # define PLATFORM_GPIO_ERROR D3
ADIJake 0:85855ecd3257 29 # define PLATFORM_GPIO_ALERT D4
ADIJake 0:85855ecd3257 30 # define PLATFORM_GPIO_DATAREADY D5
ADIJake 0:85855ecd3257 31 # define PLATFORM_LOG_TX D0
ADIJake 0:85855ecd3257 32 # define PLATFORM_LOG_RX D1
ADIJake 0:85855ecd3257 33 # else
ADIJake 0:85855ecd3257 34 # error "Unknown target device"
ADIJake 0:85855ecd3257 35 # endif
ADIJake 0:85855ecd3257 36
ADIJake 0:85855ecd3257 37 # define PLATFORM_CONNECTION_INFO \
ADIJake 0:85855ecd3257 38 { \
ADIJake 0:85855ecd3257 39 .type = ADI_SENSE_CONNECTION_TYPE_SPI, \
ADIJake 0:85855ecd3257 40 .spi = { \
ADIJake 0:85855ecd3257 41 .mosiPin = PLATFORM_SPI_MOSI, \
ADIJake 0:85855ecd3257 42 .misoPin = PLATFORM_SPI_MISO, \
ADIJake 0:85855ecd3257 43 .sckPin = PLATFORM_SPI_SCK, \
ADIJake 0:85855ecd3257 44 .csPin = PLATFORM_SPI_CS, \
ADIJake 0:85855ecd3257 45 .maxSpeedHz = 1600000, \
ADIJake 0:85855ecd3257 46 }, \
ADIJake 0:85855ecd3257 47 .gpio = { \
ADIJake 0:85855ecd3257 48 .resetPin = PLATFORM_GPIO_RESET, \
ADIJake 0:85855ecd3257 49 .errorPin = PLATFORM_GPIO_ERROR, \
ADIJake 0:85855ecd3257 50 .alertPin = PLATFORM_GPIO_ALERT, \
ADIJake 0:85855ecd3257 51 .datareadyPin = PLATFORM_GPIO_DATAREADY,\
ADIJake 0:85855ecd3257 52 }, \
ADIJake 0:85855ecd3257 53 .log = { \
ADIJake 0:85855ecd3257 54 .txPin = PLATFORM_LOG_TX, \
ADIJake 0:85855ecd3257 55 .rxPin = PLATFORM_LOG_RX, \
ADIJake 0:85855ecd3257 56 .baudRate = 115200, \
ADIJake 0:85855ecd3257 57 .disableLogs = false, \
ADIJake 0:85855ecd3257 58 } \
ADIJake 0:85855ecd3257 59 }
ADIJake 0:85855ecd3257 60
ADIJake 0:85855ecd3257 61 #else
ADIJake 0:85855ecd3257 62 # error "Unknown host platform"
ADIJake 0:85855ecd3257 63 #endif
ADIJake 0:85855ecd3257 64
ADIJake 0:85855ecd3257 65 #endif /* __PLATFORM_H__ */
ADIJake 0:85855ecd3257 66