Example code for Simple Open EtherCAT master. More...
#include <kern.h>
#include "ethercat.h"
#include "string.h"
#include <oshw.h>
#include <config.h>
#include <defBF537.h>
#include <lwip/inet.h>
Go to the source code of this file.
Classes | |
struct | in_EL1008_t |
struct | in_EL3061_t |
struct | out_EL2622_t |
struct | out_EL4001_t |
Macros | |
#define | ABS(x) ((x) < 0 ? -(x) : (x)) |
#define | EK1100_1 1 |
#define | EL1008_1 4 |
#define | EL1008_2 5 |
#define | EL2622_1 6 |
#define | EL2622_2 7 |
#define | EL2622_3 8 |
#define | EL2622_4 9 |
#define | EL3061_1 3 |
#define | EL4001_1 2 |
#define | NUMBER_OF_SLAVES 9 |
#define | pPORTFIO_CLEAR ((vuint16_t *)PORTFIO_CLEAR) |
#define | pPORTFIO_DIR ((vuint16_t *)PORTFIO_DIR) |
#define | pPORTFIO_SET ((vuint16_t *)PORTFIO_SET) |
#define | USECS_PER_SEC 1000000 |
#define | USECS_PER_TICK (USECS_PER_SEC / CFG_TICKS_PER_SECOND) |
Functions | |
uint8 | get_input_bit (uint16 slave_no, uint8 module_index) |
int32 | get_input_int32 (uint16 slave_no, uint8 module_index) |
uint8 | get_output_bit (uint16 slave_no, uint8 module_index) |
int16 | get_output_int16 (uint16 slave_no, uint8 module_index) |
int | main (void) |
static void | my_cyclic_callback (void *arg) |
uint32 | network_configuration (void) |
void | read_io (void *arg) |
void | set_input_int32 (uint16 slave_no, uint8 module_index, int32 value) |
void | set_output_bit (uint16 slave_no, uint8 module_index, uint8 value) |
void | set_output_int16 (uint16 slave_no, uint8 module_index, int16 value) |
void | simpletest (void *arg) |
static void | test_osal_current_time (void) |
static void | test_osal_current_time_for_delay_us (const int32 sleep_time_us) |
static void | test_osal_timer (void) |
static void | test_osal_timer_timeout_us (const uint32 timeout_us) |
static void | test_oshw_htons (void) |
static void | test_oshw_ntohs (void) |
static int32 | time_difference_us (const ec_timet stop, const ec_timet start) |
void | tt_error (uint32_t task_ix) |
Variables | |
int | dorun = 0 |
uint32_t | error_counter = 0 |
char | IOmap [128] |
uint8_t | load10s |
uint8_t | load1s |
uint8_t | load5s |
in_EL1008_t | slave_EL1008_1 |
in_EL1008_t | slave_EL1008_2 |
out_EL2622_t | slave_EL2622_1 |
out_EL2622_t | slave_EL2622_2 |
out_EL2622_t | slave_EL2622_3 |
in_EL3061_t | slave_EL3061_1 |
out_EL4001_t | slave_EL4001_1 |
tt_sched_t * | tt_sched [] |
Example code for Simple Open EtherCAT master.
This is a minimal example running rt-kernel TTOS. Check tutorial files in documentations for som steps to get your system running. (c)Andreas Karlsson 2012
Definition in file main.c.
#define USECS_PER_TICK (USECS_PER_SEC / CFG_TICKS_PER_SECOND) |
|
static |
Test osal_current_time() by using it for measuring how long an osal_usleep() takes, in specified number of microseconds.
|
static |
in_EL1008_t slave_EL1008_1 |
in_EL1008_t slave_EL1008_2 |
out_EL2622_t slave_EL2622_1 |
out_EL2622_t slave_EL2622_2 |
out_EL2622_t slave_EL2622_3 |
in_EL3061_t slave_EL3061_1 |
out_EL4001_t slave_EL4001_1 |
tt_sched_t* tt_sched[] |