no-OS
Loading...
Searching...
No Matches
common_data.c File Reference

Defines common data to be used by ADE9153A example project. More...

#include "common_data.h"
Include dependency graph for common_data.c:

Functions

int interface_toggle_led (struct no_os_gpio_desc *gpio_led_desc)
 Toggle Led.
 
int read_measurements (struct ade9153a_dev *dev)
 Read measurements.
 
int autocalibration_read_vals (struct ade9153a_dev *dev)
 Autocalibration read values.
 
int autocalibration_start (struct ade9153a_dev *dev)
 Autocalibration start.
 

Variables

struct max_uart_init_param max_uart_extra_ip
 
struct max_gpio_init_param gpio_extra
 
struct max_spi_init_param ade9153a_spi_extra_ip
 
struct max_gpio_init_param ade9153a_gpio_extra_ip
 
struct no_os_uart_init_param uart_ip
 
struct no_os_gpio_init_param gpio_led1_ip
 
struct no_os_gpio_init_param gpio_ss_ip
 
struct no_os_gpio_init_param gpio_sck_ip
 
struct no_os_gpio_init_param gpio_reset_ip
 
struct no_os_gpio_init_param ade9153a_gpio_rdy_ip
 
struct no_os_spi_init_param ade9153a_spi_ip
 
struct no_os_irq_init_param ade9153a_gpio_irq_ip
 

Detailed Description

Defines common data to be used by ADE9153A example project.

Author
REtz (radu..nosp@m.etz@.nosp@m.analo.nosp@m.g.co.nosp@m.m)

Copyright (c) 2024 Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ autocalibration_read_vals()

int autocalibration_read_vals ( struct ade9153a_dev * dev)

Autocalibration read values.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ autocalibration_start()

int autocalibration_start ( struct ade9153a_dev * dev)

Autocalibration start.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ interface_toggle_led()

int interface_toggle_led ( struct no_os_gpio_desc * gpio_led_desc)

Toggle Led.

Toggle LED.

Parameters
gpio_led_desc- led descriptor
Returns
0 in case of success, negative error code otherwise.

◆ read_measurements()

int read_measurements ( struct ade9153a_dev * dev)

Read measurements.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

Variable Documentation

◆ ade9153a_gpio_extra_ip

struct max_gpio_init_param ade9153a_gpio_extra_ip
Initial value:
= {
.vssel = MXC_GPIO_VSSEL_VDDIOH,
}

◆ ade9153a_gpio_irq_ip

struct no_os_irq_init_param ade9153a_gpio_irq_ip
Initial value:
= {
.platform_ops = GPIO_IRQ_OPS,
.irq_ctrl_id = GPIO_CTRL_IRQ_ID,
.extra = GPIO_IRQ_EXTRA,
}
#define GPIO_IRQ_EXTRA
Definition parameters.h:56
#define GPIO_IRQ_OPS
Definition parameters.h:54
#define GPIO_CTRL_IRQ_ID
Definition parameters.h:55

◆ ade9153a_gpio_rdy_ip

struct no_os_gpio_init_param ade9153a_gpio_rdy_ip
Initial value:
= {
.port = GPIO_RDY_PORT,
.number = GPIO_RDY_PIN,
.pull = NO_OS_PULL_NONE,
.platform_ops = &max_gpio_ops,
.extra = &gpio_extra,
}
const struct xil_gpio_init_param gpio_extra
Definition ad5758_sdz.c:43
#define GPIO_RDY_PORT
Definition platform.h:37
#define GPIO_RDY_PIN
Definition platform.h:38
const struct no_os_gpio_platform_ops max_gpio_ops
maxim platform specific GPIO platform ops structure
Definition maxim_gpio.c:293
@ NO_OS_PULL_NONE
Definition no_os_gpio.h:31

◆ ade9153a_spi_extra_ip

struct max_spi_init_param ade9153a_spi_extra_ip
Initial value:
= {
.num_slaves = SPI_SLAVE_NUM,
.polarity = SPI_SS_POL_LOW,
.vssel = MXC_GPIO_VSSEL_VDDIOH,
}
#define SPI_SLAVE_NUM
Definition platform.h:45
@ SPI_SS_POL_LOW
Definition maxim_spi.h:26

