Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michel Roelofs
dt_ctrl
Commits
2521e8d3
Commit
2521e8d3
authored
May 20, 2019
by
Jeroen Vreeken
Browse files
Some more trinamic stuff in the block
parent
87a30f7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
controller/ec/block_trinamic_tmc8460eval.c
View file @
2521e8d3
...
...
@@ -23,6 +23,7 @@
#include
<ec/ec.h>
#include
<ec/esc.h>
#include
<ec/esc_coe.h>
#include
<ec/esc_esi.h>
#include
<ec/esc_id.h>
#include
<log/log.h>
...
...
@@ -30,8 +31,10 @@
struct
controller_block_private
{
unsigned
char
*
rx_buffer
;
unsigned
char
*
tx_buffer
;
struct
esc_device
*
dev
;
struct
canopen_dev
*
candev
;
};
...
...
@@ -40,6 +43,10 @@ static void callback_rx(struct controller_block *block, void *data)
block
->
private
->
rx_buffer
=
data
;
}
static
void
callback_tx
(
struct
controller_block
*
block
,
void
*
data
)
{
block
->
private
->
tx_buffer
=
data
;
}
struct
trinamic_type
{
char
*
name
;
...
...
@@ -51,6 +58,16 @@ static struct trinamic_type devlist[] = {
{
"TMC8460EVAL"
,
ESC_ESI_PRODUCTCODE_TRINAMIC_TMC8460_EVAL
},
};
static
int
pre_operational_hook
(
struct
esc_device
*
esc
)
{
struct
controller_block
*
block
=
esc
->
block
;
if
(
!
block
->
private
->
candev
)
block
->
private
->
candev
=
esc_coe_create
(
esc
);
return
0
;
}
static
struct
controller_block
*
block_trinamic_tmc8460eval_create
(
char
*
name
,
int
argc
,
va_list
ap
)
{
struct
controller_block
*
block
;
...
...
@@ -94,8 +111,12 @@ static struct controller_block * block_trinamic_tmc8460eval_create(char *name, i
block
->
private
->
dev
=
esc
;
esc
->
block
=
block
;
esc
->
block_rx
=
block
;
esc
->
block_tx
=
block
;
esc_esi_device_fill
(
esc
);
esc
->
callback_rx
=
callback_rx
;
esc
->
callback_tx
=
callback_tx
;
esc
->
pre_operational_hook
=
pre_operational_hook
;
esc_device_initialize_operational
(
esc
);
if
(
controller_block_add
(
block
))
...
...
controller/ec/trinamic.ctrl
0 → 100644
View file @
2521e8d3
# simple set of inputs and outputs to test ethercat stack
trigger {
{ "default" }
}
blocks (1000.0, 0.0) {
{ "ec", "ethercat", "eth0", 1, 1 }
{ "trinamic_tmc8460eval", "eval", "ethercat", 0, "TMC8460EVAL" }
}
blocks (2.0, 0.0) {
{ "not", "osc" }
}
links {
{ "osc", "output", "osc", "input", false }
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment