source: rtems/bsps/arm/lpc176x/include/bsp/adc-defs.h @ 031df391

5
Last change on this file since 031df391 was 2afb22b, checked in by Chris Johns <chrisj@…>, on 12/23/17 at 07:18:56

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100755
File size: 2.2 KB
Line 
1/**
2 * @file adc-defs.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#ifndef LPC176X_ADC_DEFS_H
19#define LPC176X_ADC_DEFS_H
20
21#include <bsp.h>
22#include <bsp/io.h>
23#include <bsp/lpc176x.h>
24#include <bsp/adc.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif /* __cplusplus */
29
30/**
31 * @brief The ADC inputs of the board.
32 */
33typedef enum {
34  ADC_0,
35  ADC_1,
36  ADC_2,
37  ADC_3,
38  ADC_4,
39  ADC_5,
40  ADC_6,
41  ADC_7,
42  ADC_DEVICES_COUNT
43} lpc176x_adc_number;
44
45#define MAX_ADC_CLK 13000000u
46
47#define ADC_RANGE 0xFFFu
48
49#define ADC_NUMBER_VALID( number ) ( ( (uint32_t) number ) < \
50                                     ADC_DEVICES_COUNT )
51
52#define ADC_CR_SEL( val ) BSP_FLD32( val, 0, 7 )
53#define ADC_CR_SEL_GET( val ) BSP_FLD32GET( val, 0, 7 )
54#define ADC_CR_SEL_SET( reg, val ) BSP_FLD32SET( reg, val, 0, 7 )
55#define ADC_CR_CLKDIV( val ) BSP_FLD32( val, 8, 15 )
56#define ADC_CR_CLKDIV_GET( reg ) BSP_FLD32GET( reg, 8, 15 )
57#define ADC_CR_CLKDIV_SET( reg, val ) BSP_FLD32SET( reg, val, 8, 15 )
58#define ADC_CR_BURST BSP_BIT32( 16 )
59#define ADC_CR_CLKS( val ) BSP_FLD32( val, 17, 19 )
60#define ADC_CR_PDN BSP_BIT32( 21 )
61#define ADC_CR_START_NOW BSP_BIT32( 24 )
62#define ADC_CR_START( val ) BSP_FLD32( val, 24, 26 )
63#define ADC_CR_EDGE BSP_BIT32( 27 )
64
65#define ADC_DR_VALUE( reg ) BSP_FLD32GET( reg, 4, 15 )
66#define ADC_DR_OVERRUN BSP_BIT32( 30 )
67#define ADC_DR_DONE BSP_BIT32( 31 )
68
69#define ADC_DATA_CONVERSION_DONE( val ) ( ( val & ADC_DR_DONE ) != 0u )
70
71/**
72 * @brief The ADC low-level device.
73 */
74typedef struct {
75  volatile uint32_t ADCR;
76  volatile uint32_t ADGDR;
77  volatile uint32_t RESERVED0;
78  volatile uint32_t ADINTEN;
79  volatile uint32_t ADDR[ ADC_DEVICES_COUNT ];
80  volatile uint32_t ADSTAT;
81  volatile uint32_t ADTRM;
82} lpc176x_adc_device;
83
84/**
85 * @brief Represents the pin and function for each ADC input.
86 */
87typedef struct {
88  uint32_t pin_number;
89  lpc176x_pin_function pin_function;
90} lpc176x_adc_pin_map;
91
92#ifdef __cplusplus
93}
94#endif /* __cplusplus */
95
96#endif
Note: See TracBrowser for help on using the repository browser.