◆ ade9153a_spi_ip

struct no_os_spi_init_param ade9153a_spi_ip
Initial value:
= {
.device_id = SPI_DEVICE_ID,
.max_speed_hz = SPI_BAUDRATE,
.platform_ops = &max_spi_ops,
.chip_select = SPI_CS,
}
#define SPI_DEVICE_ID
Definition parameters.h:40
#define SPI_BAUDRATE
Definition parameters.h:44
#define SPI_CS
Definition parameters.h:41
struct max_spi_init_param ade9153a_spi_extra_ip
Definition common_data.c:21
const struct no_os_spi_platform_ops max_spi_ops
maxim platform specific SPI platform ops structure
Definition maxim_spi.c:764
@ NO_OS_SPI_BIT_ORDER_MSB_FIRST
Definition no_os_spi.h:41
@ NO_OS_SPI_MODE_0
Definition no_os_spi.h:26

◆ gpio_extra

struct max_gpio_init_param gpio_extra
Initial value:
= {
.vssel = MXC_GPIO_VSSEL_VDDIOH,
}

◆ gpio_led1_ip

struct no_os_gpio_init_param gpio_led1_ip
Initial value:
= {
.port = GPIO_LED_PORT,
.number = GPIO_LED_PIN,
.pull = NO_OS_PULL_UP,
.platform_ops = &max_gpio_ops,
.extra = &gpio_extra,
}
#define GPIO_LED_PIN
Definition platform.h:29
#define GPIO_LED_PORT
Definition platform.h:28
@ NO_OS_PULL_UP
Definition no_os_gpio.h:33

◆ gpio_reset_ip

struct no_os_gpio_init_param gpio_reset_ip
Initial value:
= {
.port = GPIO_RESET_PORT,
.number = GPIO_RESET_PIN,
.pull = NO_OS_PULL_NONE,
.platform_ops = &max_gpio_ops,
.extra = &gpio_extra,
}
#define GPIO_RESET_PORT
Definition parameters.h:37
#define GPIO_RESET_PIN
Definition platform.h:32

◆ gpio_sck_ip

struct no_os_gpio_init_param gpio_sck_ip
Initial value:
= {
.port = GPIO_SCK_PORT,
.number = GPIO_SCK_PIN,
.pull = NO_OS_PULL_NONE,
.platform_ops = &max_gpio_ops,
.extra = &gpio_extra,
}
#define GPIO_SCK_PIN
Definition common_data.h:53
#define GPIO_SCK_PORT
Definition common_data.h:52

◆ gpio_ss_ip

struct no_os_gpio_init_param gpio_ss_ip
Initial value:
= {
.port = GPIO_SS_PORT,
.number = GPIO_SS_PIN,
.pull = NO_OS_PULL_NONE,
.platform_ops = &max_gpio_ops,
.extra = &gpio_extra,
}
#define GPIO_SS_PIN
Definition common_data.h:51
#define GPIO_SS_PORT
Definition common_data.h:50

◆ max_uart_extra_ip

struct max_uart_init_param max_uart_extra_ip
Initial value:
= {
}
@ MAX_UART_FLOW_DIS
Definition maxim_uart.h:24

◆ uart_ip

struct no_os_uart_init_param uart_ip
Initial value:
= {
.device_id = UART_DEV_ID,
.baud_rate = UART_BAUD,
.size = NO_OS_UART_CS_8,
.parity = NO_OS_UART_PAR_NO,
.platform_ops = &max_uart_ops,
.extra = &max_uart_extra_ip,
}
#define UART_DEV_ID
Definition common_data.h:23
struct max_uart_init_param max_uart_extra_ip
Definition parameters.c:13
#define UART_BAUD
Definition platform.h:48
const struct no_os_uart_platform_ops max_uart_ops
Maxim platform specific UART platform ops structure.
Definition maxim_uart.c:444
@ NO_OS_UART_CS_8
Definition no_os_uart.h:31
@ NO_OS_UART_PAR_NO
Definition no_os_uart.h:42
@ NO_OS_UART_STOP_1_BIT
Definition no_os_uart.h:59