summaryrefslogtreecommitdiffstats
path: root/app/images/meters/tacho_shift_D.svg
blob: 3c824c4ca5f09412b57b8239efa9b7ca686a8b9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   version="1.1"
   width="56"
   height="63"
   id="svg2">
  <metadata
     id="metadata8">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <defs
     id="defs6" />
  <image
     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA/CAYAAAC1gwumAAAABHNCSVQICAgIfAhkiAAABsJJREFU
aIHdm09oFFccx7/zZ5PNrrtqjMZNTLKxLbUVAwVBSrHQy1JoWoS1BP9UBS89eOut1F4kLZUee7At
Hoz/mpZAKIW2OTQUG6tQItik6G2ThRhFxZ111qgzeT3Meztv3s7s7GYnyZgv/Nhhs29mPvP7vd97
83svEiEEa1kqO5Akif9e8jheDhGP48ZPTIgNyEmCDSUBkLnjQK8vHBPuO/FzyRIBJc5kziTBGpEb
BLNF4Vhy+X1d8gKUASjUVDhhg5II5mVunq1ZPCDzDINTAUSoqfQ7GcF6UIQz6afBHZvc3yU4gX3l
5UEFQOTJkyej0Wj07aWSVJNpmpqu69OGYRQ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wAwgvIVA+oa1iHFdCxRhmPx3dW+3GpVGJZ
VlxnDCWguPgqK4qSrNbAMAwN9hTPoVABSvY6enk8u3jx4i6/dqVSKQ+P1eFQAVLxq8tKOp3u8WtQ
LBZn4b5gGh5A6j0GV4ZsbW31BczlcjcRdkAqfvlcBaB2dXW969cok8lcgROuDBkKQMF7MijcqVOn
ev3K+5qm/Y3Kil5Zqw4owPE11Mjx48c/9mt/9+7dCTiXuB0h2vDiy1LFgQF20YgVhZvOnTv3RiqV
+tDvPKOjo7/AKm9UwAEIrOi0BXbBh5XPvaycIWE94CZYVekkrDJ8J4CXayk2FQqFq7DWNjbR+24C
915IPHY61Sv+hr320ohbw9zCknkvOjc390UtS2u3bt26BKuWyjzI+l+gWZRff4h4GA/ArJlaeXEm
m82mHj16dKGW0CyVStN79uz5Gc49NRUhGoQH2c2zp6dAyGRwTr/cwjQyOTl5uK+v7xO/aRnTxMTE
V7Cq4CJgxc01KgbH9tmIG3YA936oDA4Opvfv3/9eT0/PQHNz87ZaLzg7O/t9JpMZhx2ey+fBoaGh
vSu1hA1YoXny5MlvYHmP73/uFYBGs+hKittpwdYjY7DXIyveG0kIS/eeMk1TGxkZOTwwMPAPbO95
hiZTNcDQ7HUulUrTHNxTOJNL9QIVWeNbufgkI1aUTbdksVIqFotXr127diaTyfwBe2HUN2uKErOo
YzFSluUVBTRNU7t///6v4+Pjlw4cOHADFhAzcd9oTbVTN8Dy+pwsy+J4Fpga2BBbUViqJon2P352
7zb1CsuWZr6d/4Vc+qAE5yyE3cBzrP6m9CWV891CFHA+LTYNW41/K3D7fV3yAgTs0FhT/xjideHl
lHi9QFVOMmtVL8xcdKn6H2LOty1lluFuAAAAAElFTkSuQmCC
"
     x="0"
     y="0"
     width="56"
     height="63"
     id="image10" />
