usbdrv/peripheral/public/usbotgperipheralcontrolif.h
author hgs
Fri, 23 Jul 2010 15:54:47 +0800
changeset 33 089413cdde3c
child 59 bbdce6bffaad
permissions -rw-r--r--
201028_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33
089413cdde3c 201028_02
hgs
parents:
diff changeset
     1
// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
089413cdde3c 201028_02
hgs
parents:
diff changeset
     2
// All rights reserved.
089413cdde3c 201028_02
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
089413cdde3c 201028_02
hgs
parents:
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
089413cdde3c 201028_02
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
089413cdde3c 201028_02
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
089413cdde3c 201028_02
hgs
parents:
diff changeset
     7
//
089413cdde3c 201028_02
hgs
parents:
diff changeset
     8
// Initial Contributors:
089413cdde3c 201028_02
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
089413cdde3c 201028_02
hgs
parents:
diff changeset
    10
//
089413cdde3c 201028_02
hgs
parents:
diff changeset
    11
// Contributors:
089413cdde3c 201028_02
hgs
parents:
diff changeset
    12
//
089413cdde3c 201028_02
hgs
parents:
diff changeset
    13
// Description:
089413cdde3c 201028_02
hgs
parents:
diff changeset
    14
// e32\include\drivers\usbcshared.h
089413cdde3c 201028_02
hgs
parents:
diff changeset
    15
// Kernel side definitions for the USB Device driver stack (PIL + LDD).
089413cdde3c 201028_02
hgs
parents:
diff changeset
    16
// 
089413cdde3c 201028_02
hgs
parents:
diff changeset
    17
//
089413cdde3c 201028_02
hgs
parents:
diff changeset
    18
089413cdde3c 201028_02
hgs
parents:
diff changeset
    19
/**
089413cdde3c 201028_02
hgs
parents:
diff changeset
    20
 @file usbotgperipheralcontrolif.h
089413cdde3c 201028_02
hgs
parents:
diff changeset
    21
 @internalTechnology
089413cdde3c 201028_02
hgs
parents:
diff changeset
    22
*/
089413cdde3c 201028_02
hgs
parents:
diff changeset
    23
089413cdde3c 201028_02
hgs
parents:
diff changeset
    24
#ifndef USBOTGPERIPHERALCONTROLIF_H
089413cdde3c 201028_02
hgs
parents:
diff changeset
    25
#define USBOTGPERIPHERALCONTROLIF_H
089413cdde3c 201028_02
hgs
parents:
diff changeset
    26
089413cdde3c 201028_02
hgs
parents:
diff changeset
    27
#include <usb/usb_peripheral_shai.h> // For UsbShai::TUsbPeripheralEvent
089413cdde3c 201028_02
hgs
parents:
diff changeset
    28
089413cdde3c 201028_02
hgs
parents:
diff changeset
    29
/**
089413cdde3c 201028_02
hgs
parents:
diff changeset
    30
 * This M-class specifies the observer interface that the OTG state
089413cdde3c 201028_02
hgs
parents:
diff changeset
    31
 * machine implements to listen to events of the peripheral stack.
089413cdde3c 201028_02
hgs
parents:
diff changeset
    32
 */
089413cdde3c 201028_02
hgs
parents:
diff changeset
    33
NONSHARABLE_CLASS(MUsbOtgPeripheralObserverIf)
089413cdde3c 201028_02
hgs
parents:
diff changeset
    34
    {
089413cdde3c 201028_02
hgs
parents:
diff changeset
    35
    public:
089413cdde3c 201028_02
hgs
parents:
diff changeset
    36
    /**
089413cdde3c 201028_02
hgs
parents:
diff changeset
    37
     * Called by the peripheral stack to report a peripheral event to
089413cdde3c 201028_02
hgs
parents:
diff changeset
    38
     * the OTG stack.
089413cdde3c 201028_02
hgs
parents:
diff changeset
    39
     *
089413cdde3c 201028_02
hgs
parents:
diff changeset
    40
     * @param aEvent An enumeration value specifying the type of event
089413cdde3c 201028_02
hgs
parents:
diff changeset
    41
     *   that has occurred
089413cdde3c 201028_02
hgs
parents:
diff changeset
    42
     */
089413cdde3c 201028_02
hgs
parents:
diff changeset
    43
    virtual void NotifyPeripheralEvent(UsbShai::TUsbPeripheralEvent aEvent) = 0;
089413cdde3c 201028_02
hgs
parents:
diff changeset
    44
    };
