EVAL-AD7124 Mbed Example Program.

Dependencies:   adi_console_menu platform_drivers

Committer:
Kjansen
Date:
Tue Aug 03 12:05:42 2021 +0100
Revision:
7:3e1005bd4d41
Parent:
3:779bb1e55f1a
No-OS Adoption Changes:

* Updated the .lib files for adoption of no-OS repository as-is.
* Replaced platform_drivers.h with required header files.
* Added designated initializers for nanodac_init_params as the latest
spi_init_param in no-OS repository include a new field member platform_ops.
* Added Support Macros.
* Updated the copyright year of the nanodac_console_app.c file

Mbed OS update changes:
1) Added the mbed_app.json file with custom parameters
2) Updated the mbed-os version to 6.8.0

Updated the readme file.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mahphalke 3:779bb1e55f1a 1 /*!
mahphalke 3:779bb1e55f1a 2 *****************************************************************************
mahphalke 3:779bb1e55f1a 3 @file: main.c
mahphalke 3:779bb1e55f1a 4
mahphalke 3:779bb1e55f1a 5 @brief: main module for AD7124 application interface
mahphalke 3:779bb1e55f1a 6
mahphalke 3:779bb1e55f1a 7 @details: main module for AD7124 application interface
mahphalke 3:779bb1e55f1a 8
mahphalke 3:779bb1e55f1a 9 -----------------------------------------------------------------------------
mahphalke 3:779bb1e55f1a 10 Copyright (c) 2019, 2020 Analog Devices, Inc.
mahphalke 3:779bb1e55f1a 11 All rights reserved.
mahphalke 3:779bb1e55f1a 12
mahphalke 3:779bb1e55f1a 13 This software is proprietary to Analog Devices, Inc. and its licensors.
mahphalke 3:779bb1e55f1a 14 By using this software you agree to the terms of the associated
mahphalke 3:779bb1e55f1a 15 Analog Devices Software License Agreement.
mahphalke 3:779bb1e55f1a 16 /*****************************************************************************/
mahphalke 3:779bb1e55f1a 17
mahphalke 3:779bb1e55f1a 18 /*** includes ***/
mahphalke 3:779bb1e55f1a 19 #include <stdio.h>
mahphalke 3:779bb1e55f1a 20 #include "ad7124_console_app.h"
mahphalke 3:779bb1e55f1a 21
mahphalke 3:779bb1e55f1a 22 /*****************************************************************************/
mahphalke 3:779bb1e55f1a 23
mahphalke 3:779bb1e55f1a 24 /*** Function Prototypes ***/
mahphalke 3:779bb1e55f1a 25
mahphalke 3:779bb1e55f1a 26 /*****************************************************************************/
mahphalke 3:779bb1e55f1a 27
mahphalke 3:779bb1e55f1a 28 /* @brief Main function
mahphalke 3:779bb1e55f1a 29 *
mahphalke 3:779bb1e55f1a 30 * @param None
mahphalke 3:779bb1e55f1a 31 *
mahphalke 3:779bb1e55f1a 32 * @return SUCCESS(0), FAILURE (Negative)
mahphalke 3:779bb1e55f1a 33 */
mahphalke 3:779bb1e55f1a 34 int main()
mahphalke 3:779bb1e55f1a 35 {
mahphalke 3:779bb1e55f1a 36 int32_t setupResult;
mahphalke 3:779bb1e55f1a 37
mahphalke 3:779bb1e55f1a 38 /* Initialize the AD7124 application before the main loop */
mahphalke 3:779bb1e55f1a 39 if ((setupResult = ad7124_app_initialize(AD7124_CONFIG_A)) < 0) {
mahphalke 3:779bb1e55f1a 40 printf("Error setting up AD7124 (%ld)\r\n\r\n", setupResult);
mahphalke 3:779bb1e55f1a 41 }
mahphalke 3:779bb1e55f1a 42
mahphalke 3:779bb1e55f1a 43 /* Infinite loop */
mahphalke 3:779bb1e55f1a 44 while (1) {
mahphalke 3:779bb1e55f1a 45 // display the console menu for the AD7124 application
mahphalke 3:779bb1e55f1a 46 adi_do_console_menu(&ad7124_main_menu);
mahphalke 3:779bb1e55f1a 47 }
mahphalke 3:779bb1e55f1a 48
mahphalke 3:779bb1e55f1a 49 // this line should not be reached
mahphalke 3:779bb1e55f1a 50 return - 1;
mahphalke 3:779bb1e55f1a 51 }