|
API Guide Home (Online version only) |
![]() |
00001 /******************************************************************************* 00002 * Copyright (c) 2004-2005 palmOne, Inc. or its subsidiaries. 00003 * All rights reserved. 00004 ******************************************************************************/ 00005 /** 00006 * @defgroup PmConnectorLib Multi Connector Library 00007 * @brief This library provides support for multi-connector related functionalities. 00008 * 00009 * Applications can register itself to be notified when a peripheral is attached 00010 * or detached to the multi-connector port. Applications can also use this library 00011 * to enable/disable the power pin and to re-route audio output. 00012 * 00013 * @{ 00014 * @} 00015 */ 00016 /** 00017 * @ingroup PmConnectorLib 00018 */ 00019 00020 /** 00021 * @file PmConnectorLibCommon.h 00022 * @brief Public 68k common header file for Multi-Connector Library for palmOne 00023 * devices that use multi-connector. 00024 * 00025 * This file contains common structures, types and defines for palmOne library 00026 * that exports multi-connector related APIs. 00027 * <hr> 00028 */ 00029 00030 #ifndef __PMConnectorLIBCOMMON_H__ 00031 #define __PMConnectorLIBCOMMON_H__ 00032 00033 #include <NotifyMgr.h> 00034 00035 /******************************************************************** 00036 * Constants 00037 ********************************************************************/ 00038 #define kPmConnectorLibType sysFileTLibrary 00039 #define kPmConnectorLibCreator 'PmAt' 00040 #define kPmConnectorLibName "PmConnector" 00041 #define kPmConnectorNotifyType 'PmCo' 00042 #define kPmConnectorNotifySysAttach sysExternalConnectorAttachEvent 00043 #define kPmConnectorNotifySysDetach sysExternalConnectorDetachEvent 00044 00045 // Bits used in notifyDetailsP for kPmConnectorNotifySysAttach and kPmConnectorNotifySysDetach 00046 #define kPmDockStatusCharging 0x08 00047 #define kPmDockStatusUSBCradle 0x10 00048 #define kPmDockStatusSerialPeripheral 0x40 00049 00050 /******************************************************************** 00051 * Traps 00052 ********************************************************************/ 00053 /** 00054 * @name Function Traps 00055 */ 00056 /*@{*/ 00057 #define kPmConnectorLibTrapOpen sysLibTrapOpen 00058 #define kPmConnectorLibTrapClose sysLibTrapClose 00059 #define kPmConnectorLibTrapSleep sysLibTrapSleep 00060 #define kPmConnectorLibTrapWake sysLibTrapWake 00061 #define kPmConnectorLibTrapGetVersion (sysLibTrapCustom + 0) 00062 #define kPmConnectorLibTrapControl (sysLibTrapCustom + 1) 00063 #define kPmConnectorLibTrapSetAudioOutput (sysLibTrapCustom + 2) 00064 #define kPmConnectorLibTrapSetAudioInput (sysLibTrapCustom + 3) 00065 /*@}*/ 00066 00067 /*********************************************************************** 00068 * Library version 00069 ***********************************************************************/ 00070 #define kPmConnectorLibVersion sysMakeROMVersion(1, 3, 2, sysROMStageRelease, 0) 00071 00072 00073 /*********************************************************************** 00074 * PmConnectorLib result codes 00075 * (appErrorClass is reserved for 3rd party apps/libraries. 00076 * It is defined in SystemMgr.h) 00077 ***********************************************************************/ 00078 /** 00079 * @name Error Codes 00080 */ 00081 /*@{*/ 00082 #define kPmConnectorLibErrorClass (oemErrorClass + 0x100) 00083 /* Invalid parameter */ 00084 #define kPmConnectorLibErrBadParam (kPmConnectorLibErrorClass | 0x01) 00085 /* Memory error */ 00086 #define kPmConnectorLibErrNoMemory (kPmConnectorLibErrorClass | 0x02) 00087 /* Library is not open */ 00088 #define kPmConnectorLibErrNotOpen (kPmConnectorLibErrorClass | 0x03) 00089 /* Returned from PmConnectorLibClose() if the library is still open */ 00090 #define kPmConnectorLibErrStillOpen (kPmConnectorLibErrorClass | 0x04) 00091 /* Internal erro */ 00092 #define kPmConnectorLibErrInternal (kPmConnectorLibErrorClass | 0x05) 00093 /* Unsupported function */ 00094 #define kPmConnectorLibErrNotSupported (kPmConnectorLibErrorClass | 0x06) 00095 /* Bad version */ 00096 #define kPmConnectorLibErrNotCompatible (kPmConnectorLibErrorClass | 0x07) 00097 /*@}*/ 00098 00099 /*********************************************************************** 00100 * Constants - control commands 00101 ***********************************************************************/ 00102 00103 /** 00104 * @name Control commands for Connector 00105 */ 00106 /*@{*/ 00107 #define kPmConnectorLibCtrlPowerOn 0x01 00108 #define kPmConnectorLibCtrlPowerOff 0x02 00109 #define kPmConnectorLibCtrlGetDeviceClass 0x03 00110 /*@}*/ 00111 00112 /*********************************************************************** 00113 * Notification constants 00114 ***********************************************************************/ 00115 00116 /** 00117 * @name Notification Constants 00118 */ 00119 /*@{*/ 00120 #define kPmConnectorClassAudioWHeadset 0x05 // was 0x00 in versions <= 1.2.0 00121 #define kPmConnectorClassAudioNoHeadset 0x00 // was 0x01 in versions <= 1.2.0 00122 #define kPmConnectorClassCarkit 0x01 // was 0x02 in versions <= 1.2.0 00123 #define kPmConnectorClassGenericSerial 0x03 00124 #define kPmConnectorClassSmartSerial 0x07 00125 #define kPmConnectorClassSerial 0x10 00126 #define kPmConnectorClassUSB 0xf0 00127 #define kPmConnectorClassUnknown 0x00ff 00128 #define kPmConnectorClassNoDevice 0x0fff 00129 #define kPmConnectorClassMask 0x0fff 00130 /*@}*/ 00131 00132 00133 /** @brief State of the connector */ 00134 typedef enum { 00135 kPmConnectorDeviceAttach = 0x8000, /**< is currently attached */ 00136 kPmConnectorDeviceDetach = 0x4000 /**< is currently detached */ 00137 } ePmConnectorDeviceState; 00138 00139 typedef UInt16 PmConnectorStateType; 00140 00141 /** @brief Container for the notification details */ 00142 typedef struct { 00143 UInt32 serialPortId; 00144 UInt32 deviceClass; 00145 UInt32 athenaDeviceCreatorCode; 00146 UInt32 reserved1; 00147 UInt32 reserved2; 00148 } PmConnectorNotifyDataType; 00149 00150 /** 00151 * @brief Audio Output Routings 00152 */ 00153 typedef enum tagAudioOutputSetting 00154 { 00155 kAudioOutputSettingDefault = 0, //device should do something reaasonable based on its current capabilities 00156 kAudioOutputSettingHeadphone, 00157 kAudioOutputSettingAthena, 00158 kAudioOutputSettingSpeaker 00159 } ePmConnectorAudioOutputSettingsType; 00160 00161 /** Audio Output setting type */ 00162 typedef UInt16 PmConnectorAudioOutputSettingType; 00163 00164 typedef enum tagAudioInputSetting 00165 { 00166 kAudioInputDefault = 0, //device should do something reaasonable based on its current capabilities 00167 kAudioInputExternalMic, 00168 kAudioInputInternalMic 00169 } ePmConnectorAudioInputSettingsType; 00170 00171 typedef UInt16 PmConnectorAudioInputSettingType; 00172 00173 00174 /** Library control type */ 00175 typedef UInt16 PmConnectorLibControlType; 00176 00177 #endif // __PMConnectorLIBCOMMON_H__
| Top | Palm Developer Network © 2004-2008, Palm, Inc. All rights reserved. Generated on Fri Jun 13 10:06:55 2008 for Palm API Guide |