LPC43xx SGPIO Pattern Match Mode

本文深入探讨了模式匹配功能,包括其在检测启动代码等场景的应用。详细解释了如何通过编程REG_SS来实现模式匹配,以及匹配模式时的注意事项,如在特定位置不交换REG和REG_SS、设置MATCH_MODE位等。同时,介绍了支持掩码匹配的四个关键片(A、H、I和P),并提供了掩码设置的实例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

模式匹配

所有位串均具有模式匹配功能。

该功能可用于检测启动代码等。要使用该功能,则必须用需匹配的模式来对REG_SS 编程

(请注意, POS 达到零时 REG_SS 不会与 REG  交换!)

MATCH_MODE 位必须设为1。

输入数据 REG 现在与已编程的模式 REG_SS 相比较。发现匹配时会提出模式匹配中断。

Bit MATCH_MODE selects whether the match filter is active or whether data is captured.

Only slice A, H, I, and P support matching with a mask (register MASK_x).

For other slices the pattern is not masked.

匹配掩码

四个位串(A、H、I 和P)同样支持对模式的掩码;必须设置MASK_x 以便对模式位进行比较(‘1’表示比较)。

例如,寻找模式0x1234.xxxx.5678.9ABC 时,

REG 应设置为0x1234.xxxx.5678.9ABC,

MASK 设置为0xFFFF.0000.FFFF.FFFF。

When using the data match interrupt bit 0 has to be high.

When using data match mode, the slice’s shadow register [ REG_SS ] should hold the pattern to be matched.

In addition, when data match is enabled the main register [ REG ] and the shadow register [ REG_SS ] will not exchange when FIFO is done with input or output data.

Pattern match

All slices feature pattern match functionality.

This can be used for example to detect a start code.

To use this functionality, REG_SS must be programmed with the pattern to be matched
(Note that REG_SS will not be swapped with REG when POS reaches zero!).

The MATCH_MODE bit must be set to 1.

The input data is now compared to the programmed pattern.

When a match is found the pattern match interrupt is raised.

Four slices (A, H, I and P) also support masking the pattern; MASK_x must be set for the pattern bits to be compared (1 is compare).

E.g. when looking for pattern 0x1234 XXXX, then REG_SS should be set to 0x1234 XXXX and MASK to 0xFFFF 0000.

0x1234 xxxx -- REG
0x1234 0000 -- REG_SS
0xFFFF 0000 -- MASK

MASK_A, MASK_H, MASK_I, MASK_P

The mask registers are used for the “on pattern match” interrupts.

With some slices it is possible to mask the data for the pattern match interrupts. Slices A, H, I and P support this function.

Every bit that is 1 in this register will be masked.

If this register contains the value 0b00001111 the first 4 bits will be masked for the pattern interrupt.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值