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