Fork of the official mbed C/C++ SDK provides the software platform and libraries to build your applications. The fork has the documentation converted to Doxygen format

Dependents:   NervousPuppySprintOne NervousPuppySprint2602 Robot WarehouseBot1 ... more

Fork of mbed by mbed official

Committer:
simon.ford@mbed.co.uk
Date:
Thu Jan 22 18:32:40 2009 +0000
Revision:
5:62573be585e9
Parent:
4:5d1359a283bc
Child:
11:1c1ebd0324fa
* Added initial RPC release
* Added RTC and helper functions
* Added read_u16()/write_u16() to AnalogIn/Out
* Ticker/Timeout timing fixed!
* mbedinfo() helper added
* error() and printf() added to replace DEBUG() and ERROR()
* DigitalIn supports methods on rise/fall
* SPI and Serial support NC
* LED1-4 also map to 1-4
* Timer object reset fixed
* SPI uses single mode
* SPI3 added

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon.ford@mbed.co.uk 0:82220227f4fa 1 /* mbed Microcontroller Library - DigitalOut
simon.ford@mbed.co.uk 0:82220227f4fa 2 * Copyright (c) 2007-2008, sford
simon.ford@mbed.co.uk 0:82220227f4fa 3 */
simon.ford@mbed.co.uk 0:82220227f4fa 4
simon.ford@mbed.co.uk 0:82220227f4fa 5 #ifndef MBED_DIGITALOUT_H
simon.ford@mbed.co.uk 0:82220227f4fa 6 #define MBED_DIGITALOUT_H
simon.ford@mbed.co.uk 0:82220227f4fa 7
simon.ford@mbed.co.uk 0:82220227f4fa 8 #include "Base.h"
simon.ford@mbed.co.uk 0:82220227f4fa 9 #include "LPC2300.h"
simon.ford@mbed.co.uk 0:82220227f4fa 10
simon.ford@mbed.co.uk 0:82220227f4fa 11 namespace mbed {
simon.ford@mbed.co.uk 0:82220227f4fa 12
simon.ford@mbed.co.uk 0:82220227f4fa 13 /* Class: DigitalOut
simon.ford@mbed.co.uk 0:82220227f4fa 14 * A digital output, used for setting the state of a pin
simon.ford@mbed.co.uk 0:82220227f4fa 15 */
simon.ford@mbed.co.uk 0:82220227f4fa 16 class DigitalOut : public Base {
simon.ford@mbed.co.uk 0:82220227f4fa 17
simon.ford@mbed.co.uk 0:82220227f4fa 18 public:
simon.ford@mbed.co.uk 0:82220227f4fa 19
simon.ford@mbed.co.uk 3:aefd12a1f1c5 20 /* Group: Configuration Methods */
simon.ford@mbed.co.uk 3:aefd12a1f1c5 21
simon.ford@mbed.co.uk 0:82220227f4fa 22 /* Constructor: DigitalOut
simon.ford@mbed.co.uk 0:82220227f4fa 23 * Create a DigitalOut connected to the specified pin
simon.ford@mbed.co.uk 0:82220227f4fa 24 *
simon.ford@mbed.co.uk 0:82220227f4fa 25 * Variables:
simon.ford@mbed.co.uk 0:82220227f4fa 26 * pin - DigitalOut pin to connect to (5-30)
simon.ford@mbed.co.uk 0:82220227f4fa 27 */
simon.ford@mbed.co.uk 4:5d1359a283bc 28 DigitalOut(int pin, const char* name = NULL);
simon.ford@mbed.co.uk 0:82220227f4fa 29
simon.ford@mbed.co.uk 3:aefd12a1f1c5 30 /* Group: Access Methods */
simon.ford@mbed.co.uk 3:aefd12a1f1c5 31
simon.ford@mbed.co.uk 0:82220227f4fa 32 /* Function: write
simon.ford@mbed.co.uk 0:82220227f4fa 33 * Set the output, specified as 0 or 1 (int)
simon.ford@mbed.co.uk 0:82220227f4fa 34 *
simon.ford@mbed.co.uk 0:82220227f4fa 35 * Variables:
simon.ford@mbed.co.uk 0:82220227f4fa 36 * value - An integer specifying the pin output value,
simon.ford@mbed.co.uk 0:82220227f4fa 37 * 0 for logical 0 (0v) and 1 (or any other non-zero value) for logical 1 (3.3v).
simon.ford@mbed.co.uk 0:82220227f4fa 38 */
simon.ford@mbed.co.uk 0:82220227f4fa 39 void write(int value);
simon.ford@mbed.co.uk 0:82220227f4fa 40
simon.ford@mbed.co.uk 0:82220227f4fa 41 /* Function: read
simon.ford@mbed.co.uk 0:82220227f4fa 42 * Return the output setting, represented as 0 or 1 (int)
simon.ford@mbed.co.uk 0:82220227f4fa 43 *
simon.ford@mbed.co.uk 0:82220227f4fa 44 * Variables:
simon.ford@mbed.co.uk 0:82220227f4fa 45 * returns - An integer representing the output setting of the pin,
simon.ford@mbed.co.uk 0:82220227f4fa 46 * 0 for logical 0 (0v) and 1 for logical 1 (3.3v)
simon.ford@mbed.co.uk 0:82220227f4fa 47 */
simon.ford@mbed.co.uk 0:82220227f4fa 48 int read();
simon.ford@mbed.co.uk 4:5d1359a283bc 49
simon.ford@mbed.co.uk 5:62573be585e9 50 virtual const struct rpc_method *get_rpc_methods();
simon.ford@mbed.co.uk 5:62573be585e9 51 static struct rpc_class *get_rpc_class();
simon.ford@mbed.co.uk 4:5d1359a283bc 52
simon.ford@mbed.co.uk 3:aefd12a1f1c5 53 /* Group: Access Method Shorthand */
simon.ford@mbed.co.uk 3:aefd12a1f1c5 54
simon.ford@mbed.co.uk 0:82220227f4fa 55 /* Function: operator=
simon.ford@mbed.co.uk 0:82220227f4fa 56 * A shorthand for <write>
simon.ford@mbed.co.uk 0:82220227f4fa 57 */
simon.ford@mbed.co.uk 0:82220227f4fa 58 DigitalOut& operator= (int v);
simon.ford@mbed.co.uk 0:82220227f4fa 59 DigitalOut& operator= (DigitalOut& rhs);
simon.ford@mbed.co.uk 0:82220227f4fa 60
simon.ford@mbed.co.uk 0:82220227f4fa 61 /* Function: operator int()
simon.ford@mbed.co.uk 0:82220227f4fa 62 * A shorthand for <read>
simon.ford@mbed.co.uk 0:82220227f4fa 63 */
simon.ford@mbed.co.uk 0:82220227f4fa 64 operator int();
simon.ford@mbed.co.uk 0:82220227f4fa 65
simon.ford@mbed.co.uk 0:82220227f4fa 66 protected:
simon.ford@mbed.co.uk 0:82220227f4fa 67
simon.ford@mbed.co.uk 0:82220227f4fa 68 LPC2300::GPIORF* _rf;
simon.ford@mbed.co.uk 0:82220227f4fa 69 unsigned int _mask;
simon.ford@mbed.co.uk 0:82220227f4fa 70 int _id;
simon.ford@mbed.co.uk 0:82220227f4fa 71
simon.ford@mbed.co.uk 0:82220227f4fa 72 };
simon.ford@mbed.co.uk 0:82220227f4fa 73
simon.ford@mbed.co.uk 0:82220227f4fa 74 }
simon.ford@mbed.co.uk 0:82220227f4fa 75
simon.ford@mbed.co.uk 1:6b7f447ca868 76 #endif
simon.ford@mbed.co.uk 1:6b7f447ca868 77