Changeset 774
- Timestamp:
- 07/31/08 13:16:09 (4 months ago)
- Location:
- firmware/trunk
- Files:
-
- 4 modified
-
core/makingthings/pwm.c (modified) (4 diffs)
-
core/makingthings/pwm.h (modified) (1 diff)
-
libraries/pwmout/pwmout.c (modified) (7 diffs)
-
libraries/pwmout/pwmout.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
firmware/trunk/core/makingthings/pwm.c
r771 r774 19 19 PWM - Pulse Width Modulation. 20 20 Library of functions for the Make Application Board's PwmOut Subsystem. 21 //ToDo: DW choose which functions are public, and confirm/correct annotations22 21 */ 23 22 … … 59 58 } Pwm; 60 59 61 /** \defgroup Pwm PWM 62 The Pwm subsystem provides control of the 4 PWM outputs on the SAM7X. 63 The Pwm subsystem of the Controller Board can be used independently from the PWM_Out subsystem 64 of the Application Board, and in fact the AppBoard PwmOut relies on the Controller Board PWM. 60 /** \defgroup Pwm PWM (Pulse Width Modulation) 61 The PWM subsystem provides control of the 4 PWM outputs on the SAM7X. 62 63 The Make Controller has 4 PWM lines. These can each be configured separately and can control 64 up to 2 output lines directly, the 2 lines running either parallel or inverted. For a very simple 65 start, just see Pwm_Set( ) and Pwm_Get( ) as these will start driving your PWMs immediately with 66 very little hassle. 67 68 \section padjust Period adjustment of the PWM unit 69 Configuring and setting the clock for the PWM system can be quite a complicated matter. Here are 70 some of the relevant issues. 71 72 Each of the 4 PWM channels is fed in a clock, as determined by its clock source: 73 - Clock source 0-10 represent the Master clock divided by 2 to the power of the Clock Source Value. eg. a clock 74 source value of 5 = a clock rate of MasterClock/(2^5) 75 - A value of 11 sets the Clock source to be generated by clock Divider A (Default) 76 - A value of 12 sets the Clock source to be generated by clock Divider B 77 78 If either Clock Divider A or Clock Divider B is used, you can adjust their values individually to 79 allow the clock period to precisely match your needs. Each clock divider has two values, a \b Mux value 80 and a \b Divider value. 81 82 The mux works just like the clock source values, and chooses Master clock divided by 2 to 83 the power of the Clock Source Value, eg. a DividerXMux value of 5 == a clock rate of MasterClock/(2^5). 84 The Divider value sets a linear divider, which is fed the clock value as selected by the Mux, and returns that 85 clock value divided by the divider value. This output value is what is fed out of the divider unit. A output 86 formula: 87 \code output = MCLK / ( (2^DividerMux) * DividerValue ) \endcode 65 88 66 @see PWM_Out 89 The PWM subsystem of the Controller Board can be used independently from the \ref PwmOut 90 library, since the \ref PwmOut library relies on the core PWM. 91 67 92 \ingroup Core 68 93 @{ … … 99 124 return Pwm.duty[ index ]; 100 125 } 101 102 /** @}103 */104 126 105 127 int Pwm_Start( int channel ) … … 243 265 return io; 244 266 } 267 268 /** 269 Adjust the clock period on Divider A. 270 See AT91SAM7X manual for more information p.421 271 272 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 273 @param val An int between 0 and 4096. 274 @return 0 on success. 275 */ 276 int Pwm_SetDividerA(int val) 277 { 278 if( val < 0 || val > ( 1 << 12 ) ) 279 return CONTROLLER_ERROR_ILLEGAL_PARAMETER_VALUE; 280 281 // First disable PWM controller for all 4 channels. 282 AT91C_BASE_PWMC->PWMC_DIS = 0x0000000f; 283 284 // Now Set the new Clock values 285 AT91C_BASE_PWMC->PWMC_MR = (AT91C_BASE_PWMC->PWMC_MR & 0xffff0000) | val; 286 287 // Re-enable the active channels 288 AT91C_BASE_PWMC->PWMC_ENA = Pwm.channels; 289 290 return CONTROLLER_OK; 291 } 292 293 /** 294 Read the clock period on Divider A. 295 296 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 297 @return The clock period on Divider A. 298 */ 299 int Pwm_GetDividerA() 300 { 301 return (AT91C_BASE_PWMC->PWMC_MR & 0x0000ffff); 302 } 303 304 /** 305 Adjust the clock period on Divider B. 306 See AT91SAM7X manual for more information p.421 307 308 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 309 @param val An int between 0 and 4096. 310 @return 0 on success. 311 */ 312 int Pwm_SetDividerB(int val) 313 { 314 if( val < 0 || val > ( 1 << 12 ) ) 315 return CONTROLLER_ERROR_ILLEGAL_PARAMETER_VALUE; 316 317 //New function which adjusts the clock period on Divider A. 318 //See AT91SAM7X manual for more information p.421 319 320 // First disable PWM controller for all 4 channels. 321 AT91C_BASE_PWMC->PWMC_DIS = 0x0000000f; 322 323 // Now Set the new Clock values 324 AT91C_BASE_PWMC->PWMC_MR = (AT91C_BASE_PWMC->PWMC_MR & 0x0000ffff) | ( val << 16 ); 325 326 // Re-enable the active channels 327 AT91C_BASE_PWMC->PWMC_ENA = Pwm.channels; 328 329 return CONTROLLER_OK; 330 } 331 332 /** 333 Read the clock period on Divider B. 334 335 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 336 @return The clock period on Divider B. 337 */ 338 int Pwm_GetDividerB() 339 { 340 return (AT91C_BASE_PWMC->PWMC_MR >> 16); 341 } 342 343 /** 344 Set the clock divider for a particular channel. 345 For values 0-10, the Master_Clock is divided by (2^val). For example, 346 for 4 the resulting period will be Master Clock / 16, as 2 ^ 4 == 16. 347 348 When val is 11, Clock Divider A is used. When val is 12, Clock Divider B 349 is used. Values other than 0 - 12 are not valid. 350 351 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 352 @param channel The PWM channel (0-3) you'd like to configure. 353 @param val The new clock divider. 354 @return 0 on success. 355 */ 356 int Pwm_SetClockSource(int channel, int val) 357 { 358 if ( channel < 0 || channel > PWM_COUNT ) 359 return CONTROLLER_ERROR_ILLEGAL_INDEX; 360 361 if ( val < 0 || val > 12 ) 362 return CONTROLLER_ERROR_ILLEGAL_PARAMETER_VALUE; 363 364 AT91S_PWMC_CH *pwm = &AT91C_BASE_PWMC->PWMC_CH[ channel ]; 365 int c = 1 << channel; 366 367 // Disable the Channel 368 AT91C_BASE_PWMC->PWMC_DIS = c; 369 370 // Set the Channel Divider Value 371 pwm->PWMC_CMR = (pwm->PWMC_CMR & 0x00000700) | val; 372 373 // Re-enable the Channel 374 AT91C_BASE_PWMC->PWMC_ENA = c; 375 376 return CONTROLLER_OK; 377 } 378 379 /** 380 Read the clock source for a particular channel. 381 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 382 @param channel The PWM channel (0-3) whose channel you'd like to read. 383 @return The clock source. 384 @see Pwm_SetClockSource( ) 385 */ 386 int Pwm_GetClockSource(int channel) 387 { 388 if ( channel < 0 || channel > PWM_COUNT ) 389 return CONTROLLER_ERROR_ILLEGAL_INDEX; 390 391 return (AT91C_BASE_PWMC->PWMC_CH[ channel ].PWMC_CMR & 0x0000000f); 392 } 393 394 /** 395 Set the wave form properties of the PWM contoller for a given channel. 396 The waveform properties are controlled by bits 0, 1, and 2. 397 - bit 0 sets whether the PWModule is Left aligned (0) or Center aligned (1) 398 - bit 1 sets whether the PWMoudle's polarity starts out low (0) or high (1) 399 - bit 2 is not supported at this time. 400 401 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 402 @param channel the PWM channel (0-3) that you want to configure 403 @param val The mask of values as described above. 404 @return 0 on success. 405 */ 406 int Pwm_SetWaveformProperties(int channel, int val) 407 { 408 if ( channel < 0 || channel > PWM_COUNT ) 409 return CONTROLLER_ERROR_ILLEGAL_INDEX; 410 411 if ( val < 0 || val > 3 ) 412 return CONTROLLER_ERROR_ILLEGAL_PARAMETER_VALUE; 413 414 AT91S_PWMC_CH *pwm = &AT91C_BASE_PWMC->PWMC_CH[ channel ]; 415 int c = 1 << channel; 416 417 // Disable the Channel 418 AT91C_BASE_PWMC->PWMC_DIS = c; 419 420 // Set the Channel Divider Value 421 pwm->PWMC_CMR = (pwm->PWMC_CMR & 0x0000040f) | ( val << 8 ); 422 423 // Re-enable the Channel 424 AT91C_BASE_PWMC->PWMC_ENA = c; 425 426 return CONTROLLER_OK; 427 } 428 429 /** 430 Read the waveform configuration of a specified PWM channel 431 432 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 433 @param channel The PWM channel (0-3) to read from. 434 @return A bitmask describing the waveform configuration. 435 @see Pwm_SetWaveformProperties( ) 436 */ 437 int Pwm_GetWaveformProperties(int channel) 438 { 439 if ( channel < 0 || channel > PWM_COUNT ) 440 return CONTROLLER_ERROR_ILLEGAL_INDEX; 441 442 return ( (AT91C_BASE_PWMC->PWMC_CH[ channel ].PWMC_CMR >> 8) & 0x00000003 ); 443 } 444 445 /** @} 446 */ -
firmware/trunk/core/makingthings/pwm.h
r318 r774 30 30 int Pwm_Get( int index ); 31 31 32 int Pwm_SetDividerA(int val); 33 int Pwm_GetDividerA( void ); 34 35 int Pwm_SetDividerB(int val); 36 int Pwm_GetDividerB( void ); 37 38 int Pwm_SetClockSource(int channel, int val); 39 int Pwm_GetClockSource(int channel); 40 41 int Pwm_SetWaveformProperties(int channel, int val); 42 int Pwm_GetWaveformProperties(int channel); 43 44 32 45 #endif -
firmware/trunk/libraries/pwmout/pwmout.c
r771 r774 324 324 } 325 325 326 /** @}327 */328 329 326 int PwmOut_Start( int index ) 330 327 { … … 445 442 } 446 443 444 /** 445 Set the divider A value. 446 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 447 @param val The value (between 0 and 255) 448 @return 0 on success. 449 */ 450 int PwmOut_SetDividerAValue(int val) 451 { 452 if( val < 0 || val > 255 ) 453 return CONTROLLER_ERROR_ILLEGAL_PARAMETER_VALUE; 454 455 int v = Pwm_GetDividerA(); 456 457 //strip off the divider Value 458 v &= 0x00000f00; 459 460 //add on the new Value 461 v |= val; 462 463 return Pwm_SetDividerA( v ); 464 } 465 466 /** 467 Read the divider A value. 468 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 469 @return the divider A value (0 - 255) 470 @see PwmOut_SetDividerAValue( ) 471 */ 472 int PwmOut_GetDividerAValue() 473 { 474 return ( Pwm_GetDividerA() & 0x000000ff ); 475 } 476 477 /** 478 Set the divider A mux value. 479 @param mux The mux value (between 0 and 10) 480 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 481 @return 0 on success. 482 */ 483 int PwmOut_SetDividerAMux(int mux) 484 { 485 if( mux < 0 || mux > 10 ) 486 return CONTROLLER_ERROR_ILLEGAL_PARAMETER_VALUE; 487 488 int v = Pwm_GetDividerA(); 489 490 //strip off the divider Value 491 v &= 0x000000ff; 492 493 //add on the new Value 494 v |= ( mux << 8 ); 495 496 return Pwm_SetDividerA( v ); 497 } 498 /** 499 Read the divider A mux value. 500 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 501 @return the divider A mux value (0 - 10) 502 @see PwmOut_SetDividerAMux( ) 503 */ 504 int PwmOut_GetDividerAMux() 505 { 506 return ( ( Pwm_GetDividerA() >> 8 ) & 0x0000000f ); 507 } 508 509 /** 510 Set the divider B value. 511 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 512 @param val The value (between 0 and 255) 513 @return 0 on success. 514 */ 515 int PwmOut_SetDividerBValue(int val) 516 { 517 if( val < 0 || val > 255 ) 518 return CONTROLLER_ERROR_ILLEGAL_PARAMETER_VALUE; 519 520 int v = Pwm_GetDividerB(); 521 522 //strip off the divider Value 523 v &= 0x00000f00; 524 525 //add on the new Value 526 v |= val; 527 528 return Pwm_SetDividerA( v ); 529 } 530 531 /** 532 Read the divider B value. 533 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 534 @return the divider B value (0 - 255) 535 @see PwmOut_SetDividerBValue( ) 536 */ 537 int PwmOut_GetDividerBValue() 538 { 539 return ( Pwm_GetDividerB() & 0x000000ff ); 540 } 541 542 /** 543 Set the divider B mux value. 544 @param mux The mux value (between 0 and 10) 545 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 546 @return 0 on success. 547 */ 548 int PwmOut_SetDividerBMux(int mux) 549 { 550 if( mux < 0 || mux > 10 ) 551 return CONTROLLER_ERROR_ILLEGAL_PARAMETER_VALUE; 552 553 int v = Pwm_GetDividerB(); 554 555 //strip off the divider Value 556 v &= 0x000000ff; 557 558 //add on the new Value 559 v |= ( mux << 8 ); 560 561 return Pwm_SetDividerB( v ); 562 } 563 564 /** 565 Read the divider B mux value. 566 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 567 @return the divider B mux value (0 - 10) 568 @see PwmOut_SetDividerBMux( ) 569 */ 570 int PwmOut_GetDividerBMux() 571 { 572 return ( ( Pwm_GetDividerB() >> 8 ) & 0x0000000f ); 573 } 574 575 /** 576 Set the alignment of a channel's waveform. 577 Valid values are: 578 - 0 = Left Aligned (default) 579 - 1 = Center Aligned 580 581 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 582 @param index The PWM channel (0-3) that you'd like to configure. 583 @param val The alignment value, as described above. 584 @return 0 on success. 585 */ 586 int PwmOut_SetWaveformAlignment(int index, int val) 587 { 588 if ( index < 0 || index > 3 ) 589 return CONTROLLER_ERROR_ILLEGAL_INDEX; 590 if ( val > 1 || val < 0 ) 591 return CONTROLLER_ERROR_ILLEGAL_PARAMETER_VALUE; 592 593 int currval = Pwm_GetWaveformProperties( index ) & 0x00000006; //Leave bits 2 & 3 alone 594 currval |= val; 595 return Pwm_SetWaveformProperties( index, currval ); 596 } 597 598 /** 599 Read the configured waveform alignment for a given PWM channel. 600 601 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 602 @param index The PWM channel (0-3) you'd like to read from. 603 @return the waveform alignment - see PwmOut_SetWaveformAlignment( ) 604 */ 605 int PwmOut_GetWaveformAlignment( int index ) 606 { 607 int val = Pwm_GetWaveformProperties( index ); 608 if ( val < 0 ) 609 return val; 610 611 return val & 0x00000001; 612 } 613 614 /** 615 Set the Waveform Polarity for a PWM channel. 616 Valid values are: 617 - 0 = Start Waveform Low 618 - 1 = Start Waveform High (default) 619 620 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 621 @param index The PWM channel (0-3) that you'd like to configure. 622 @param val The value, as described above. 623 @return 0 on success. 624 */ 625 int PwmOut_SetWaveformPolarity(int index, int val) 626 { 627 if ( index < 0 || index > 3 ) 628 return CONTROLLER_ERROR_ILLEGAL_INDEX; 629 if ( val > 1 || val < 0 ) 630 return CONTROLLER_ERROR_ILLEGAL_PARAMETER_VALUE; 631 632 int currval = Pwm_GetWaveformProperties( index ) & 0x00000005; //Leave bits 3 & 1 alone 633 currval |= (val << 1); 634 return Pwm_SetWaveformProperties( index, currval ); 635 } 636 637 /** 638 Read the waveform polarity for a given channel. 639 640 Contributed by TheStigg - http://www.makingthings.com/author/thestigg 641 @param index The PWM channel (0-3) that you'd like to read from. 642 @return The configured polarity for that channel. 643 @see PwmOut_SetWaveformPolarity( ) 644 */ 645 int PwmOut_GetWaveformPolarity( int index ) 646 { 647 int val = Pwm_GetWaveformProperties( index ); 648 if ( val < 0 ) 649 return val; 650 651 return val & 0x00000002; 652 } 653 654 /** @} 655 */ 656 447 657 #ifdef OSC 448 658 449 /** \defgroup PWMOutOSCPWM Out - OSC659 /** \defgroup pwmout_osc PWM Out - OSC 450 660 Generate PWM signals with the Application Board via OSC. 451 661 \ingroup OSC … … 463 673 464 674 \section properties Properties 465 Each PWM Out has fourproperties:675 Each PWM Out has the following properties: 466 676 - duty 467 677 - invA 468 678 - invB 469 679 - active 470 471 \par Duty 680 - dividerAValue 681 - dividerAMux 682 - dividerBValue 683 - dividerBMux 684 - clockSource 685 - alignment 686 - polarity 687 688 \subsection Duty 472 689 The \b duty property corresponds to the duty at which a load connected to the output is being driven. 473 690 This value can be both read and written. The range of values expected by the board 474 691 is from 0 - 1023. 475 \par 476 To generate a 75% on PWM signal, send a message like692 693 To generate a 75% on PWM signal, send a message like 477 694 \verbatim /pwmout/1/duty 768 \endverbatim 478 695 Leave the argument value off to read the duty: 479 696 \verbatim /pwmout/1/duty \endverbatim 480 697 481 \ parinvA698 \subsection invA 482 699 The \b invA property corresponds to the inversion of the A channel of a PWM Out. 483 700 This value can be both read and written, and the range of values expected is simply 484 701 0 or 1. 1 means inverted and 0 means normal. 0 is the default. 485 \par702 486 703 To set the A channel of the second PWM Out as inverted, send the message 487 704 \verbatim /pwmout/1/invA 1 \endverbatim 488 705 Note that the A channel of PWM Out 1 is Digital Out 2. 489 706 490 \ parinvB707 \subsection invB 491 708 The \b invB property corresponds to the inversion of the B channel of a PWM Out. 492 709 This value can be both read and written, and the range of values expected is simply 493 710 0 or 1. 1 means inverted and 0 means normal. 0 is the default. 494 \par711 495 712 To set the B channel of the fourth PWM Out back to normal, send the message 496 713 \verbatim /pwmout/1/invB 0 \endverbatim 497 714 Note that the A channel of PWM Out 1 is Digital Out 7. 498 715 499 \ parActive716 \subsection Active 500 717 The \b active property corresponds to the active state of the PWM Out. 501 718 If the device is set to be active, no other tasks will be able to … … 504 721 locked by sending a message like 505 722 \verbatim /pwmout/0/active \endverbatim 506 \par723 507 724 If you're no longer using the PWM Out, it's a good idea to free the 2 Digital Outs by 508 725 sending the message 509 726 \verbatim /pwmout/0/active 0 \endverbatim 727 728 \section p_adjust Period adjustment of the PWM unit 729 730 The below values allow you to adjust the period length to all possible values as supported 731 by the physical limits of the Make Controller. Before altering the values, it is good to understand 732 a little about the subsustem of the PWM module. Please see the general introduction in the \ref Pwm section. 733 734 \subsection DividerBValue 735 The \b dividerXValue property corresponds to the linear divider value within clock divider module X of the 736 PWM Out. This value can be between 0 and 255, and linearly divides the clock that is fed into it. You can 737 change the incomming clock value by altering the DividerAMux parameter. Higher linear divider values mean 738 a longer period. 739 740 Default value of DividerA is 4. Default value of DividerB is 0. 741 742 \subsection divs DividerAMux & DividerBMux 743 The \b dividerAMux and \b dividerBMux properties select the incoming clock value for divider module A or B (respectively) 744 of the PWM Out. This value ranges between 0 and 10. This is similar to the clock source value, eg. a DividerAMux 745 value of 5 = a clock rate of MasterClock/(2^5) 746 747 Increasing this value will substantially increase the period of the PWM. Use the DividerXValue parameter 748 to more finely tune the value of the period. 749 750 Default value of MuxA is 4. Default value of MuxB is 0. 751 752 \subsection ClockSource 753 The \b clockSource property selects the incoming clock value for the specified PWM channel. A clock 754 source of \b 0-10 represents the Master clock divided by 2 to the power of the Clock Source Value, eg. a clock 755 source value of 5 = a clock rate of MasterClock/(2^5). A value of \b 11 sets the Clock source to be 756 generated by clock Divider A. A value of \b 12 sets the Clock source to be generated by clock Divider B 757 758 The default value is 11 (Divider A). 759 760 \subsection WaveformAlignment 761 The \b waveformAlignment property chooses whether the channel is left aligned or center aligned. 762 The following values are valid: 763 - 0 = Left aligned 764 - 1 = Center aligned 765 766 A left aligned channel counts up to the maximum duty cycle, then resets the counter. A center aligned 767 channel counts up to the maximum duty cycle, then counts down to zero, etc. The default is left aligned. 768 769 \subsection WaveformPolarity 770 The \b polarity property chooses whether the channel begins its period high or low. The following values are valid: 771 - 0 = Normal Polarity 772 - 1 = Inverted Polarity 773 774 Normal polarity starts low, then goes high. Inverted polarity starts high, then goes low. The default is inverted polarity. 510 775 */ 511 776 … … 517 782 // MUST end in zero 518 783 static char* PwmOutOsc_Name = "pwmout"; 519 static char* PwmOutOsc_PropertyNames[] = { "active", "duty", "invA", "invB", 0 }; // must have a trailing 0 784 static char* PwmOutOsc_PropertyNames[] = { "active", "duty", "invA", "invB", 785 "dividerAValue", "dividerAMux", 786 "dividerBValue", "dividerBMux", 787 "clockSource", "alignment", 788 "polarity", 789 0 }; // must have a trailing 0 520 790 521 791 int PwmOutOsc_PropertySet( int index, int property, int value ); … … 559 829 PwmOut_SetInvertB( index, value ); 560 830 break; 831 case 4: 832 PwmOut_SetDividerAValue(value); 833 break; 834 case 5: 835 PwmOut_SetDividerAMux(value); 836 break; 837 case 6: 838 PwmOut_SetDividerBValue(value); 839 break; 840 case 7: 841 PwmOut_SetDividerBMux(value); 842 break; 843 case 8: 844 Pwm_SetClockSource( index, value ); 845 break; 846 case 9: 847 PwmOut_SetWaveformAlignment( index, value ); 848 break; 849 case 10: 850 PwmOut_SetWaveformPolarity( index, value ); 851 break; 561 852 } 562 853 return CONTROLLER_OK; … … 581 872 value = PwmOut_GetInvertB( index ); 582 873 break; 874 case 4: 875 value = PwmOut_GetDividerAValue(); 876 break; 877 case 5: 878 value = PwmOut_GetDividerAMux(); 879 break; 880 case 6: 881 value = PwmOut_GetDividerBValue(); 882 break; 883 case 7: 884 value = PwmOut_GetDividerBMux(); 885 break; 886 case 8: 887 value = Pwm_GetClockSource( index ); 888 break; 889 case 9: 890 value = PwmOut_GetWaveformAlignment( index ); 891 break; 892 case 10: 893 value = PwmOut_GetWaveformPolarity( index ); 894 break; 583 895 } 584 896 return value; -
firmware/trunk/libraries/pwmout/pwmout.h
r693 r774 45 45 int PwmOut_SetAll( int motor, int duty, char invertA, char invertB ); 46 46 47 // Divider A is used by default to setup the clock period. 48 // Read the notes in controll/makingthings/pwm.c before changing these. 49 int PwmOut_SetDividerAValue(int val); 50 int PwmOut_GetDividerAValue( void ); 51 52 int PwmOut_SetDividerAMux(int mux); 53 int PwmOut_GetDividerAMux( void ); 54 55 int PwmOut_SetDividerBValue(int val); 56 int PwmOut_GetDividerBValue( void ); 57 58 int PwmOut_SetDividerBMux(int mux); 59 int PwmOut_GetDividerBMux( void ); 60 61 int PwmOut_SetWaveformAlignment(int index, int val); 62 int PwmOut_GetWaveformAlignment(int index); 63 64 int PwmOut_SetWaveformPolarity(int index, int val); 65 int PwmOut_GetWaveformPolarity(int index); 66 47 67 /* OSC Interface */ 48 68 const char* PwmOutOsc_GetName( void );
