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 Declaration of class CPmCommand
26 * \cond UCS_INTERNAL_DOC
27 * \addtogroup G_PM_CMD
34 /*------------------------------------------------------------------------------------------------*/
36 /*------------------------------------------------------------------------------------------------*/
37 #include "ucs_types_cfg.h"
38 #include "ucs_memory.h"
39 #include "ucs_lldpool.h"
47 /*------------------------------------------------------------------------------------------------*/
48 /* Class CPmCommand */
49 /*------------------------------------------------------------------------------------------------*/
50 /*! \brief Class CPmCommand */
51 typedef struct CPmCommand_
53 Lld_IntTxMsg_t tx_obj; /*!< \brief Required LLD Tx structure, must be first attribute */
54 uint8_t data[10]; /*!< \brief Reserved memory space */
55 Ucs_Mem_Buffer_t memory; /*!< \brief Public memory structure */
56 bool reserved; /*!< \brief \c true if the command is in use, otherwise \c false. */
57 bool trigger; /*!< \brief \c true if the command is triggered, otherwise \c false. */
62 /*------------------------------------------------------------------------------------------------*/
64 /*------------------------------------------------------------------------------------------------*/
65 extern void Pmcmd_Ctor(CPmCommand *self, Pmp_FifoId_t fifo, Pmp_MsgType_t type);
66 extern Ucs_Lld_TxMsg_t* Pmcmd_GetLldTxObject(CPmCommand *self);
67 extern bool Pmcmd_Reserve(CPmCommand *self);
68 extern void Pmcmd_Release(CPmCommand *self);
69 extern void Pmcmd_SetContent(CPmCommand *self, uint8_t sid, uint8_t ext_type,
70 uint8_t ext_code, uint8_t add_data_ptr[], uint8_t add_data_sz);
71 extern void Pmcmd_UpdateContent(CPmCommand *self, uint8_t sid, uint8_t ext_type, uint8_t ext_code);
72 extern void Pmcmd_SetTrigger(CPmCommand *self, bool trigger);
73 extern bool Pmcmd_IsTriggered(CPmCommand *self);
80 #endif /* #ifndef UCS_PMCMD_H */
87 /*------------------------------------------------------------------------------------------------*/
89 /*------------------------------------------------------------------------------------------------*/