le_gpioCfg_interface.h

Go to the documentation of this file.
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 /** @addtogroup le_gpioCfg le_gpioCfg API Reference
50  * @{
51  * @file le_gpioCfg_common.h
52  * @file le_gpioCfg_interface.h **/
53 //--------------------------------------------------------------------------------------------------
54 /**
55  * Type for handler called when a server disconnects.
56  */
57 //--------------------------------------------------------------------------------------------------
58 typedef void (*le_gpioCfg_DisconnectHandler_t)(void *);
59 
60 //--------------------------------------------------------------------------------------------------
61 /**
62  *
63  * Connect the current client thread to the service providing this API. Block until the service is
64  * available.
65  *
66  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
67  * called before any other functions in this API. Normally, ConnectService is automatically called
68  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
69  *
70  * This function is created automatically.
71  */
72 //--------------------------------------------------------------------------------------------------
74 (
75  void
76 );
77 
78 //--------------------------------------------------------------------------------------------------
79 /**
80  *
81  * Try to connect the current client thread to the service providing this API. Return with an error
82  * if the service is not available.
83  *
84  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
85  * called before any other functions in this API. Normally, ConnectService is automatically called
86  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
87  *
88  * This function is created automatically.
89  *
90  * @return
91  * - LE_OK if the client connected successfully to the service.
92  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
93  * bound.
94  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
95  * - LE_COMM_ERROR if the Service Directory cannot be reached.
96  */
97 //--------------------------------------------------------------------------------------------------
99 (
100  void
101 );
102 
103 //--------------------------------------------------------------------------------------------------
104 /**
105  * Set handler called when server disconnection is detected.
106  *
107  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
108  * to continue without exiting, it should call longjmp() from inside the handler.
109  */
110 //--------------------------------------------------------------------------------------------------
112 (
113  le_gpioCfg_DisconnectHandler_t disconnectHandler,
114  void *contextPtr
115 );
116 
117 //--------------------------------------------------------------------------------------------------
118 /**
119  *
120  * Disconnect the current client thread from the service providing this API.
121  *
122  * Normally, this function doesn't need to be called. After this function is called, there's no
123  * longer a connection to the service, and the functions in this API can't be used. For details, see
124  * @ref apiFilesC_client.
125  *
126  * This function is created automatically.
127  */
128 //--------------------------------------------------------------------------------------------------
130 (
131  void
132 );
133 
134 
135 //--------------------------------------------------------------------------------------------------
136 /**
137  * Get the current number of GPIO pins in the system
138  *
139  * @return The current configured value
140  */
141 //--------------------------------------------------------------------------------------------------
143 (
144  void
145 );
146 
147 //--------------------------------------------------------------------------------------------------
148 /**
149  * Get the current number of GPIO pins in the system
150  *
151  * @return The current configured value
152  */
153 //--------------------------------------------------------------------------------------------------
155 (
156  uint32_t gpioId
157  ///< [IN] GPIO ID being examined
158 );
159 
160 //--------------------------------------------------------------------------------------------------
161 /**
162  * Get list of supported GPIOs. If GPIO01, GPIO03 and GPIO05 are supported,
163  * the returned list will look like {1, 5, 7}
164  *
165  * @return
166  * - LE_OK on success
167  * - LE_FAULT on failure
168  */
169 //--------------------------------------------------------------------------------------------------
171 (
172  uint32_t* retListPtr,
173  ///< [OUT] User allocated buffer where results will be stored
174  size_t* retListSizePtr
175  ///< [INOUT]
176 );
177 
178 /** @} **/
179 
180 #endif // LE_GPIOCFG_INTERFACE_H_INCLUDE_GUARD
void le_gpioCfg_DisconnectService(void)
le_result_t
Definition: le_basics.h:46
void(* le_gpioCfg_DisconnectHandler_t)(void *)
Definition: le_gpioCfg_interface.h:58
LE_FULL_API void le_gpioCfg_SetServerDisconnectHandler(le_gpioCfg_DisconnectHandler_t disconnectHandler, void *contextPtr)
uint32_t le_gpioCfg_GetTotalPinNumber(void)
void le_gpioCfg_ConnectService(void)
le_result_t le_gpioCfg_TryConnectService(void)
#define LE_FULL_API
Definition: le_apiFeatures.h:40
le_result_t le_gpioCfg_GetSupportedGpioList(uint32_t *retListPtr, size_t *retListSizePtr)
bool le_gpioCfg_IsAvailable(uint32_t gpioId)