diff --git a/+adi/+AD7944/Rx.m b/+adi/+AD7944/Rx.m new file mode 100644 index 0000000..9e4acb3 --- /dev/null +++ b/+adi/+AD7944/Rx.m @@ -0,0 +1,80 @@ +classdef Rx < adi.common.Rx & matlabshared.libiio.base & adi.common.Attribute + % AD7944 Precision ADC Class + % adi.AD7944.Rx Receives data from the AD7944 ADC + % The adi.AD7944.Rx System object is a signal source that can receive + % data from the AD7944. + % + % rx = adi.AD7944.Rx; + % rx = adi.AD7944.Rx('uri','ip:192.168.2.1'); + % + % AD7944 Datasheet + + properties (Nontunable) + % SamplesPerFrame Samples Per Frame + % Number of samples per frame, specified as an even positive + % integer. + SamplesPerFrame = 4096 + + % SampleRate Sample Rate + % Baseband sampling rate in Hz, specified as a scalar + % in samples per second. + SampleRate = 2500000 + end + + properties (Dependent) + % VoltageScale Voltage Scale + % ADC Voltage scale. + VoltageScale + end + + % Channel names + properties (Nontunable, Hidden, Constant) + channel_names = {'voltage0'} + end + + % isOutput + properties (Hidden, Nontunable, Access = protected) + isOutput = false + end + + properties (Nontunable, Hidden) + Timeout = Inf + kernelBuffersCount = 1 + dataTypeStr = 'uint16' + phyDevName = 'ad7944' + devName = 'ad7944' + end + + properties (Nontunable, Hidden, Constant) + Type = 'Rx' + end + + properties (Hidden, Constant) + ComplexData = false + end + + methods + %% Constructor + function obj = Rx(varargin) + obj = obj@matlabshared.libiio.base(varargin{:}); + obj.enableExplicitPolling = false; + obj.EnabledChannels = 1; + obj.BufferTypeConversionEnable = true; + end + + %% Check Voltage Scale + function rValue = get.VoltageScale(obj) + if obj.ConnectedToDevice + rValue = obj.getAttributeDouble('voltage0', 'scale', obj.isOutput); + else + rValue = NaN; + end + end + end + + %% API Functions + methods (Hidden, Access = protected) + function setupInit(~) + end + end +end diff --git a/+adi/+AD7985/Rx.m b/+adi/+AD7985/Rx.m new file mode 100644 index 0000000..3242115 --- /dev/null +++ b/+adi/+AD7985/Rx.m @@ -0,0 +1,80 @@ +classdef Rx < adi.common.Rx & matlabshared.libiio.base & adi.common.Attribute + % AD7985 Precision ADC Class + % adi.AD7985.Rx Receives data from the AD7985 ADC + % The adi.AD7985.Rx System object is a signal source that can receive + % data from the AD7985. + % + % rx = adi.AD7985.Rx; + % rx = adi.AD7985.Rx('uri','ip:192.168.2.1'); + % + % AD7985 Datasheet + + properties (Nontunable) + % SamplesPerFrame Samples Per Frame + % Number of samples per frame, specified as an even positive + % integer. + SamplesPerFrame = 4096 + + % SampleRate Sample Rate + % Baseband sampling rate in Hz, specified as a scalar + % in samples per second. + SampleRate = 2500000 + end + + properties (Dependent) + % VoltageScale Voltage Scale + % ADC Voltage scale. + VoltageScale + end + + % Channel names + properties (Nontunable, Hidden, Constant) + channel_names = {'voltage0'} + end + + % isOutput + properties (Hidden, Nontunable, Access = protected) + isOutput = false + end + + properties (Nontunable, Hidden) + Timeout = Inf + kernelBuffersCount = 1 + dataTypeStr = 'uint32' + phyDevName = 'ad7985' + devName = 'ad7985' + end + + properties (Nontunable, Hidden, Constant) + Type = 'Rx' + end + + properties (Hidden, Constant) + ComplexData = false + end + + methods + %% Constructor + function obj = Rx(varargin) + obj = obj@matlabshared.libiio.base(varargin{:}); + obj.enableExplicitPolling = false; + obj.EnabledChannels = 1; + obj.BufferTypeConversionEnable = true; + end + + %% Check Voltage Scale + function rValue = get.VoltageScale(obj) + if obj.ConnectedToDevice + rValue = obj.getAttributeDouble('voltage0', 'scale', obj.isOutput); + else + rValue = NaN; + end + end + end + + %% API Functions + methods (Hidden, Access = protected) + function setupInit(~) + end + end +end diff --git a/+adi/+AD7986/Rx.m b/+adi/+AD7986/Rx.m new file mode 100644 index 0000000..9d87d95 --- /dev/null +++ b/+adi/+AD7986/Rx.m @@ -0,0 +1,80 @@ +classdef Rx < adi.common.Rx & matlabshared.libiio.base & adi.common.Attribute + % AD7986 Precision ADC Class + % adi.AD7986.Rx Receives data from the AD7986 ADC + % The adi.AD7986.Rx System object is a signal source that can receive + % data from the AD7986. + % + % rx = adi.AD7986.Rx; + % rx = adi.AD7986.Rx('uri','ip:192.168.2.1'); + % + % AD7986 Datasheet + + properties (Nontunable) + % SamplesPerFrame Samples Per Frame + % Number of samples per frame, specified as an even positive + % integer. + SamplesPerFrame = 4096 + + % SampleRate Sample Rate + % Baseband sampling rate in Hz, specified as a scalar + % in samples per second. + SampleRate = 2000000 + end + + properties (Dependent) + % VoltageScale Voltage Scale + % ADC Voltage scale. + VoltageScale + end + + % Channel names + properties (Nontunable, Hidden, Constant) + channel_names = {'voltage0-voltage1'} + end + + % isOutput + properties (Hidden, Nontunable, Access = protected) + isOutput = false + end + + properties (Nontunable, Hidden) + Timeout = Inf + kernelBuffersCount = 1 + dataTypeStr = 'int32' + phyDevName = 'ad7986' + devName = 'ad7986' + end + + properties (Nontunable, Hidden, Constant) + Type = 'Rx' + end + + properties (Hidden, Constant) + ComplexData = false + end + + methods + %% Constructor + function obj = Rx(varargin) + obj = obj@matlabshared.libiio.base(varargin{:}); + obj.enableExplicitPolling = false; + obj.EnabledChannels = 1; + obj.BufferTypeConversionEnable = true; + end + + %% Check Voltage Scale + function rValue = get.VoltageScale(obj) + if obj.ConnectedToDevice + rValue = obj.getAttributeDouble('voltage0-voltage1', 'scale', obj.isOutput); + else + rValue = NaN; + end + end + end + + %% API Functions + methods (Hidden, Access = protected) + function setupInit(~) + end + end +end diff --git a/+adi/Contents.m b/+adi/Contents.m index 5752456..2e2e759 100644 --- a/+adi/Contents.m +++ b/+adi/Contents.m @@ -29,6 +29,9 @@ % AD7380 - ADC % AD7768 - ADC % AD7768-1 - ADC +% AD7944 - ADC +% AD7985 - ADC +% AD7986 - ADC % AD2S1210 - Resolver-to-Digital Converter % AD5760 - DAC % AD5780 - DAC diff --git a/CI/doc/SysObjsProps.m b/CI/doc/SysObjsProps.m index eb094cb..23a990a 100644 --- a/CI/doc/SysObjsProps.m +++ b/CI/doc/SysObjsProps.m @@ -21,4 +21,7 @@ % * AD463x % * AD7768 % * AD7768 +% * AD7944 +% * AD7985 +% * AD7986 % * AD2S1210 diff --git a/CI/doc/genhtml.m b/CI/doc/genhtml.m index 912ba03..23d51a6 100644 --- a/CI/doc/genhtml.m +++ b/CI/doc/genhtml.m @@ -1,6 +1,6 @@ mfiledir = '..\..\+adi\'; docdir = '..\..\doc\'; -parts = {'AD4630','AD4030','AD463x','AD7768','AD4858','AD2S1210','AD4000', 'AD4001', 'AD4002', 'AD4003', 'AD4004', 'AD4005', 'AD4006', 'AD4007', 'AD4008', 'AD4010', 'AD4011', 'AD4020', 'AD4021', 'AD4022'}; +parts = {'AD4630','AD4030','AD463x','AD7768','AD4858','AD2S1210','AD4000', 'AD4001', 'AD4002', 'AD4003', 'AD4004', 'AD4005', 'AD4006', 'AD4007', 'AD4008', 'AD4010', 'AD4011', 'AD4020', 'AD4021', 'AD4022', 'AD7944', 'AD7985', 'AD7986'}; trx_files = {'Rx','Base','Tx'}; for ii = 1:numel(parts) for jj = 1:numel(trx_files) diff --git a/CI/gen_doc/docs/_pages/index.md b/CI/gen_doc/docs/_pages/index.md index 84fdabf..2e9cf57 100644 --- a/CI/gen_doc/docs/_pages/index.md +++ b/CI/gen_doc/docs/_pages/index.md @@ -30,6 +30,9 @@ The following have device-specific implementations in MATLAB and Simulink. If a | AD7380 | Zedboard | Yes | No | ADI (2021b) | | AD7768 | Zedboard | Yes | No | ADI (2021b) | | AD7768-1 | Zedboard | Yes | No | ADI (2021b) | +| AD7944 | Zedboard | Yes | No | ADI (2021b) | +| AD7985 | Zedboard | Yes | No | ADI (2021b) | +| AD7986 | Zedboard | Yes | No | ADI (2021b) | | AD4030-24 | Zedboard | Yes | No | ADI (2021b) | | AD4630-16 | Zedboard | Yes | No | ADI (2021b) | | AD4630-24 | Zedboard | Yes | No | ADI (2021b) | @@ -50,4 +53,4 @@ The following have device-specific implementations in MATLAB and Simulink. If a | AD4021 | Zedboard | Yes | No | ADI (2021b) | | AD4022 | Zedboard | Yes | No | ADI (2021b) | | AD7124-4 | Zedboard | Yes | No | ADI (2021b) | -| AD7124-8 | Zedboard | Yes | No | ADI (2021b) | \ No newline at end of file +| AD7124-8 | Zedboard | Yes | No | ADI (2021b) | diff --git a/CI/gen_doc/docs/gen_sysobj_doc.m b/CI/gen_doc/docs/gen_sysobj_doc.m index 1b0a6ff..0185116 100644 --- a/CI/gen_doc/docs/gen_sysobj_doc.m +++ b/CI/gen_doc/docs/gen_sysobj_doc.m @@ -10,6 +10,9 @@ {'AD7380',{'Rx'}}... , {'AD7768', {'Rx'}}... , {'AD7768_1', {'Rx'}}... + , {'AD7944', {'Rx'}}... + , {'AD7985', {'Rx'}}... + , {'AD7986', {'Rx'}}... , {'AD4030', {'Rx'}}... , {'AD4630_16', {'Rx'}}... , {'AD4630_24', {'Rx'}}... diff --git a/examples/ad7944_DataCapture.m b/examples/ad7944_DataCapture.m new file mode 100644 index 0000000..98103bf --- /dev/null +++ b/examples/ad7944_DataCapture.m @@ -0,0 +1,16 @@ +%% Script for capturing data from a connected AD7944 board + +% Instantiate the system object +rx = adi.AD7944.Rx('uri','ip:analog.local'); + +% Connect to device and initialize data +rx(); + +% Retrieve ADC voltage scale +rx.VoltageScale(); + +% Print system object properties +rx + +% Delete the system object +release(rx)