le_adc_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_adc ADC Channel API
14  *
15  * @ref le_adc_interface.h "API Reference" <br>
16  * @ref platformConstraintsAdc Constraints
17  *
18  * <HR>
19  *
20  * This API provides definitions for reading ADC inputs.
21  *
22  * le_adc_ReadValue() returns the value read from an ADC channel. It takes two arguments:
23  * - The first is the name of the ADC channel to read.
24  * - The second is used to return the value read.
25  *
26  * @warning Ensure to check the list of supported ADC channels on your specific platform before
27  * calling the le_adc_ReadValue() function. Please refer to @subpage platformConstraintsAdc page.
28  *
29  * <HR>
30  *
31  * Copyright (C) Sierra Wireless Inc.
32  */
33 /**
34  * @file le_adc_interface.h
35  *
36  * Legato @ref c_adc include file.
37  *
38  * Copyright (C) Sierra Wireless Inc.
39  */
40 
41 #ifndef LE_ADC_INTERFACE_H_INCLUDE_GUARD
42 #define LE_ADC_INTERFACE_H_INCLUDE_GUARD
43 
44 
45 #include "legato.h"
46 
47 // Internal includes for this interface
48 #include "le_adc_common.h"
49 /** @addtogroup le_adc le_adc API Reference
50  * @{
51  * @file le_adc_common.h
52  * @file le_adc_interface.h **/
53 //--------------------------------------------------------------------------------------------------
54 /**
55  * Type for handler called when a server disconnects.
56  */
57 //--------------------------------------------------------------------------------------------------
58 typedef void (*le_adc_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_adc_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 value of an ADC input
138  *
139  * @return
140  * - LE_OK The function succeeded.
141  * - LE_FAULT The function failed.
142  */
143 //--------------------------------------------------------------------------------------------------
145 (
146  const char* LE_NONNULL adcName,
147  ///< [IN] Name of the ADC to read.
148  int32_t* adcValuePtr
149  ///< [OUT] The adc value
150 );
151 
152 /** @} **/
153 
154 #endif // LE_ADC_INTERFACE_H_INCLUDE_GUARD
le_result_t le_adc_ReadValue(const char *LE_NONNULL adcName, int32_t *adcValuePtr)
le_result_t
Definition: le_basics.h:46
void le_adc_DisconnectService(void)
void le_adc_ConnectService(void)
le_result_t le_adc_TryConnectService(void)
LE_FULL_API void le_adc_SetServerDisconnectHandler(le_adc_DisconnectHandler_t disconnectHandler, void *contextPtr)
void(* le_adc_DisconnectHandler_t)(void *)
Definition: le_adc_interface.h:58
#define LE_FULL_API
Definition: le_apiFeatures.h:40