le_gpioCfg_interface.h

1 
2 
3 /*
4  * ====================== WARNING ======================
5  *
6  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
7  * DO NOT MODIFY IN ANY WAY.
8  *
9  * ====================== WARNING ======================
10  */
11 
12 /**
13  * @page c_gpioCfg GPIO configuration services
14  *
15  * @ref le_gpioCfg_interface.h "GPIO configuration API Reference" <br>
16  *
17  * <HR>
18  *
19  * This API is used by apps to provide user info on general-purpose digital input/output pins.
20  * The following functions are used to get the informatin on GPIO configuration:
21  * - GetTotalPinNumber() - Returns total available number of GPIO pins inti he system
22  * - IsAvailable() - Is the GPIO available
23  * - GetSupportedGpioList() - Returns the list of available GPIO pins
24  *
25  * @section bindings Using Bindings
26  *
27  * To create a binding from your app to pin 22 of the GPIO service,
28  * add something like this to your @c .adef binding section:
29  *
30  * @verbatim
31 bindings:
32 {
33  gpioServiceTest.gpioServiceTestComponent.le_gpioCfg -> gpioService.le_gpioCfg
34 }
35 @endverbatim
36  *
37  *
38  * Copyright (C) Sierra Wireless Inc.
39  */
40 
41 #ifndef LE_GPIOCFG_INTERFACE_H_INCLUDE_GUARD
42 #define LE_GPIOCFG_INTERFACE_H_INCLUDE_GUARD
43 
44 
45 #include "legato.h"
46 
47 // Internal includes for this interface
48 #include "le_gpioCfg_common.h"
49 //--------------------------------------------------------------------------------------------------
50 /**
51  * Type for handler called when a server disconnects.
52  */
53 //--------------------------------------------------------------------------------------------------
54 typedef void (*le_gpioCfg_DisconnectHandler_t)(void *);
55 
56 //--------------------------------------------------------------------------------------------------
57 /**
58  *
59  * Connect the current client thread to the service providing this API. Block until the service is
60  * available.
61  *
62  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
63  * called before any other functions in this API. Normally, ConnectService is automatically called
64  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
65  *
66  * This function is created automatically.
67  */
68 //--------------------------------------------------------------------------------------------------
69 void le_gpioCfg_ConnectService
70 (
71  void
72 );
73 
74 //--------------------------------------------------------------------------------------------------
75 /**
76  *
77  * Try to connect the current client thread to the service providing this API. Return with an error
78  * if the service is not available.
79  *
80  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
81  * called before any other functions in this API. Normally, ConnectService is automatically called
82  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
83  *
84  * This function is created automatically.
85  *
86  * @return
87  * - LE_OK if the client connected successfully to the service.
88  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
89  * bound.
90  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
91  * - LE_COMM_ERROR if the Service Directory cannot be reached.
92  */
93 //--------------------------------------------------------------------------------------------------
94 le_result_t le_gpioCfg_TryConnectService
95 (
96  void
97 );
98 
99 //--------------------------------------------------------------------------------------------------
100 /**
101  * Set handler called when server disconnection is detected.
102  *
103  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
104  * to continue without exiting, it should call longjmp() from inside the handler.
105  */
106 //--------------------------------------------------------------------------------------------------
107 LE_FULL_API void le_gpioCfg_SetServerDisconnectHandler
108 (
109  le_gpioCfg_DisconnectHandler_t disconnectHandler,
110  void *contextPtr
111 );
112 
113 //--------------------------------------------------------------------------------------------------
114 /**
115  *
116  * Disconnect the current client thread from the service providing this API.
117  *
118  * Normally, this function doesn't need to be called. After this function is called, there's no
119  * longer a connection to the service, and the functions in this API can't be used. For details, see
120  * @ref apiFilesC_client.
121  *
122  * This function is created automatically.
123  */
124 //--------------------------------------------------------------------------------------------------
125 void le_gpioCfg_DisconnectService
126 (
127  void
128 );
129 
130 
131 //--------------------------------------------------------------------------------------------------
132 /**
133  * Get the current number of GPIO pins in the system
134  *
135  * @return The current configured value
136  */
137 //--------------------------------------------------------------------------------------------------
138 uint32_t le_gpioCfg_GetTotalPinNumber
139 (
140  void
141 );
142 
143 //--------------------------------------------------------------------------------------------------
144 /**
145  * Get the current number of GPIO pins in the system
146  *
147  * @return The current configured value
148  */
149 //--------------------------------------------------------------------------------------------------
150 bool le_gpioCfg_IsAvailable
151 (
152  uint32_t gpioId
153  ///< [IN] GPIO ID being examined
154 );
155 
156 //--------------------------------------------------------------------------------------------------
157 /**
158  * Get list of supported GPIOs. If GPIO01, GPIO03 and GPIO05 are supported,
159  * the returned list will look like {1, 5, 7}
160  *
161  * @return
162  * - LE_OK on success
163  * - LE_FAULT on failure
164  */
165 //--------------------------------------------------------------------------------------------------
166 le_result_t le_gpioCfg_GetSupportedGpioList
167 (
168  uint32_t* retListPtr,
169  ///< [OUT] User allocated buffer where results will be stored
170  size_t* retListSizePtr
171  ///< [INOUT]
172 );
173 
174 #endif // LE_GPIOCFG_INTERFACE_H_INCLUDE_GUARD
le_result_t
Definition: le_basics.h:45
#define LE_FULL_API
Definition: le_apiFeatures.h:40