-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(stepper_motor): initial drv8434 driver #120
Draft
sri9311
wants to merge
23
commits into
fouge/zephyr-4.0.0
Choose a base branch
from
sri/motor-driver-drv8434
base: fouge/zephyr-4.0.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+3,263
−1,195
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hey |
0974d92
to
52ec901
Compare
update revision in west Signed-off-by: Cyril Fougeray <[email protected]>
make CMake successfully load Signed-off-by: Cyril Fougeray <[email protected]>
app is building signature changed, now passing pointer, instead of pointer of pointer. still many changes to be made Signed-off-by: Cyril Fougeray <[email protected]>
with deferred initialization, we can now initialize devices at runtime. I2C1 is one that should be postponed until after the power supplies are initialized and turned on. Signed-off-by: Cyril Fougeray <[email protected]>
for main battery Signed-off-by: Cyril Fougeray <[email protected]>
global CSTD property is deprecated with zephyr 3.7.0. Signed-off-by: Cyril Fougeray <[email protected]>
ZTEST_NEW_API not a config anymore fix test compilation and warnings config MCUBOOT_BOOTLOADER_MODE_SINGLE_APP (one-slot) config MCUBOOT_GENERATE_UNSIGNED_IMAGE because no signing keys are used when generating the test binary add more delay between dfu messages (erasure takes time) Signed-off-by: Cyril Fougeray <[email protected]>
taken from mcuboot example debug boot: read flash data, instead of relying on hardcoded values Signed-off-by: Cyril Fougeray <[email protected]>
redefine M_PI BUILD_ASSERT must be used instead of static_assert Signed-off-by: Cyril Fougeray <[email protected]>
was enabled as long as `watchdog0` was an existing label. now, kconfig has to be enabled Signed-off-by: Cyril Fougeray <[email protected]>
use sys_init to initialize watchdog callback cannot be set dynamically anymore, but weakly defined instead so that it can be overridden by user at compile time. Signed-off-by: Cyril Fougeray <[email protected]>
fix the generation of proto files. cmake from orb-messages library is requesting to be linked into target. Plus, use target defined in zephyr cmake as a dependency. Signed-off-by: Cyril Fougeray <[email protected]>
don't use `orb/public` was not causing issues so far but zephyr_module.py changed and isn't able to find the project repo for zephyr.meta generation it's important to note that this is only when the repo is used alone, without it's `private` counterpart. Signed-off-by: Cyril Fougeray <[email protected]>
when found, the cmake package `McuPrivate` is used to load custom configs. Allow a single point of entry for private configs, which is simpler to maintain and understand. Signed-off-by: Cyril Fougeray <[email protected]>
internal routing is now set in specific drivers that we don't use, as we use the adc drivers to get vbat, vref and die temperature. so we need so hardcode the configuration. Signed-off-by: Cyril Fougeray <[email protected]>
disable formatter for CMakeLists.txt rename dts.overlay to app.overlay copy-pasted all files from original project encryption enabled in release builds only Signed-off-by: Cyril Fougeray <[email protected]>
with fixes watchdog can be initialized only once, by our libray adc node property: <SYNC> became "SYNC" Signed-off-by: Cyril Fougeray <[email protected]>
fouge
reviewed
Jan 28, 2025
Comment on lines
73
to
87
uint16_t tx_word = 0; | ||
|
||
// Load register address into tx word | ||
tx_word = | ||
tx_word | ((uint16_t)(address) << DRV8434_SPI_TX_ADDRESS_START_POS); | ||
|
||
// Load data into tx word | ||
tx_word = tx_word | (uint16_t)(data); | ||
|
||
// Wipe TX and RX buffers before each operation | ||
memset(instance->spi.rx_buffer, 0, sizeof(instance->spi.rx_buffer)); | ||
memset(instance->spi.tx_buffer, 0, sizeof(instance->spi.tx_buffer)); | ||
|
||
instance->spi.tx_buffer[0u] = (tx_word >> 8) & DRV8434_SPI_TX_LSB_MASK; | ||
instance->spi.tx_buffer[1u] = tx_word & DRV8434_SPI_TX_LSB_MASK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about?
seems overly complicated to me 🤔
Suggested change
uint16_t tx_word = 0; | |
// Load register address into tx word | |
tx_word = | |
tx_word | ((uint16_t)(address) << DRV8434_SPI_TX_ADDRESS_START_POS); | |
// Load data into tx word | |
tx_word = tx_word | (uint16_t)(data); | |
// Wipe TX and RX buffers before each operation | |
memset(instance->spi.rx_buffer, 0, sizeof(instance->spi.rx_buffer)); | |
memset(instance->spi.tx_buffer, 0, sizeof(instance->spi.tx_buffer)); | |
instance->spi.tx_buffer[0u] = (tx_word >> 8) & DRV8434_SPI_TX_LSB_MASK; | |
instance->spi.tx_buffer[1u] = tx_word & DRV8434_SPI_TX_LSB_MASK; | |
instance->spi.tx_buffer[0u] = address << 1; | |
instance->spi.tx_buffer[1u] = data; |
8c22185
to
3d38424
Compare
drv8434 register structs and addresses Signed-off-by: Srikar Chintapalli <[email protected]>
drv8434 runtime context structs Signed-off-by: Srikar Chintapalli <[email protected]>
drv8434 defines, application and SPI frame Signed-off-by: Srikar Chintapalli <[email protected]>
drv8434 SPI transaction layer Signed-off-by: Srikar Chintapalli <[email protected]>
drv8434 application interface Signed-off-by: Srikar Chintapalli <[email protected]>
3d38424
to
f01a485
Compare
dts file changes to add peripheral support for motor driver Signed-off-by: Srikar Chintapalli <[email protected]>
05461a3
to
13f8c3a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
draft of interface driver to motor driver.
stepper application and integration to follow
fixes ORBP-286