Commit 25c85f4c authored by Guilherme Sanches's avatar Guilherme Sanches

Clean up on the iop_example. Wrongly commited files

parent 3f97dd6b
#include <iop.h>
/**
* @brief IOP remote ports
*/
extern iop_port_t remote_ports[2];
/**
* @brief Logical devices
*/
extern iop_logical_device_t logical_device_0;
/**
* @brief Physical devices
*/
extern iop_physical_device_t physical_device_0;
/**
* @brief Physical devices list
*/
static iop_physical_device_t *physical_device_list[1] = \
{
&physical_device_0,
};
/**
* @brief Logical devices list
*/
static iop_logical_device_t *logical_device_list[1] = \
{
&logical_device_0,
};
static iop_wrapper_t requests_storage[1024];
/**
* @brief IOP buffers
*/
static iop_buffer_t iop_buffers[1024];
static uint8_t iop_buffers_storage[1024 * IOP_BUFFER_SIZE];
/**
* @brief IOP application configurations
*/
iop_configuration_t usr_configuration = {
.wrappers = requests_storage,
.iop_buffers = iop_buffers,
.iop_buffers_storage = iop_buffers_storage,
.wrappers_count = 1024,
.physical_devices = {
.length = 1,
.elements = physical_device_list
},
.logical_devices = {
.length = 1,
.elements = logical_device_list
},
.remote_ports = {
.length = 2,
.elements = remote_ports
}
};
#include <iop.h>
/**
* @brief Physical devices
*/
extern iop_physical_device_t physical_device_0;
/**
* @brief Routes Headers
*/
static iop_header_t route_header[1] = \
{
{
.eth_header = {
.dst_ip = { 192,168,0,3 },
.dst_mac = { 0x00,0x50,0xbf,0x50,0x07,0x0d},
.dst_port = HTONS(13000),
.src_port = HTONS(13000)
}
}
};
/**
* @brief Routes Scheduling
*/
static uint32_t route_schedule_0[1] = \
{ 1 };
/**
* @brief Routes Configuration
*/
static iop_logical_route_t logical_routes[1] = \
{
{
.schedule = route_schedule_0,
.header = &route_header[0],
.device = &physical_device_0
}
};
/**
* @brief Logical Device configuration
*/
iop_logical_device_t logical_device_0 = \
{
.routes = {
.length = 1,
.elements = logical_routes
},
};
/*
* ============================================================================
* This file was generated by the GMV's Configurator Tool and is part of an I/O
* partition configuration.
* File Purpose: IO Partition user configuration. Contains the configuration
* options for Ethernet's GRETH devices.
* ============================================================================
*/
#include <iop.h>
#include <iop_greth.h>
#include <eth_support.h>
/**
* @brief IOP remote ports
*/
extern iop_port_t remote_ports[2];
/**
* @brief IOP buffers
*/
static iop_buffer_t iop_buffers[64];
static uint8_t iop_buffers_storage[64 * IOP_BUFFER_SIZE];
/**
* @brief TX descriptor to IOP buffer mapping
*/
static iop_buffer_t *tx_iop_buffer[32];
/**
* @brief RX descriptor to IOP buffer mapping
*/
static iop_buffer_t *rx_iop_buffer[32];
/**
* @brief RX and TX descriptor table
* @warning this should be 2048, but we need 3072 to ensure the 0x400 alignment
*/
static uint8_t descriptor_table[3072];
/** @brief GRETH control structure*/
static greth_softc_t greth_driver = \
{
.iop_buffers = iop_buffers,
.iop_buffers_storage = iop_buffers_storage,
/** @note descriptor table address are split and aligned at the runtime */
.txdesc = descriptor_table,
.rxdesc = descriptor_table,
.tx_iop_buffer = tx_iop_buffer,
.rx_iop_buffer = rx_iop_buffer
};
/** @brief GRETH driver configuration */
static iop_eth_device_t device_configuration = \
{
/* device configuration */
.dev = {
.driver = (void *)&greth_driver,
.init = greth_initialize,
.open = greth_open,
.read = greth_read,
.write = greth_write,
.close = greth_close,
},
/* ethernet configuration */
.ip = { 192, 168, 0, 17 },
.mac = { 0x00, 0x50, 0xC2, 0x75, 0xa0, 0x60 },
.rx_count = 32,
.tx_count = 32
};
/**
* @brief Device Scheduling
*/
static uint32_t reads_per_period[] = \
{ 5 };
/**
* @brief Routes Headers
*/
static iop_header_t route_header[1] = \
{
{
.eth_header = {
.dst_ip = { 192,168,0,3 },
.dst_mac = { 0x00,0x50,0xbf,0x50,0x07,0x0d},
.dst_port = HTONS(14000),
.src_port = HTONS(14000)
}
}
};
/**
* @brief Routes Scheduling
*/
static uint32_t route_schedule_0[1] = \
{ 1 };
/**
* @brief Routes Configuration
*/
static iop_physical_route_t physical_routes[1] =\
{
{
.schedule = route_schedule_0,
.header = &route_header[0],
.port = &remote_ports[1]
}
};
/**
* @brief Pysical Device configuration
*/
iop_physical_device_t physical_device_0 =\
{
.driver = (iop_device_driver_t *)&device_configuration,
.routes = {
.length = 1,
.elements = physical_routes
},
.reads_per_period = reads_per_period,
.reader_task = eth_reader,
.writer_task = eth_writer,
.header_prebuild = eth_prebuild_header,
.header_compare = eth_compare_header,
.header_copy = eth_copy_header,
};
/*
* ============================================================================
* This file was generated by the GMV's Configurator Tool and is part of an I/O
* partition configuration.
* File Purpose: IO Partition user configuration. Contains the routing
* configuration options of the IO Partition.
* ============================================================================
*/
#include <iop.h>
/**
* @brief Logical devices
*/
extern iop_logical_device_t logical_device_0;
/**
* @brief Queuing ports configurations
*/
static air_queuing_port_configuration_t queuing_ports[] = {
{
.max_message_size = 1024,
.max_nb_message = 32,
.port_direction = AIR_SOURCE_PORT,
.port_discipline = 0
},
};
/**
* @brief Sampling ports configurations
*/
static air_sampling_port_configuration_t sampling_ports[] = {
{
.max_message_size = 1024,
.refresh_period = 1000,
.port_direction = AIR_DESTINATION_PORT,
},
};
/**
* @brief IOP remote ports
*/
iop_port_t remote_ports[2] = {
{
.type = AIR_SAMPLING_PORT,
.name = "dsampling",
.configuration = &sampling_ports[0],
.device = &logical_device_0
},
{
.type = AIR_QUEUING_PORT,
.name = "squeuing",
.configuration = &queuing_ports[0],
.device = NULL
},
};
/*
* ============================================================================
* This file was generated by the GMV's Configurator Tool and is part of an I/O
* partition configuration.
* File Purpose: IO Partition user configuration. Contains the configuration
* options for Ethernet's GRETH devices.
* ============================================================================
*/
#include <iop.h>
#include <occan.h>
#include <can_support.h>
/**
* @brief IOP remote ports
*/
extern iop_port_t remote_ports[2];
/**
* @brief IOP buffers
*/
static iop_buffer_t iop_buffers[64];
static uint8_t iop_buffers_storage[64 * IOP_BUFFER_SIZE];
/**
* @brief TX descriptor to IOP buffer mapping
*/
static iop_buffer_t *tx_iop_buffer[32];
/**
* @brief RX descriptor to IOP buffer mapping
*/
static iop_buffer_t *rx_iop_buffer[32];
/**
* @brief RX and TX descriptor table
* @warning this should be 2048, but we need 3072 to ensure the 0x400 alignment
*/
//static uint8_t descriptor_table[3072];
/** @brief GRETH control structure*/
static occan_priv occan_driver = \
{
.speed = 250000, // TODO maybe use a enum in the future
.code = {0, 0, 0, 0},
.mask = {0, 0, 0, 0},
.iop_buffers = iop_buffers,
.iop_buffers_storage = iop_buffers_storage,
/** @note descriptor table address are split and aligned at the runtime */
// .txdesc = descriptor_table,
// .rxdesc = descriptor_table,
.tx_iop_buffer = tx_iop_buffer,
.rx_iop_buffer = rx_iop_buffer
};
/** @brief GRETH driver configuration */
static iop_can_device_t device_configuration = \
{
/* device configuration */
.dev = {
.driver = (void *)&occan_driver,
.init = occan_initialize,
.open = occan_open,
.read = occan_read,
.write = occan_write,
.close = occan_close,
},
.dev_name ="/dev/occan0",
.count = 0,
.flags = 0,
.bytes_moved = 0,
};
/**
* @brief Device Scheduling
*/
static uint32_t reads_per_period[] = \
{ 5 };
/**
* @brief Routes Headers
*/
static iop_header_t route_header[1] = \
{
{
.can_header = {
.extended = 0,
.rtr = 0,
.sshot = 0,
.id = 2,
},
}
};
/**
* @brief Routes Scheduling
*/
static uint32_t route_schedule_0[1] = \
{ 1 };
/**
* @brief Routes Configuration
*/
static iop_physical_route_t physical_routes[1] =\
{
{
.schedule = route_schedule_0,
.header = &route_header[0],
.port = &remote_ports[2]
},
};
/**
* @brief Pysical Device configuration
*/
iop_physical_device_t physical_device_0 =\
{
.driver = (iop_device_driver_t *)&device_configuration,
.routes = {
.length = 2,
.elements = physical_routes
},
.reads_per_period = reads_per_period,
.reader_task = can_reader,
.writer_task = can_write,
.header_prebuild = can_prebuild_header,
.header_compare = can_compare_header,
.header_copy = can_copy_header,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment