FreeCalypso > hg > fc-magnetite
comparison src/cs/services/lls/lls_api.c @ 0:945cf7f506b2
src/cs: chipsetsw import from tcs211-fcmodem
binary blobs and LCD demo files have been excluded,
all line endings are LF only
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 25 Sep 2016 22:50:11 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:945cf7f506b2 |
---|---|
1 /** | |
2 * @file lls_api.c | |
3 * | |
4 * Implementation of Functions. | |
5 * | |
6 * @author Laurent Sollier (l-sollier@ti.com) | |
7 * @version 0.1 | |
8 */ | |
9 | |
10 /* | |
11 * History: | |
12 * | |
13 * Date Author Modification | |
14 * ---------------------------------------- | |
15 * 03/12/2002 L Sollier Create | |
16 * | |
17 * | |
18 * (C) Copyright 2002 by Texas Instruments Incorporated, All Rights Reserved | |
19 */ | |
20 | |
21 #ifndef _WINDOWS | |
22 #include "l1sw.cfg" | |
23 #include "chipset.cfg" | |
24 #endif | |
25 | |
26 #include "lls/lls_api.h" | |
27 #include "lls/lls_env.h" | |
28 #include "lls/lls_i.h" | |
29 | |
30 | |
31 /** External declaration */ | |
32 extern T_LLS_ENV_CTRL_BLK* lls_env_ctrl_blk; | |
33 | |
34 | |
35 /** | |
36 * @name Functions implementation | |
37 * | |
38 */ | |
39 /*@{*/ | |
40 | |
41 | |
42 /** | |
43 * function: lls_switch_on | |
44 */ | |
45 T_RV_RET lls_switch_on(T_LLS_EQUIPMENT equipment_sort) | |
46 { | |
47 #if (ANLG_FAM == 2) | |
48 T_RV_RET ret = RV_OK; | |
49 UINT8 equipment_index; | |
50 | |
51 /* Check if initialization has been correctly done */ | |
52 if ( (lls_env_ctrl_blk == 0) || (lls_env_ctrl_blk->swe_is_initialized == FALSE) ) | |
53 { | |
54 LLS_SEND_TRACE("LLS: Initialization is not yet done or failed", RV_TRACE_LEVEL_ERROR); | |
55 return RV_INTERNAL_ERR; | |
56 } | |
57 | |
58 LLS_SEND_TRACE_PARAM("LLS: Switch ON request for equipment", equipment_sort, RV_TRACE_LEVEL_DEBUG_HIGH); | |
59 | |
60 /* Retrieve index of the equipment in the table */ | |
61 ret = lls_search_index(equipment_sort, &equipment_index); | |
62 | |
63 if (ret != RV_OK) | |
64 { | |
65 LLS_SEND_TRACE("LLS: Equipment is unknow", RV_TRACE_LEVEL_ERROR); | |
66 return ret; | |
67 } | |
68 | |
69 ret = lls_manage_equipment(equipment_index, SWITCH_ON); | |
70 | |
71 return ret; | |
72 | |
73 #else | |
74 return RV_NOT_SUPPORTED; | |
75 #endif | |
76 } | |
77 | |
78 /** | |
79 * function: lls_switch_off | |
80 * | |
81 */ | |
82 T_RV_RET lls_switch_off(T_LLS_EQUIPMENT equipment_sort) | |
83 { | |
84 #if (ANLG_FAM == 2) | |
85 T_RV_RET ret = RV_OK; | |
86 UINT8 equipment_index; | |
87 | |
88 /* Check if initialization has been correctly done */ | |
89 if ( (lls_env_ctrl_blk == 0) || (lls_env_ctrl_blk->swe_is_initialized == FALSE) ) | |
90 { | |
91 LLS_SEND_TRACE("LLS: Initialization is not yet done or failed", RV_TRACE_LEVEL_ERROR); | |
92 return RV_INTERNAL_ERR; | |
93 } | |
94 | |
95 LLS_SEND_TRACE_PARAM("LLS: Switch OFF request for equipment", equipment_sort, RV_TRACE_LEVEL_DEBUG_HIGH); | |
96 | |
97 /* Retrieve index of the equipment in the table */ | |
98 ret = lls_search_index(equipment_sort, &equipment_index); | |
99 | |
100 if (ret != RV_OK) | |
101 { | |
102 LLS_SEND_TRACE("LLS: Equipment is unknow", RV_TRACE_LEVEL_ERROR); | |
103 return ret; | |
104 } | |
105 | |
106 ret = lls_manage_equipment(equipment_index, SWITCH_OFF); | |
107 | |
108 return ret; | |
109 | |
110 #else | |
111 return RV_NOT_SUPPORTED; | |
112 #endif | |
113 } | |
114 | |
115 | |
116 /*@}*/ |