Bioscara
DALSA's DIY SCARA Robot Arm.
Loading...
Searching...
No Matches
Namespaces | Macros | Enumerations | Functions
joint.h File Reference

joint firmware header More...

#include <Arduino.h>

Go to the source code of this file.

Namespaces

namespace  bioscara_joint_firmware
 Joint firmware.
 

Macros

#define ACK   'O'
 
#define NACK   'N'
 
#define MAX_BUFFER   4
 Maximum size of I2C Payload in bytes.
 
#define RFLAGS_SIZE   1
 Size of the return flags in bytes.
 
#define DUMP_BUFFER(buffer, size)
 Macro to dump a buffer to the serial console.
 

Enumerations

enum  bioscara_joint_firmware::stp_reg_t {
  bioscara_joint_firmware::PING = 0x0f , bioscara_joint_firmware::SETUP = 0x10 , bioscara_joint_firmware::SETRPM = 0x11 , bioscara_joint_firmware::GETDRIVERRPM = 0x12 ,
  bioscara_joint_firmware::MOVESTEPS = 0x13 , bioscara_joint_firmware::MOVEANGLE = 0x14 , bioscara_joint_firmware::MOVETOANGLE = 0x15 , bioscara_joint_firmware::GETMOTORSTATE = 0x16 ,
  bioscara_joint_firmware::RUNCOTINOUS = 0x17 , bioscara_joint_firmware::ANGLEMOVED = 0x18 , bioscara_joint_firmware::SETCURRENT = 0x19 , bioscara_joint_firmware::SETHOLDCURRENT = 0x1A ,
  bioscara_joint_firmware::SETMAXACCELERATION = 0x1B , bioscara_joint_firmware::SETMAXDECELERATION = 0x1C , bioscara_joint_firmware::SETMAXVELOCITY = 0x1D , bioscara_joint_firmware::ENABLESTALLGUARD = 0x1E ,
  bioscara_joint_firmware::DISABLESTALLGUARD = 0x1F , bioscara_joint_firmware::CLEARSTALL = 0x20 , bioscara_joint_firmware::SETBRAKEMODE = 0x22 , bioscara_joint_firmware::ENABLEPID = 0x23 ,
  bioscara_joint_firmware::DISABLEPID = 0x24 , bioscara_joint_firmware::ENABLECLOSEDLOOP = 0x25 , bioscara_joint_firmware::DISABLECLOSEDLOOP = 0x26 , bioscara_joint_firmware::SETCONTROLTHRESHOLD = 0x27 ,
  bioscara_joint_firmware::MOVETOEND = 0x28 , bioscara_joint_firmware::STOP = 0x29 , bioscara_joint_firmware::GETPIDERROR = 0x2A , bioscara_joint_firmware::CHECKORIENTATION = 0x2B ,
  bioscara_joint_firmware::GETENCODERRPM = 0x2C , bioscara_joint_firmware::HOME = 0x2D , bioscara_joint_firmware::HOMEOFFSET = 0x2E
}
 register and command definitions More...
 

Functions

template<typename T >
void bioscara_joint_firmware::readValue (T &val, uint8_t *rxBuf, size_t rx_length)
 Reads a value from a buffer to a value of the specified type.
 
template<typename T >
int bioscara_joint_firmware::writeValue (const T val, uint8_t *txBuf, size_t &tx_length)
 Writes a value of the specified type to a buffer.
 

Detailed Description

joint firmware header

Author
sbstorz
Version
0.1
Date
2025-05-27

This file contains definitions and macros for the joint firmware.

Macro Definition Documentation

◆ ACK

#define ACK   'O'

◆ DUMP_BUFFER

#define DUMP_BUFFER (   buffer,
  size 
)
Value:
{ \
Serial.print("Buffer dump: "); \
for (size_t i = 0; i < size; i++) \
{ \
Serial.print(buffer[i], HEX); \
Serial.print(" "); \
} \
Serial.println(); \
}

Macro to dump a buffer to the serial console.

Parameters
bufferpointer to a buffer to dump to the console
sizenumber of bytes to dump

◆ MAX_BUFFER

#define MAX_BUFFER   4

Maximum size of I2C Payload in bytes.

4 bytes used to transmit floats and int32_t

◆ NACK

#define NACK   'N'

◆ RFLAGS_SIZE

#define RFLAGS_SIZE   1

Size of the return flags in bytes.

Only one byte used and hence set to 1.