New ESP32 Port #763
dylanetaft
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am looking at porting the Maslow 4 board to grblhal. The ESP32 driver is using a very old SDK that has been deprecated.
I am building on the ESP SDK 5.4.1. They changed a ton of API, timers, i2c, so I am building a new driver.
I saw another thread about documenting the process, I probably could do that.
The Maslow 4 is weird. It has 4 planetary gear brushed motors instead of steppers, for inverse kinematic based movement via trilateration, ADC for current sensing on each motor, AS5600 magnetic encoders, TCA9546A I2C switch.
I am going to try to make the motors emulate step pulses against the magnetic encoders.
I ported the drivers from Sparkfun and a popular arduino library here and introduced a HAL layer for I2C.
https://github.com/dylanetaft/I2C_HAL_drivers
I don't see a very strong I2C interface\HAL layer in grblhal, am I missing anything?
Is it best to just use grbl core, implement the necessary code to drive peripherals in a board driver for grblhal, and keep other things separate from grblhal - like there's not a standard interface for uart, i2c, spi callbacks or externs to define in a board driver?
I see maybe a couple things in core/plugins.h...
extern i2c_cap_t i2c_start (void);
extern bool i2c_probe (i2c_address_t i2c_address);
extern bool i2c_send (i2c_address_t i2c_address, uint8_t *data, size_t size, bool block);
extern bool i2c_receive (i2c_address_t i2cAddr, uint8_t *buf, size_t size, bool block);
extern bool i2c_get_keycode (i2c_address_t i2c_address, keycode_callback_ptr callback);
extern bool i2c_transfer (i2c_transfer_t *i2c, bool read);
The keycode thing looks strangely specific to a specific plugin.
But it's missing things - like often times you write to a reg and then read without an i2c stop bit.
Should I just ignore "plugins" and stick with implementing core? Kinda thinking yes.
I was wondering if there's anything to contribute back to grblhal for the project I'm working on - maybe not, just use the core - really only the bits you need even then - build your own cmake file.
Beta Was this translation helpful? Give feedback.
All reactions