#pragma once
#include <stdint.h>
#define IDSENS 252

typedef enum { DYNAMIXEL_IN_VOL_ERR = 1, DYNAMIXEL_OVR_HEAT = 4, DYNAMIXEL_RANGE_ERR = 8, DYNAMIXEL_CKSM_ERR = 16, DYNAMIXEL_INST_ERR = 64, DYNAMIXEL_NO_ERR = 128 } Error_t;

typedef enum { MORE_BYTES, PACKET_OK, CKSM_ERROR } PacketState_t;

typedef struct {
	int ID;
	int LEN;
	int INST;
	uint8_t parameters[8];
}Packet_t;

void tick(void);
PacketState_t dynamixel1_byte_recieved(uint8_t value, Packet_t* packet);
void dynamixel1_send_status_packet(Error_t error, uint8_t parameters[], uint8_t len);
