analogdevicesinc / no-OS

Software drivers in C for systems without an operating system
http://analogdevicesinc.github.io/no-OS/
Other
882 stars 1.63k forks source link

ad796x: Add project and driver for ad796x-fmc #2139

Closed ahaslam2 closed 1 month ago

ahaslam2 commented 3 months ago

This adds driver files and a project test the ad796x series of pulsar Differential ADC.

The HDL for this project is still not merged, and probably its why CI is failing. perhaps review can start without the HDL

this was tested using the HDL binary at https://github.com/adi-ses/sea-misc/tree/main/AD796x-PRJ

PR Type

PR Checklist

ahaslam2 commented 3 months ago

@rbolboac

ok ill separate driver and project. but what do you mean by "new project structure"?

rbolboac commented 3 months ago

@rbolboac

ok ill separate driver and project. but what do you mean by "new project structure"?

By new project structure I mean the src folder should have platform independent examples, with common folder and platform specific folders. This is an example from iio_demo project:

├── src
│   ├── common
│   │   ├── app_config.h
│   │   ├── common_data.c
│   │   └── common_data.h
│   ├── examples
│   │   ├── examples_src.mk
│   │   ├── iio_example
│   │   │   ├── iio_example.c
│   │   │   └── iio_example.h
│   │   ├── iio_sw_trigger_example
│   │   │   ├── iio_sw_trigger_example.c
│   │   │   └── iio_sw_trigger_example.h
│   │   └── iio_timer_trigger_example
│   │       ├── iio_timer_trigger_example.c
│   │       └── iio_timer_trigger_example.h
│   └── platform
│       ├── aducm3029
│       │   ├── main.c
│       │   ├── parameters.c
│       │   ├── parameters.h
│       │   └── platform_src.mk
│       ├── linux
│       │   ├── main.c
│       │   ├── parameters.c
│       │   ├── parameters.h
│       │   └── platform_src.mk
│       ├── maxim
│       │   ├── main.c
│       │   ├── parameters.c
│       │   ├── parameters.h
│       │   └── platform_src.mk
│       ├── pico
│       │   ├── main.c
│       │   ├── parameters.c
│       │   ├── parameters.h
│       │   └── platform_src.mk
│       ├── platform_includes.h
│       ├── stm32
│       │   ├── main.c
│       │   ├── parameters.c
│       │   ├── parameters.h
│       │   └── platform_src.mk
│       └── xilinx
│           ├── main.c
│           ├── parameters.c
│           ├── parameters.h
│           └── platform_src.mk
ahaslam2 commented 3 months ago

Ok, i did not know this structure was a requirement, will do.

ahaslam2 commented 3 months ago

one question @rbolboac

i would suppose the structure requirement is to keep the examples platform independant?

i see things like axi_dac_init_begin(&phy->tx_dac, &tx_dac_init); int the example c files that i think are tied to some specific fpga/platform ?

https://github.com/analogdevicesinc/no-OS/blob/main/projects/adrv902x/src/examples/iio_example/iio_example.c#L304

are there some rules as to what goes into platform/common/example?

rbolboac commented 3 months ago

well, the idea is to have the examples generic and platform independent, but if that is not possible I suppose it is alright. in that case adrv902x project can be used as an example.

ahaslam2 commented 2 months ago

The failure of CI is currently due to the missing HDL:

 -> Building ad796x_fmcz (iio) -- xilinx -- ad796x_fmc_zed
 -> cp /no-OS_builds/builds_main/new_hardware/ad796x_fmc_zed/system_top.xsa /no-OS_builds/builds_main/hardware/ad796x_fmc_zed.xsa
 -> ERROR
 -> See log logs/ad796x_fmcz_xilinx_iio_ad796x_fmc_zed.txt -- Use cat (linux) or type (windows) to see colored output
Error occured: 1
ahaslam2 commented 2 months ago

changes:

rbolboac commented 1 month ago

do you plan on adding the driver documentation in this PR or in a new one?

ahaslam2 commented 1 month ago

do you plan on adding the driver documentation in this PR or in a new one?

i will add it to this PR