source: rtems/c/src/lib/libbsp/arm/lpc176x/include/adc.h @ 7b35a36

4.115
Last change on this file since 7b35a36 was 7b35a36, checked in by Martin Galvan <martin.galvan@…>, on 03/11/15 at 19:57:23

Add CAN, PWM, ADC and UART1/2/3 support to the LPC176x BSP.

This patch adds support for the following devices to the LPC176x BSP:

  • CAN
  • PWM
  • ADC

It also adds the probe routines for UART1/2/3 to the console_device_table in console-config.c, and enables UART1 in configure.ac.

  • 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.com/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
26extern "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 */
36rtems_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 */
43rtems_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 */
51rtems_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.