no-OS
Functions | Variables
platform.c File Reference

Defines platform data to be used by ADE7913 example project. More...

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

Functions

int init_nvic (struct no_os_irq_ctrl_desc *ade7913_nvic_desc)
 Init NVIC. More...
 

Variables

struct max_uart_init_param max_uart_extra_ip
 
struct max_gpio_init_param gpio_extra
 
struct max_spi_init_param ade7913_spi_extra_ip
 
struct max_gpio_init_param ade7913_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 ade7913_gpio_rdy_ip
 
struct no_os_spi_init_param ade7913_spi_ip0
 
struct no_os_spi_init_param ade7913_spi_ip1
 
struct no_os_spi_init_param ade7913_spi_ip2
 
struct no_os_irq_init_param ade7913_gpio_irq_ip
 

Detailed Description

Defines platform data to be used by ADE7913 example project.

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

Copyright (c) 2024 Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.

Function Documentation

◆ init_nvic()

int init_nvic ( struct no_os_irq_ctrl_desc ade7913_nvic_desc)

Init NVIC.

Parameters
ade7913_nvic_desc- irq nvic descriptor
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

Variable Documentation

◆ ade7913_gpio_extra_ip

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

◆ ade7913_gpio_irq_ip

struct no_os_irq_init_param ade7913_gpio_irq_ip
Initial value:
= {
.platform_ops = GPIO_IRQ_OPS,
.irq_ctrl_id = GPIO_CTRL_IRQ_ID,
.extra = GPIO_IRQ_EXTRA,
}

◆ ade7913_gpio_rdy_ip

struct no_os_gpio_init_param ade7913_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,
}

◆ ade7913_spi_extra_ip

struct max_spi_init_param ade7913_spi_extra_ip
Initial value:
= {
.num_slaves = SPI_SLAVE_NUM,
.polarity = SPI_SS_POL_LOW,
.vssel = MXC_GPIO_VSSEL_VDDIOH,
}

◆ ade7913_spi_ip0

struct no_os_spi_init_param ade7913_spi_ip0
Initial value:
= {
.device_id = SPI_DEVICE_ID,
.max_speed_hz = SPI_BAUDRATE,
.platform_ops = &max_spi_ops,
.chip_select = SPI_CS0,
}

◆ ade7913_spi_ip1

struct no_os_spi_init_param ade7913_spi_ip1
Initial value:
= {
.device_id = SPI_DEVICE_ID,
.max_speed_hz = SPI_BAUDRATE,
.platform_ops = &max_spi_ops,
.chip_select = SPI_CS1,
}

◆ ade7913_spi_ip2

struct no_os_spi_init_param ade7913_spi_ip2
Initial value:
= {
.device_id = SPI_DEVICE_ID,
.max_speed_hz = SPI_BAUDRATE,
.platform_ops = &max_spi_ops,
.chip_select = SPI_CS2,
}

◆ 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,
}

◆ max_uart_extra_ip

struct max_uart_init_param max_uart_extra_ip
Initial value:
= {
.flow = UART_FLOW_DIS
}

◆ 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,
}
ade7913_spi_extra_ip
struct max_spi_init_param ade7913_spi_extra_ip
Definition: platform.c:51
max_uart_extra_ip
struct max_uart_init_param max_uart_extra_ip
Definition: platform.c:43
GPIO_RDY_PIN
#define GPIO_RDY_PIN
Definition: platform.h:68
NO_OS_UART_STOP_1_BIT
@ NO_OS_UART_STOP_1_BIT
Definition: no_os_uart.h:94
GPIO_LED_PORT
#define GPIO_LED_PORT
Definition: platform.h:75
SPI_SS_POL_LOW
@ SPI_SS_POL_LOW
Definition: maxim_spi.h:49
NO_OS_PULL_NONE
@ NO_OS_PULL_NONE
Definition: no_os_gpio.h:66
UART_BAUD
#define UART_BAUD
Definition: platform.h:96
NO_OS_SPI_MODE_3
@ NO_OS_SPI_MODE_3
Definition: no_os_spi.h:67
SPI_SLAVE_NUM
#define SPI_SLAVE_NUM
Definition: platform.h:93
SPI_CS2
#define SPI_CS2
Definition: platform.h:74
SPI_BAUDRATE
#define SPI_BAUDRATE
Definition: parameters.h:73
max_spi_ops
const struct no_os_spi_platform_ops max_spi_ops
maxim platform specific SPI platform ops structure
Definition: maxim_spi.c:795
GPIO_LED_PIN
#define GPIO_LED_PIN
Definition: platform.h:76
UART_FLOW_DIS
@ UART_FLOW_DIS
Definition: maxim_uart.h:47
GPIO_RDY_PORT
#define GPIO_RDY_PORT
Definition: platform.h:67
max_gpio_ops
const struct no_os_gpio_platform_ops max_gpio_ops
maxim platform specific GPIO platform ops structure
Definition: maxim_gpio.c:320
max_uart_ops
const struct no_os_uart_platform_ops max_uart_ops
Maxim platform specific UART platform ops structure.
Definition: maxim_uart.c:475
gpio_extra
struct max_gpio_init_param gpio_extra
Definition: platform.c:47
SPI_CS1
#define SPI_CS1
Definition: platform.h:73
NO_OS_SPI_BIT_ORDER_MSB_FIRST
@ NO_OS_SPI_BIT_ORDER_MSB_FIRST
Definition: no_os_spi.h:76
SPI_DEVICE_ID
#define SPI_DEVICE_ID
Definition: parameters.h:69
NO_OS_UART_PAR_NO
@ NO_OS_UART_PAR_NO
Definition: no_os_uart.h:77
SPI_CS0
#define SPI_CS0
Definition: platform.h:72
GPIO_CTRL_IRQ_ID
#define GPIO_CTRL_IRQ_ID
Definition: parameters.h:84
NO_OS_PULL_UP
@ NO_OS_PULL_UP
Definition: no_os_gpio.h:68
UART_DEV_ID
#define UART_DEV_ID
Definition: platform.h:95
GPIO_IRQ_EXTRA
#define GPIO_IRQ_EXTRA
Definition: parameters.h:85
NO_OS_UART_CS_8
@ NO_OS_UART_CS_8
Definition: no_os_uart.h:66
GPIO_IRQ_OPS
#define GPIO_IRQ_OPS
Definition: parameters.h:83