Chameleon-PIC Nurve Networks, Chameleon-PIC Datasheet - Page 202

MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)

Chameleon-PIC

Manufacturer Part Number
Chameleon-PIC
Description
MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)
Manufacturer
Nurve Networks
Datasheet

Specifications of Chameleon-PIC

Processor To Be Evaluated
PIC24
Data Bus Width
16 bit
Interface Type
USB, VGA, PS/2, I2C, ISP, SPI
Operating Supply Voltage
3.3 V, 5 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
However, I only exposed a portion of its abilities thru the current SPI messages, no need to waste messages. You can
always add more. Therefore, the abilities you see exposed in the following API are just a taste of what it can do. In other
words, if you need more functions that the driver supports then you will have to add messages to the SPI driver and add
them yourself.
With that in mind, if you want to use the mouse driver then you need the following files added to your project:
25.1 A Brief Mouse Primer
Mice typically have two axes and a number of buttons. The two axes (X and Y) are decoded as the moves either
mechanically (roller mice) or optically. Inside the mouse is a microprocessor that actually handles all the decoding and
sending of the information. There are two ways that mice send messages; absolute and relative. In absolute mode, the X-
Y position is accumulated, and in relative mode, the mouse sends the current change from the last positions. Additionally,
mouse have “sensitivity” settings that you can control that slow or speed the relative mouse message values to the
surface they are moving on. Finally, some mice have a “Z-axis” which is usually the scrub wheel, this is just like the X-Y.
Finally, the mice have a number of buttons, these are encoded by the mouse as simple switches. There is a whole mouse
message API that most mice respond to, but for our purposes we will let the Propeller driver deal with it. All our API needs
to do is call the driver over the SPI link, get absolute, relative, position and the buttons – simple.
25.2 Header File Contents Overview
The “Mouse” module header CHAM_PIC_MOUSE_DRV_V010.h actually has nothing in it once again (I told you this stuff
was easy!). However, the mouse does use a data structure located in the global system file
CHAM_PIC_SYSTEM_V010.h, the data structure is shown below:
// generic input device data record type, helps get back data from various multidata calls
typedef struct gid_event_type
It’s nice to think of input devices in all the same way and thus wrap a “container” around them. This data structure was
created with that in mind for future expansion. So all mouse messages use this container. The first ints are the x,y
position, the 3
the mouse up to 5 different standard buttons.
25.3 API Listing Reference
The API listing for the “Mouse” module CHAM_PIC_MOUSE_DRV_V010.c is listed in Table 25.1 categorized by
functionality.
Function Name
Mouse Driver Control
int Mouse_Load(void);
{
int x,y,z;
int buttons;
} gid_event, *gid_event_ptr;
CHAM_PIC_MOUSE_DRV_V010.c
CHAM_PIC_MOUSE_DRV_V010.h
rd
(Z) is usually the scrub wheel. The next int, buttons is a bit encoded representation of all the buttons on
// position data
// buttons, bit encoded
// bit4 = right-side button
// bit3 = left-side button
// bit2 = center/scrollwheel button
// bit1 = right button
// bit0 = left button
Table 25.1 – “Mouse” module API functions listing.
- Main C file source for “Mouse” module.
- Header file for “Mouse” module.
Description
Loads the mouse driver.
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
202

Related parts for Chameleon-PIC