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 
48 //--------------------------------------------------------------------------------------------------
49 /**
50  * Type for handler called when a server disconnects.
51  */
52 //--------------------------------------------------------------------------------------------------
53 typedef void (*le_adc_DisconnectHandler_t)(void *);
54 
55 //--------------------------------------------------------------------------------------------------
56 /**
57  *
58  * Connect the current client thread to the service providing this API. Block until the service is
59  * available.
60  *
61  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
62  * called before any other functions in this API. Normally, ConnectService is automatically called
63  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
64  *
65  * This function is created automatically.
66  */
67 //--------------------------------------------------------------------------------------------------
69 (
70  void
71 );
72 
73 //--------------------------------------------------------------------------------------------------
74 /**
75  *
76  * Try to connect the current client thread to the service providing this API. Return with an error
77  * if the service is not available.
78  *
79  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
80  * called before any other functions in this API. Normally, ConnectService is automatically called
81  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
82  *
83  * This function is created automatically.
84  *
85  * @return
86  * - LE_OK if the client connected successfully to the service.
87  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
88  * bound.
89  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
90  * - LE_COMM_ERROR if the Service Directory cannot be reached.
91  */
92 //--------------------------------------------------------------------------------------------------
94 (
95  void
96 );
97 
98 //--------------------------------------------------------------------------------------------------
99 /**
100  * Set handler called when server disconnection is detected.
101  *
102  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
103  * to continue without exiting, it should call longjmp() from inside the handler.
104  */
105 //--------------------------------------------------------------------------------------------------
107 (
108  le_adc_DisconnectHandler_t disconnectHandler,
109  void *contextPtr
110 );
111 
112 //--------------------------------------------------------------------------------------------------
113 /**
114  *
115  * Disconnect the current client thread from the service providing this API.
116  *
117  * Normally, this function doesn't need to be called. After this function is called, there's no
118  * longer a connection to the service, and the functions in this API can't be used. For details, see
119  * @ref apiFilesC_client.
120  *
121  * This function is created automatically.
122  */
123 //--------------------------------------------------------------------------------------------------
125 (
126  void
127 );
128 
129 
130 //--------------------------------------------------------------------------------------------------
131 /**
132  * Maximum ADC's name string length.
133  */
134 //--------------------------------------------------------------------------------------------------
135 #define LE_ADC_ADC_NAME_MAX_LEN 30
136 
137 //--------------------------------------------------------------------------------------------------
138 /**
139  * Maximum ADC's name string length.
140  * One extra byte is added for the null character.
141  */
142 //--------------------------------------------------------------------------------------------------
143 #define LE_ADC_ADC_NAME_MAX_BYTES 31
144 
145 //--------------------------------------------------------------------------------------------------
146 /**
147  * Get the value of an ADC input
148  *
149  * @return
150  * - LE_OK The function succeeded.
151  * - LE_FAULT The function failed.
152  */
153 //--------------------------------------------------------------------------------------------------
155 (
156  const char* adcName,
157  ///< [IN] Name of the ADC to read.
158  int32_t* adcValuePtr
159  ///< [OUT] The adc value
160 )
161 __attribute__(( nonnull(1) ));
162 
163 #endif // LE_ADC_INTERFACE_H_INCLUDE_GUARD
le_result_t le_adc_ReadValue(const char *adcName, int32_t *adcValuePtr)
le_result_t
Definition: le_basics.h:35
le_result_t le_adc_TryConnectService(void)
void(* le_adc_DisconnectHandler_t)(void *)
Definition: le_adc_interface.h:53
void le_adc_DisconnectService(void)
void le_adc_ConnectService(void)
void le_adc_SetServerDisconnectHandler(le_adc_DisconnectHandler_t disconnectHandler, void *contextPtr)