PROGRAMMER'S GUIDETimer library
Back | ■
Timer library


2.2 Function specifications / SCU


 Title

Function specifications

 Function

Timer 0 interrupt enabled

 Function Name

TIM_T0_ENABLE

 No

1

Form
void TIM_T0_ENABLE (void)
input
none
output
none
Function value
none
function
Enables timer 0 interrupts.

 Title

Function specifications

 Function

Timer 0 interrupt disabled

 Function Name

TIM_T0_DISABLE

 No

2

Form
void TIM_T0_DISABLE (void)
input
none
output
none
Function value
none
function
Disables timer 0 interrupts.

 Title

Function specifications

 Function

Timer 1 interrupt enabled

 Function Name

TIM_T1_ENABLE

 No

3

Form
void TIM_T1_ENABLE (void)
input
none
output
none
Function value
none
function
Enables timer 1 interrupt.

 Title

Function specifications

 Function

Timer 1 interrupt disabled

 Function Name

TIM_T1_DISABLE

 No

Four

Form
void TIM_T1_DISABLE (void)
input
none
output
none
Function value
none
function
Disables timer 1 interrupt.

 Title

Function specifications

 Function

Timer 0 compare register setting

 Function Name

TIM_T0_SET_CMP

 No

Five

Form
void TIM_T0_SET_CMP (Uint32 time_cmp)
input
time_cmp: Timer 0 compare register setting value
output
none
Function value
none
function
Set the timer compare register setting value to the timer 0 compare register.

 Title

Function specifications

 Function

Timer 1 set data register setting

 Function Name

TIM_T1_SET_DATA

 No

6

Form
void TIM_T1_SET_DATA (Uint32 time_data)
input
time_data: Timer 1 set data register setting value
output
none
Function value
none
function
Set the timer 1 set data register setting value in the timer 1 set data register.

 Title

Function specifications

 Function

Timer 1 mode register setting

 Function Name

TIM_T1_SET_MODE

 No

7

Form
void TIM_T1_SET_MODE (Uint32 time_mode)
input
time_mode: Timer 1 mode register setting value
output
none
Function value
none
function
Set the timer 1 mode register setting value to the timer 1 mode register.

CPU


 Title

Function specifications

 Function

FRT initialization

 Function Name

TIM_FRT_INIT

 No

8

Form
void TIM_FRT_INIT (Uint32 mode)
input
mode: Number of divisions
 constant
 explanation
 TIM-CKS-8
 8
 TIM-CKS-32
 32
 TIM-CKS-128
 128

output
none
Function value
none
function
Sets the frequency division to the specified number and initializes the FRT.

 Title

Function specifications

 Function

Counter value setting (16 bits)

 Function Name

TIM_FRT_SET_16

 No

9

Form
void TIM_FRT_SET_16 (Uint16 cnt)
input
cnt: Counter value
output
none
Function value
none
function
Sets a 16-bit counter value to the FRT. FRT counts from this setting value.

 Title

Function specifications

 Function

Counter value acquisition (16 bits)

 Function Name

TIM_FRT_GET_16

 No

Ten

Form
Uint16 TIM_FRT_GET_16 (void)
input
none
output
none
Function value
Counter value
function
Gets the 16-bit counter value of the FRT.

 Title

Function specifications

 Function

Waiting for time (16 bits)

 Function Name

TIM_FRT_DELAY_16

 No

11

Form
void TIM_FRT_DELAY_16 (Uint16 cnt)
input
cnt: Time wait counter value
output
none
Function value
none
function
Waits for the specified time wait counter value. Internally, TIM_Frt_Set_16 (0) is executed, and TIM_Frt_Get_16 (w_cnt) loops until cnt == w_cnt.

 Title

Function specifications

 Function

Counter value-> microsecond conversion

 Function Name

TIM_FRT_CNT_TO_MCR

 No

12

Form
Float TIM_FRT_CNT_TO_MCR (Uint32 count)
input
count: Counter value
output
none
Function value
Microsecond value
function
Converts the specified counter value to a microsecond value.

 Title

Function specifications

 Function

Microsecond-> Counter value conversion

 Function Name

TIM_FRT_MCR_TO_CNT

 No

13

Form
Uint32 TIM_FRT_MCR_TO_CNT (Float micro)
input
micro: Microsecond value
output
none
Function value
Counter value
function
Converts a microsecond value to a specified counter value.

 Title

