Skip to content

Commit

Permalink
adi:ad719x: Add AD719x Support
Browse files Browse the repository at this point in the history
1. Added drivers for Ad7190/2/3/4 and 5
2. Added example script for data capture
3. Updated index.rst and contents.m

Signed-off-by: Disha D <[email protected]>
  • Loading branch information
D-Disha authored and jansunil committed Aug 1, 2024
1 parent 4870e76 commit 7f596d8
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 2 deletions.
24 changes: 24 additions & 0 deletions +adi/+AD7190/Rx.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
classdef Rx < adi.common.Rx & adi.common.RxTx ...
& adi.AD719x.Base
% AD7190 Precision ADC Class
% adi.AD7190.Rx Receives data from the AD7190 ADC
% The adi.AD7190.Rx System object is a signal source that can receive
% data from the AD7190.
%
% `rx = adi.AD7190.Rx;`
% `rx = adi.AD7190.Rx('serial:COM18,230400');`
%
% `AD7190 DataSheet<a href="https://www.analog.com/media/en/technical-documentation/data-sheets/ad7190.pdf">`_

properties (Nontunable, Hidden)
channel_names = {'voltage0', 'voltage1','voltage2','voltage3'};
end

methods
%% Constructor
function obj = Rx(varargin)
obj = [email protected]('ad7190','ad7190',varargin{:});
end
end

end
24 changes: 24 additions & 0 deletions +adi/+AD7192/Rx.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
classdef Rx < adi.common.Rx & adi.common.RxTx ...
& adi.AD719x.Base
% AD7192 Precision ADC Class
% adi.AD7192.Rx Receives data from the AD7192 ADC
% The adi.AD7192.Rx System object is a signal source that can receive
% data from the AD7192.
%
% `rx = adi.AD7192.Rx;`
% `rx = adi.AD7192.Rx('serial:COM18,230400');`
%
% `AD7192 DataSheet<a href="https://www.analog.com/media/en/technical-documentation/data-sheets/ad7192.pdf">`_

properties (Nontunable, Hidden)
channel_names = {'voltage0', 'voltage1','voltage2','voltage3'};
end

methods
%% Constructor
function obj = Rx(varargin)
obj = [email protected]('ad7192','ad7192',varargin{:});
end
end

end
26 changes: 26 additions & 0 deletions +adi/+AD7193/Rx.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
classdef Rx < adi.common.Rx & adi.common.RxTx ...
& adi.AD719x.Base
% AD7193 Precision ADC Class
% adi.AD7193.Rx Receives data from the AD7193 ADC
% The adi.AD7193.Rx System object is a signal source that can receive
% data from the AD7193.
%
% `rx = adi.AD7193.Rx;`
% `rx = adi.AD7193.Rx('serial:COM18,230400');`
%
% `AD7193 Datasheet <https://www.analog.com/media/en/technical-documentation/data-sheets/ad7193.pdf>`_

properties (Nontunable, Hidden)
channel_names = {'voltage0', 'voltage1','voltage2','voltage3','voltage4','voltage5','voltage6','voltage7'};
end

methods
%% Constructor
function obj = Rx(varargin)
obj = [email protected]('ad7193','ad7193',varargin{:});
end
end

end


24 changes: 24 additions & 0 deletions +adi/+AD7194/Rx.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
classdef Rx < adi.common.Rx & adi.common.RxTx ...
& adi.AD719x.Base
% AD7194 Precision ADC Class
% adi.AD7194.Rx Receives data from the AD7194 ADC
% The adi.AD7194.Rx System object is a signal source that can receive
% data from the AD7194.
%
% `rx = adi.AD7194.Rx;`
% `rx = adi.AD7194.Rx('serial:COM18,230400');`
%
% `AD7194 Datasheet <https://www.analog.com/media/en/technical-documentation/data-sheets/ad7194.pdf>`_

properties (Nontunable, Hidden)
channel_names = {'voltage0', 'voltage1','voltage2','voltage3','voltage4','voltage5','voltage6','voltage7','voltage8','voltage9','voltage10','voltage11','voltage12','voltage13','voltage14','voltage15'};
end

methods
%% Constructor
function obj = Rx(varargin)
obj = [email protected]('ad7194','ad7194',varargin{:});
end
end

end
24 changes: 24 additions & 0 deletions +adi/+AD7195/Rx.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
classdef Rx < adi.common.Rx & adi.common.RxTx ...
& adi.AD719x.Base
% AD7195 Precision ADC Class
% adi.AD7195.Rx Receives data from the AD7195 ADC
% The adi.AD7195.Rx System object is a signal source that can receive
% data from the AD7195.
%
% `rx = adi.AD7195.Rx;`
% `rx = adi.AD7195.Rx('serial:COM18,230400');`
%
% `AD7195 Datasheet <https://www.analog.com/media/en/technical-documentation/data-sheets/ad7195.pdf>`_

properties (Nontunable, Hidden)
channel_names = {'voltage0', 'voltage1','voltage2','voltage3'};
end

methods
%% Constructor
function obj = Rx(varargin)
obj = [email protected]('ad7195','ad7195',varargin{:});
end
end

end
1 change: 0 additions & 1 deletion +adi/Contents.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@
% <a href="matlab:help adi.AD5791 ">AD5791</a> - DAC
% <a href="matlab:help adi.AD7124_4 ">AD7124_4</a> - ADC
% <a href="matlab:help adi.AD7124_8 ">AD7124_8</a> - ADC
% <a href="matlab:help adi.AD4170 ">AD7124_8</a> - ADC
6 changes: 5 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@ The following have device-specific implementations in MATLAB and Simulink. In ge
"AD7124-8", "Zedboard", "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)"
"AD7192", "SDP-K1", "Yes", "No", "ADI (2021b)"
"AD7193", "SDP-K1", "Yes", "No", "ADI (2021b)"
"AD7194", "SDP-K1", "Yes", "No", "ADI (2021b)"
"AD7195", "SDP-K1", "Yes", "No", "ADI (2021b)"
24 changes: 24 additions & 0 deletions examples/ad719x_DataCapture.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
%% Script for capturing and displaying a continuous set of samples from a
%% connected AD719x board

% Instantiate the system object
rx = adi.AD7193.Rx();
rx.uri = 'serial:COM12,230400,8n1n';

% Samples per frame cannot exceed 500 if all 16 channels need to be captured on ad7194
rx.SamplesPerFrame = 400;
rx.EnabledChannels = [1];

% Capture data
data = rx();

enabledChannels = size(data,2);
figure(1);
for i = 1:enabledChannels
subplot(enabledChannels, 1, i);
plot(data(1:rx.SamplesPerFrame, i));
title("Channel " + num2str(rx.EnabledChannels(i)));
end

% Delete the system object
release(rx);

0 comments on commit 7f596d8

Please sign in to comment.