AM243x MCU+ SDK  09.00.00
tsn_data.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 Texas Instruments Incorporated
3  * Copyright (c) 2023 Excelfore Corporation (https://excelfore.com)
4  *
5  * All rights reserved not granted herein.
6  * Limited License.
7  *
8  * Texas Instruments Incorporated grants a world-wide, royalty-free,
9  * non-exclusive license under copyrights and patents it now or hereafter
10  * owns or controls to make, have made, use, import, offer to sell and sell ("Utilize")
11  * this software subject to the terms herein. With respect to the foregoing patent
12  * license, such license is granted solely to the extent that any such patent is necessary
13  * to Utilize the software alone. The patent license shall not apply to any combinations which
14  * include this software, other than combinations with devices manufactured by or for TI ("TI Devices").
15  * No hardware patent is licensed hereunder.
16  *
17  * Redistributions must preserve existing copyright notices and reproduce this license (including the
18  * above copyright notice and the disclaimer and (if applicable) source code license limitations below)
19  * in the documentation and/or other materials provided with the distribution
20  *
21  * Redistribution and use in binary form, without modification, are permitted provided that the following
22  * conditions are met:
23  *
24  * * No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any
25  * software provided in binary form.
26  * * any redistribution and use are licensed by TI for use only with TI Devices.
27  * * Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.
28  *
29  * If software source code is provided to you, modification and redistribution of the source code are permitted
30  * provided that the following conditions are met:
31  *
32  * * any redistribution and use of the source code, including any resulting derivative works, are licensed by
33  * TI for use only with TI Devices.
34  * * any redistribution and use of any object code compiled from the source code and any resulting derivative
35  * works, are licensed by TI for use only with TI Devices.
36  *
37  * Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or
38  * promote products derived from this software without specific prior written permission.
39  *
40  * DISCLAIMER.
41  *
42  * THIS SOFTWARE IS PROVIDED BY TI AND TI"S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
43  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
44  * IN NO EVENT SHALL TI AND TI"S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
45  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
46  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
48  * POSSIBILITY OF SUCH DAMAGE.
49 */
50 #ifndef XL4_DATA_H_
51 #define XL4_DATA_H_
52 
53 #include "../uc_dbal.h"
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 enum {
68 };
69 
70 /* number of network devices never go beyond this number */
71 #define XL4_DATA_ABS_MAX_NETDEVS 16
72 
73 #define YANGINIT_GEN_SMEM yanginit_gen_smem
74 
75 typedef struct xl4_data_data xl4_data_data_t;
76 
77 typedef uint8_t (*get_enum_func)(char*);
78 typedef const char* (*get_string_func)(uint8_t);
79 
80 xl4_data_data_t *xl4_data_init(uc_dbald *dbald);
81 
82 void xl4_data_set_dbald(xl4_data_data_t *xdd, uc_dbald *dbald);
83 
85 
86 int xl4_data_lock(xl4_data_data_t *xdd, int tout_ms);
87 
89 
90 uint8_t xl4_data_get_enum(char *astr);
91 
97 get_enum_func xl4_extmod_get_enum_func(xl4_data_data_t *xdd, char *emodname, uint8_t emodid);
98 
104 get_string_func xl4_extmod_get_string_func(xl4_data_data_t *xdd, char *emodname, uint8_t emodid);
105 
106 const char *xl4_data_get_string(uint8_t anum);
107 
108 uint8_t xl4_data_get_modid(xl4_data_data_t *xdd, char *emodname);
109 
110 char *xl4_data_get_modname(xl4_data_data_t *xdd, uint8_t emodid);
111 
112 int xl4_data_set_xl4ext(xl4_data_data_t *xdd, char *emodname,
113  get_enum_func get_enum, get_string_func get_string);
114 
115 int xl4_data_remove_xl4ext(xl4_data_data_t *xdd, char *emodname);
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif
XL4_DATA_ENUM_END
@ XL4_DATA_ENUM_END
Definition: tsn_data.h:67
get_enum_func
uint8_t(* get_enum_func)(char *)
Definition: tsn_data.h:77
UC_READY
@ UC_READY
Definition: tsn_data.h:61
xl4_data_remove_xl4ext
int xl4_data_remove_xl4ext(xl4_data_data_t *xdd, char *emodname)
xl4_extmod_get_string_func
get_string_func xl4_extmod_get_string_func(xl4_data_data_t *xdd, char *emodname, uint8_t emodid)
get_string function from registered xl4-extmod
UC_LAST_DB_ACCESS
@ UC_LAST_DB_ACCESS
Definition: tsn_data.h:66
xl4_data_set_dbald
void xl4_data_set_dbald(xl4_data_data_t *xdd, uc_dbald *dbald)
xl4_data_init
xl4_data_data_t * xl4_data_init(uc_dbald *dbald)
UC_NOTICE_REG
@ UC_NOTICE_REG
Definition: tsn_data.h:63
xl4_data_get_modid
uint8_t xl4_data_get_modid(xl4_data_data_t *xdd, char *emodname)
xl4_data_get_modname
char * xl4_data_get_modname(xl4_data_data_t *xdd, uint8_t emodid)
UC_ASKACTION_REG
@ UC_ASKACTION_REG
Definition: tsn_data.h:62
get_string_func
const char *(* get_string_func)(uint8_t)
Definition: tsn_data.h:78
xl4_data_data_t
struct xl4_data_data xl4_data_data_t
Definition: tsn_data.h:75
YANG_VALUE_TYPES
@ YANG_VALUE_TYPES
Definition: tsn_data.h:60
XL4_EXTMOD_REG
@ XL4_EXTMOD_REG
Definition: tsn_data.h:65
xl4_data_get_string
const char * xl4_data_get_string(uint8_t anum)
xl4_data_lock
int xl4_data_lock(xl4_data_data_t *xdd, int tout_ms)
xl4_data_get_enum
uint8_t xl4_data_get_enum(char *astr)
xl4_data_set_xl4ext
int xl4_data_set_xl4ext(xl4_data_data_t *xdd, char *emodname, get_enum_func get_enum, get_string_func get_string)
xl4_data_close
void xl4_data_close(xl4_data_data_t *xdd)
xl4_extmod_get_enum_func
get_enum_func xl4_extmod_get_enum_func(xl4_data_data_t *xdd, char *emodname, uint8_t emodid)
get_enum function from registered xl4-extmod
xl4_data_unlock
void xl4_data_unlock(xl4_data_data_t *xdd)
UC_NOTICE_ACT
@ UC_NOTICE_ACT
Definition: tsn_data.h:64