Renesas Single-Chip Microcomputer M38C89T-ADF Bedienungsanleitung Seite 95

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 138
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 94
Rev.1.00 May 22 2012
REJ09B0566
4-75
3BLibrary Reference
R_MTU_CreateChannel
4
4.2.7 Multi Function Timer
4.2.8. Compare Match Timer
1) R_CMT_Create
Synopsis
Configure a CMT channel.
Prototype bool R_CMT_Create(
uint8_t data1, // Timer channel selection
uint16_t data2, // Configuration selection
void * data3, // Period, frequency or register data
void * func, // Callback function
uint8_t data4
// Interrupt priority level
);
Description
Set up a Compare Match Timer channel and start the timer.
[data1]
The channel number n (where n = 0 or 1).
[data2]
Configure the timer. To set multiple options at the same time, use |” to separate each value.
The default settings are shown in bold.
Clock calculation
PDL_CMT_PERIOD or
PDL_CMT_FREQUENCY or
PDL_CMT_PCLK_DIV_8 or
PDL_CMT_PCLK_DIV_32 or
PDL_CMT_PCLK_DIV_128 or
PDL_CMT_PCLK_DIV_512
The parameter data3 will specify the timer period.
The counter clock source and compare match value will be calculated
by this function.
The parameter data3 will specify the timer frequency.
The counter clock source and compare match value will be calculated
by this function.
Select the internal clock signal PCLK ÷ 8, 32, 128 or 512 as the
counter clock source.
The parameter data3 will be the register CMCOR value.
[data3]
The data to be used for the register value calculations.
Data use Parameter type
The timer period in seconds or float
The timer frequency in Hz or float
The value to be put in register CMCOR uint16_t
[func]
The function to be called at the periodic interval. Specify PDL_NA if not required.
[data4]
The interrupt priority level. Select between 0 (interrupt disabled) and 15 (highest priority).
Return value
True if all parameters are valid and exclusive; otherwise false.
Category
Compare Match Timer
Reference
R_CMT_Destroy
Remarks (1/2) Function R_CPG_Set must be called before any use of this function.
If a callback function is specified, this function will enable the relevant interrupt.
Please see the notes on callback function use
Seitenansicht 94
1 2 ... 90 91 92 93 94 95 96 97 98 99 100 ... 137 138

Kommentare zu diesen Handbüchern

Keine Kommentare