background image

8

USB Functions

Main_loop

 –This function spins in an infi nite loop waiting 

for an event that needs servicing. sample_mouse and 
report_mouse_data are the functions which are called 
within this loop to retrieve any new motion or button in-
formation. The data received from these functions will be 
loaded into the endpoint 1 buff er to be sent to the host.

Mice_USB_Loop

 – This routine initializes the USB related 

parameters and then loads the SROM fi rmware into the 
ADNS-6010 sensor before proceeding to AdjustLaser. The 
program then goes to the main_loop.

main_loop

 – This function spins in an infi nite loop waiting 

for an event that needs servicing. The sample_mouse 
function is called within this loop to retrieve any new 
motion or button information. The data received from 
this function will be loaded into the endpoint 1 buff er to 
be sent to the host.

ep0SetupReceived

 – This routine is entered whenever a 

SETUP packet is received in on endpoint 0. It parses the 
packet and calls the appropriate routine to handle the 
packet.

ep0InReceived

 –This routine is entered whenever an IN 

packet is received on endpoint 0.

ep0OutReceived

 – This routine is entered whenever an 

OUT packet is received on endpoint 0.

setDeviceConfi guration

 – This routine is entered when a 

SET CONFIGURATION request has been received from the 
host.

setDeviceAddress

 – This routine is entered whenever 

a SET ADDRESS request has been received. The device 
address change cannot actually take place until after the 
status stage of this no-data control transaction, so the 
address is saved and a fl ag is set to indicate that a new 
address was just received. The code that handles IN trans-
actions will recognize this and set the address properly.

setInterfaceIdle

 – This routine is entered whenever a 

SET IDLE request is received. See the HID specifi cation 
for the rules on setting idle periods. This function sets the 
HID idle time. See the HID documentation for details on 
handling the idle timer.

setInterfaceProtocol

 – This routine is entered whenever 

a SET PROTOCOL request is received. This no-data control 
transaction enables boot or report protocol.

getInterfaceReport

 – This routine is entered whenever a 

GET REPORT request is received.

getInterfaceProtocol

 – This routine is entered whenever 

a GET PROTOCOL request is received. This request initiates 
a control-read transaction that tells the host if the mouse 
is confi gured for boot or report protocol. See the HID class 
documentation for more details.

getDeviceConfi guration

 – This routine is entered 

whenever a GET CONFIGURATION Request is received. 
This function then starts a control read transaction that 
sends the confi guration, interface, endpoint, and HID de-
scriptors to the host.

requestNotSupported

 – Unsupported or invalid descrip-

tor requests will cause this fi rmware to STALL these trans-
actions.

Figure 6. USB Operation Function Call Map

System 

Initialization

USB Intialization

Calibration

Load SROM

AdjustLaser

Main_loop

Sample_mouse

Detect_key_change

ReadDeltaX

ReadDeltaY

Read Z Wheel

Load new mouse 

packet to EP 1 

buffer &  enable 

EP 1

Содержание ADNK-6013-SP01

Страница 1: ...o moving parts which means high reliabil ity and less maintenance for the end user In addition precision optical alignment is not required facilitating high volume assembly The ADNS 6010 enables 400cp...

Страница 2: ...rive the data via MISO The microcontroller is only driving the SCLK line outputs SCLK for the serial interface Optical Sensor Avago Technologies ADNS 6010 optical sensor is used in this reference desi...

Страница 3: ...sses a button the switch will be closed and the pin will be pulled LOW to GND A LOW state at the pin is interpreted as the button being pressed A HIGH state is interpreted as the button has been relea...

Страница 4: ...6010 optical mouse sensor Dimension in millimeters inches Figure 5 Distance from lens reference plane to surface Enabling the SROM The ADNS 6010 must operate from the externally loaded programming Thi...

Страница 5: ...n Note 5088 LASER Power Adjustment Procedure 1 The ambient temperature should be 25C 5C 2 Set VDD3 to its permanent value 3 Ensure that the laser drive is at 100 duty cycle by setting bit 6 of registe...

Страница 6: ...e mouse 2 At this point the process of enumeration is completed Notes 1 idVendor should be changed to the value as supplied by the USB IF 2 idProduct should be assigned for specific product 3 MaxPower...

Страница 7: ...is to check the SROM ID if product device and program ID do not match the program is trapped in the dead loop and thus the device is unusable disable_laser This function is called to disable the oper...

Страница 8: ...nge cannot actually take place until after the status stage of this no data control transaction so the address is saved and a flag is set to indicate that a new address was just received The code that...

Страница 9: ...following string ADNS 6010 Mouse Configuration String A request for the configuration string will return the following string HID Compliant Mouse Endpoint 1 String A request for the endpoint string w...

Страница 10: ...it level block diagram for ADNK 6013 SP01 designer s kit optical mouse using the Avago Technologies ADNS 6010 optical mouse sensor and Sunplus SPCP825A USB Controller Appendix A Schematic Diagram of t...

Страница 11: ...05 1 Chip RES 12 7k 1 0805 1 Cer Cap 470pF 0805 1 Cer Cap 100nF 0805 6 CAPTANTALUM 4 7uF 20V CASE A 2 CAPTANTALUM 2 2uF 10V CASE A 2 PhotoTransistor DIP 1 2N3906 TO92 1 Resonator 6MHz SMD 1 Resonator...

Страница 12: ...12 Appendix C PCB Layout Figure C1 PCB Schematic Bottom Layer Figure C2 PCB Schematic Top Layer...

Страница 13: ...13 Figure C4 PCB Schematic Bottom Overlay Figure C3 PCB Schematic Top Overlay...

Страница 14: ...Y Y Y Y The following is the USB report protocol format and allows the additional wheel movement information in the fourth byte When the wheel is moved forward the fourth byte reports a 0x01 and when...

Страница 15: ...e Lens 5 ADNS 6130 001 Laser VCSEL Trim Lens Plate Lens 5 ADNS 6230 001 Laser VCSEL Assembly Clip VCSEL Clip 5 ADNV 6340 Single Mode Vertical Cavity Surface Emitting LASER VCSEL VCSEL 5 ADNK 6013 SP01...

Отзывы: