EZR32 Wonder Gecko Software Documentation
ezr32wg-doc-4.2.1
|
Common parts for both HOST and DEVICE USB stacks, see USB device stack library and USB host stack library pages for device and host library documentation.
. More...
Data Structures | |
struct | USB_Setup_TypeDef |
USB Setup request package. More... | |
struct | USB_DeviceDescriptor_TypeDef |
USB Device Descriptor. More... | |
struct | USB_ConfigurationDescriptor_TypeDef |
USB Configuration Descriptor. More... | |
struct | USB_InterfaceDescriptor_TypeDef |
USB Interface Descriptor. More... | |
struct | USB_EndpointDescriptor_TypeDef |
USB Endpoint Descriptor. More... | |
struct | USB_StringDescriptor_TypeDef |
USB String Descriptor. More... | |
Typedefs | |
typedef unsigned short | char16_t |
typedef int(* | USB_XferCompleteCb_TypeDef) (USB_Status_TypeDef status, uint32_t xferred, uint32_t remaining) |
USB transfer callback function. More... | |
typedef void(* | USBTIMER_Callback_TypeDef) (void) |
USBTIMER callback function. More... | |
Enumerations | |
enum | USB_Status_TypeDef { USB_STATUS_OK = 0, USB_STATUS_REQ_ERR = -1, USB_STATUS_EP_BUSY = -2, USB_STATUS_REQ_UNHANDLED = -3, USB_STATUS_ILLEGAL = -4, USB_STATUS_EP_STALLED = -5, USB_STATUS_EP_ABORTED = -6, USB_STATUS_EP_ERROR = -7, USB_STATUS_EP_NAK = -8, USB_STATUS_DEVICE_UNCONFIGURED = -9, USB_STATUS_DEVICE_SUSPENDED = -10, USB_STATUS_DEVICE_RESET = -11, USB_STATUS_TIMEOUT = -12, USB_STATUS_DEVICE_REMOVED = -13, USB_STATUS_HC_BUSY = -14, USB_STATUS_DEVICE_MALFUNCTION = -15, USB_STATUS_PORT_OVERCURRENT = -16 } |
USB transfer status enumerator. More... | |
Functions | |
int | USB_PUTCHAR (char c) |
Transmit a single char on the debug serial port. More... | |
void | USB_PUTS (const char *p) |
Transmit a zero terminated string on the debug serial port. More... | |
int | USB_PRINTF (const char *format,...) |
Transmit "printf" formated data on the debug serial port. More... | |
char * | USB_GetErrorMsgString (int error) |
Return an error message string for a given error code. More... | |
void | USB_PrintErrorMsgString (char *pre, int error) |
Format and print a text string given an error code, prepends an optional user supplied leader string. More... | |
void | USBTIMER_DelayMs (uint32_t msec) |
Active wait millisecond delay function. Can also be used inside interrupt handlers. More... | |
void | USBTIMER_DelayUs (uint32_t usec) |
Active wait microsecond delay function. Can also be used inside interrupt handlers. More... | |
void | USBTIMER_Init (void) |
Activate the hardware timer used to pace the 1 millisecond timer system. More... | |
void | USBTIMER_Start (uint32_t id, uint32_t timeout, USBTIMER_Callback_TypeDef callback) |
Start a timer. More... | |
void | USBTIMER_Stop (uint32_t id) |
Stop a timer. More... | |
#define SILABS_USB_VID 0x10C4 |
#define USB_SETUP_DIR_OUT 0 |
Setup request data stage OUT direction value.
Definition at line 58 of file em_usb.h.
Referenced by MSDD_SetupCmd().
#define USB_SETUP_DIR_IN 1 |
Setup request data stage IN direction value.
Definition at line 59 of file em_usb.h.
Referenced by CDC_SetupCmd(), HIDKBD_SetupCmd(), and MSDD_SetupCmd().
#define USB_SETUP_DIR_MASK 0x80 |
Setup request data stage direction mask.
Definition at line 60 of file em_usb.h.
Referenced by USBD_Init(), and USBH_AssignHostChannel().
#define USB_SETUP_DIR_D2H 0x80 |
Setup request data stage IN direction mask.
Definition at line 61 of file em_usb.h.
Referenced by USBH_GetConfigurationDescriptorB(), USBH_GetDeviceDescriptorB(), and USBH_GetStringB().
#define USB_SETUP_DIR_H2D 0x00 |
Setup request data stage OUT direction mask.
Definition at line 62 of file em_usb.h.
Referenced by USBH_SetAddressB(), USBH_SetAltInterfaceB(), USBH_SetConfigurationB(), USBH_StallEpB(), and USBH_UnStallEpB().
#define USB_SETUP_TYPE_STANDARD 0 |
Standard setup request value.
Definition at line 65 of file em_usb.h.
Referenced by HIDKBD_SetupCmd(), and MSDD_SetupCmd().
#define USB_SETUP_TYPE_CLASS 1 |
Class setup request value.
Definition at line 66 of file em_usb.h.
Referenced by CDC_SetupCmd(), HIDKBD_SetupCmd(), and MSDD_SetupCmd().
#define USB_SETUP_TYPE_STANDARD_MASK 0x00 |
Standard setup request mask.
Definition at line 68 of file em_usb.h.
Referenced by USBH_GetConfigurationDescriptorB(), USBH_GetDeviceDescriptorB(), USBH_GetStringB(), USBH_SetAddressB(), USBH_SetAltInterfaceB(), USBH_SetConfigurationB(), USBH_StallEpB(), and USBH_UnStallEpB().
#define USB_SETUP_TYPE_CLASS_MASK 0x20 |
#define USB_SETUP_TYPE_VENDOR_MASK 0x40 |
#define USB_SETUP_RECIPIENT_DEVICE 0 |
Setup request device recipient value.
Definition at line 73 of file em_usb.h.
Referenced by USBH_GetConfigurationDescriptorB(), USBH_GetDeviceDescriptorB(), USBH_GetStringB(), USBH_SetAddressB(), and USBH_SetConfigurationB().
#define USB_SETUP_RECIPIENT_INTERFACE 1 |
Setup request interface recipient value.
Definition at line 74 of file em_usb.h.
Referenced by CDC_SetupCmd(), HIDKBD_SetupCmd(), MSDD_SetupCmd(), and USBH_SetAltInterfaceB().
#define USB_SETUP_RECIPIENT_ENDPOINT 2 |
Setup request endpoint recipient value.
Definition at line 75 of file em_usb.h.
Referenced by MSDD_SetupCmd(), USBH_StallEpB(), and USBH_UnStallEpB().
#define USB_SETUP_RECIPIENT_OTHER 3 |
#define CLEAR_FEATURE 1 |
Standard setup request CLEAR_FEATURE.
Definition at line 80 of file em_usb.h.
Referenced by MSDD_SetupCmd(), and USBH_UnStallEpB().
#define SET_FEATURE 3 |
Standard setup request SET_FEATURE.
Definition at line 81 of file em_usb.h.
Referenced by USBH_StallEpB().
#define SET_ADDRESS 5 |
Standard setup request SET_ADDRESS.
Definition at line 82 of file em_usb.h.
Referenced by USBH_SetAddressB().
#define GET_DESCRIPTOR 6 |
Standard setup request GET_DESCRIPTOR.
Definition at line 83 of file em_usb.h.
Referenced by HIDKBD_SetupCmd(), USBH_GetConfigurationDescriptorB(), USBH_GetDeviceDescriptorB(), and USBH_GetStringB().
#define SET_DESCRIPTOR 7 |
#define GET_CONFIGURATION 8 |
#define SET_CONFIGURATION 9 |
Standard setup request SET_CONFIGURATION.
Definition at line 86 of file em_usb.h.
Referenced by USBH_SetConfigurationB().
#define GET_INTERFACE 10 |
#define SET_INTERFACE 11 |
Standard setup request SET_INTERFACE.
Definition at line 88 of file em_usb.h.
Referenced by USBH_SetAltInterfaceB().
#define USB_HID_GET_REPORT 0x01 |
HID class setup request GET_REPORT.
Definition at line 92 of file em_usb.h.
Referenced by HIDKBD_SetupCmd().
#define USB_HID_GET_IDLE 0x02 |
HID class setup request GET_IDLE.
Definition at line 93 of file em_usb.h.
Referenced by HIDKBD_SetupCmd().
#define USB_HID_SET_REPORT 0x09 |
HID class setup request SET_REPORT.
Definition at line 94 of file em_usb.h.
Referenced by HIDKBD_SetupCmd().
#define USB_HID_SET_IDLE 0x0A |
HID class setup request SET_IDLE.
Definition at line 95 of file em_usb.h.
Referenced by HIDKBD_SetupCmd().
#define USB_HID_SET_PROTOCOL 0x0B |
#define USB_CDC_SETLINECODING 0x20 |
CDC class setup request SET_LINE_CODING.
Definition at line 97 of file em_usb.h.
Referenced by CDC_SetupCmd().
#define USB_CDC_GETLINECODING 0x21 |
CDC class setup request GET_LINE_CODING.
Definition at line 98 of file em_usb.h.
Referenced by CDC_SetupCmd().
#define USB_CDC_SETCTRLLINESTATE 0x22 |
CDC class setup request SET_CONTROL_LINE_STATE.
Definition at line 99 of file em_usb.h.
Referenced by CDC_SetupCmd().
#define USB_MSD_BOTRESET 0xFF |
MSD class setup request Bulk only transfer reset.
Definition at line 100 of file em_usb.h.
Referenced by MSDD_SetupCmd().
#define USB_MSD_GETMAXLUN 0xFE |
MSD class setup request Get Max LUN.
Definition at line 101 of file em_usb.h.
Referenced by MSDD_SetupCmd().
#define USB_AUDIO_GET_CUR 0x81 |
#define USB_AUDIO_GET_CUR 0x81 |
#define USB_AUDIO_SET_CUR 0x01 |
#define USB_AUDIO_SET_MIN 0x02 |
#define USB_AUDIO_GET_MIN 0x82 |
#define USB_AUDIO_SET_MAX 0x03 |
#define USB_AUDIO_GET_MAX 0x83 |
#define USB_AUDIO_SET_RES 0x04 |
#define USB_AUDIO_GET_RES 0x84 |
#define USB_AUDIO_SET_MEM 0x05 |
#define USB_AUDIO_GET_MEM 0x85 |
#define USB_AUDIO_GET_STAT 0xFF |
#define USB_DEVICE_DESCRIPTOR 1 |
DEVICE descriptor value.
Definition at line 116 of file em_usb.h.
Referenced by USBH_GetDeviceDescriptorB(), and USBH_QGetDeviceDescriptor().
#define USB_CONFIG_DESCRIPTOR 2 |
CONFIGURATION descriptor value.
Definition at line 117 of file em_usb.h.
Referenced by USBH_GetConfigurationDescriptorB(), and USBH_QGetConfigurationDescriptor().
#define USB_STRING_DESCRIPTOR 3 |
#define USB_MAX_STRING_DESCRIPTOR_CHARS 126 |
#define USB_INTERFACE_DESCRIPTOR 4 |
INTERFACE descriptor value.
Definition at line 120 of file em_usb.h.
Referenced by USBD_Init(), and USBH_QGetInterfaceDescriptor().
#define USB_ENDPOINT_DESCRIPTOR 5 |
ENDPOINT descriptor value.
Definition at line 121 of file em_usb.h.
Referenced by USBD_Init(), and USBH_QGetEndpointDescriptor().
#define USB_DEVICE_QUALIFIER_DESCRIPTOR 6 |
#define USB_OTHER_SPEED_CONFIG_DESCRIPTOR 7 |
#define USB_INTERFACE_POWER_DESCRIPTOR 8 |
#define USB_INTERFACE_ASSOCIATION_DESCRIPTOR 11 |
#define USB_HID_DESCRIPTOR 0x21 |
#define USB_SMARTCARD_DESCRIPTOR 0x21 |
#define USB_HID_REPORT_DESCRIPTOR 0x22 |
HID REPORT descriptor value.
Definition at line 128 of file em_usb.h.
Referenced by HIDKBD_SetupCmd().
#define USB_CS_INTERFACE_DESCRIPTOR 0x24 |
#define USB_CS_ENDPOINT_DESCRIPTOR 0x25 |
#define USB_CA_HEADER_DESCRIPTOR 1 |
#define USB_CA_INPUT_TERMINAL_DESCRIPTOR 2 |
#define USB_CA_OUTPUT_TERMINAL_DESCRIPTOR 3 |
#define USB_CA_MIXER_UNIT_DESCRIPTOR 4 |
#define USB_CA_SELECTOR_UNIT_DESCRIPTOR 5 |
#define USB_CA_FEATURE_UNIT_DESCRIPTOR 6 |
#define USB_CA_PROCESSING_UNIT_DESCRIPTOR 7 |
#define USB_CA_EXTENSION_UNIT_DESCRIPTOR 8 |
#define USB_CA_EP_GENERAL_DESCRIPTOR 1 |
#define USB_CA_AS_GENERAL_DESCRIPTOR 1 |
#define USB_CA_FORMAT_TYPE_DESCRIPTOR 2 |
#define USB_DEVICE_DESCSIZE 18 |
Device descriptor size.
Definition at line 144 of file em_usb.h.
Referenced by USBH_InitDeviceData(), USBH_QGetDeviceDescriptor(), and USBH_QueryDeviceB().
#define USB_CONFIG_DESCSIZE 9 |
Configuration descriptor size.
Definition at line 145 of file em_usb.h.
Referenced by USBH_InitDeviceData(), USBH_QGetConfigurationDescriptor(), USBH_QGetInterfaceDescriptor(), and USBH_QueryDeviceB().
#define USB_INTERFACE_DESCSIZE 9 |
Interface descriptor size.
Definition at line 146 of file em_usb.h.
Referenced by USBH_InitDeviceData(), USBH_QGetEndpointDescriptor(), USBH_QGetInterfaceDescriptor(), and USBH_QueryDeviceB().
#define USB_ENDPOINT_DESCSIZE 7 |
Endpoint descriptor size.
Definition at line 147 of file em_usb.h.
Referenced by USBH_InitDeviceData(), and USBH_QGetEndpointDescriptor().
#define USB_DEVICE_QUALIFIER_DESCSIZE 10 |
#define USB_OTHER_SPEED_CONFIG_DESCSIZE 9 |
#define USB_INTERFACE_ASSOCIATION_DESCSIZE 8 |
#define USB_HID_DESCSIZE 9 |
#define USB_CDC_HEADER_FND_DESCSIZE 5 |
#define USB_CDC_CALLMNG_FND_DESCSIZE 5 |
#define USB_CDC_ACM_FND_DESCSIZE 4 |
#define USB_CA_INPUT_TERMINAL_DESCSIZE 12 |
#define USB_CA_OUTPUT_TERMINAL_DESCSIZE 9 |
#define USB_CA_EP_GENERAL_DESCSIZE 7 |
#define USB_CA_AS_GENERAL_DESCSIZE 7 |
#define USB_CA_STD_AS_ENDPOINT_DESCSZIE 9 |
#define USB_LS_CTRL_EP_MAXSIZE 8 |
#define USB_LS_INTR_EP_MAXSIZE 8 |
#define USB_FS_CTRL_EP_MAXSIZE 64 |
#define USB_FS_INTR_EP_MAXSIZE 64 |
#define USB_FS_BULK_EP_MAXSIZE 64 |
#define USB_FS_ISOC_EP_MAXSIZE 1023 |
#define USB_EPTYPE_CTRL 0 |
Endpoint type control.
Definition at line 169 of file em_usb.h.
Referenced by USBD_Init(), and USBH_InitDeviceData().
#define USB_EPTYPE_INTR 3 |
Endpoint type interrupt.
Definition at line 172 of file em_usb.h.
Referenced by USBH_Read(), and USBH_Write().
#define USB_EPSYNC_NO (0 << 2) |
#define USB_EPSYNC_ASYNC (1 << 2) |
#define USB_EPSYNC_ADAPTIVE (2 << 2) |
#define USB_EPSYNC_SYNC (3 << 2) |
#define USB_EPNUM_MASK 0x0F |
#define USB_LANGID_ENUS 0x0409 |
#define USB_MAX_DEVICE_ADDRESS 127 |
Maximum allowable device address.
Definition at line 181 of file em_usb.h.
Referenced by USBH_SetAddressB().
#define CONFIG_DESC_BM_REMOTEWAKEUP 0x20 |
#define CONFIG_DESC_BM_SELFPOWERED 0x40 |
#define CONFIG_DESC_BM_RESERVED_D7 0x80 |
#define CONFIG_DESC_BM_TRANSFERTYPE 0x03 |
Configuration descriptor transfer type bitmask.
Definition at line 186 of file em_usb.h.
Referenced by USBD_Init(), and USBH_AssignHostChannel().
#define CONFIG_DESC_MAXPOWER_mA | ( | x | ) | (((x)+1)/2) |
#define DEVICE_IS_SELFPOWERED 0x0001 |
#define REMOTE_WAKEUP_ENABLED 0x0002 |
#define USB_FEATURE_ENDPOINT_HALT 0 |
Standard request CLEAR/SET_FEATURE bitmask.
Definition at line 191 of file em_usb.h.
Referenced by MSDD_SetupCmd(), USBH_StallEpB(), and USBH_UnStallEpB().
#define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 |
#define HUB_FEATURE_PORT_RESET 4 |
#define HUB_FEATURE_PORT_POWER 8 |
#define HUB_FEATURE_C_PORT_CONNECTION 16 |
#define HUB_FEATURE_C_PORT_RESET 20 |
#define HUB_FEATURE_PORT_INDICATOR 22 |
#define USB_CLASS_CDC_DATA 0x0A |
#define USB_CLASS_CDC_ACM 2 |
#define USB_CLASS_CDC_HFN 0 |
#define USB_CLASS_CDC_CMNGFN 1 |
#define USB_CLASS_CDC_ACMFN 2 |
#define USB_CLASS_CDC_UNIONFN 6 |
#define USB_CLASS_HID_KEYBOARD 1 |
#define USB_CLASS_HID_MOUSE 2 |
#define USB_CLASS_MSD_BOT_TRANSPORT 0x50 |
#define USB_CLASS_MSD_SCSI_CMDSET 6 |
#define USB_CLASS_MSD_CSW_CMDPASSED 0 |
MSD BOT Command status wrapper command passed code.
Definition at line 217 of file em_usb.h.
Referenced by MSDBOT_Xfer().
#define USB_CLASS_MSD_CSW_CMDFAILED 1 |
#define USB_CLASS_MSD_CSW_PHASEERROR 2 |
#define USB_CLASS_AUDIO_CONTROL 1 |
#define USB_CLASS_AUDIO_STREAMING 2 |
#define USB_CLASS_AUDIO_MIDISTREAMING 3 |
#define USB_CLASS_MISCELLANEOUS 0xEF |
#define USB_CLASS_MISC_COMMON_SUBCLASS 2 |
#define USB_CLASS_MISC_IAD_PROTOCOL 1 |
#define PORT_FULL_SPEED 1 |
Full speed return value for USBH_GetPortSpeed().
Definition at line 231 of file em_usb.h.
Referenced by MSDBOT_Init().
#define PORT_LOW_SPEED 2 |
Low speed return value for USBH_GetPortSpeed().
#define STATIC_CONST_STRING_DESC | ( | _name, | |
... | |||
) |
Macro for creating USB compliant UTF-16LE UNICODE string descriptors.
Example: STATIC_CONST_STRING_DESC( iManufacturer, 'E','n','e','r','g','y',' ','M','i','c','r','o',' ','A','S' );
#define STATIC_CONST_STRING_DESC_LANGID | ( | _name, | |
x, | |||
y | |||
) |
Macro for creating USB compliant language string descriptors.
Example: STATIC_CONST_STRING_DESC_LANGID( langID, 0x04, 0x09 );
#define UBUF | ( | x, | |
y | |||
) | uint8_t x[((y)+3)&~3] __attribute__ ((aligned(4))) |
Macro for creating WORD (4 byte) aligned uint8_t array with size which is a multiple of WORD size.
Example:
UBUF( rxBuffer, 37 ); => uint8_t rxBuffer[ 40 ];
#define STATIC_UBUF | ( | x, | |
y | |||
) | static uint8_t x[((y)+3)&~3] __attribute__ ((aligned(4))) |
Macro for creating WORD (4 byte) aligned static uint8_t arrays with size which is a multiple of WORD size.
Example:
STATIC_UBUF( rxBuffer, 37 ); => static uint8_t rxBuffer[ 40 ];
Definition at line 311 of file em_usb.h.
Referenced by HIDKBD_SetupCmd().
typedef unsigned short char16_t |
typedef int(* USB_XferCompleteCb_TypeDef) (USB_Status_TypeDef status, uint32_t xferred, uint32_t remaining) |
The callback function is called when a transfer has completed. An application should check the status, xferred and optionally the remaining parameters before deciding if the transfer is usable. In the case where the transfer is part of a control request data stage, the callback function should return an appropriate USB_Status_TypeDef status.
[in] | status | The transfer status. See USB_Status_TypeDef. |
[in] | xferred | Number of bytes actually transferred. |
[in] | remaining | Number of bytes not transferred. |
typedef void(* USBTIMER_Callback_TypeDef) (void) |
enum USB_Status_TypeDef |
int USB_PUTCHAR | ( | char | c | ) |
[in] | c | Char to transmit. |
Referenced by USBH_PrintConfigurationDescriptor(), and USBH_PrintString().
void USB_PUTS | ( | const char * | p | ) |
[in] | p | Pointer to string to transmit. |
Referenced by USBH_PrintString().
int USB_PRINTF | ( | const char * | format, |
... | |||
) |
[in] | format | Format string (as in printf). No floating point format support. |
Referenced by MSDH_Init(), USB_PrintErrorMsgString(), USBH_PrintConfigurationDescriptor(), USBH_PrintDeviceDescriptor(), USBH_PrintEndpointDescriptor(), and USBH_PrintInterfaceDescriptor().
char* USB_GetErrorMsgString | ( | int | error | ) |
[in] | error | Error code, see USB_Status_TypeDef. |
Definition at line 71 of file em_usbhal.c.
Referenced by USB_PrintErrorMsgString().
void USB_PrintErrorMsgString | ( | char * | pre, |
int | error | ||
) |
[in] | pre | Optional leader string to prepend to error message string. |
[in] | error | Error code, see USB_Status_TypeDef. |
Definition at line 92 of file em_usbhal.c.
References USB_GetErrorMsgString(), USB_PRINTF(), and USB_STATUS_OK.
void USBTIMER_DelayMs | ( | uint32_t | msec | ) |
[in] | msec | Number of milliseconds to wait. |
Definition at line 135 of file em_usbtimer.c.
Referenced by MSDH_Init(), USBD_RemoteWakeup(), USBH_PortReset(), USBH_PortResume(), and USBH_WaitForDeviceConnectionB().
void USBTIMER_DelayUs | ( | uint32_t | usec | ) |
[in] | usec | Number of microseconds to wait. |
Definition at line 156 of file em_usbtimer.c.
void USBTIMER_Init | ( | void | ) |
Call this function whenever the HFPERCLK frequency is changed. This function is initially called by HOST and DEVICE stack xxxx_Init() functions.
Definition at line 190 of file em_usbtimer.c.
References CMU_ClockEnable(), CMU_ClockFreqGet(), cmuClock_HFPER, TIMER_InitCC_TypeDef::mode, TIMER_CompareSet(), TIMER_CounterGet(), TIMER_IEN_CC0, TIMER_Init(), TIMER_INIT_DEFAULT, TIMER_InitCC(), TIMER_INITCC_DEFAULT, TIMER_IntClear(), TIMER_IntEnable(), TIMER_TopSet(), and timerCCModeCompare.
Referenced by USBD_Init(), and USBH_Init().
void USBTIMER_Start | ( | uint32_t | id, |
uint32_t | timeout, | ||
USBTIMER_Callback_TypeDef | callback | ||
) |
If the timer is already running, it will be restarted with new timeout.
[in] | id | Timer id (0..). |
[in] | timeout | Number of milliseconds before timer will elapse. |
[in] | callback | Function to be called on timer elapse, ref. USBTIMER_Callback_TypeDef. |
Definition at line 234 of file em_usbtimer.c.
References INT_Disable(), INT_Enable(), and USBTIMER_Stop().
Referenced by CDC_StateChangeEvent(), HIDKBD_StateChangeEvent(), USBH_ControlMsg(), USBH_Read(), and USBH_Write().
void USBTIMER_Stop | ( | uint32_t | id | ) |
[in] | id | Timer id (0..). |
Definition at line 302 of file em_usbtimer.c.
References INT_Disable(), and INT_Enable().
Referenced by CDC_StateChangeEvent(), HIDKBD_SetupCmd(), HIDKBD_StateChangeEvent(), USBH_Stop(), USBH_WaitForDeviceConnectionB(), and USBTIMER_Start().