RTEMS  5.0.0
Functions
adc.h File Reference

ADC library for the lpc176x bsp. More...

#include <bsp.h>
#include <bsp/common-types.h>

Go to the source code of this file.

Functions

rtems_status_code adc_open (const lpc176x_pin_number pin_number)
 Opens and initializes the ADC device. More...
 
rtems_status_code adc_close (void)
 Closes the ADC device. More...
 
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. More...
 

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_numberThe 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_numberThe port to read the value.
resultThe read result. (In a percentage between 0.0f and 1.0f).