-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ad400x: Support for pulsar HDL and STM32 #2105
Conversation
e5dda00
to
99f61f1
Compare
99f61f1
to
36a23b7
Compare
c286e34
to
89b96f2
Compare
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.
I still have to think a little bit about the spi chip select changes you have submitted, until then here are my remarks.
There is onother option with these chips is leave the CS go low, but this would require SDI to be high. |
c977fd6
to
c528fb9
Compare
changes in v2: voltage ref patch squashed into iio/project patches. |
c528fb9
to
767d9a9
Compare
So please correct me if I am wrong: all you actually need for this driver is to have chip-select active high instead of active low, is that right? |
this is not exactly right,he chip does not have a CS pin. its a conversion pin. the issue with just inverting the polarity of the CS pin on the spi driver, is that if you want to avoid handling the gpio on the driver: the above is what i see on the datasheet and from experiments: |
767d9a9
to
0d794aa
Compare
changes v4:
|
So we would like to avoid changing the SPI driver like that (seeing how for other platforms we will have to adapt this kind of behavior and it might not be possible to not have a chip select configured)... A workaround would be to simply have a dummy chip select in the project (which will not be connected to the chip) and then gpio_cnv pin can be used however is needed directly in the driver. |
ok, ill do that. |
81da7c1
to
cbffd43
Compare
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.
drivers/adc/ad400x/iio_ad400x.c
Outdated
|
||
|
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.
remove extra lines
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.
this extra line is not part of the latest push.
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.
it is part of this commit: 5e09916
in general, in the same PR, we avoid fixing a problem we introduced with a later commit, rather we remove it in the commit it was introduced by rebasing.
this makes the review process easier, commit by commit
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.
ok, ill fix it there.
cbffd43
to
f951053
Compare
Change log:
|
f951053
to
043b2fd
Compare
changelog:
|
seeing how there is no ad400x driver documentation, do you plan on adding that here? |
The pulsar HDL now supports the ad400x parts. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Device id parameter is not set if using standard SPI. We need device id to be able to set IIO attributes on the IIO driver. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
In standard SPI the CNV pin has to toggle before register access or getting a conversion result. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
This adds device id's for more ad400x parts that can use this same driver (AD4000, AD4001, AD4002, AD4004, AD4005, AD4006) Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
If offload is disabled, the xfer width must be byte aligned. We can also simplify the macro wrappers around the set_xfer_width call. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Fixes to get correct data out of 4-wire turbo mode: - For the chips that support 18 or 20 bit resolution, the least significant bits are in the higher nibble of the last byte. - Sign needs to be taken into consideration when printing the result. - The SDI line must remain high. - Move the bit operations that format the data to the project file, as we can avoid the performance hit in the IIO case were scan_type gives this info to the app for post processing. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
This adds axi clkgen and pwm to support the pulsar HDL, clkgen will ckl the spi_engine and pwm is used as offload trigger. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
use a pointer for spi_init parameters, to be consistent accross most no-os projects, the parameters are passed by reference. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
In preparation for iio and making the projects platform independant, move the offload code to the driver so it is simply enabled or not by the project code. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Add initial IIO support for the ad400x driver. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
This migrates the ad400x project to the multiplatform sructure so that we can add stm32 and iio examples Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
This adds the iio example project that makes use of the iio driver for the ad400x. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
This adds the stm32 platfrom to the ad400x project. It uses the standard spi of the stm32 and was tested using the sdp K1 development board. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Instead of using separtate tables and exports, add a device info structure to hold the per device resolution and sign. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
The functions are missing a check for null dev pointer. This adds the check. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
043b2fd
to
e431fea
Compare
I added the driver README. |
This adds the project and driver documentation. Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
e431fea
to
dcc36cb
Compare
Pull Request Description
This PR adds:
HDL is not merged yet on main repo, but code was tested with:
https://github.com/adi-ses/sea-misc/tree/main/AD4000-PRJ/debug_single_conversion
PR Type
PR Checklist