Speeduino
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
idle.cpp File Reference
#include <Arduino.h>
#include "idle.h"
#include "maths.h"
#include "timers.h"
#include "preprocessor.h"
#include "src/PID_v1/PID_v1.h"
#include "units.h"
#include "globals.h"
#include "src/pins/fastOutputPin.h"

Classes

struct  StepperIdle
 

Macros

#define STEPPER_FORWARD   0
 
#define STEPPER_BACKWARD   1
 
#define STEPPER_POWER_WHEN_ACTIVE   0
 
#define STEPPER_LESS_AIR_DIRECTION()   ((configPage9.iacStepperInv == 0) ? STEPPER_BACKWARD : STEPPER_FORWARD)
 
#define STEPPER_MORE_AIR_DIRECTION()   ((configPage9.iacStepperInv == 0) ? STEPPER_FORWARD : STEPPER_BACKWARD)
 

Enumerations

enum  StepperStatus { SOFF , STEPPING , COOLING }
 

Functions

static void enableIdle (void)
 
static void initialiseIdleUpOutput (void)
 
void initialiseIdle (bool forcehoming)
 
static uint8_t checkForStepping (void)
 
static void doStep (void)
 
static uint8_t isStepperHomed (void)
 
void idleControl (void)
 
void disableIdle (void)
 
void idleInterrupt (void)
 

Variables

static uint8_t idleUpOutputHIGH = HIGH
 
static uint8_t idleUpOutputLOW = LOW
 
static uint8_t idleCounter
 
static uint8_t idleTaper
 
static struct StepperIdle idleStepper
 
static bool idleOn
 
static uint8_t idleInitComplete = 99
 
static unsigned int iacStepTime_uS
 
static unsigned int iacCoolTime_uS
 
static unsigned int completedHomeSteps
 
static volatile bool idle_pwm_state
 
static bool lastDFCOValue
 
uint16_t idle_pwm_max_count
 
static volatile unsigned int idle_pwm_cur_value
 
static long idle_pid_target_value
 
static long FeedForwardTerm
 
static uint32_t idle_pwm_target_value
 
static long idle_cl_target_rpm
 
static fastOutputPin_t idle_pin
 
static fastOutputPin_t idle2_pin
 
constexpr table2D_u8_u8_10 iacPWMTableconfigPage6
 
integerPID idlePIDcurrentStatus
 

Macro Definition Documentation

◆ STEPPER_BACKWARD

#define STEPPER_BACKWARD   1

◆ STEPPER_FORWARD

#define STEPPER_FORWARD   0

◆ STEPPER_LESS_AIR_DIRECTION

#define STEPPER_LESS_AIR_DIRECTION ( )    ((configPage9.iacStepperInv == 0) ? STEPPER_BACKWARD : STEPPER_FORWARD)

◆ STEPPER_MORE_AIR_DIRECTION

#define STEPPER_MORE_AIR_DIRECTION ( )    ((configPage9.iacStepperInv == 0) ? STEPPER_FORWARD : STEPPER_BACKWARD)

◆ STEPPER_POWER_WHEN_ACTIVE

#define STEPPER_POWER_WHEN_ACTIVE   0

Enumeration Type Documentation

◆ StepperStatus

Enumerator
SOFF 
STEPPING 
COOLING 

Function Documentation

◆ checkForStepping()

static uint8_t checkForStepping ( void  )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ disableIdle()

void disableIdle ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ doStep()

static void doStep ( void  )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enableIdle()

static void enableIdle ( void  )
inlinestatic
Here is the caller graph for this function:

◆ idleControl()

void idleControl ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ idleInterrupt()

void idleInterrupt ( void  )

◆ initialiseIdle()

void initialiseIdle ( bool  forcehoming)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialiseIdleUpOutput()

static void initialiseIdleUpOutput ( void  )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isStepperHomed()

static uint8_t isStepperHomed ( void  )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ completedHomeSteps

unsigned int completedHomeSteps
static

◆ configPage6

◆ currentStatus

integerPID idlePID& currentStatus

The master global "live" status struct. Contains all values that are updated frequently and used across modules

◆ FeedForwardTerm

long FeedForwardTerm
static

◆ iacCoolTime_uS

unsigned int iacCoolTime_uS
static

◆ iacStepTime_uS

unsigned int iacStepTime_uS
static

◆ idle2_pin

fastOutputPin_t idle2_pin
static

◆ idle_cl_target_rpm

long idle_cl_target_rpm
static

◆ idle_pid_target_value

long idle_pid_target_value
static

◆ idle_pin

fastOutputPin_t idle_pin
static

◆ idle_pwm_cur_value

volatile unsigned int idle_pwm_cur_value
static

◆ idle_pwm_max_count

uint16_t idle_pwm_max_count

◆ idle_pwm_state

volatile bool idle_pwm_state
static

◆ idle_pwm_target_value

uint32_t idle_pwm_target_value
static

◆ idleCounter

uint8_t idleCounter
static

◆ idleInitComplete

uint8_t idleInitComplete = 99
static

◆ idleOn

bool idleOn
static

◆ idleStepper

struct StepperIdle idleStepper
static

◆ idleTaper

uint8_t idleTaper
static

◆ idleUpOutputHIGH

uint8_t idleUpOutputHIGH = HIGH
static

◆ idleUpOutputLOW

uint8_t idleUpOutputLOW = LOW
static

◆ lastDFCOValue

bool lastDFCOValue
static