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 //--------------------------------------------------------------------------------------------------
50 /**
51  * Type for handler called when a server disconnects.
52  */
53 //--------------------------------------------------------------------------------------------------
54 typedef void (*le_adc_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 //--------------------------------------------------------------------------------------------------
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 //--------------------------------------------------------------------------------------------------
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 //--------------------------------------------------------------------------------------------------
108 (
109  le_adc_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 //--------------------------------------------------------------------------------------------------
126 (
127  void
128 );
129 
130 
131 //--------------------------------------------------------------------------------------------------
132 /**
133  * Get the value of an ADC input
134  *
135  * @return
136  * - LE_OK The function succeeded.
137  * - LE_FAULT The function failed.
138  */
139 //--------------------------------------------------------------------------------------------------
141 (
142  const char* LE_NONNULL adcName,
143  ///< [IN] Name of the ADC to read.
144  int32_t* adcValuePtr
145  ///< [OUT] The adc value
146 );
147 
148 #endif // LE_ADC_INTERFACE_H_INCLUDE_GUARD
le_result_t
Definition: le_basics.h:45
le_result_t le_adc_ReadValue(const char *LE_NONNULL adcName, int32_t *adcValuePtr)
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:54
void le_adc_DisconnectService(void)
#define LE_FULL_API
Definition: le_apiFeatures.h:40
void le_adc_ConnectService(void)