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 Public header file of the Node Script Management.
30 /*------------------------------------------------------------------------------------------------*/
32 /*------------------------------------------------------------------------------------------------*/
33 #include "ucs_rules.h"
34 #include "ucs_rm_pv.h"
41 /*------------------------------------------------------------------------------------------------*/
43 /*------------------------------------------------------------------------------------------------*/
44 /*! \brief Result codes of the Node Script Management.
45 * \ingroup G_UCS_SCRIPTING
47 typedef enum Ucs_Ns_ResultCode_
49 UCS_NS_RES_SUCCESS = 0x00U, /*!< \brief Transmission of script(s) was successful. */
50 UCS_NS_RES_ERROR = 0x01U /*!< \brief Transmission of script(s) failed. */
52 } Ucs_Ns_ResultCode_t;
54 /*------------------------------------------------------------------------------------------------*/
56 /*------------------------------------------------------------------------------------------------*/
57 /*! \brief Structure of a ConfigMsg used in Node-Script.
58 * \ingroup G_UCS_SCRIPTING
60 typedef struct Ucs_Ns_ConfigMsg_
62 /*! \brief FBlockId of the config msg. */
64 /*! \brief InstId of the config msg. */
66 /*! \brief FunktId of the config msg. */
68 /*! \brief OpCode of the config msg. */
70 /*! \brief Data length. */
72 /*! \brief Reference to the Data */
77 /*! \brief Structure of a node-script used to configure a remote node.
78 * \attention The Node Scripting module is designed and intended for the use of \b I2C and \b GPIO commands only. That is, using the Scripting for any other FBlock INIC commands
79 * (for example MOST, MediaLB, USB, Streaming, Connections, etc.) is expressly \b prohibited.
80 * \ingroup G_UCS_SCRIPTING
82 typedef struct Ucs_Ns_Script_
84 /*! \brief Specifies the pause which shall be set before sending
85 * the configuration message.
88 /*! \brief Command to be transmitted. */
89 Ucs_Ns_ConfigMsg_t * send_cmd;
90 /*! \brief Expected result. */
91 Ucs_Ns_ConfigMsg_t * exp_result;
95 /*! \brief Configuration structure of a Node.
97 * \attention Use the \ref UCS_ADDR_LOCAL_DEV macro to address your local device when specifying routes to/from It.
98 * \n The following address ranges are supported:
100 * - [0x500 ... 0xFEF]
101 * - UCS_ADDR_LOCAL_DEV
102 * \ingroup G_UCS_ROUTING_TYPES
104 typedef struct Ucs_Rm_Node_
106 /*! \brief node signature. */
107 Ucs_Signature_t * signature_ptr;
108 /*! \brief Reference to a list of configuration scripts. */
109 Ucs_Ns_Script_t * script_list_ptr;
110 /*! \brief size of the scripts table. */
111 uint8_t script_list_size;
112 /*! \brief Internal information of this node object. */
113 Ucs_Rm_NodeInt_t internal_infos;
117 /*------------------------------------------------------------------------------------------------*/
118 /* Type definitions */
119 /*------------------------------------------------------------------------------------------------*/
120 /*! \brief Function signature used for the results of the Scripting Manager.
121 * \param node_ptr Reference to the node instance
122 * \param result Result of the scripting operation.
123 * \param ucs_user_ptr User reference for API callback functions.
124 * \ingroup G_UCS_SCRIPTING
126 typedef void (*Ucs_Ns_ResultCb_t)(Ucs_Rm_Node_t * node_ptr, Ucs_Ns_ResultCode_t result, void *ucs_user_ptr);
132 #endif /* #ifndef UCS_NSM_PB_H */
133 /*------------------------------------------------------------------------------------------------*/
135 /*------------------------------------------------------------------------------------------------*/