stepper first steps
This commit is contained in:
1 parent
9b63d79ae5
commit
830bc0849a
3 files changed
+56
No files matched your search
@@ -0,0 +1,23 @@
|
|||||||
|
#include "Console.h"
|
||||||
|
#include "Spindle.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "FreeRTOS.h"
|
||||||
|
#include "openamp.h"
|
||||||
|
#include "LibL6474.h"
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
static void* StepLibraryMalloc( unsigned int size );
|
||||||
|
|
||||||
|
static void StepLibraryFree( const void* const ptr );
|
||||||
|
|
||||||
|
static int StepDriverSpiTransfer( void* pIO, char* pRX, const char* pTX, unsigned int length );
|
||||||
|
|
||||||
|
void StepDriverReset();
|
||||||
|
|
||||||
|
void StepLibraryDelay();
|
||||||
|
|
||||||
|
void StepTimerAsync();
|
||||||
|
|
||||||
|
void StepTimerCancelAsync();
|
||||||
|
|
||||||
|
L6474_Handle_t init_stepper();
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#include "Stepper/stepper.h"
|
||||||
|
|
||||||
|
|
||||||
|
static void* StepLibraryMalloc( unsigned int size ){
|
||||||
|
return malloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void StepLibraryFree( const void* const ptr ){
|
||||||
|
free((void*)ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int StepDriverSpiTransfer( void* pIO, char* pRX, const char* pTX, unsigned int length ){
|
||||||
|
for ( unsigned int i = 0; i < length; i++ )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
L6474_Handle_t init_stepper(){
|
||||||
|
L6474x_Platform_t p;
|
||||||
|
p.malloc = StepLibraryMalloc;
|
||||||
|
p.free = StepLibraryFree;
|
||||||
|
p.transfer = StepDriverSpiTransfer;
|
||||||
|
p.reset = StepDriverReset;
|
||||||
|
p.sleep = StepLibraryDelay;
|
||||||
|
//p.stepAsync = StepTimerAsync;
|
||||||
|
//p.cancelStep = StepTimerCancelAsync;
|
||||||
|
}
|
||||||
@@ -30,6 +30,8 @@
|
|||||||
#include "Spindle.h"
|
#include "Spindle.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
#include "Spindle/spindel.h"
|
#include "Spindle/spindel.h"
|
||||||
|
#include "Stepper/stepper.h"
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
|||||||
Reference in new issue
Block a user