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

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
if you need more than simple 4 channel sound, 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 sound driver then you need the following files added to your project:
23.1 Header File Contents Overview
The “Sound” module header CHAM_PIC_SOUND_DRV_V010.h has nothing in it except the prototypes for the handful of
functions. Rather, it makes more sense to show you the SPI header messages relating to the sound driver:
// sound commands
#define SND_CMD_PLAYSOUNDFM
#define SND_CMD_STOPSOUND
#define SND_CMD_STOPALLSOUNDS 42 // stops all channels
#define SND_CMD_SETFREQ
#define SND_CMD_SETVOLUME
#define SND_CMD_RELEASESOUND
The above messages are located in CHAM_PIC_I2C_SPI_DRV_V010.H as well as in the main SPI driver running on the
Propeller CHAM_DEFAULT2_DRV_V112.spin or CHAM_DEFAULT1_DRV_V112.spin. The above messages only
expose rudimentary abilities of the sound driver, but they are enough to start and stop sounds, play music, sound fx, etc.
23.2 API Listing Reference
The API listing for the “Sound” module CHAM_SOUND_DRV_V010.c is listed in Table 23.1 categorized by functionality.
Function Name
Playing a Sound
int Sound_Play(int channel, int frequency, int duration);
Stopping Sounds
int Sound_Stop(int channel);
int Sound_StopAll(void);
Updating a Sound
int Sound_Update(int channel, int frequency, int volume);
23.3 API Functional Declarations
The following lists each function, a description, comments, and example usage of the function.
_________________________________________________________________________________________________
Function Prototype:
CHAM_PIC_SOUND_DRV_V010.c
CHAM_PIC_SOUND_DRV_V010.h
int Sound_Play(int channel, int frequency, int duration);
40 // plays a sound on a channel with the sent frequency at 90% volume
41 // stops the sound of the sent channel
43 // sets the frequency of a playing sound channel
44 // sets the volume of the playing sound channel
45 // for sounds with infinite duration, releases the sound and it enters
Table 23.1 – “Sound” module API functions listing.
// the "release" portion of ADSR envelope
- Main C file source for “Sound” module.
- Header file for “Sound” module.
Description
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
Plays a sound on one of the 4 channels.
Stops a sound and silences the channel.
Stops all sound channels and silences them.
Updates a currently playing sound.
196

Related parts for Chameleon-PIC