Skip to content
Snippets Groups Projects
Commit cea02ed2 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added a data structure for the action motion moduel.

Added the dynamixel slave interface registers.
parent 6d473aeb
No related branches found
No related tags found
No related merge requests found
......@@ -7,16 +7,62 @@ extern "C" {
#include "motion_pages.h"
#include "motion_module.h"
#include "motion_pages.h"
#include "memory.h"
typedef enum {ACTION_PRE,ACTION_MAIN,ACTION_POST,ACTION_PAUSE} action_states;
typedef struct{
TMotionModule mmodule;
TMemory *memory;
TMemModule mem_module;
unsigned short int ram_base_address;
unsigned short int eeprom_base_address;
TPage next_page;
TPage current_page;
unsigned char current_step_index;
unsigned char current_page_index;
// angle variables
long long int moving_angles[PAGE_MAX_NUM_SERVOS];// fixed point 48|16 format
long long int start_angles[PAGE_MAX_NUM_SERVOS];// fixed point 48|16 format
// speed variables
long long int start_speed[PAGE_MAX_NUM_SERVOS];// fixed point 48|16 format
long long int main_speed[PAGE_MAX_NUM_SERVOS];// fixed point 48|16 format
// control variables
unsigned char end;
unsigned char stop;
unsigned char zero_speed_finish[PAGE_MAX_NUM_SERVOS];
unsigned char next_index;
unsigned char running;
// time variables (in time units (7.8 ms each time unit))
long long int total_time;// fixed point 48|16 format
long long int pre_time;// fixed point 48|16 format
long long int main_time;// fixed point 48|16 format
long long int step_time;// fixed point 48|16 format
long long int pause_time;// fixed point 48|16 format
long long int current_time;// fixed point 48|16 format
long long int section_time;// fixed point 48|16 format
long long int period;
// angle variables
long long int accel_angles[PAGE_MAX_NUM_SERVOS];// fixed point 48|16 format
long long int main_angles[PAGE_MAX_NUM_SERVOS];// fixed point 48|16 format
// speed variables (in controller units)
long long int current_speed[PAGE_MAX_NUM_SERVOS];// fixed point 48|16 format
long long int delta_speed;
char num_repetitions;
// control variables
action_states state;
}TActionMModule;
// public functions
void action_init(void);
TMotionModule *action_get_module(void);
unsigned char action_load_page(unsigned char page_id);
void action_start_page(void);
void action_stop_page(void);
unsigned char action_is_running(void);
unsigned char action_get_current_page(void);
unsigned char action_get_current_step(void);
unsigned char action_init(TActionMModule *action,TMemory *memory,unsigned short int ram_base_address);
TMotionModule *action_get_module(TActionMModule *action);
unsigned char action_load_page(TActionMModule *action,unsigned char page_id);
void action_start_page(TActionMModule *action);
void action_stop_page(TActionMModule *action);
unsigned char action_is_running(TActionMModule *action);
unsigned char action_get_current_page(TActionMModule *action);
unsigned char action_get_current_step(TActionMModule *action);
#ifdef __cplusplus
}
......
#ifndef _ACTION_MM_REGISTERS_H
#define _ACTION_MM_REGISTERS_H
#define RAM_ACTION_MM_LENGTH 2
#define ACTION_MM_PAGE_OFFSET 0
#define ACTION_MM_CNTRL_OFFSET 1
#endif
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment