Eric Pena / Mbed OS EVAL-AD7768-1

Dependencies:   platform_drivers

Committer:
epena
Date:
Fri Sep 24 18:39:34 2021 +0800
Revision:
1:c0429edee15b
Adding Released source code of ad7768-1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
epena 1:c0429edee15b 1 /***************************************************************************//*
epena 1:c0429edee15b 2 * @file app_config.h
epena 1:c0429edee15b 3 * @brief Configuration file for AD77681 IIO firmware application
epena 1:c0429edee15b 4 * @details
epena 1:c0429edee15b 5 ******************************************************************************
epena 1:c0429edee15b 6 * Copyright (c) 2021 Analog Devices, Inc.
epena 1:c0429edee15b 7 * All rights reserved.
epena 1:c0429edee15b 8 *
epena 1:c0429edee15b 9 * This software is proprietary to Analog Devices, Inc. and its licensors.
epena 1:c0429edee15b 10 * By using this software you agree to the terms of the associated
epena 1:c0429edee15b 11 * Analog Devices Software License Agreement.
epena 1:c0429edee15b 12 ******************************************************************************/
epena 1:c0429edee15b 13
epena 1:c0429edee15b 14 #ifndef _APP_CONFIG_H_
epena 1:c0429edee15b 15 #define _APP_CONFIG_H_
epena 1:c0429edee15b 16
epena 1:c0429edee15b 17 /* List of supported platforms*/
epena 1:c0429edee15b 18 #define MBED_PLATFORM 1
epena 1:c0429edee15b 19
epena 1:c0429edee15b 20 /* Select the active platform */
epena 1:c0429edee15b 21 #define ACTIVE_PLATFORM MBED_PLATFORM
epena 1:c0429edee15b 22
epena 1:c0429edee15b 23 /******************************************************************************/
epena 1:c0429edee15b 24 /***************************** Include Files **********************************/
epena 1:c0429edee15b 25 /******************************************************************************/
epena 1:c0429edee15b 26
epena 1:c0429edee15b 27 #include <stdint.h>
epena 1:c0429edee15b 28
epena 1:c0429edee15b 29 /******************************************************************************/
epena 1:c0429edee15b 30 /********************** Macros and Constants Definition ***********************/
epena 1:c0429edee15b 31 /******************************************************************************/
epena 1:c0429edee15b 32
epena 1:c0429edee15b 33 /* Name of active device */
epena 1:c0429edee15b 34 #define ACTIVE_DEVICE_NAME "ad7768-1"
epena 1:c0429edee15b 35
epena 1:c0429edee15b 36 #if (ACTIVE_PLATFORM == MBED_PLATFORM)
epena 1:c0429edee15b 37 #include "app_config_mbed.h"
epena 1:c0429edee15b 38
epena 1:c0429edee15b 39 /* Used to form a VCOM serial number */
epena 1:c0429edee15b 40 #define FIRMWARE_NAME "ad77681_mbed_iio_application"
epena 1:c0429edee15b 41
epena 1:c0429edee15b 42 /* Redefine the init params structure mapping w.r.t. platform */
epena 1:c0429edee15b 43 #define uart_init_extra_params mbed_uart_extra_init_param
epena 1:c0429edee15b 44 #define spi_init_extra_params mbed_spi_init_extra_params
epena 1:c0429edee15b 45 #else
epena 1:c0429edee15b 46 #error "No/Invalid active platform selected"
epena 1:c0429edee15b 47 #endif
epena 1:c0429edee15b 48
epena 1:c0429edee15b 49 /* ADC resolution for active device */
epena 1:c0429edee15b 50 #define ADC_RESOLUTION 24
epena 1:c0429edee15b 51
epena 1:c0429edee15b 52 /* Baud rate for IIO application UART interface */
epena 1:c0429edee15b 53 #define IIO_UART_BAUD_RATE (230400)
epena 1:c0429edee15b 54
epena 1:c0429edee15b 55 /****** Macros used to form a VCOM serial number ******/
epena 1:c0429edee15b 56 #if !defined(DEVICE_NAME)
epena 1:c0429edee15b 57 #define DEVICE_NAME "DEV_AD77681"
epena 1:c0429edee15b 58 #endif
epena 1:c0429edee15b 59
epena 1:c0429edee15b 60 #if !defined(PLATFORM_NAME)
epena 1:c0429edee15b 61 #define PLATFORM_NAME "SDP_K1"
epena 1:c0429edee15b 62 #endif
epena 1:c0429edee15b 63 /******/
epena 1:c0429edee15b 64
epena 1:c0429edee15b 65 /* Enable the VirtualCOM port connection/interface. By default serial communication
epena 1:c0429edee15b 66 * is physical UART */
epena 1:c0429edee15b 67 //#define USE_VIRTUAL_COM_PORT
epena 1:c0429edee15b 68
epena 1:c0429edee15b 69 #if defined(USE_VIRTUAL_COM_PORT)
epena 1:c0429edee15b 70 /* Below USB configurations (VID and PID) are owned and assigned by ADI.
epena 1:c0429edee15b 71 * If intended to distribute software further, use the VID and PID owned by your
epena 1:c0429edee15b 72 * organization */
epena 1:c0429edee15b 73 #define VIRTUAL_COM_PORT_VID 0x0456
epena 1:c0429edee15b 74 #define VIRTUAL_COM_PORT_PID 0xb66c
epena 1:c0429edee15b 75 /* Serial number string is formed as: application name + device (target) name + platform (host) name */
epena 1:c0429edee15b 76 #define VIRTUAL_COM_SERIAL_NUM (FIRMWARE_NAME "_" DEVICE_NAME "_" PLATFORM_NAME)
epena 1:c0429edee15b 77 #endif
epena 1:c0429edee15b 78
epena 1:c0429edee15b 79 /******************************************************************************/
epena 1:c0429edee15b 80 /************************ Public Declarations *********************************/
epena 1:c0429edee15b 81 /******************************************************************************/
epena 1:c0429edee15b 82
epena 1:c0429edee15b 83 int32_t init_system(void);
epena 1:c0429edee15b 84
epena 1:c0429edee15b 85 extern struct uart_init_param uart_init_params;
epena 1:c0429edee15b 86 extern struct gpio_desc *led_green_gpio_desc;
epena 1:c0429edee15b 87
epena 1:c0429edee15b 88
epena 1:c0429edee15b 89 #endif /* _APP_CONFIG_H_ */