Tizen Native API
7.0
|
The ADC API provides functions to control ADC peripherals connected to the IoT device.
Required Header
#include <peripheral_io.h>
Overview
This ADC API provides functions to control ADC peripherals connected to the IoT device.
Realted Features
This API is related with the following feature:
It is recommended to use features in your application for reliability.
You can check if a IoT device supports the related features for this API
by using System Information, and control your application's actions accordingly.
To ensure your application is only running on the IoT device with specific features,
please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions | |
int | peripheral_adc_open (int device, int channel, peripheral_adc_h *adc) |
Opens the ADC pin. | |
int | peripheral_adc_close (peripheral_adc_h adc) |
Closes the ADC pin. | |
int | peripheral_adc_read (peripheral_adc_h adc, uint32_t *value) |
Gets the current value of the ADC pin. | |
Typedefs | |
typedef struct _peripheral_adc_s * | peripheral_adc_h |
The handle of the ADC peripherals. |
Typedef Documentation
typedef struct _peripheral_adc_s* peripheral_adc_h |
The handle of the ADC peripherals.
- Since :
- 5.0
Function Documentation
int peripheral_adc_close | ( | peripheral_adc_h | adc | ) |
Closes the ADC pin.
- Warning:
- This is not for use by third-party applications.
- Since :
- 5.0
- Privilege Level:
- platform
- Privilege:
- http://tizen.org/privilege/peripheralio
- Parameters:
-
[in] adc The ADC handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
PERIPHERAL_ERROR_NONE Successful PERIPHERAL_ERROR_IO_ERROR I/O operation failed PERIPHERAL_ERROR_NO_DEVICE Device does not exist or is removed PERIPHERAL_ERROR_PERMISSION_DENIED Permission denied PERIPHERAL_ERROR_INVALID_PARAMETER Invalid parameter PERIPHERAL_ERROR_NOT_SUPPORTED Not supported PERIPHERAL_ERROR_UNKNOWN Unknown internal error
- Precondition:
- peripheral_adc_open()
int peripheral_adc_open | ( | int | device, |
int | channel, | ||
peripheral_adc_h * | adc | ||
) |
Opens the ADC pin.
- Warning:
- This is not for use by third-party applications.
- Since :
- 5.0
- Privilege Level:
- platform
- Privilege:
- http://tizen.org/privilege/peripheralio
- Remarks:
- adc should be released with peripheral_adc_close()
- Parameters:
-
[in] device The ADC device number [in] channel The ADC channel number to control [out] adc The ADC handle is created on success
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
PERIPHERAL_ERROR_NONE Successful PERIPHERAL_ERROR_IO_ERROR I/O operation failed PERIPHERAL_ERROR_NO_DEVICE Device does not exist or is removed PERIPHERAL_ERROR_OUT_OF_MEMORY Memory allocation failed PERIPHERAL_ERROR_PERMISSION_DENIED Permission denied PERIPHERAL_ERROR_RESOURCE_BUSY Device is in use PERIPHERAL_ERROR_INVALID_PARAMETER Invalid parameter PERIPHERAL_ERROR_NOT_SUPPORTED Not supported PERIPHERAL_ERROR_UNKNOWN Unknown internal error
- Postcondition:
- peripheral_adc_close()
int peripheral_adc_read | ( | peripheral_adc_h | adc, |
uint32_t * | value | ||
) |
Gets the current value of the ADC pin.
- Warning:
- This is not for use by third-party applications.
- Since :
- 5.0
- Privilege Level:
- platform
- Privilege:
- http://tizen.org/privilege/peripheralio
- Parameters:
-
[in] adc The ADC handle [out] value The value to get
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
PERIPHERAL_ERROR_NONE Successful PERIPHERAL_ERROR_IO_ERROR I/O operation failed PERIPHERAL_ERROR_NO_DEVICE Device does not exist or is removed PERIPHERAL_ERROR_PERMISSION_DENIED Permission denied PERIPHERAL_ERROR_INVALID_PARAMETER Invalid parameter PERIPHERAL_ERROR_NOT_SUPPORTED Not supported PERIPHERAL_ERROR_UNKNOWN Unknown internal error