Example program for EVAL-AD7124
Dependencies: tempsensors adi_console_menu platform_drivers
app/main.c@7:217c27bc3082, 2021-07-21 (annotated)
- Committer:
- Kjansen
- Date:
- Wed Jul 21 11:49:48 2021 +0100
- Revision:
- 7:217c27bc3082
- Parent:
- 3:f20f09251190
Updated the project directory structure to remove the duplicate drivers repositories and replaced with common no-os driver repository
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mahphalke | 1:c863d7e9e272 | 1 | /***************************************************************************//** |
mahphalke | 1:c863d7e9e272 | 2 | * @file main.c |
mahphalke | 1:c863d7e9e272 | 3 | * @brief Main interface for AD7124 temperature measurement firmware example |
mahphalke | 1:c863d7e9e272 | 4 | * @details |
mahphalke | 1:c863d7e9e272 | 5 | ******************************************************************************** |
mahphalke | 1:c863d7e9e272 | 6 | * Copyright (c) 2021 Analog Devices, Inc. |
mahphalke | 1:c863d7e9e272 | 7 | * All rights reserved. |
mahphalke | 1:c863d7e9e272 | 8 | * |
mahphalke | 1:c863d7e9e272 | 9 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
mahphalke | 1:c863d7e9e272 | 10 | * By using this software you agree to the terms of the associated |
mahphalke | 1:c863d7e9e272 | 11 | * Analog Devices Software License Agreement. |
mahphalke | 1:c863d7e9e272 | 12 | *******************************************************************************/ |
mahphalke | 1:c863d7e9e272 | 13 | |
mahphalke | 1:c863d7e9e272 | 14 | /******************************************************************************/ |
mahphalke | 1:c863d7e9e272 | 15 | /***************************** Include Files **********************************/ |
mahphalke | 1:c863d7e9e272 | 16 | /******************************************************************************/ |
mahphalke | 1:c863d7e9e272 | 17 | |
mahphalke | 1:c863d7e9e272 | 18 | #include <stdint.h> |
mahphalke | 1:c863d7e9e272 | 19 | #include <stdio.h> |
mahphalke | 1:c863d7e9e272 | 20 | |
mahphalke | 1:c863d7e9e272 | 21 | #include "ad7124_console_app.h" |
Kjansen |
7:217c27bc3082 | 22 | #include "error.h" |
mahphalke | 1:c863d7e9e272 | 23 | |
mahphalke | 1:c863d7e9e272 | 24 | /******************************************************************************/ |
mahphalke | 1:c863d7e9e272 | 25 | /************************** Functions Definitions *****************************/ |
mahphalke | 1:c863d7e9e272 | 26 | /******************************************************************************/ |
mahphalke | 1:c863d7e9e272 | 27 | |
mahphalke | 1:c863d7e9e272 | 28 | /* @brief Main function |
mahphalke | 1:c863d7e9e272 | 29 | * @details This is a main entry function for firmware application |
mahphalke | 1:c863d7e9e272 | 30 | */ |
mahphalke | 1:c863d7e9e272 | 31 | int main(void) |
mahphalke | 1:c863d7e9e272 | 32 | { |
mahphalke | 1:c863d7e9e272 | 33 | int32_t result; |
mahphalke | 1:c863d7e9e272 | 34 | |
mahphalke | 1:c863d7e9e272 | 35 | /* Initialize the AD7124 device and application */ |
mahphalke |
3:f20f09251190 | 36 | if ((result = ad7124_app_initialize(AD7124_CONFIG_RESET)) != SUCCESS) { |
mahphalke | 1:c863d7e9e272 | 37 | printf("Error setting up AD7124 (%ld)" EOL EOL, result); |
mahphalke | 1:c863d7e9e272 | 38 | } |
mahphalke | 1:c863d7e9e272 | 39 | |
mahphalke | 1:c863d7e9e272 | 40 | /* Infinite loop */ |
mahphalke | 1:c863d7e9e272 | 41 | while (1) { |
mahphalke | 1:c863d7e9e272 | 42 | /* display the console menu for the AD7124 application */ |
mahphalke | 1:c863d7e9e272 | 43 | adi_do_console_menu(&ad7124_main_menu); |
mahphalke | 1:c863d7e9e272 | 44 | } |
mahphalke | 1:c863d7e9e272 | 45 | |
mahphalke | 1:c863d7e9e272 | 46 | /* this line should never be reached */ |
mahphalke | 1:c863d7e9e272 | 47 | return (-1); |
mahphalke | 1:c863d7e9e272 | 48 | } |