Speeduino
Loading...
Searching...
No Matches
speeduino
idle.h
Go to the documentation of this file.
1
#ifndef IDLE_H
2
#define IDLE_H
3
4
#include "
globals.h
"
5
#include "
table2d.h
"
6
#include "
board_definition.h
"
7
8
#define IDLE_PIN_LOW() *idle_pin_port &= ~(idle_pin_mask)
9
#define IDLE_PIN_HIGH() *idle_pin_port |= (idle_pin_mask)
10
#define IDLE2_PIN_LOW() *idle2_pin_port &= ~(idle2_pin_mask)
11
#define IDLE2_PIN_HIGH() *idle2_pin_port |= (idle2_pin_mask)
12
13
#define STEPPER_FORWARD 0
14
#define STEPPER_BACKWARD 1
15
#define STEPPER_POWER_WHEN_ACTIVE 0
16
#define IDLE_TABLE_SIZE 10
17
18
enum
StepperStatus
{
SOFF
,
STEPPING
,
COOLING
};
//The 2 statuses that a stepper can have. STEPPING means that a high pulse is currently being sent and will need to be turned off at some point.
19
20
struct
StepperIdle
21
{
22
int
curIdleStep
;
//Tracks the current location of the stepper
23
int
targetIdleStep
;
//What the targeted step is
24
volatile
StepperStatus
stepperStatus
;
25
volatile
unsigned
long
stepStartTime
;
26
};
27
28
extern
uint16_t
idle_pwm_max_count
;
//Used for variable PWM frequency
29
extern
long
FeedForwardTerm
;
30
31
void
initialiseIdle
(
bool
forcehoming
);
32
void
idleControl
(
void
);
33
void
initialiseIdleUpOutput
(
void
);
34
void
disableIdle
(
void
);
35
void
idleInterrupt
(
void
);
36
37
#endif
board_definition.h
Inclusion of board specific header files and board related definitions.
globals.h
rshift
static uint32_t rshift(uint32_t a)
Bitwise right shift - generic, unoptimized, case.
Definition
bit_shifts.h:348
idleInterrupt
void idleInterrupt(void)
Definition
idle.cpp:763
initialiseIdleUpOutput
void initialiseIdleUpOutput(void)
Definition
idle.cpp:199
disableIdle
void disableIdle(void)
Definition
idle.cpp:718
idle_pwm_max_count
uint16_t idle_pwm_max_count
Definition
idle.cpp:30
FeedForwardTerm
long FeedForwardTerm
Definition
idle.cpp:33
idleControl
void idleControl(void)
Definition
idle.cpp:328
initialiseIdle
void initialiseIdle(bool forcehoming)
Definition
idle.cpp:74
StepperStatus
StepperStatus
Definition
idle.h:18
SOFF
@ SOFF
Definition
idle.h:18
COOLING
@ COOLING
Definition
idle.h:18
STEPPING
@ STEPPING
Definition
idle.h:18
StepperIdle
Definition
idle.h:21
StepperIdle::targetIdleStep
int targetIdleStep
Definition
idle.h:23
StepperIdle::stepStartTime
volatile unsigned long stepStartTime
Definition
idle.h:25
StepperIdle::stepperStatus
volatile StepperStatus stepperStatus
Definition
idle.h:24
StepperIdle::curIdleStep
int curIdleStep
Definition
idle.h:22
table2d.h
Generated by
1.9.8