From 98314e0872bd73ec5025ebde72a667e66d454871 Mon Sep 17 00:00:00 2001 From: Anush Shetty Date: Tue, 22 Oct 2024 18:05:57 +0530 Subject: [PATCH] adi:ad405x: Modified the AD405x MATLAB scripts 1. Added the Rx System Object for AD4050 2. Modified the data capture script to include AD4050 3. Deleted the Rx.m script from the +AD405x folder 4. Updated index.rst and Contents.m files. Signed-off-by: Anush Shetty --- +adi/+AD4050/Rx.m | 39 +++++++++++++++++++ +adi/+AD405x/Rx.m | 0 +adi/Contents.m | 2 + docs/source/index.rst | 1 + ...052_DataCapture.m => ad405x_DataCapture.m} | 14 +++++-- 5 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 +adi/+AD4050/Rx.m delete mode 100644 +adi/+AD405x/Rx.m rename examples/{ad4052_DataCapture.m => ad405x_DataCapture.m} (61%) diff --git a/+adi/+AD4050/Rx.m b/+adi/+AD4050/Rx.m new file mode 100644 index 0000000..0552bbe --- /dev/null +++ b/+adi/+AD4050/Rx.m @@ -0,0 +1,39 @@ +classdef Rx < adi.common.Rx & adi.common.RxTx ... + & adi.AD405x.Base + + % AD4050 Precision ADC Class + % + % adi.AD4050.Rx Receive data from the AD4050 ADC + % The adi.AD4050.Rx System object is a signal source that can receive + % data from the AD4050. + % + % `rx = adi.AD4050.Rx;` + % `rx = adi.AD4050.Rx('uri','serial:COM28,230400');` + % + % `AD4050 Datasheet `_ + + properties (Nontunable, Hidden, Constant) + Type = 'Rx' + end + + properties (Hidden) + Timeout = Inf + kernelBuffersCount = 1 + dataTypeStr = 'int32' + phyDevName = 'ad4050' + devName = 'ad4050' + end + + methods + %% Constructor + + function obj = Rx(Args) + arguments + Args.uri + end + coder.allowpcode('plain'); + obj = obj@adi.AD405x.Base('devName', 'ad4050', 'phyDevName', 'ad4050', 'uri', Args.uri); + end + + end +end \ No newline at end of file diff --git a/+adi/+AD405x/Rx.m b/+adi/+AD405x/Rx.m deleted file mode 100644 index e69de29..0000000 diff --git a/+adi/Contents.m b/+adi/Contents.m index 4880534..5752456 100644 --- a/+adi/Contents.m +++ b/+adi/Contents.m @@ -20,6 +20,8 @@ % AD4021 - ADC % AD4022 - ADC % AD4030-24 - ADC +% AD4050 - ADC +% AD4052 - ADC % AD4630-16 - ADC % AD4630-24 - ADC % ADAQ4224 - ADAQ diff --git a/docs/source/index.rst b/docs/source/index.rst index a1d40b9..d52021c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -58,6 +58,7 @@ The following have device-specific implementations in MATLAB and Simulink. In ge "AD5791", "Zedboard", "Yes", "No", "ADI (2021b)" "AD7124-4", "Zedboard", "Yes", "No", "ADI (2021b)" "AD7124-8", "Zedboard", "Yes", "No", "ADI (2021b)" + "AD4050", "SDP-K1", "Yes", "No", "ADI (2021b)" "AD4052", "SDP-K1", "Yes", "No", "ADI (2021b)" "AD4170", "SDP-K1", "Yes", "No", "ADI (2021b)" "AD7190", "SDP-K1", "Yes", "No", "ADI (2021b)" diff --git a/examples/ad4052_DataCapture.m b/examples/ad405x_DataCapture.m similarity index 61% rename from examples/ad4052_DataCapture.m rename to examples/ad405x_DataCapture.m index e73b0d3..490dd2a 100644 --- a/examples/ad4052_DataCapture.m +++ b/examples/ad405x_DataCapture.m @@ -1,11 +1,19 @@ %% Script for capturing and displaying a continuous set of samples from a -%% connected AD4052 board +%% connected AD405x board + +ActiveDevice = "AD4052"; % Devices available are AD4052 and AD4050 % Instantiate the system object -rx = adi.AD4052.Rx('uri', 'serial:COM13,230400'); +if ActiveDevice == "AD4052" + rx = adi.AD4052.Rx('uri', 'serial:COM28,230400'); +elseif ActiveDevice == "AD4050" + rx = adi.AD4050.Rx('uri', 'serial:COM28,230400'); +else + rx = adi.AD4052.Rx('uri', 'serial:COM28,230400'); +end + rx.SamplesPerFrame = 400; rx.EnabledChannels = [1]; - rx.SampleRate = 62500; % In sample mode, the sampling rate can be as high as 1MSPS % Capture data