From ba78bd9ba834260d035a9830726afc34fdad2a15 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 18 Oct 2009 23:32:54 +0200 Subject: import firmware from LEGO v1.05 --- AT91SAM7S256/Source/c_output.iom | 92 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 AT91SAM7S256/Source/c_output.iom (limited to 'AT91SAM7S256/Source/c_output.iom') diff --git a/AT91SAM7S256/Source/c_output.iom b/AT91SAM7S256/Source/c_output.iom new file mode 100644 index 0000000..e13f0f8 --- /dev/null +++ b/AT91SAM7S256/Source/c_output.iom @@ -0,0 +1,92 @@ +// +// Date init 14.12.2004 +// +// Revision date $Date:: 16-05-06 12:13 $ +// +// Filename $Workfile:: c_output.iom $ +// +// Version $Revision:: 25 $ +// +// Archive $Archive:: /LMS2006/Sys01/Main/Firmware/Source/c_output.i $ +// +// Platform C +// + +#ifndef COUTPUT_IOM +#define COUTPUT_IOM + +#define NO_OF_OUTPUTS 3 +#define pMapOutPut ((IOMAPOUTPUT*)(pHeaders[ENTRY_OUTPUT]->pIOMap)) + +// Constants reffering to mode +enum +{ + MOTORON = 0x01, + BRAKE = 0x02, + REGULATED = 0x04, + REG_METHOD = 0xF0 /* Regulation methods - to be designed! */ +}; + +// Constants related to Flags +enum +{ + UPDATE_MODE = 0x01, + UPDATE_SPEED = 0x02, + UPDATE_TACHO_LIMIT = 0x04, + UPDATE_RESET_COUNT = 0x08, + UPDATE_PID_VALUES = 0x10, + UPDATE_RESET_BLOCK_COUNT = 0x20, + UPDATE_RESET_ROTATION_COUNT = 0x40, + PENDING_UPDATES = 0x80 +}; + +// Constant related to RunState +#define MOTOR_RUN_STATE_IDLE 0x00 +#define MOTOR_RUN_STATE_RAMPUP 0x10 +#define MOTOR_RUN_STATE_RUNNING 0x20 +#define MOTOR_RUN_STATE_RAMPDOWN 0x40 + +// Constant related to RegMode +enum +{ + REGULATION_MODE_IDLE, + REGULATION_MODE_MOTOR_SPEED, + REGULATION_MODE_MOTOR_SYNC +}; + +typedef struct +{ + SLONG TachoCnt; /* R - Holds current number of counts, since last reset, updated every 1 mS */ + SLONG BlockTachoCount; /* R - Holds current number of counts for the current output block */ + SLONG RotationCount; /* R - Holds current number of counts for the rotation counter to the output */ + ULONG TachoLimit; /* RW - Holds number of counts to travel, 0 => Run forever */ + SWORD MotorRPM; /* !! Is not updated, will be removed later !! */ + UBYTE Flags; /* RW - Holds flags for which data should be updated */ + UBYTE Mode; /* RW - Holds motor mode: Run, Break, regulated, ... */ + SBYTE Speed; /* RW - Holds the wanted speed */ + SBYTE ActualSpeed; /* R - Holds the current motor speed */ + UBYTE RegPParameter; /* RW - Holds the P-constant use din the regulation, Is set to a default value at init => Setting this value is optional for the user */ + UBYTE RegIParameter; /* RW - Holds the I-constant use din the regulation, Is set to a default value at init => Setting this value is optional for the user */ + UBYTE RegDParameter; /* RW - Holds the D-constant use din the regulation, Is set to a default value at init => Setting this value is optional for the user */ + UBYTE RunState; /* RW - Holds the current RunState in the output module */ + UBYTE RegMode; /* RW - Tells which regulation mode should be used */ + UBYTE Overloaded; /* R - True if the motor has been overloaded within speed control regulation */ + SBYTE SyncTurnParameter; /* RW - Holds the turning parameter need within MoveBlock */ + UBYTE SpareOne; + UBYTE SpareTwo; + UBYTE SpareThree; +}OUTPUT; + + +typedef struct +{ + OUTPUT Outputs[NO_OF_OUTPUTS]; + UBYTE PwnFreq; +}IOMAPOUTPUT; + + + +#endif + + + -- cgit v1.2.3