![]() |
no-OS
|
Implementation of terminal command control for ADIN1320. More...
#include <errno.h>#include <stdbool.h>#include <stdint.h>#include <string.h>#include "adin1320.h"#include "common_data.h"#include "mdio_spi.h"#include "no_os_alloc.h"#include "no_os_delay.h"#include "no_os_gpio.h"#include "no_os_mdio.h"#include "no_os_print_log.h"#include "no_os_util.h"Classes | |
| struct | cmd_config |
| struct | cmd_input |
| struct | cmd_gpio |
Macros | |
| #define | FW_VERSION_MAJOR 1 |
| #define | FW_VERSION_MINOR 0 |
| #define | FW_VERSION_PATCH 0 |
| #define | EVAL_BOARD_NAME "EVAL-ADIN1320FMCZ" |
| #define | CMD_PARAM_EMPTY -1 |
| #define | CMD_BUFFER_SIZE 100 |
| #define | CMD_PARAM_SIZE 10 |
Enumerations | |
| enum | cmd_type { CMD_TYPE_NONE = 0 , CMD_TYPE_MDIO_READ , CMD_TYPE_MDIO_WRITE , CMD_TYPE_HELP , CMD_TYPE_RESET , CMD_TYPE_MAX } |
Implementation of terminal command control for ADIN1320.
Copyright 2026(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| #define CMD_BUFFER_SIZE 100 |
| #define CMD_PARAM_EMPTY -1 |
| #define CMD_PARAM_SIZE 10 |
| #define EVAL_BOARD_NAME "EVAL-ADIN1320FMCZ" |
| #define FW_VERSION_MAJOR 1 |
| #define FW_VERSION_MINOR 0 |
| #define FW_VERSION_PATCH 0 |
| enum cmd_type |
| int board_init | ( | struct no_os_uart_desc ** | uart_desc, |
| struct cmd_config * | cmd_cfg, | ||
| struct cmd_gpio ** | cmd_gpio ) |
| void cmd_mdio_read | ( | struct adin1320_desc * | dev, |
| struct cmd_input * | cmd_input ) |
| void cmd_mdio_write | ( | struct adin1320_desc * | dev, |
| struct cmd_input * | cmd_input ) |
| void cmd_print_list | ( | struct cmd_input * | cmd_input | ) |
| void cmd_reset | ( | struct adin1320_desc * | dev_0, |
| struct adin1320_desc * | dev_8, | ||
| struct cmd_input * | cmd_input, | ||
| bool | dev_init[2] ) |
| int device_init | ( | struct adin1320_desc ** | dev_0, |
| struct adin1320_desc ** | dev_8, | ||
| bool | dev_init[2] ) |
| int example_main | ( | void | ) |
Basic example main executiont.
Basic example main execution.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
IIO descriptor and initialization parameter.
IIO app.
Declaring iio_devices structure
Initializing IIO app init param.
Initializing IIO app.
Running the IIO app (use iio_info or osc in terminal).
Set the threshold voltage to 5V
The comparator output will be available on the GPO_A pin
Set the DAC output on channel C to 5V
Measure input current on channel D
Initialize the ADC_RDY GPIO and associated IRQ event
GPIO Pin Interrupt Controller
| int fw_mode_init | ( | struct cmd_config | cmd_cfg, |
| struct cmd_gpio * | cmd_gpio, | ||
| struct adin1320_desc ** | dev_0, | ||
| struct adin1320_desc ** | dev_8, | ||
| bool * | dev_init ) |
| int fw_mode_mdi_path_test | ( | struct cmd_gpio * | cmd_gpio, |
| struct adin1320_desc * | dev_0, | ||
| struct adin1320_desc * | dev_8 ) |
| int fw_mode_sgmii_path_test | ( | struct cmd_gpio * | cmd_gpio, |
| struct adin1320_desc * | dev_0, | ||
| struct adin1320_desc * | dev_8 ) |
| void get_cmd | ( | struct no_os_uart_desc * | uart_desc, |
| struct cmd_input * | cmd_input ) |
| void process_cmd | ( | struct adin1320_desc * | dev_0, |
| struct adin1320_desc * | dev_8, | ||
| struct cmd_input * | cmd_input, | ||
| bool | dev_init[2] ) |
| void select_cmd | ( | struct cmd_input * | cmd_input | ) |