Control of mbed using OSC. Based on code from the Make Controller. Right now you can turn the onboard LEDs on/off and toggle 8 digital out pins. More I/O will be done in the future.

Dependencies:   mbed

Committer:
pehrhovey
Date:
Wed Mar 17 03:17:38 2010 +0000
Revision:
0:439354122597

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pehrhovey 0:439354122597 1 /*
pehrhovey 0:439354122597 2 * Pehr Hovey
pehrhovey 0:439354122597 3 *
pehrhovey 0:439354122597 4 * mBed OSC - IoOsc subsystem
pehrhovey 0:439354122597 5 * Get/set digital output pins
pehrhovey 0:439354122597 6 * Based on code from Make Controller
pehrhovey 0:439354122597 7 */
pehrhovey 0:439354122597 8 /*********************************************************************************
pehrhovey 0:439354122597 9
pehrhovey 0:439354122597 10 Copyright 2006-2009 MakingThings
pehrhovey 0:439354122597 11
pehrhovey 0:439354122597 12 Licensed under the Apache License,
pehrhovey 0:439354122597 13 Version 2.0 (the "License"); you may not use this file except in compliance
pehrhovey 0:439354122597 14 with the License. You may obtain a copy of the License at
pehrhovey 0:439354122597 15
pehrhovey 0:439354122597 16 http://www.apache.org/licenses/LICENSE-2.0
pehrhovey 0:439354122597 17
pehrhovey 0:439354122597 18 Unless required by applicable law or agreed to in writing, software distributed
pehrhovey 0:439354122597 19 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
pehrhovey 0:439354122597 20 CONDITIONS OF ANY KIND, either express or implied. See the License for
pehrhovey 0:439354122597 21 the specific language governing permissions and limitations under the License.
pehrhovey 0:439354122597 22
pehrhovey 0:439354122597 23 *********************************************************************************/
pehrhovey 0:439354122597 24 #ifndef MBED_IO_OSC_
pehrhovey 0:439354122597 25 #define MBED_IO_OSC_
pehrhovey 0:439354122597 26 //OSC Subsystems
pehrhovey 0:439354122597 27
pehrhovey 0:439354122597 28 #define IO_CHANNELS 14 //start with 8
pehrhovey 0:439354122597 29 // Regular digital I/O
pehrhovey 0:439354122597 30 int IoOsc_ReceiveMessage( int channel, char* message, int length );
pehrhovey 0:439354122597 31 const char* IoOsc_GetName( void );
pehrhovey 0:439354122597 32 int IoOsc_PropertySet( int index, int property, int value );
pehrhovey 0:439354122597 33 int IoOsc_ReceiveMessage( int channel, char* message, int length );
pehrhovey 0:439354122597 34 int IoOsc_PropertyGet( int property, int channel );
pehrhovey 0:439354122597 35 bool IoOsc_validIndex(int index);
pehrhovey 0:439354122597 36
pehrhovey 0:439354122597 37
pehrhovey 0:439354122597 38 //Get/set digital IO
pehrhovey 0:439354122597 39 int Io_SetValue(int index, int value);
pehrhovey 0:439354122597 40 int Io_GetValue(int index);
pehrhovey 0:439354122597 41 void Io_SetMode(int index, int mode); //in or out
pehrhovey 0:439354122597 42
pehrhovey 0:439354122597 43 //four onboard LEDs - on or off
pehrhovey 0:439354122597 44
pehrhovey 0:439354122597 45 #define LED_CHANNELS 4
pehrhovey 0:439354122597 46 //Get/set LEDs
pehrhovey 0:439354122597 47 int Led_SetValue(int index, int value);
pehrhovey 0:439354122597 48 int Led_GetValue(int index);
pehrhovey 0:439354122597 49
pehrhovey 0:439354122597 50 int LedOsc_ReceiveMessage( int channel, char* message, int length );
pehrhovey 0:439354122597 51 const char* LedOsc_GetName( void );
pehrhovey 0:439354122597 52 int LedOsc_PropertySet( int index, int property, int value );
pehrhovey 0:439354122597 53 int LedOsc_ReceiveMessage( int channel, char* message, int length );
pehrhovey 0:439354122597 54 int LedOsc_PropertyGet( int property, int channel );
pehrhovey 0:439354122597 55 #endif