Skip to content
Snippets Groups Projects
Commit 90b7b7c5 authored by Ricco Müller's avatar Ricco Müller
Browse files

Upload New File

parent 5d2963ec
No related branches found
No related tags found
No related merge requests found
#include <Arduino.h>
#include <SPI.h>
#ifndef ADNS3080_h
#define ADNS3080_h
//------------ Constants and registers ---------------
// Signal delay time:
#define ADNS3080_T_IN_RST 500
#define ADNS3080_T_PW_RESET 10
#define ADNS3080_T_SRAD_MOT 75
#define ADNS3080_T_SWW 50
#define ADNS3080_T_SRAD 50
#define ADNS3080_T_LOAD 10
#define ADNS3080_T_BEXIT 4
// Pixel dimensions:
#define ADNS3080_PIXELS 30
// Registers:
#define ADNS3080_PRODUCT_ID 0x00
#define ADNS3080_CONFIGURATION_BITS 0x0a
#define ADNS3080_MOTION_CLEAR 0x12
#define ADNS3080_FRAME_CAPTURE 0x13
#define ADNS3080_PIXEL_BURST 0x40
#define ADNS3080_MOTION_BURST 0x50
#define ADNS3080_PRODUCT_ID_VALUE 0x17
//--------------- Template Parameters ---------------- [ No characters after backlash! ]
#define TEMPLATE_TYPE \
uint8_t PIN_RESET, \
uint8_t PIN_NCS
#define TEMPLATE_INPUTS \
PIN_RESET, \
PIN_NCS
//---------------- Class definition ------------------
template <TEMPLATE_TYPE>
class ADNS3080 {
private:
// Read and write registers:
void writeRegister( const uint8_t, uint8_t );
uint8_t readRegister( const uint8_t );
public:
// Miscellaneous functions:
void reset();
bool setup( const bool=false, const bool=false );
void motionClear();
bool available();
// Major outputs:
void motionBurst( uint8_t*, int8_t*, int8_t*, uint8_t*, uint16_t*, uint8_t* );
void displacement( int8_t*, int8_t* );
void frameCapture( uint8_t[ADNS3080_PIXELS][ADNS3080_PIXELS] );
};
#include "ADNS_3080.tpp"
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment