Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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:
-
mosi A SPI(mosi) pin, for the spi interface of the mouse chip (SDIO) miso A SPI(miso) pin, for the spi interface of the mouse chip (SDIO) sclk A SPI(sclk) pin, for the spi interface of the mouse chip (SCLK) ncs A DigitalOut, set low for chip select reset A DigitalOut, set high for chip reset npd A 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:
-
cpi A 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_dx A pointer to an integer, to return the value of the deltaX register in reading counts a_dy A 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:
-
freq A 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.
Generated on Wed Jul 13 2022 17:51:04 by
1.7.2