libpynq  (release 5EID0-2023 version 0.3.0 of 2024-04-25 09:42 )
stepper.c File Reference
#include "stepper.h"
#include "arm_shared_memory_system.h"
#include "log.h"
#include <platform.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for stepper.c:

Go to the source code of this file.

Data Structures

union  pwm_set
 

Macros

#define STEPPER_REG_CONFIG   0
 
#define STEPPER_REG_STEPS   1
 
#define STEPPER_REG_CUR_STEPS   1
 
#define STEPPER_REG_PERIOD   2
 
#define STEPPER_REG_CUR_PERIOD   2
 
#define STEPPER_REG_DUTY   3
 
#define STEPPER_REG_CUR_DUTY   3
 
#define STEPPER_REG_NXT_STEPS   4
 
#define STEPPER_REG_NXT_PERIOD   5
 
#define STEPPER_REG_NXT_DUTY   6
 
#define STEPPER_REG_COUNT   7
 
#define MIN_PULSE   0x10
 
#define MIN_PERIOD   (0x30 * 64)
 

Functions

union __attribute__ ((packed))
 
void stepper_init (void)
 
void stepper_enable (void)
 
void stepper_disable (void)
 
void stepper_destroy (void)
 
void stepper_reset ()
 
bool stepper_steps_done (void)
 
void stepper_steps (int16_t left, int16_t right)
 
void stepper_set_speed (uint16_t left, uint16_t right)
 
void stepper_get_steps (int16_t *left, int16_t *right)
 

Variables

 steps
 

Macro Definition Documentation

◆ MIN_PERIOD

#define MIN_PERIOD   (0x30 * 64)

Definition at line 49 of file stepper.c.

◆ MIN_PULSE

#define MIN_PULSE   0x10

Definition at line 48 of file stepper.c.

◆ STEPPER_REG_CONFIG

#define STEPPER_REG_CONFIG   0

Definition at line 32 of file stepper.c.

◆ STEPPER_REG_COUNT

#define STEPPER_REG_COUNT   7

Definition at line 46 of file stepper.c.

◆ STEPPER_REG_CUR_DUTY

#define STEPPER_REG_CUR_DUTY   3

Definition at line 41 of file stepper.c.

◆ STEPPER_REG_CUR_PERIOD

#define STEPPER_REG_CUR_PERIOD   2

Definition at line 38 of file stepper.c.

◆ STEPPER_REG_CUR_STEPS

#define STEPPER_REG_CUR_STEPS   1

Definition at line 35 of file stepper.c.

◆ STEPPER_REG_DUTY

#define STEPPER_REG_DUTY   3

Definition at line 40 of file stepper.c.

◆ STEPPER_REG_NXT_DUTY

#define STEPPER_REG_NXT_DUTY   6

Definition at line 45 of file stepper.c.

◆ STEPPER_REG_NXT_PERIOD

#define STEPPER_REG_NXT_PERIOD   5

Definition at line 44 of file stepper.c.

◆ STEPPER_REG_NXT_STEPS

#define STEPPER_REG_NXT_STEPS   4

Definition at line 43 of file stepper.c.

◆ STEPPER_REG_PERIOD

#define STEPPER_REG_PERIOD   2

Definition at line 37 of file stepper.c.

◆ STEPPER_REG_STEPS

#define STEPPER_REG_STEPS   1

Definition at line 34 of file stepper.c.

Function Documentation

◆ __attribute__()

union __attribute__ ( (packed)  )

Definition at line 51 of file stepper.c.

Variable Documentation

◆ steps

steps

Definition at line 59 of file stepper.c.