From 6f5d1cd31c06d6d27a265ccd725e61868a2a8e5b Mon Sep 17 00:00:00 2001 From: Terje Io Date: Tue, 10 Aug 2021 13:28:54 +0200 Subject: [PATCH] Added entries for motor driver chip select lines to crossbar.h, enums for aux I/O pin types. No funtional changes. --- crossbar.h | 15 +++++++++++++++ grbl.h | 2 +- hal.h | 15 ++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/crossbar.h b/crossbar.h index d701ea1..d995cc6 100644 --- a/crossbar.h +++ b/crossbar.h @@ -91,6 +91,13 @@ typedef enum { Output_DirC, Output_DirU, Output_DirV, + Output_MotorChipSelect, + Output_MotorChipSelectX, + Output_MotorChipSelectY, + Output_MotorChipSelectZ, + Output_MotorChipSelectM3, + Output_MotorChipSelectM4, + Output_MotorChipSelectM5, Output_StepperPower, Output_StepperEnable, Output_StepperEnableX, @@ -207,6 +214,13 @@ PROGMEM static const pin_name_t pin_names[] = { { .function = Output_StepperEnableC, .name = "C enable" }, { .function = Output_StepperEnableXY, .name = "XY enable" }, { .function = Output_StepperEnableAB, .name = "AB enable" }, + { .function = Output_MotorChipSelect, .name = "Motor CS" }, + { .function = Output_MotorChipSelectX, .name = "Motor CSX" }, + { .function = Output_MotorChipSelectY, .name = "Motor CSY" }, + { .function = Output_MotorChipSelectZ, .name = "Motor CSZ" }, + { .function = Output_MotorChipSelectM3, .name = "Motor CSM3" }, + { .function = Output_MotorChipSelectM4, .name = "Motor CSM4" }, + { .function = Output_MotorChipSelectM5, .name = "Motor CSM5" }, { .function = Output_SpindleOn, .name = "Spindle on" }, { .function = Output_SpindleDir, .name = "Spindle direction" }, { .function = Output_SpindlePWM, .name = "Spindle PWM" }, @@ -239,6 +253,7 @@ typedef enum { PinGroup_StepperDir, PinGroup_AuxOutput, PinGroup_SdCard, + PinGroup_MotorChipSelect, PinGroup_I2C, PinGroup_SPI, PinGroup_UART, diff --git a/grbl.h b/grbl.h index 02bfd91..cd08323 100644 --- a/grbl.h +++ b/grbl.h @@ -34,7 +34,7 @@ #else #define GRBL_VERSION "1.1f" #endif -#define GRBL_VERSION_BUILD "20210803" +#define GRBL_VERSION_BUILD "20210809" // The following symbols are set here if not already set by the compiler or in config.h // Do NOT change here! diff --git a/hal.h b/hal.h index 76e57dd..abc623d 100644 --- a/hal.h +++ b/hal.h @@ -72,6 +72,9 @@ typedef union { } driver_cap_t; +/*! \brief Pointer to function called to set up driver peripherals after settings are loaded. */ +typedef bool (*driver_setup_ptr)(settings_t *settings); + /*! \brief Pointer to function to be called when a soft reset occurs. */ typedef void (*driver_reset_ptr)(void); @@ -88,6 +91,16 @@ typedef bool (*stream_select_ptr)(const io_stream_t *stream); * Aux I/O * *************/ +typedef enum { + Port_Analog = 0, + Port_Digital = 1 +} io_port_type_t; + +typedef enum { + Port_Input = 0, + Port_Output = 1 +} io_port_direction_t; + /*! \brief Pointer to function for setting a digital output. \param port port number \param on true to set ouput high, false to set it low @@ -622,7 +635,7 @@ typedef struct { \param settings pointer to settings_t structure. \returns true if completed sucessfully and the driver supports the _settings->version_ number, false otherwise. */ - bool (*driver_setup)(settings_t *settings); + driver_setup_ptr driver_setup; /*! \brief Millisecond delay.