le_adc_interface.h

Go to the documentation of this file.
1 /*
2  * ====================== WARNING ======================
3  *
4  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
5  * DO NOT MODIFY IN ANY WAY.
6  *
7  * ====================== WARNING ======================
8  */
9 
10 /**
11  * @page c_adc ADC Channel API
12  *
13  * @ref le_adc_interface.h "API Reference"
14  *
15  * <HR>
16  *
17  * This API provides definitions for reading ADC inputs.
18  *
19  * le_adc_ReadValue() returns the value read from an ADC channel. It takes two arguments:
20  * - The first is the name of the ADC channel to read.
21  * - The second is used to return the value read.
22  *
23  * @warning Ensure to check the list of supported ADC channels on your specific platform before
24  * calling the le_adc_ReadValue() function. Please refer to @subpage platformConstraintsAdc page.
25  *
26  * <HR>
27  *
28  * Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
29  */
30 /**
31  * @file le_adc_interface.h
32  *
33  * Legato @ref c_adc include file.
34  *
35  * Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
36  */
37 
38 #ifndef LE_ADC_INTERFACE_H_INCLUDE_GUARD
39 #define LE_ADC_INTERFACE_H_INCLUDE_GUARD
40 
41 
42 #include "legato.h"
43 
44 //--------------------------------------------------------------------------------------------------
45 /**
46  *
47  * Connect the current client thread to the service providing this API. Block until the service is
48  * available.
49  *
50  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
51  * called before any other functions in this API. Normally, ConnectService is automatically called
52  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
53  *
54  * This function is created automatically.
55  */
56 //--------------------------------------------------------------------------------------------------
58 (
59  void
60 );
61 
62 //--------------------------------------------------------------------------------------------------
63 /**
64  *
65  * Try to connect the current client thread to the service providing this API. Return with an error
66  * if the service is not available.
67  *
68  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
69  * called before any other functions in this API. Normally, ConnectService is automatically called
70  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
71  *
72  * This function is created automatically.
73  *
74  * @return
75  * - LE_OK if the client connected successfully to the service.
76  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
77  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
78  * - LE_COMM_ERROR if the Service Directory cannot be reached.
79  */
80 //--------------------------------------------------------------------------------------------------
82 (
83  void
84 );
85 
86 //--------------------------------------------------------------------------------------------------
87 /**
88  *
89  * Disconnect the current client thread from the service providing this API.
90  *
91  * Normally, this function doesn't need to be called. After this function is called, there's no
92  * longer a connection to the service, and the functions in this API can't be used. For details, see
93  * @ref apiFilesC_client.
94  *
95  * This function is created automatically.
96  */
97 //--------------------------------------------------------------------------------------------------
99 (
100  void
101 );
102 
103 
104 //--------------------------------------------------------------------------------------------------
105 /**
106  * Maximum ADC's name string length.
107  */
108 //--------------------------------------------------------------------------------------------------
109 #define LE_ADC_ADC_NAME_MAX_LEN 30
110 
111 
112 //--------------------------------------------------------------------------------------------------
113 /**
114  * Maximum ADC's name string length.
115  * One extra byte is added for the null character.
116  */
117 //--------------------------------------------------------------------------------------------------
118 #define LE_ADC_ADC_NAME_MAX_BYTES 31
119 
120 //--------------------------------------------------------------------------------------------------
121 /**
122  * Get the value of an ADC input
123  *
124  * @return
125  * - LE_OK The function succeeded.
126  * - LE_FAULT The function failed.
127  */
128 //--------------------------------------------------------------------------------------------------
130 (
131  const char* adcName,
132  ///< [IN] Name of the ADC to read.
133 
134  int32_t* adcValuePtr
135  ///< [OUT] The adc value
136 );
137 
138 
139 #endif // LE_ADC_INTERFACE_H_INCLUDE_GUARD
140 
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_DisconnectService(void)
void le_adc_ConnectService(void)