Determine input capacity on digital input using internal pull up/down.
libcap.h@0:9e556d29961c, 2010-10-02 (annotated)
- Committer:
- hornfeldt
- Date:
- Sat Oct 02 22:03:01 2010 +0000
- Revision:
- 0:9e556d29961c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hornfeldt | 0:9e556d29961c | 1 | #ifndef LIBCAP_H |
hornfeldt | 0:9e556d29961c | 2 | #define LIBCAP_H |
hornfeldt | 0:9e556d29961c | 3 | |
hornfeldt | 0:9e556d29961c | 4 | #include "mbed.h" |
hornfeldt | 0:9e556d29961c | 5 | |
hornfeldt | 0:9e556d29961c | 6 | class CapIn |
hornfeldt | 0:9e556d29961c | 7 | { |
hornfeldt | 0:9e556d29961c | 8 | public: |
hornfeldt | 0:9e556d29961c | 9 | /** |
hornfeldt | 0:9e556d29961c | 10 | * Constructor. |
hornfeldt | 0:9e556d29961c | 11 | * |
hornfeldt | 0:9e556d29961c | 12 | * Creates a object for capacitive measurement on digital pin using default timer. |
hornfeldt | 0:9e556d29961c | 13 | * |
hornfeldt | 0:9e556d29961c | 14 | * @param pin - Digital input pin |
hornfeldt | 0:9e556d29961c | 15 | */ |
hornfeldt | 0:9e556d29961c | 16 | CapIn(PinName pin); |
hornfeldt | 0:9e556d29961c | 17 | /** |
hornfeldt | 0:9e556d29961c | 18 | * Constructor. |
hornfeldt | 0:9e556d29961c | 19 | * |
hornfeldt | 0:9e556d29961c | 20 | * Creates a object for capacitive measurement on digital pin using custom timer. |
hornfeldt | 0:9e556d29961c | 21 | * |
hornfeldt | 0:9e556d29961c | 22 | * @param pin - Digital input pin |
hornfeldt | 0:9e556d29961c | 23 | * @param timer - Timer[0-4] uesed for measurement |
hornfeldt | 0:9e556d29961c | 24 | */ |
hornfeldt | 0:9e556d29961c | 25 | CapIn(PinName pin, int timer); |
hornfeldt | 0:9e556d29961c | 26 | int read_uF(); |
hornfeldt | 0:9e556d29961c | 27 | int read_t(); |
hornfeldt | 0:9e556d29961c | 28 | private: |
hornfeldt | 0:9e556d29961c | 29 | DigitalIn _pin; |
hornfeldt | 0:9e556d29961c | 30 | }; |
hornfeldt | 0:9e556d29961c | 31 | |
hornfeldt | 0:9e556d29961c | 32 | #endif /* LIBCAP_H */ |