参数资料
型号: 151-0153
厂商: Rabbit Semiconductor
文件页数: 79/162页
文件大小: 0K
描述: ASSEMBLY - RABBITFLEX CABLES
标准包装: 1
系列: RabbitFLEX™
附件类型: 缆线组件
适用于相关产品: BL300F
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描述
1515738-1 INSERT ASSEMBLY 1 CHANNEL
1515739-1 INSERT ASSEMBLY, 2 X 1310
1515740-1 INSERT ASSEMBLY 4 CHANNEL
1515747-1 INSERT ASSEMBLY 4 CHANNEL
1515867-1 PROTECTIVE CAP,PLUG CONN.
相关代理商/技术参数
参数描述
151-01530 功能描述:RATCHET P CLAMP SIZE A SOFT INSE 制造商:hellermanntyton 系列:- 零件状态:新产品 配件类型:插件 配套使用产品/相关产品:Ratchet P 夹,6.2mm-13.7mm 捆扎直径 材料:热塑性塑胶(TPE) 特性:- 标准包装:100
151-01531 功能描述:RATCHET P CLAMP SIZE B SOFT INSE 制造商:hellermanntyton 系列:- 零件状态:新产品 配件类型:插件 配套使用产品/相关产品:Ratchet P 夹,13.2mm-19.5mm 捆扎直径 材料:热塑性塑胶(TPE) 特性:- 标准包装:100
151-01532 功能描述:RATCHET P CLAMP SIZE C SOFT INSE 制造商:hellermanntyton 系列:- 零件状态:新产品 配件类型:插件 配套使用产品/相关产品:Ratchet P 夹,19.2mm-36mm 捆扎直径 材料:热塑性塑胶(TPE) 特性:- 标准包装:100
151-01533 功能描述:RATCHET P CLAMP SIZE D SOFT INSE 制造商:hellermanntyton 系列:- 零件状态:新产品 配件类型:插件 配套使用产品/相关产品:Ratchet P 夹,35.1mm-51mm 捆扎直径 材料:热塑性塑胶(TPE) 特性:- 标准包装:100
151-01554 功能描述:WIDE STRAP ADHESIVE MOUNT BLK 制造商:hellermanntyton 系列:* 零件状态:在售 标准包装:3,000