Avago ADNS6010 mouse chip library This class referred to ADNS5020EN library http://mbed.org/users/IPAB/programs/ADNS5020EN/5zwdp

Embed: (wiki syntax)

« Back to documentation index

ADNS6010 Class Reference

ADNS6010 Class Reference

Interface to control a ADNS-6010 Avago mouse chip using a SPI and 3 DigitalOuts. More...

#include <ADNS6010.h>

Public Member Functions

 ADNS6010 (PinName mosi, PinName miso, PinName sclk, PinName ncs, PinName reset, PinName npd)
 Create the mouse chip control interface.
void read_deltas (int *a_dx, int *a_dy)
 Read the deltaX and deltaY registers and assign to the input variable the counts for the previous read.
int read_squal ()
 Read the SQUAL registers.
void changeCPI (int cpi)
 Change the resolution of the mouse chip.
void set_freq (int freq)
 Set new operating frequency to the mouse chip.
void end ()
 Chip Power Down.
void start ()
 Chip Power Up.

Detailed Description

Interface to control a ADNS-6010 Avago mouse chip using a SPI and 3 DigitalOuts.

Definition at line 29 of file ADNS6010.h.


Constructor & Destructor Documentation

ADNS6010 ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  ncs,
PinName  reset,
PinName  npd 
)

Create the mouse chip control interface.

Returns Error if the connection is not established.

Parameters:
mosiA SPI(mosi) pin, for the spi interface of the mouse chip (SDIO)
misoA SPI(miso) pin, for the spi interface of the mouse chip (SDIO)
sclkA SPI(sclk) pin, for the spi interface of the mouse chip (SCLK)
ncsA DigitalOut, set low for chip select
resetA DigitalOut, set high for chip reset
npdA DigitalOut, set high for chip powerdown

Definition at line 3 of file ADNS6010.cpp.


Member Function Documentation

void changeCPI ( int  cpi )

Change the resolution of the mouse chip.

Parameters:
cpiA int value 400 or 800 or 1600 or 2000

Definition at line 39 of file ADNS6010.cpp.

void end (  )

Chip Power Down.

Definition at line 68 of file ADNS6010.cpp.

void read_deltas ( int *  a_dx,
int *  a_dy 
)

Read the deltaX and deltaY registers and assign to the input variable the counts for the previous read.

Parameters:
a_dxA pointer to an integer, to return the value of the deltaX register in reading counts
a_dyA pointer to an integer, to return the value of the deltaY register in reading counts

Definition at line 99 of file ADNS6010.cpp.

int read_squal (  )

Read the SQUAL registers.

Returns:
SQUAL register value an integer

Definition at line 93 of file ADNS6010.cpp.

void set_freq ( int  freq )

Set new operating frequency to the mouse chip.

Parameters:
freqA int value between 500000 and 2000000 for the SPI frequency(in MHz)

Definition at line 85 of file ADNS6010.cpp.

void start (  )

Chip Power Up.

Definition at line 73 of file ADNS6010.cpp.