3fdc5d1b583a0c31658fff31e0669993869294b2
[apps/agl-service-unicens.git] / ucs2-lib / inc / ucs_pmcmd.h
1 /*------------------------------------------------------------------------------------------------*/
2 /* UNICENS V2.1.0-3491                                                                            */
3 /* Copyright (c) 2017 Microchip Technology Germany II GmbH & Co. KG.                              */
4 /*                                                                                                */
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.                                                            */
9 /*                                                                                                */
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.                                                   */
14 /*                                                                                                */
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/>.                          */
17 /*                                                                                                */
18 /* You may also obtain this software under a propriety license from Microchip.                    */
19 /* Please contact Microchip for further information.                                              */
20 /*------------------------------------------------------------------------------------------------*/
21
22 /*!
23  * \file
24  * \brief Declaration of class CPmCommand
25  *
26  * \cond UCS_INTERNAL_DOC
27  * \addtogroup  G_PM_CMD
28  * @{
29  */
30
31 #ifndef UCS_PMCMD_H
32 #define UCS_PMCMD_H
33
34 /*------------------------------------------------------------------------------------------------*/
35 /* Includes                                                                                       */
36 /*------------------------------------------------------------------------------------------------*/
37 #include "ucs_types_cfg.h"
38 #include "ucs_memory.h"
39 #include "ucs_lldpool.h"
40 #include "ucs_pmp.h"
41
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46
47 /*------------------------------------------------------------------------------------------------*/
48 /* Class CPmCommand                                                                               */
49 /*------------------------------------------------------------------------------------------------*/
50 /*! \brief   Class CPmCommand  */
51 typedef struct CPmCommand_
52 {
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. */
58
59 } CPmCommand;
60
61
62 /*------------------------------------------------------------------------------------------------*/
63 /* Methods                                                                                        */
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);
74
75
76 #ifdef __cplusplus
77 }                                                   /* extern "C" */
78 #endif
79
80 #endif /* #ifndef UCS_PMCMD_H */
81
82 /*!
83  * @}
84  * \endcond
85  */
86
87 /*------------------------------------------------------------------------------------------------*/
88 /* End of file                                                                                    */
89 /*------------------------------------------------------------------------------------------------*/
90