089413cdde3c 201028_02
hgs
parents:
diff changeset
    45
089413cdde3c 201028_02
hgs
parents:
diff changeset
    46
089413cdde3c 201028_02
hgs
parents:
diff changeset
    47
/**
089413cdde3c 201028_02
hgs
parents:
diff changeset
    48
 * This M-class specifies the control interface that the OTG state
089413cdde3c 201028_02
hgs
parents:
diff changeset
    49
 * machine uses to control the peripheral stack and register for
089413cdde3c 201028_02
hgs
parents:
diff changeset
    50
 * peripheral events.
089413cdde3c 201028_02
hgs
parents:
diff changeset
    51
 */
089413cdde3c 201028_02
hgs
parents:
diff changeset
    52
NONSHARABLE_CLASS(MUsbOtgPeripheralControlIf)
089413cdde3c 201028_02
hgs
parents:
diff changeset
    53
    {
089413cdde3c 201028_02
hgs
parents:
diff changeset
    54
    public:
089413cdde3c 201028_02
hgs
parents:
diff changeset
    55
    /**
089413cdde3c 201028_02
hgs
parents:
diff changeset
    56
     * Called by the OTG state machine to enable the peripheral stack.
089413cdde3c 201028_02
hgs
parents:
diff changeset
    57
     * When called, the peripheral stack must activate the controller
089413cdde3c 201028_02
hgs
parents:
diff changeset
    58
     * and connect to the bus as soon as possible.
089413cdde3c 201028_02
hgs
parents:
diff changeset
    59
     */
089413cdde3c 201028_02
hgs
parents:
diff changeset
    60
    virtual void EnablePeripheralStack() = 0;
089413cdde3c 201028_02
hgs
parents:
diff changeset
    61
089413cdde3c 201028_02
hgs
parents:
diff changeset
    62
    /**
089413cdde3c 201028_02
hgs
parents:
diff changeset
    63
     * Called by the OTG state machine to disable the peripheral
089413cdde3c 201028_02
hgs
parents:
diff changeset
    64
     * stack. When called, the peripheral stack must immediately
089413cdde3c 201028_02
hgs
parents:
diff changeset
    65
     * disconnect from the bus and deactivate the controller.
089413cdde3c 201028_02
hgs
parents:
diff changeset
    66
     */
089413cdde3c 201028_02
hgs
parents:
diff changeset
    67
    virtual void DisablePeripheralStack() = 0;
089413cdde3c 201028_02
hgs
parents:
diff changeset
    68
089413cdde3c 201028_02
hgs
parents:
diff changeset
    69
    /**
089413cdde3c 201028_02
hgs
parents:
diff changeset
    70
     * Called by the OTG state machine to set the peripheral event
089413cdde3c 201028_02
hgs
parents:
diff changeset
    71
     * observer.
089413cdde3c 201028_02
hgs
parents:
diff changeset
    72
     *
089413cdde3c 201028_02
hgs
parents:
diff changeset
    73
     * @param aObserver Pointer to the OTG Observer, or NULL when the
089413cdde3c 201028_02
hgs
parents:
diff changeset
    74
     *   OTG stack is being shutdown.
089413cdde3c 201028_02
hgs
parents:
diff changeset
    75
     */
089413cdde3c 201028_02
hgs
parents:
diff changeset
    76
    virtual void SetOtgObserver(MUsbOtgPeripheralObserverIf* aObserver) = 0;
089413cdde3c 201028_02
hgs
parents:
diff changeset
    77
    };
089413cdde3c 201028_02
hgs
parents:
diff changeset
    78
089413cdde3c 201028_02
hgs
parents:
diff changeset
    79
089413cdde3c 201028_02
hgs
parents:
diff changeset
    80
#endif    // USBOTGPERIPHERALCONTROLIF_H