RTEMS: bsps/arm/lpc176x/start/adc.c File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Functions
adc.c File Reference
Board Support Packages » ARM » NXP LPC176X

ADC library for the lpc176x bsp. More...

`#include <rtems/status-checks.h>`
`#include <bsp/adc.h>`
`#include <bsp/adc-defs.h>`

## Functions
rtems_status_code | adc_open (const lpc176x_pin_number pin_number)
| Opens and initializes the ADC device.
rtems_status_code | adc_close (void)
| Closes the ADC device.
rtems_status_code | adc_read (const lpc176x_pin_number pin_number, float *const result)
| Starts a conversion, waits for it to finish and reads the value.

## Detailed Description

ADC library for the lpc176x bsp.

## Function Documentation

## ◆ adc_close()

rtems_status_code adc_close | ( | void |  | ) |

Closes the ADC device.

Returns
  RTEMS_SUCCESSFUL if closed succesfully.

## ◆ adc_open()

rtems_status_code adc_open | ( | const lpc176x_pin_number | pin_number | ) |

Opens and initializes the ADC device.

Parameters

  adc_number | The ADC pin number to be initialized.

Returns
  RTEMS_SUCCESSFUL if the initialization was succesful, RTEMS_INVALID_NUMBER if wrong parameter.

## ◆ adc_read()

rtems_status_code adc_read | ( | const lpc176x_pin_number | pin_number,
|  | float *const | result
| ) |  |

Starts a conversion, waits for it to finish and reads the value.

Parameters

  pin_number | The port to read the value.
  result | The read result. (In a percentage between 0.0f and 1.0f).