Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Schwimmwinkelsensor MA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ricco Müller
Schwimmwinkelsensor MA
Commits
90b7b7c5
Commit
90b7b7c5
authored
11 months ago
by
Ricco Müller
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
5d2963ec
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Arduino Code/Schwimmwinkel_FINAL/ADNS_3080.h
+64
-0
64 additions, 0 deletions
Arduino Code/Schwimmwinkel_FINAL/ADNS_3080.h
with
64 additions
and
0 deletions
Arduino Code/Schwimmwinkel_FINAL/ADNS_3080.h
0 → 100644
+
64
−
0
View file @
90b7b7c5
#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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment