SPI Device Parity

This MotoHawk™ block allows Parity operations common to SPI communications to be performed.

Block ID

GenericSPIDeviceParity

Library

motohawk_GenericSPI_lib

MotoHawk_lib/Device Specific/SPI Device Blocks

Description

This MotoHawk™ block allows Parity operations common to SPI communications to be performed.

Available operations are:

Insert Parity Bit

Will insert a parity bit based upon the desired parity (Even or Odd) at the desired bit location (LSBit is bit 0).

For example, a data value of 0xF0 that was to support Odd parity using bit 0 would lead to 0xF1 being generated as the output because the data has an even number of bits (4) that requires an additional set bit to meet an Odd parity requirement. Even parity would see the value of 0xF0 returned because the word already has an even number of bits.

The block is able to process a vector data stream.

Test Parity

Will test the data against the defined parity. A data value of 0xF0 would report TRUE if the value was supposed to have Even parity and FALSE if it was tested against Odd parity.

The block is able to process a vector data stream and will return a vector of boolean values.

Block Parameters

Parameter Field Values Comments/Description
Parity Function Drop-down list Selects the function to apply. Select either Insert Parity Bit or Test Parity.
Parity Drop-down list Selects the Parity to be considered. Odd parity implies the word under consideration has an odd number of bits set. Even parity implies the word under consideration has an even number of bits set.
Insertion Bit (LSBit=0) Integer Visible when the Insert Parity Bit function has been selected. This attribute defines where the Parity Bit is to be inserted into the word to achieve the desired parity. Selecting bit 0 implies that bit 0 of the word will be set or cleared depending upon the desired parity.
Transfer Word Size (Bytes) Drop-down list Defines the word size of the data.