Tizen Native API
5.0
|
The ADC API provides functions to control ADC peripherals connected to the IoT device.
#include <peripheral_io.h>
This ADC API provides functions to control ADC peripherals connected to the IoT device.
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 struct _peripheral_adc_s* peripheral_adc_h |
The handle of the ADC peripherals.
int peripheral_adc_close | ( | peripheral_adc_h | adc | ) |
Closes the ADC pin.
[in] | adc | The ADC handle |
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 |
int peripheral_adc_open | ( | int | device, |
int | channel, | ||
peripheral_adc_h * | adc | ||
) |
Opens the ADC pin.
[in] | device | The ADC device number |
[in] | channel | The ADC channel number to control |
[out] | adc | The ADC handle is created on success |
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 |
int peripheral_adc_read | ( | peripheral_adc_h | adc, |
uint32_t * | value | ||
) |
Gets the current value of the ADC pin.
[in] | adc | The ADC handle |
[out] | value | The value to get |
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 |