dialler 3.29 KB
Newer Older
Kevin Bracey's avatar
Kevin Bracey committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
/* Copyright 1997 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/* File:    dialler.h
 * Purpose: Interface to Dialler SWIs, status codes etc.
 * Author:  B Laughton
 * History: 07-Feb-97: BAL: created
 *          25-Feb-97: BAL: added reason code masks courtesy of AH
 *                          added R0 bit mask for entry to SWI Dialler_Status
 */

#ifndef dialler_h
#define dialler_h

/* =============================================================================
 * Include header files
 */

/* CLib */
#include "kernel.h"




/* =============================================================================
 * Define contants
 */

#ifndef Dialler_Dial
#define Dialler_Dial                     0x04c6c0
#define Dialler_HangUp                   0x04c6c1
#define Dialler_Status                   0x04c6c2
#define Dialler_Answering                0x04c6c3
#define Dialler_Configure                0x04c6c4
#define Dialler_Register                 0x04c6c5
#define Dialler_Arbitrate                0x04c6c6
#define Dialler_Timeout                  0x04c6c7
#define Dialler_ResetCounter             0x04c6c8
#endif


/* Bit masks for r0 flags word on entry to SWI Dialler_Status */
#define Dialler_Status_ConnectTime            0x1

/* SWI Dialler_Arbitrate entry and exit values */
#define Dialler_Arbitrate_RequestIOAccess       0
#define Dialler_Arbitrate_RelinquishAccess      1
#define Dialler_IOAccessGranted_BlockDrivers    0
#define Dialler_IOAccessGranted_DualSerial      1
#define Dialler_IOAccessDenied_ActiveClient    64
#define Dialler_IOAccessDenied_NotConnected    65


#define Service_DiallerStatus                0xb4

/* Reason code masks */
#define Dialler_MajorReasonCodeMask    0xffff0000
#define Dialler_MinorReasonCodeMask    0x0000ff00
#define Dialler_GeneralInfoMask        0x000000ff

/* Major reason code (top two bytes of status word) */
#define Dialler_StateChanged           0x00010000
#define Dialler_LineDropped            0x00020000

/* Minor reason code (2nd byte of status word) */
#define Dialler_ConnectedFlagsMask     0x00000300
#define Dialler_Disconnected           0x00000000
#define Dialler_Connected              0x00000200
#define Dialler_ConnectedOutgoing      0x00000200
#define Dialler_ConnectedIncoming      0x00000300
#define Dialler_RelinquishAccess       0x00000400
#define Dialler_DiallerDroppedLine     0x00000000
#define Dialler_RemoteDroppedLine      0x00000800

/* General info (1st byte of status word) */
enum
{
    Dialler_ExecutingScript_Dial = 1,
    Dialler_ExecutingScript_Hangup,
    Dialler_ExecutingScript_Answer,
    Dialler_AbortedScript_Syntax,
    Dialler_AbortedScript_Timeout,
    Dialler_AbortedScript_NoCarrier,
    Dialler_AbortedScript_Error,
    Dialler_AbortedScript_NoDialtone,
    Dialler_AbortedScript_Busy,
    Dialler_AbortedScript_NoAnswer
};

#endif