49 #ifndef __REGISTER_ACCESS_H__
50 #define __REGISTER_ACCESS_H__
57 #define CTRL_REG_RS_MSK (0b00000001)
58 #define CTRL_REG_LR_MSK (0b00000010)
59 #define CTRL_REG_MODE_MSK (0b00111100)
60 #define CTRL_REG_IE_MSK (0b01000000)
61 #define CTRL_REG_IR_MSK (0b10000000)
62 #define MODE_STOP_CON_RUN_MSK (0b0011)
63 #define MODE_STOP (0b0000)
64 #define MODE_CON_RUN (0b0001)
65 #define MODE_CH_OF_ST_1_4 (0b0010)
66 #define MODE_CH_OF_ST_1_2 (0b0110)
67 #define MODE_CH_OF_ST_1 (0b1010)
68 #define MODE_CH_OF_ST_2 (0b1110)
74 #define IOWR_REGS_ADDR(base, addr, data) IOWR(base, addr, data)
80 #define REGS_CTRL 0b000
83 #define IOADDR_REGS_CTRL(base) \
84 __IO_CALC_ADDRESS_NATIVE(base, REGS_CTRL)
86 #define IORD_REGS_CTRL(base) IORD(base, REGS_CTRL)
88 #define IOWR_REGS_CTRL(base, data) IOWR(base, REGS_CTRL, data)
112 #define REGS_CTRL_SET 0b001
115 #define IOADDR_REGS_CTRL_SET(base) \
116 __IO_CALC_ADDRESS_NATIVE(base, REGS_CTRL_SET)
118 #define IORD_REGS_CTRL_SET(base) IORD(base, REGS_CTRL_SET)
120 #define IOWR_REGS_CTRL_SET(base, data) IOWR(base, REGS_CTRL_SET, data)
136 #define REGS_CTRL_CLR 0b010
139 #define IOADDR_REGS_CTRL_CLR(base) \
140 __IO_CALC_ADDRESS_NATIVE(base, REGS_CTRL_CLR)
142 #define IORD_REGS_CTRL_CLR(base) IORD(base, REGS_CTRL_CLR)
144 #define IOWR_REGS_CTRL_CLR(base, data) IOWR(base, REGS_CTRL_CLR, data)
160 #define REGS_SPEED 0b011
163 #define IOADDR_REGS_SPEED(base) \
164 __IO_CALC_ADDRESS_NATIVE(base, REGS_SPEED)
166 #define IORD_REGS_SPEED(base) IORD(base, REGS_SPEED)
168 #define IOWR_REGS_SPEED(base, data) IOWR(base, REGS_SPEED, data)
206 #define REGS_STEPS 0b100
209 #define IOADDR_REGS_STEPS(base) \
210 __IO_CALC_ADDRESS_NATIVE(base, REGS_STEPS)
212 #define IORD_REGS_STEPS(base) IORD(base, REGS_STEPS)
214 #define IOWR_REGS_STEPS(base, data) IOWR(base, REGS_STEPS, data)
235 #endif // __REGISTER_ACCESS_H__
#define IOWR_REGS_CTRL_CLR(base, data)
Macro to write CtrlClr-Register.
#define IORD_REGS_STEPS(base)
Macro to read Steps-Register.
#define IORD_REGS_CTRL(base)
Macro to read Ctrl-Register.
static __inline__ void stepsRegSet(uint32_t newStepCount)
Sets the given steps for the Stepper-Motor-Control VHDL-component.
#define IOWR_REGS_STEPS(base, data)
Macro to write Steps-Register.
static __inline__ void ctrlRegBitSet(uint8_t bitsToSet)
Sets the CtrlReg bitwise.
static __inline__ void speedRegSet(uint8_t newSpeed)
Sets the speed, how fast the Stepper-Motor-Control turns the motor.
#define IOWR_REGS_SPEED(base, data)
Macro to write Speed-Register.
#define IOWR_REGS_CTRL_SET(base, data)
Macro to write CtrlSet-Register.
#define IOWR_REGS_CTRL(base, data)
Macro to write Ctrl-Register.
#define IORD_REGS_SPEED(base)
Macro to read Speed-Register.
static __inline__ uint32_t stepsRegGet(void)
Returns the actual content of the steps-register.
static __inline__ uint8_t speedRegGet(void)
Returns the actual content of the speed-register.
static __inline__ void ctrlRegBitClr(uint8_t bitsToClr)
Clears the CtrlReg bitwise.
static __inline__ void ctrlRegSet(uint8_t newCtrlReg)
Overwrites the complete CtrlReg.
static __inline__ uint8_t ctrlRegGet(void)
Returns the actual content of the control-register.
Defines for Error and Debug-Output Management.