Skip to content
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

Modified the AD405x MATLAB scripts #36

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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