Robot
The embedded systems for UTRA's autonomous humanoid soccer-playing robot
Collaboration diagram for Header:

Functions

void Dynamixel_DataWriter (Dynamixel_HandleTypeDef *hdynamixel, uint8_t *args, uint8_t numArgs)
 Sends an array of data to a motor as per its configuration details. More...
 
uint16_t Dynamixel_DataReader (Dynamixel_HandleTypeDef *hdynamixel, uint8_t readAddr, uint8_t readLength)
 Reads data back from the motor passed in by reference. More...
 

Detailed Description

Function Documentation

◆ Dynamixel_DataReader()

uint16_t Dynamixel_DataReader ( Dynamixel_HandleTypeDef hdynamixel,
uint8_t  readAddr,
uint8_t  readLength 
)

Reads data back from the motor passed in by reference.

Uses the READ DATA instruction, 0x02, in the motor instruction set. The status packet returned will be of the following form

{0xFF, 0xFF, ID, LENGTH, ERR, PARAM_1,...,PARAM_N, CHECKSUM}

Where N = readLength. Also, this function computes the checksum of data using the same algorithm as the motors, and it sets ‘hdynamixel -> _lastReadIsValid’ if the computations match, and clears this field otherwise. This is a basic data integrity check that reduces the probability of passing invalid data to the application

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
readAddrthe address inside the motor memory table where reading is to begin
readLengththe number of bytes to be read. Must be either 1 or 2
Returns
A 16-bit value containing 1 or both bytes received, as applicable. The 1st byte received will be the LSB and the 2nd byte received will be the MSB

Definition at line 489 of file DynamixelProtocolV1_IO.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dynamixel_DataWriter()

void Dynamixel_DataWriter ( Dynamixel_HandleTypeDef hdynamixel,
uint8_t *  args,
uint8_t  numArgs 
)

Sends an array of data to a motor as per its configuration details.

Uses the WRITE DATA instruction, 0x03, in the motor instruction set.

Parameters
hdynamixelpointer to a Dynamixel_HandleTypeDef structure that contains the configuration information for the motor
argsan array of arguments of the form {ADDR, PARAM_1, ... , PARAM_N}
numArgsthis must be equal to sizeof(args), and must be either 2 or 3
Returns
None

Definition at line 438 of file DynamixelProtocolV1_IO.c.

Here is the call graph for this function:
Here is the caller graph for this function: