MCS3142 Dual K
EE
L
OQ®
Encoder Wireless Remote Control Development Kit User’s Guide
DS40001746A-page 28
2014 Microchip Technology Inc.
6.3.1
Software Design
The software was written so that a developer can easily use it. All of the K
EE
L
OQ
decoding is abstracted away from the developer, leaving the important properties of the
final result to the developer. The following figure shows a top-level diagram of the
software layout.
FIGURE 6-1:
BLOCK DIAGRAM DESIGN OF THE SOFTWARE ON THE TARGET
CONTROLLER
Encoder Mediator
This file contains the place where custom code can be entered after the algorithm is
done checking for a valid response.
EXAMPLE 6-1:
K
EE
L
OQ
MEDIATOR CODE SNIPPET
if
(Decode_Classic_KeeLoq(&inData) != NOT_VALID_PACKET) {
//Custom code to interpret a valid Classic Keeloq Packet.
}
else if
(Decode_Advanced_KeeLoq(&inData) != NOT_VALID_PACKET) {
//Custom code to interpret a valid Advanced Keeloq Packet.
}
else if
(Decode_Ultimate_KeeLoq(&inData) != NOT_VALID_PACKET) {
//Custom code to interpret a valid Ultimate Keeloq Packet.
}
else
{
validated_packet.type = INVALID_ENCODER;
}