/* SPDX-License-Identifier: GPL-2.0 */ /* * Helper types to take care of the fact that the DSP card memory * is 16 bits, but aligned on a 32 bit PCI boundary */ static inline u16 get_u16(const u32 __iomem *p) { … } static inline void set_u16(u32 __iomem *p, u16 val) { … } static inline s16 get_s16(const s32 __iomem *p) { … } static inline void set_s16(s32 __iomem *p, s16 val) { … } /* * The raw data is stored in a format which facilitates rapid * processing by the JR3 DSP chip. The raw_channel structure shows the * format for a single channel of data. Each channel takes four, * two-byte words. * * Raw_time is an unsigned integer which shows the value of the JR3 * DSP's internal clock at the time the sample was received. The clock * runs at 1/10 the JR3 DSP cycle time. JR3's slowest DSP runs at 10 * Mhz. At 10 Mhz raw_time would therefore clock at 1 Mhz. * * Raw_data is the raw data received directly from the sensor. The * sensor data stream is capable of representing 16 different * channels. Channel 0 shows the excitation voltage at the sensor. It * is used to regulate the voltage over various cable lengths. * Channels 1-6 contain the coupled force data Fx through Mz. Channel * 7 contains the sensor's calibration data. The use of channels 8-15 * varies with different sensors. */ struct raw_channel { … }; /* * The force_array structure shows the layout for the decoupled and * filtered force data. */ struct force_array { … }; /* * The six_axis_array structure shows the layout for the offsets and * the full scales. */ struct six_axis_array { … }; /* VECT_BITS */ /* * The vect_bits structure shows the layout for indicating * which axes to use in computing the vectors. Each bit signifies * selection of a single axis. The V1x axis bit corresponds to a hex * value of 0x0001 and the V2z bit corresponds to a hex value of * 0x0020. Example: to specify the axes V1x, V1y, V2x, and V2z the * pattern would be 0x002b. Vector 1 defaults to a force vector and * vector 2 defaults to a moment vector. It is possible to change one * or the other so that two force vectors or two moment vectors are * calculated. Setting the changeV1 bit or the changeV2 bit will * change that vector to be the opposite of its default. Therefore to * have two force vectors, set changeV1 to 1. */ /* vect_bits appears to be unused at this time */ enum { … }; /* WARNING_BITS */ /* * The warning_bits structure shows the bit pattern for the warning * word. The bit fields are shown from bit 0 (lsb) to bit 15 (msb). */ /* XX_NEAR_SET */ /* * The xx_near_sat bits signify that the indicated axis has reached or * exceeded the near saturation value. */ enum { … }; /* ERROR_BITS */ /* XX_SAT */ /* MEMORY_ERROR */ /* SENSOR_CHANGE */ /* * The error_bits structure shows the bit pattern for the error word. * The bit fields are shown from bit 0 (lsb) to bit 15 (msb). The * xx_sat bits signify that the indicated axis has reached or exceeded * the saturation value. The memory_error bit indicates that a problem * was detected in the on-board RAM during the power-up * initialization. The sensor_change bit indicates that a sensor other * than the one originally plugged in has passed its CRC check. This * bit latches, and must be reset by the user. * */ /* SYSTEM_BUSY */ /* * The system_busy bit indicates that the JR3 DSP is currently busy * and is not calculating force data. This occurs when a new * coordinate transformation, or new sensor full scale is set by the * user. A very fast system using the force data for feedback might * become unstable during the approximately 4 ms needed to accomplish * these calculations. This bit will also become active when a new * sensor is plugged in and the system needs to recalculate the * calibration CRC. */ /* CAL_CRC_BAD */ /* * The cal_crc_bad bit indicates that the calibration CRC has not * calculated to zero. CRC is short for cyclic redundancy code. It is * a method for determining the integrity of messages in data * communication. The calibration data stored inside the sensor is * transmitted to the JR3 DSP along with the sensor data. The * calibration data has a CRC attached to the end of it, to assist in * determining the completeness and integrity of the calibration data * received from the sensor. There are two reasons the CRC may not * have calculated to zero. The first is that all the calibration data * has not yet been received, the second is that the calibration data * has been corrupted. A typical sensor transmits the entire contents * of its calibration matrix over 30 times a second. Therefore, if * this bit is not zero within a couple of seconds after the sensor * has been plugged in, there is a problem with the sensor's * calibration data. */ /* WATCH_DOG */ /* WATCH_DOG2 */ /* * The watch_dog and watch_dog2 bits are sensor, not processor, watch * dog bits. Watch_dog indicates that the sensor data line seems to be * acting correctly, while watch_dog2 indicates that sensor data and * clock are being received. It is possible for watch_dog2 to go off * while watch_dog does not. This would indicate an improper clock * signal, while data is acting correctly. If either watch dog barks, * the sensor data is not being received correctly. */ enum error_bits_t { … }; /* THRESH_STRUCT */ /* * This structure shows the layout for a single threshold packet inside of a * load envelope. Each load envelope can contain several threshold structures. * 1. data_address contains the address of the data for that threshold. This * includes filtered, unfiltered, raw, rate, counters, error and warning data * 2. threshold is the is the value at which, if data is above or below, the * bits will be set ... (pag.24). * 3. bit_pattern contains the bits that will be set if the threshold value is * met or exceeded. */ struct thresh_struct { … }; /* LE_STRUCT */ /* * Layout of a load enveloped packet. Four thresholds are showed ... for more * see manual (pag.25) * 1. latch_bits is a bit pattern that show which bits the user wants to latch. * The latched bits will not be reset once the threshold which set them is * no longer true. In that case the user must reset them using the reset_bit * command. * 2. number_of_xx_thresholds specify how many GE/LE threshold there are. */ struct le_struct { … }; /* LINK_TYPES */ /* * Link types is an enumerated value showing the different possible transform * link types. * 0 - end transform packet * 1 - translate along X axis (TX) * 2 - translate along Y axis (TY) * 3 - translate along Z axis (TZ) * 4 - rotate about X axis (RX) * 5 - rotate about Y axis (RY) * 6 - rotate about Z axis (RZ) * 7 - negate all axes (NEG) */ enum link_types { … }; /* TRANSFORM */ /* Structure used to describe a transform. */ struct intern_transform { … }; /* * JR3 force/torque sensor data definition. For more information see sensor * and hardware manuals. */ struct jr3_sensor { … }; struct jr3_block { … };