drivers/sensors: Add AS5047D magnetic encoder driver#18802
drivers/sensors: Add AS5047D magnetic encoder driver#18802DheerajSingh1107 wants to merge 1 commit intoapache:masterfrom
Conversation
There was a problem hiding this comment.
@DheerajSingh1107 thank you for your contribution, please align the CMakelist:
if(CONFIG_SENSORS_AS5047D)
list(APPEND SRCS as5047d.c)
endif()
|
Please add documentation for this driver :) |
|
@DheerajSingh1107 please take a look at this PR I submitted to MT6816 (#18807) and add a board config to some board you are using with it and Documentation to your AS5047D, this way a new user will be able to get it working easily |
|
Hi @linguini1 , does you mean add a description to as5047d.h header file or a rst file ? |
jerpelea
left a comment
There was a problem hiding this comment.
please remove the merge commit
Some RST docs please! |
I think it is guilt of our Documentation: I fixed it at "Submitting Your Changes to NuttX" but I didn't modified the original documentation that shows how to setup the environment. |
Thanks |
This adds support for the AMS AS5047D SPI magnetic encoder. Features: - 14-bit angle read - SPI interface - basic error handling Tested on STM32F4 with SPI3. Signed-off-by: Dheeraj Singh <Dheerajsingh1107@gmail.com>
jerpelea
left a comment
There was a problem hiding this comment.
please remove the merge commit
6a3266a to
9f565d2
Compare
|
@DheerajSingh1107 seems like there is some issue with the CMakefile: You can try to run the suggested cmake-format command over the original CMakeLists.txt and compare the resulting output file. @simbit18 I quick look at this CMakefile I didn't see any issue, any idea? |
Hi @acassis From what I can see, it’s just a styling error in the CMakeLists.txt file. Hi @DheerajSingh1107 , you need to fix the file locally. install cmake-format https://github.com/apache/nuttx/blob/master/.github/workflows/check.yml#L42C11-L44C72 |
Summary
This PR adds a new SPI-based magnetic encoder driver for the AMS AS5047D.
The AS5047D is a 14-bit on-axis magnetic rotary encoder that communicates over SPI and is commonly used in motor control and robotics applications requiring precise angular position feedback.
This driver provides:
The implementation follows existing NuttX sensor driver patterns and is designed to be reusable across supported boards.
Impact
No impact on existing APIs or backward compatibility.
Testing
Tested on:
Test Procedure:
Initialized SPI bus and driver in NuttX
Performed continuous angle reads
Verified:
Checked error flags in returned data
Observations:
Logs (example):