参数资料
型号: 20-151-0178
厂商: Rabbit Semiconductor
文件页数: 79/162页
文件大小: 0K
描述: CABLE CONVERTER RS-232 TO USB
标准包装: 1
附件类型: USB 至 RS232 适配器
适用于相关产品: 基于 Rabbit 的板
产品目录页面: 619 (CN2011-ZH PDF)
其它名称: 20-151-0178-ND
316-1181
6.4 Software Walk-Through
In this section, we will begin with the speaker_tone.c sample program and modify it to demonstrate
more RabbitFLEX functionality. Note that to make the modifications and run the sample program, you
will need the speaker option, appropriate digital inputs and outputs, and the demo board that is included
with the RabbitFLEX tool kit. However, even if you do not have these items, you should still be able to
read along to gain more understanding of how to use the RabbitFLEX software.
6.4.1 Studying speaker_tone.c
The speaker_tone.c sample program demonstrates how to use the tone driver. For the purposes of
RabbitFLEX, it is not necessary to understand all of the details of this sample program, but essentially it
builds waveforms at different frequencies to be used with the tone driver. The refwave_organ() and
refwave_saw() functions build the waveforms; the buildwave() function adapts the organ and
saw waveforms to different frequencies.
In the following walk-through, we will only be making changes to the main() function, so it is probably
worth studying main() to understand it.
void main(void)
{
char ch;
char repeat;
int request_exit;
// Holds the user command
// Indicates whether or not the tone should repeat
// Indicates if user has requested to exit the program
The above section of code simply declares some variables for later use in main() .
// This function must be called to initialize the RabbitFLEX board
brdInit();
The brdInit() function must be called at the beginning of every RabbitFLEX BL300F program. It sets
up internal data structures, initializes analog capabilities, sets up CPU registers appropriately, etc. If this
function is not called, then much of the RabbitFLEX I/O capability will be unavailable.
// This function sets the correct PWM channel to use for the speaker.
// Simply pass a pointer to the speaker structure.
flexSpeakerPWM(&MY_SPEAKER);
The above function is used to set the PWM (Pulse Width Modulation) channel that the speaker uses. This
introduces the idea of using data structures to pass information into the RabbitFLEX functions.
MY_SPEAKER is a macro that has been defined at the top of the program to flex_speaker . So, with-
out the macro definition, this line would be:
flexSpeakerPWM(&flex_speaker);
flex_speaker is a data structure of type Flex_IOPin . These data structures contain all of the infor-
mation that the RabbitFLEX functions need to know about the given pin. In this case, the structure con-
tains the correct PWM channel. Note that instead of passing the data structure itself, we pass a pointer to
the data structure. We will see this again and again in other RabbitFLEX functions.
RabbitFLEX User’s Manual
73
相关PDF资料
PDF描述
MAX11200EVKIT+ KIT EVALUATION FOR MAX11200
HCC06DRTF-S13 CONN EDGECARD 12POS .100 EXTEND
HK1608R47J-T INDUCTOR HI FREQ 470NH 5% 0603
PCM16XD0 PROCESSOR MODULE FOR MPLAB-ICE
SDR1006-681KL INDUCTOR POWER 680UH 0.28A SMD
相关代理商/技术参数
参数描述
20-151-0183 功能描述:处理器配件 UNIVL PWRSUPLY 12VDC 1A/W MOLEX MICROFIT3 RoHS:否 制造商:Olimex Ltd. 产品:Cable 用于:
2015103-1 制造商:TE CONNECTIVITY 功能描述:RF C/A, RT ANG QMA/DIN 1.0/2.3 CONN
2015-104 制造商:The Bergquist Company 功能描述:THERMAL PAD TO-3P PK5 制造商:The Bergquist Company 功能描述:THERMAL PAD, TO-3P, PK5 制造商:The Bergquist Company 功能描述:THERMAL PAD, TO-3P, PK5; Insulator Body Material:Silicone Elastomer; Thermal Conductivity:3.5W/m.K; Breakdown Voltage Vbr:4kV; Thickness:0.508mm; Volume Resistivity:100000Mohm-m; SVHC:No SVHC (19-Dec-2012); Electrical Property Ins /
2015-104 制造商:The Bergquist Company 功能描述:THERMAL PAD TO-3P 制造商:The Bergquist Company 功能描述:THERMAL PAD, TO-3P
201511 制造商:Phoenix Contact 功能描述:Misc Products