1 /*------------------------------------------------------------------------------------------------*/
2 /* UNICENS V2.1.0-3491 */
3 /* Copyright (c) 2017 Microchip Technology Germany II GmbH & Co. KG. */
5 /* This program is free software: you can redistribute it and/or modify */
6 /* it under the terms of the GNU General Public License as published by */
7 /* the Free Software Foundation, either version 2 of the License, or */
8 /* (at your option) any later version. */
10 /* This program is distributed in the hope that it will be useful, */
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
13 /* GNU General Public License for more details. */
15 /* You should have received a copy of the GNU General Public License */
16 /* along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 /* You may also obtain this software under a propriety license from Microchip. */
19 /* Please contact Microchip for further information. */
20 /*------------------------------------------------------------------------------------------------*/
24 * \brief Internal header file of the Command Decoder Module.
26 * \cond UCS_INTERNAL_DOC
27 * \addtogroup G_DEC_INT
34 /*------------------------------------------------------------------------------------------------*/
36 /*------------------------------------------------------------------------------------------------*/
38 #include "ucs_message.h"
39 /*#include "ucs_ams.h"*/
46 /*------------------------------------------------------------------------------------------------*/
48 /*------------------------------------------------------------------------------------------------*/
49 /*! \brief Stores FktID and OPType in one 16 bit value */
50 #define DEC_FKTOP(a,b) ((uint16_t)((((uint16_t)((a)<<4)) & (uint16_t)0xFFF0)) | ((uint16_t)(((uint16_t)(b)) & (uint16_t)0x000F))) /* parasoft-suppress MISRA2004-19_7 "Is used in arrays and therefore cannot be converted to inline function." */
52 /*! \brief Denotes the end of an FktOp table */
53 #define DEC_FKTOP_TERMINATION 0xFFFFU
55 /*------------------------------------------------------------------------------------------------*/
57 /*------------------------------------------------------------------------------------------------*/
58 /*! \brief Return codes used for decoding functions */
59 /* Attention: these values are used as error descriptor in error messages and
60 must therefore not changed!
62 typedef enum Dec_Return_
64 DEC_RET_SUCCESS = 0x00, /*!< \brief Operation successfully completed */
65 DEC_RET_FKTID_NOT_FOUND = 0x03, /*!< \brief FunctionID not found */
66 DEC_RET_OPTYPE_NOT_FOUND = 0x04 /*!< \brief Operation Type not found */
71 /*------------------------------------------------------------------------------------------------*/
73 /*------------------------------------------------------------------------------------------------*/
74 typedef void (*Dec_IcmCb_t)(void *self, Msg_MostTel_t *msg_ptr);
75 typedef void (*Dec_RcmCb_t)(void *self, Msg_MostTel_t *msg_ptr);
80 /*------------------------------------------------------------------------------------------------*/
82 /*------------------------------------------------------------------------------------------------*/
83 /*! \brief Structure of an FktID_OpType element for FBlock INIC */
84 typedef struct Dec_FktOpIcm_
86 /*!< \brief FktID and OPType (combined to a 16-bit value) */
88 /*!< \brief pointer to the belonging handler function */
89 Dec_IcmCb_t handler_function_ptr;
93 /*! \brief Structure of an FktID_OpType element for internal INIC Shadow FBlocks e.g. FBlock EXC*/
94 typedef struct Dec_FktOpIsh_
96 /*! \brief FktID and OPType (combined to a 16-bit value) */
98 /*! \brief pointer to the belonging handler function */
99 Dec_RcmCb_t handler_function_ptr;
104 /*------------------------------------------------------------------------------------------------*/
106 /*------------------------------------------------------------------------------------------------*/
107 extern Dec_Return_t Dec_SearchFktOpIcm(Dec_FktOpIcm_t const list[], uint16_t *index_ptr,
108 uint16_t function_id, Ucs_OpType_t op_type);
109 extern Dec_Return_t Dec_SearchFktOpIsh(Dec_FktOpIsh_t const list[], uint16_t *index_ptr,
110 uint16_t function_id, Ucs_OpType_t op_type);
116 #endif /* #ifndef UCS_DEC_H */
123 /*------------------------------------------------------------------------------------------------*/
125 /*------------------------------------------------------------------------------------------------*/