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