Skip to content

Commit

Permalink
adi:ad405x: Modified the AD405x MATLAB scripts
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Shetty-Anush authored and SaikiranGudla committed Oct 23, 2024
1 parent 590936d commit b28198c
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
39 changes: 39 additions & 0 deletions +adi/+AD4050/Rx.m
Original file line number Diff line number Diff line change
@@ -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 <https://www.analog.com/media/en/technical-documentation/data-sheets/ad4050-ad4056.pdf>`_

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 = [email protected]('devName', 'ad4050', 'phyDevName', 'ad4050', 'uri', Args.uri);
end

end
end
Empty file removed +adi/+AD405x/Rx.m
Empty file.
2 changes: 2 additions & 0 deletions +adi/Contents.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
% <a href="matlab:help adi.AD4021 ">AD4021</a> - ADC
% <a href="matlab:help adi.AD4022 ">AD4022</a> - ADC
% <a href="matlab:help adi.AD4030 ">AD4030-24</a> - ADC
% <a href="matlab:help adi.AD4050 ">AD4050</a> - ADC
% <a href="matlab:help adi.AD4052 ">AD4052</a> - ADC
% <a href="matlab:help adi.AD4630_16 ">AD4630-16</a> - ADC
% <a href="matlab:help adi.AD4630_24 ">AD4630-24</a> - ADC
% <a href="matlab:help adi.ADAQ4224 ">ADAQ4224</a> - ADAQ
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
14 changes: 11 additions & 3 deletions examples/ad4052_DataCapture.m → examples/ad405x_DataCapture.m
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit b28198c

Please sign in to comment.