4.115
Last change
on this file since d4edbdbc was
d4edbdbc,
checked in by Sebastian Huber <sebastian.huber@…>, on 03/20/15 at 13:09:26
|
Replace www.rtems.com with www.rtems.org
|
-
Property mode set to
100755
|
File size:
1.3 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file adc.h |
---|
3 | * |
---|
4 | * @ingroup lpc176x |
---|
5 | * |
---|
6 | * @brief ADC library for the lpc176x bsp. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2014 Taller Technologies. |
---|
11 | * |
---|
12 | * @author Diaz Marcos (marcos.diaz@tallertechnologies.com) |
---|
13 | * |
---|
14 | * The license and distribution terms for this file may be |
---|
15 | * found in the file LICENSE in this distribution or at |
---|
16 | * http://www.rtems.org/license/LICENSE. |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef LPC176X_ADC_H |
---|
20 | #define LPC176X_ADC_H |
---|
21 | |
---|
22 | #include <bsp.h> |
---|
23 | #include <bsp/common-types.h> |
---|
24 | |
---|
25 | #ifdef __cplusplus |
---|
26 | extern "C" { |
---|
27 | #endif /* __cplusplus */ |
---|
28 | |
---|
29 | /** |
---|
30 | * @brief Opens and initializes the ADC device. |
---|
31 | * |
---|
32 | * @param adc_number The ADC pin number to be initialized. |
---|
33 | * @return RTEMS_SUCCESSFUL if the initialization was succesful, |
---|
34 | * RTEMS_INVALID_NUMBER if wrong parameter. |
---|
35 | */ |
---|
36 | rtems_status_code adc_open( const lpc176x_pin_number pin_number ); |
---|
37 | |
---|
38 | /** |
---|
39 | * @brief Closes the ADC device. |
---|
40 | * |
---|
41 | * @return RTEMS_SUCCESSFUL if closed succesfully. |
---|
42 | */ |
---|
43 | rtems_status_code adc_close( void ); |
---|
44 | |
---|
45 | /** |
---|
46 | * @brief Starts a conversion, waits for it to finish and reads the value. |
---|
47 | * |
---|
48 | * @param pin_number The port to read the value. |
---|
49 | * @param result The read result. (In a percentage between 0.0f and 1.0f). |
---|
50 | */ |
---|
51 | rtems_status_code adc_read( |
---|
52 | const lpc176x_pin_number pin_number , |
---|
53 | float *const result |
---|
54 | ); |
---|
55 | |
---|
56 | #ifdef __cplusplus |
---|
57 | } |
---|
58 | #endif /* __cplusplus */ |
---|
59 | |
---|
60 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.