11classdef Rx < matlab .system .mixin .CustomIcon & adi .common .Rx ...
2- & matlabshared .libiio .base & adi .common .Attribute
2+ & matlabshared .libiio .base & adi .common .Attribute ...
3+ & adi .common .Sensor
34 % RX ADIS16460 Inertial Measurement Unit
45 % The adi.ADIS16460.Rx System object is a signal source that can
56 % collect IMU data from the ADIS16460.
1819 % contiguous within that buffer. However, successive buffers are not.
1920 %
2021 % <a href="https://www.analog.com/media/en/technical-documentation/data-sheets/ADIS16460.pdf">ADIS16460 Datasheet</a>
21- properties (Nontunable )
22- % SamplesPerFrame Samples Per Frame
23- % Number of samples per frame, specified as an even positive
24- % integer from 2 to 16,777,216.
25- SamplesPerFrame = 1024 ;
26- end
2722 properties
2823 % SampleRate Sample Rate
2924 % Baseband sampling rate in Hz, specified as a scalar
107102
108103 end
109104
105+ %% Sensor specific APIs
106+ methods
107+ function [accelReadings , gyroReadings , valid ] = read(obj )
108+ [accelReadings , gyroReadings , valid ] = step(obj );
109+ end
110+ function flush(obj )
111+ flushBuffers(obj );
112+ end
113+ end
114+
110115 %% API Functions
111116 methods (Hidden , Access = protected )
112117
113118 function [accelReadings , gyroReadings , valid ] = stepImpl(obj )
114119 [dataR , valid ] = stepImpl@adi.common.Rx(obj );
120+ if strcmpi(obj .ReadMode ,' latest' )
121+ dataR = dataR(end : -1 : 1 ,: );
122+ end
115123 data = obj .AttributeScales .* double(dataR );
116124 % AngularVelocity
117125 gyroReadings = data(: ,1 : 3 );
121129 end
122130
123131 function flag = isInactivePropertyImpl(obj , prop )
124- flag = isInactivePropertyImpl@adi.common.RxTx(obj , prop );
125- flag = flag || strcmpi(prop ,' EnabledChannels' );
132+ flag = isInactivePropertyImpl@adi.common.Sensor(obj , prop );
126133 end
127134
128135 function icon = getIconImpl(obj )
135142 scales(c ) = obj .getAttributeDouble(obj.channel_names{c },' scale' ,false );
136143 end
137144 end
138-
145+
139146 function setupInit(obj )
140147 obj .setDeviceAttributeRAW(' current_timestamp_clock' ,obj .TimeStampClockSource );
141148 obj .setDeviceAttributeRAW(' sampling_frequency' ,num2str(obj .SampleRate ));
@@ -159,7 +166,7 @@ function updateBuildInfo(buildInfo, bldCfg)
159166 function bName = getDescriptiveName(~)
160167 bName = ' ADIS16460' ;
161168 end
162-
169+
163170 end
164171end
165172
0 commit comments