Tizen Native API  5.5
ADC

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

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]adcThe ADC handle
Returns:
0 on success, otherwise a negative error value
Return values:
PERIPHERAL_ERROR_NONESuccessful
PERIPHERAL_ERROR_IO_ERRORI/O operation failed
PERIPHERAL_ERROR_NO_DEVICEDevice does not exist or is removed
PERIPHERAL_ERROR_PERMISSION_DENIEDPermission denied
PERIPHERAL_ERROR_INVALID_PARAMETERInvalid parameter
PERIPHERAL_ERROR_NOT_SUPPORTEDNot supported
PERIPHERAL_ERROR_UNKNOWNUnknown 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]deviceThe ADC device number
[in]channelThe ADC channel number to control
[out]adcThe ADC handle is created on success
Returns:
0 on success, otherwise a negative error value
Return values:
PERIPHERAL_ERROR_NONESuccessful
PERIPHERAL_ERROR_IO_ERRORI/O operation failed
PERIPHERAL_ERROR_NO_DEVICEDevice does not exist or is removed
PERIPHERAL_ERROR_OUT_OF_MEMORYMemory allocation failed
PERIPHERAL_ERROR_PERMISSION_DENIEDPermission denied
PERIPHERAL_ERROR_RESOURCE_BUSYDevice is in use
PERIPHERAL_ERROR_INVALID_PARAMETERInvalid parameter
PERIPHERAL_ERROR_NOT_SUPPORTEDNot supported
PERIPHERAL_ERROR_UNKNOWNUnknown 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]adcThe ADC handle
[out]valueThe value to get
Returns:
0 on success, otherwise a negative error value
Return values:
PERIPHERAL_ERROR_NONESuccessful
PERIPHERAL_ERROR_IO_ERRORI/O operation failed
PERIPHERAL_ERROR_NO_DEVICEDevice does not exist or is removed
PERIPHERAL_ERROR_PERMISSION_DENIEDPermission denied
PERIPHERAL_ERROR_INVALID_PARAMETERInvalid parameter
PERIPHERAL_ERROR_NOT_SUPPORTEDNot supported
PERIPHERAL_ERROR_UNKNOWNUnknown internal error