ANALOG_IN
Ameba SDK » HAL

analog_in functions More...

## Ameba Common

typedef struct analogin_s | analogin_t
void | analogin_init (analogin_t *obj, PinName pin)
| Initializes the ADC device, include clock/function/ADC registers. More...
void | analogin_deinit (analogin_t *obj)
| Deinitializes the ADC device, include clock/function/ADC registers. More...
float | analogin_read (analogin_t *obj)
| Reads data from the specified adc channel fifo. More...
uint16_t | analogin_read_u16 (analogin_t *obj)
| Reads data from the specified adc channel fifo. More...

## Detailed Description

analog_in functions

## Function Documentation

void analogin_deinit | ( | analogin_t * | obj | ) |

Deinitializes the ADC device, include clock/function/ADC registers.

Parameters

  obj | adc object define in application software.

Return values

  none |

void analogin_init | ( | analogin_t * | obj,
|  | PinName | pin
| ) |  |

Initializes the ADC device, include clock/function/ADC registers.

Parameters

  obj | adc object define in application software.
  pin | adc PinName according to pinmux spec.

Return values

  none |

float analogin_read | ( | analogin_t * | obj | ) |

Reads data from the specified adc channel fifo.

Parameters

  obj | adc object define in application software.

Return values

  | adc channel data(float)

uint16_t analogin_read_u16 | ( | analogin_t * | obj | ) |

Reads data from the specified adc channel fifo.

Parameters

  obj | adc object define in application software.

Return values

  | 16bit adc channel data(int)