Function specifications

 Function

Timer interrupt enable register setting

 Function Name

TIM_FRT_SET_TIER

 No

14

Form
void TIM_FRT_SET_TIER (Uint8 reg)
input
reg: Set value
output
none
Function value
none
function
Set the set value in the timer interrupt enable register.

 Title

Function specifications

 Function

Timer control / status register setting

 Function Name

TIM_FRT_SET_TCSR

 No

15

Form
void TIM_FRT_SET_TCSR (Uint8 reg)
input
reg: Set value
output
none
Function value
none
function
Set the set value in the timer control / status register.

 Title

Function specifications

 Function

Free running counter setting

 Function Name

TIM_FRT_SET_FRC

 No

16

Form
void TIM_FRT_SET_FRC (Uint16 reg)
input
reg: Set value
output
none
Function value
none
function
Set the set value to the free running counter.

 Title

Function specifications

 Function

Output compare register A setting

 Function Name

TIM_FRT_SET_OCRA

 No

17

Form
void TIM_FRT_SET_OCRA (Uint16 reg)
input
reg: Set value
output
none
Function value
none
function
Set the set value in the output compare register A.

 Title

Function specifications

 Function

Output compare register B setting

 Function Name

TIM_FRT_SET_OCRB

 No

18

Form
void TIM_FRT_SET_OCRB (Uint16 reg)
input
reg: Set value
output
none
Function value
none
function
Set the set value in the output compare register B.

 Title

Function specifications

 Function

Timer control register setting

 Function Name

TIM_FRT_SET_TCR

 No

19

Form
void TIM_FRT_SET_TCR (Uint8 reg)
input
reg: Set value
output
none
Function value
none
function
Set the set value in the timer control register.

 Title

Function specifications

 Function

Timer output compare control register setting

 Function Name

TIM_FRT_SET_TOCR

 No

20

Form
void TIM_FRT_SET_TOCR (Uint8 reg)
input
reg: Set value
output
none
Function value
none
function
Set the set value in the timer output compare control register.

 Title

Function specifications

 Function

Get timer interrupt enable register

 Function Name

TIM_FRT_GET_TIER

 No

twenty one

Form
Uint8 TIM_FRT_GET_TIER (void)
input
none
output
none
Function value
Register value
function
Acquires the timer interrupt enable register.

 Title

Function specifications

 Function

Timer control / status register acquisition

 Function Name

TIM_FRT_GET_TCSR

 No

twenty two

Form
Uint8 TIM_FRT_GET_TCSR (void)
input
none
output
none
Function value
Register value
function
Acquires timer control / status register.

 Title

Function specifications

 Function

Free running counter acquisition

 Function Name

TIM_FRT_GET_FRC

 No

twenty three

Form
Uint16 TIM_FRT_GET_FRC (void)
input
none
output
none
Function value
Register value
function
Get the free running counter.

 Title

Function specifications

 Function

Output compare register A acquisition

 Function Name

TIM_FRT_GET_OCRA

 No

twenty four

Form
Uint16 TIM_FRT_GET_OCRA (void)
input
none
output
none
Function value
Register value
function
Acquires the output compare register A.

 Title

Function specifications

 Function

Output compare register B acquisition

 Function Name

TIM_FRT_GET_OCRB

 No

twenty five

Form
Uint16 TIM_FRT_GET_OCRB (void)
input
none
output
none
Function value
Register value
function
Acquires the output compare register B.

 Title

Function specifications

 Function

Get timer control register

 Function Name

TIM_FRT_GET_TCR

 No

26

Form
Uint8 TIM_FRT_GET_TCR (void)
input
none
output
none
Function value
Register value
function
Acquires the timer control register.

 Title

Function specifications

 Function

Get timer output compare control register

 Function Name

TIM_FRT_GET_TOCR

 No

27

Form
Uint8 TIM_FRT_GET_TOCR (void)
input
none
output
none
Function value
Register value
function
Acquires the timer output compare control register.

 Title

Function specifications

 Function

Input capture register A acquisition

 Function Name

TIM_FRT_GET_ICRA

 No

28

Form
Uint16 TIM_FRT_GET_ICRA (void)
input
none
output
none
Function value
Register value
function
Acquires input capture register A.

Back | ■
PROGRAMMER'S GUIDETimer library
Copyright SEGA ENTERPRISES, LTD., 1997