</svg>
"cm"> * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * You may also obtain this software under a propriety license from Microchip. * Please contact Microchip for further information. * */ /*! * \file * \brief Implementation of message encoder * * \cond MNS_INTERNAL_DOC * \addtogroup G_ENCODER * @{ */ /*------------------------------------------------------------------------------------------------*/ /* Includes */ /*------------------------------------------------------------------------------------------------*/ #include "mns_encoder.h" #include "mns_misc.h" /*------------------------------------------------------------------------------------------------*/ /* Constants */ /*------------------------------------------------------------------------------------------------*/ #define ENC_LLR_TIME_DEFAULT 11U /*! \brief Default LLR time required to transmit valid messages * with ContentType 0x81 */ /*------------------------------------------------------------------------------------------------*/ /* Internal prototypes */ /*------------------------------------------------------------------------------------------------*/ static void Enc_Encode_00(Msg_MostTel_t *tel_ptr, uint8_t header[]); static void Enc_Decode_00(Msg_MostTel_t *tel_ptr, uint8_t header[]); static void Enc_Encode_80(Msg_MostTel_t *tel_ptr, uint8_t header[]); static void Enc_Decode_80(Msg_MostTel_t *tel_ptr, uint8_t header[]); static void Enc_Encode_81(Msg_MostTel_t *tel_ptr, uint8_t header[]); static void Enc_Decode_81(Msg_MostTel_t *tel_ptr, uint8_t header[]); /*------------------------------------------------------------------------------------------------*/ /* Implementation */ /*------------------------------------------------------------------------------------------------*/ /*! \brief Retrieves the interface of a specific encoder * \details Creates all encoder interfaces as singletons * \param type Specifies the type of encoder to retrieve * \return The desired interface to the specified encoder */ IEncoder *Enc_GetEncoder(Enc_MsgContent_t type) { static IEncoder enc_content_00 = {ENC_CONTENT_00, 8U, 12U, &Enc_Encode_00, &Enc_Decode_00}; static IEncoder enc_content_80 = {ENC_CONTENT_80, 6U, 11U, &Enc_Encode_80, &Enc_Decode_80}; static IEncoder enc_content_81 = {ENC_CONTENT_81, 6U, 13U, &Enc_Encode_81, &Enc_Decode_81}; IEncoder *encoder_ptr = NULL; switch (type) { case ENC_CONTENT_00: encoder_ptr = &enc_content_00; break; case ENC_CONTENT_80: encoder_ptr = &enc_content_80; break; case ENC_CONTENT_81: encoder_ptr = &enc_content_81; break; default: encoder_ptr = NULL; break; } return encoder_ptr; } /*------------------------------------------------------------------------------------------------*/ /* Content type "00" */ /*------------------------------------------------------------------------------------------------*/ /*! \brief Encodes a message telegram to the "ContentType 0x00" MOST message header * \param tel_ptr Reference to the Msg_MostTel_t structure * \param header The header buffer */ static void Enc_Encode_00(Msg_MostTel_t *tel_ptr, uint8_t header[]) { header[0] = MISC_HB(tel_ptr->source_addr); header[1] = MISC_LB(tel_ptr->source_addr); header[2] = MISC_HB(tel_ptr->destination_addr); header[3] = MISC_LB(tel_ptr->destination_addr); header[4] = tel_ptr->id.fblock_id; header[5] = tel_ptr->id.instance_id; header[6] = MISC_HB(tel_ptr->id.function_id); header[7] = MISC_LB(tel_ptr->id.function_id); header[8] = (uint8_t)(tel_ptr->tel.tel_id << 4) | (uint8_t)((uint8_t)tel_ptr->id.op_type & 0xFU); header[9] = tel_ptr->opts.llrbc; header[10] = tel_ptr->tel.tel_cnt; header[11] = tel_ptr->tel.tel_len; } /*! \brief Decodes a "ContentType 0x00" MOST message header to a message telegram structure * \param tel_ptr Reference to the Msg_MostTel_t structure * \param header The header buffer */ static void Enc_Decode_00(Msg_MostTel_t *tel_ptr, uint8_t header[]) { tel_ptr->source_addr = (uint16_t)((uint16_t)header[0] << 8) | (uint16_t)header[1]; tel_ptr->destination_addr = (uint16_t)((uint16_t)header[2] << 8) | (uint16_t)header[3]; tel_ptr->id.fblock_id = header[4]; tel_ptr->id.instance_id = header[5]; tel_ptr->id.function_id = (uint16_t)((uint16_t)header[6] << 8) | (uint16_t)header[7]; tel_ptr->tel.tel_id = header[8] >> 4; /* high nibble: TelId */ tel_ptr->id.op_type = (Mns_OpType_t)(header[8] & 0x0FU); /* low nibble: OPType */ tel_ptr->opts.llrbc = header[9]; tel_ptr->tel.tel_cnt = header[10]; tel_ptr->tel.tel_len = header[11]; tel_ptr->tel.tel_data_ptr = &header[12]; } /*------------------------------------------------------------------------------------------------*/ /* Content type "0x80" */ /*------------------------------------------------------------------------------------------------*/ /*! \brief Encodes a message telegram to the "ContentType 0x80" MOST message header * \param tel_ptr Reference to the Msg_MostTel_t structure * \param header The header buffer */ static void Enc_Encode_80(Msg_MostTel_t *tel_ptr, uint8_t header[]) { /* high nibble: TelId low nibble: OPType */ header[0] = (uint8_t)(tel_ptr->tel.tel_id << 4) | (uint8_t)((uint8_t)tel_ptr->id.op_type & 0xFU); header[1] = tel_ptr->tel.tel_cnt; header[2] = tel_ptr->tel.tel_len; header[3] = MISC_HB(tel_ptr->id.function_id); header[4] = MISC_LB(tel_ptr->id.function_id); header[5] = MISC_HB(tel_ptr->source_addr); header[6] = MISC_LB(tel_ptr->source_addr); header[7] = MISC_HB(tel_ptr->destination_addr); header[8] = MISC_LB(tel_ptr->destination_addr); header[9] = tel_ptr->id.fblock_id; header[10] = tel_ptr->id.instance_id; } /*! \brief Decodes a "ContentType 0x80" MOST message header to a message telegram structure * \param tel_ptr Reference to the Msg_MostTel_t structure * \param header The header buffer */ static void Enc_Decode_80(Msg_MostTel_t *tel_ptr, uint8_t header[]) { tel_ptr->tel.tel_id = header[0] >> 4; /* high nibble: TelId */ tel_ptr->id.op_type = (Mns_OpType_t)(header[0] & 0x0FU); /* low nibble: OPType */ tel_ptr->tel.tel_cnt = header[1]; tel_ptr->tel.tel_len = header[2]; tel_ptr->id.function_id = (uint16_t)((uint16_t)header[3] << 8) | (uint16_t)header[4]; tel_ptr->source_addr = (uint16_t)((uint16_t)header[5] << 8) | (uint16_t)header[6]; tel_ptr->destination_addr = (uint16_t)((uint16_t)header[7] << 8) | (uint16_t)header[8]; tel_ptr->id.fblock_id = header[9]; tel_ptr->id.instance_id = header[10]; tel_ptr->tel.tel_data_ptr = &header[11]; } /*------------------------------------------------------------------------------------------------*/ /* Content type "0x81" */ /*------------------------------------------------------------------------------------------------*/ /*! \brief Encodes a message telegram to the "ContentType 0x81" MOST message header * \param tel_ptr Reference to the Msg_MostTel_t structure * \param header The header buffer */ static void Enc_Encode_81(Msg_MostTel_t *tel_ptr, uint8_t header[]) { header[0] = tel_ptr->opts.llrbc; header[1] = ENC_LLR_TIME_DEFAULT; /* high nibble: TelId low nibble: OPType */ header[2] = (uint8_t)(tel_ptr->tel.tel_id << 4) | (uint8_t)((uint8_t)tel_ptr->id.op_type & 0xFU); header[3] = tel_ptr->tel.tel_cnt; header[4] = tel_ptr->tel.tel_len; header[5] = MISC_HB(tel_ptr->id.function_id); header[6] = MISC_LB(tel_ptr->id.function_id); header[7] = MISC_HB(tel_ptr->source_addr); header[8] = MISC_LB(tel_ptr->source_addr); header[9] = MISC_HB(tel_ptr->destination_addr); header[10] = MISC_LB(tel_ptr->destination_addr); header[11] = tel_ptr->id.fblock_id; header[12] = tel_ptr->id.instance_id; } /*! \brief Decodes a "ContentType 0x81" MOST message header to a message telegram structure * \param tel_ptr Reference to the Msg_MostTel_t structure * \param header The header buffer */ static void Enc_Decode_81(Msg_MostTel_t *tel_ptr, uint8_t header[]) { tel_ptr->opts.llrbc = header[0]; tel_ptr->tel.tel_id = header[2] >> 4; /* high nibble: TelId */ tel_ptr->id.op_type = (Mns_OpType_t)(header[2] & 0x0FU); /* low nibble: OPType */ tel_ptr->tel.tel_cnt = header[3]; tel_ptr->tel.tel_len = header[4]; tel_ptr->id.function_id = (uint16_t)((uint16_t)header[5] << 8) | (uint16_t)header[6]; tel_ptr->source_addr = (uint16_t)((uint16_t)header[7] << 8) | (uint16_t)header[8]; tel_ptr->destination_addr = (uint16_t)((uint16_t)header[9] << 8) | (uint16_t)header[10]; tel_ptr->id.fblock_id = header[11]; tel_ptr->id.instance_id = header[12]; tel_ptr->tel.tel_data_ptr = &header[13]; } /*! * @} * \endcond */ /*------------------------------------------------------------------------------------------------*/ /* End of file */ /*------------------------------------------------------------------------------------------------*/