stepRocker servo Open Source TMCL
1.00
|
TMC429 library definitions. More...
Go to the source code of this file.
Functions | |
void | ReadWrite429 (UCHAR *Read, UCHAR *Write) |
32 bit SPI communication with TMC429 More... | |
void | Write429Zero (UCHAR Address) |
Write zero to a TMC429 register. More... | |
void | Write429Bytes (UCHAR Address, UCHAR *Bytes) |
TMC429 write access. More... | |
void | Write429Datagram (UCHAR Address, UCHAR HighByte, UCHAR MidByte, UCHAR LowByte) |
TMC429 write access. More... | |
void | Write429Short (UCHAR Address, int Value) |
Write 16 bit value to a TMC429 register. More... | |
void | Write429Int (UCHAR Address, int Value) |
Write 24 bit value to a TMC429 register. More... | |
UCHAR | Read429Status (void) |
Read TMC429 status byte. More... | |
UCHAR | Read429Bytes (UCHAR Address, UCHAR *Bytes) |
Read TMC429 register. More... | |
UCHAR | Read429SingleByte (UCHAR Address, UCHAR Index) |
Read TMC429 register. More... | |
int | Read429Short (UCHAR Address) |
Read TMC429 register (12 bit) More... | |
int | Read429Int (UCHAR Address) |
Read TMC429 register (24 bit) More... | |
void | Set429RampMode (UCHAR Axis, UCHAR RampMode) |
Set the ramping mode of an axis. More... | |
void | Set429SwitchMode (UCHAR Axis, UCHAR SwitchMode) |
Set the end switch mode. More... | |
UCHAR | SetAMax (UCHAR Motor, UINT AMax) |
Set the maximum acceleration. More... | |
void | HardStop (UINT Motor) |
Stop a motor immediately. More... | |
void | Init429 (void) |
TMC429 initialization. More... | |
TMC429 library definitions.
This file contains all macro and function definitions of the TMC429 library.
void HardStop | ( | UINT | Motor | ) |
Stop a motor immediately.
Motor | motor number (0, 1, 2) |
This function stops a motor immediately (hard stop) by switching to velocity mode and then zeroing the V_TARGT and V_ACTUAL registers of that axis.
void Init429 | ( | void | ) |
TMC429 initialization.
This function does all necessary initializations of the TMC429.
Read TMC429 register.
Address | TMC429 register address (see TMC429.h) |
Bytes | Pointer at array of three bytes |
This functions reads a TMC429 register and puts the result into an array of bytes. It also returns the TMC429 status bytes.
int Read429Int | ( | UCHAR | Address | ) |
Read TMC429 register (24 bit)
Address | TMC429 register address (see TMC429.h) |
This functions reads a TMC429 24 bit register and sign-extends the register value to 32 bit.
int Read429Short | ( | UCHAR | Address | ) |
Read TMC429 register (12 bit)
Address | TMC429 register address (see TMC429.h) |
This functions reads a TMC429 12 bit register and sign-extends the register value to 32 bit.
Read TMC429 register.
Address | TMC429 register address (see TMC429.h) |
Index | TMC429 register byte to be returned (0..3) |
This functions reads a TMC429 register and returns the desired byte of that register.
UCHAR Read429Status | ( | void | ) |
Read TMC429 status byte.
This functions reads just the status byte of the TMC429 using a single byte SPI access which makes this a little bit faster.
32 bit SPI communication with TMC429
Read | four byte array holding the data read from the TMC428 |
Write | four byte array holding the data to write to the TMC428 |
This is the low-level function that does all SPI communication with the TMC429. It sends a 32 bit SPI telegramme to the TMC429 and receives the 32 bit answer telegramme from the TMC429. It also raises the motor current when there is write access to a register that could cause motor movement.
Set the ramping mode of an axis.
Axis | Motor number (0, 1 or 2) |
RampMode | ramping mode (RM_RAMP/RM_SOFT/RM_VELOCITY/RM_HOLD) |
This functions changes the ramping mode of a motor in the TMC429. It is some TMC429 register bit twiddling.
Set the end switch mode.
Axis | Motor number (0, 1 or 2) |
SwitchMode | end switch mode |
This functions changes the end switch mode of a motor in the TMC429. It is some TMC429 register bit twiddling.
Set the maximum acceleration.
Motor | motor number (0, 1, 2) |
AMax | maximum acceleration (1..2047) |
This function sets the maximum acceleration and also calculates the PMUL and PDIV value according to all other parameters (please see the TMC429 data sheet for more info about PMUL and PDIV values).
TMC429 write access.
Address | TMC429 register address (see also TMC429.h) |
Bytes | Array holding three bytes to be written to the TMC429 register. |
This function writes an array of three bytes to a TMC429 register.
TMC429 write access.
Address | TMC429 register address |
HighByte | MSB of the TMC429 register |
MidByte | mid byte of the TMC429 register |
LowByte | LSB of the TMC429 register |
This function write three bytes to a TMC429 register.
void Write429Int | ( | UCHAR | Address, |
int | Value | ||
) |
Write 24 bit value to a TMC429 register.
Address | TMC429 register address |
Value | Value to be written |
This function writes a 24 bit value to a TMC429 register.
void Write429Short | ( | UCHAR | Address, |
int | Value | ||
) |
Write 16 bit value to a TMC429 register.
Address | TMC429 register address |
Value | Value to be written |
This function writes a 16 bit value to a TMC429 register.
void Write429Zero | ( | UCHAR | Address | ) |
Write zero to a TMC429 register.
Address | TMC429 register address |
This function sets a TMC429 register to zero. This can be useful e.g. to stop a motor quickly.