This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
university:tools:pluto:hacking:power_amp [10 Jul 2019 23:30] – [VDD_GPO] Robin Getz | university:tools:pluto:hacking:power_amp [13 Jul 2019 02:19] – [Test Results] Robin Getz | ||
---|---|---|---|
Line 23: | Line 23: | ||
More information about the [[adi> | More information about the [[adi> | ||
- | ===== ADLM-PLUTO implementation ===== | + | ===== ADALM-PLUTO implementation ===== |
==== VDD_GPO ==== | ==== VDD_GPO ==== | ||
Line 83: | Line 83: | ||
{{ : | {{ : | ||
+ | |||
+ | <WRAP round help> | ||
+ | </ | ||
+ | |||
+ | OK, someone asked for the C code - it's pretty trivial, just longer. You will need to change the uri, and put in proper error checking. | ||
+ | |||
+ | < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | |||
+ | volatile sig_atomic_t stop = 0; | ||
+ | |||
+ | void inthand(int signum) { | ||
+ | stop = 1; | ||
+ | } | ||
+ | |||
+ | int main(int argc, char **argv) | ||
+ | { | ||
+ | struct iio_context *ctx; | ||
+ | struct iio_device *dev; | ||
+ | struct iio_channel *ch; | ||
+ | const char* val_str; | ||
+ | ssize_t ret = 0; | ||
+ | char buf[256]; | ||
+ | |||
+ | signal(SIGINT, | ||
+ | |||
+ | /* Create IIO Context */ | ||
+ | ctx = iio_create_context_from_uri(" | ||
+ | |||
+ | /* Find IIO device in current context */ | ||
+ | dev = iio_context_find_device(ctx, | ||
+ | |||
+ | /* Write into the IIO debug attributes */ | ||
+ | iio_device_debug_attr_write_bool(dev, | ||
+ | iio_device_debug_attr_write_bool(dev, | ||
+ | iio_device_debug_attr_write_bool(dev, | ||
+ | iio_device_debug_attr_write_bool(dev, | ||
+ | | ||
+ | while (!stop) { | ||
+ | ret++; | ||
+ | iio_device_attr_write(dev, | ||
+ | iio_device_attr_write(dev, | ||
+ | } | ||
+ | iio_context_destroy(ctx); | ||
+ | printf(" | ||
+ | return EXIT_SUCCESS; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Over USB, you get:< | ||
+ | time ./foo | ||
+ | ^Citteration = 2693 | ||
+ | |||
+ | real 0m5.283s | ||
+ | </ | ||
+ | |||
+ | or about 0.980876346 ms per Rx/Tx slot. | ||
===== Testing in IIO Oscilloscope ===== | ===== Testing in IIO Oscilloscope ===== | ||