Japanese
PROGRAMMER'S GUIDETimer library
Back | ■
timer library


2.2 Function specifications/SCU


 Title

function specification

 Function

Timer 0 interrupt enable

 Function name

TIM_T0_ENABLE

 No

1

Format
void TIM_T0_ENABLE(void)
input
none
output
none
function value
none
function
Enable timer 0 interrupt.

 Title

function specification

 Function

Timer 0 interrupt disabled

 Function name

TIM_T0_DISABLE

 No

2

Format
void TIM_T0_DISABLE(void)
input
none
output
none
function value
none
function
Disables timer 0 interrupt.

 Title

function specification

 Function

Timer 1 interrupt enable

 Function name

TIM_T1_ENABLE

 No

3

Format
void TIM_T1_ENABLE(void)
input
none
output
none
function value
none
function
Enable timer 1 interrupt.

 Title

function specification

 Function

Timer 1 interrupt disabled

 Function name

TIM_T1_DISABLE

 No

4

Format
void TIM_T1_DISABLE(void)
input
none
output
none
function value
none
function
Disable timer 1 interrupt.

 Title

function specification

 Function

Timer 0 compare register setting

 Function name

TIM_T0_SET_CMP

 No

5

Format
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 specification

 Function

Timer 1 set data register setting

 Function name

TIM_T1_SET_DATA

 No

6

Format
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 to the timer 1 set data register.

 Title

function specification

 Function

Timer 1 mode register setting

 Function name

TIM_T1_SET_MODE

 No

7

Format
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 specification

 Function

FRT initialization

 Function name

TIM_FRT_INIT

 No

8

Format
void TIM_FRT_INIT(Uint32 mode)
input
mode: division number
 constant
 explanation
 TIM-CKS-8
 8
 TIM-CKS-32
 32
 TIM-CKS-128
 128

output
none
function value
none
function
Set the specified frequency division number and initialize the FRT.

 Title

function specification

 Function

Counter value setting (16 bits)

 Function name

TIM_FRT_SET_16

 No

9

Format
void TIM_FRT_SET_16(Uint16 cnt)
input
cnt: Counter value
output
none
function value
none
function
Set a 16-bit counter value to FRT. FRT starts counting from this set value.

 Title

function specification

 Function

Obtain counter value (16 bit)

 Function name

TIM_FRT_GET_16

 No

10

Format
Uint16 TIM_FRT_GET_16(void)
input
none
output
none
function value
counter value
function
Get the FRT 16-bit counter value.

 Title

function specification

 Function

Wait for time (16 bit)

 Function name

TIM_FRT_DELAY_16

 No

11

Format
void TIM_FRT_DELAY_16(Uint16 cnt)
input
cnt: Time waiting 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) is looped until cnt==w_cnt.

 Title

function specification

 Function

Counter value -> microsecond conversion

 Function name

TIM_FRT_CNT_TO_MCR

 No

12

Format
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 specification

 Function

microsecond -> Counter value conversion

 Function name

TIM_FRT_MCR_TO_CNT

 No

13

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

 Title

function specification

 Function

Timer interrupt enable register setting

 Function name

TIM_FRT_SET_TIER

 No

14

Format
void TIM_FRT_SET_TIER(Uint8 reg)
input
reg: Setting value
output
none
function value
none
function
Set the setting value to the timer interrupt enable register.

 Title

function specification

 Function

Timer control/status
Register settings

 Function name

TIM_FRT_SET_TCSR

 No

15

Format
void TIM_FRT_SET_TCSR(Uint8 reg)
input
reg: Setting value
output
none
function value
none
function
Set the set value to the timer control/status register.

 Title

function specification

 Function

Free running counter settings

 Function name

TIM_FRT_SET_FRC

 No

16

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

 Title

function specification

 Function

Output compare register A setting

 Function name

TIM_FRT_SET_OCRA

 No

17

Format
void TIM_FRT_SET_OCRA(Uint16 reg)
input
reg: Setting value
output
none
function value
none
function
Set the set value to output compare register A.

 Title

function specification

 Function

Output compare register B setting

 Function name

TIM_FRT_SET_OCRB

 No

18

Format
void TIM_FRT_SET_OCRB(Uint16 reg)
input
reg: Setting value
output
none
function value
none
function
Set the set value to output compare register B.

 Title

function specification

 Function

Timer control register settings

 Function name

TIM_FRT_SET_TCR

 No

19

Format
void TIM_FRT_SET_TCR(Uint8 reg)
input
reg: Setting value
output
none
function value
none
function
Set the set value to the timer control register.

 Title

function specification

 Function

Timer output compare
Control register settings

 Function name

TIM_FRT_SET_TOCR

 No

20

Format
void TIM_FRT_SET_TOCR(Uint8 reg)
input
reg: Setting value
output
none
function value
none
function
Set the set value to the timer output compare control register.

 Title

function specification

 Function

Get timer interrupt enable register

 Function name

TIM_FRT_GET_TIER

 No

21

Format
Uint8 TIM_FRT_GET_TIER(void)
input
none
output
none
function value
register value
function
Get the timer interrupt enable register.

 Title

function specification

 Function

Timer control/status register acquisition

 Function name

TIM_FRT_GET_TCSR

 No

22

Format
Uint8 TIM_FRT_GET_TCSR(void)
input
none
output
none
function value
register value
function
Get the timer control/status register.

 Title

function specification

 Function

Get free running counter

 Function name

TIM_FRT_GET_FRC

 No

23

Format
Uint16 TIM_FRT_GET_FRC(void)
input
none
output
none
function value
register value
function
Get free running counter.

 Title

function specification

 Function

Get output compare register A

 Function name

TIM_FRT_GET_OCRA

 No

24

Format
Uint16 TIM_FRT_GET_OCRA(void)
input
none
output
none
function value
register value
function
Get output compare register A.

 Title

function specification

 Function

Get output compare register B

 Function name

TIM_FRT_GET_OCRB

 No

25

Format
Uint16 TIM_FRT_GET_OCRB(void)
input
none
output
none
function value
register value
function
Get output compare register B.

 Title

function specification

 Function

Get timer control register

 Function name

TIM_FRT_GET_TCR

 No

26

Format
Uint8 TIM_FRT_GET_TCR(void)
input
none
output
none
function value
register value
function
Get the timer control register.

 Title

function specification

 Function

Timer output compare
Get control register

 Function name

TIM_FRT_GET_TOCR

 No

27

Format
Uint8 TIM_FRT_GET_TOCR(void)
input
none
output
none
function value
register value
function
Get the timer output compare control register.

 Title

function specification

 Function

Get input capture register A

 Function name

TIM_FRT_GET_ICRA

 No

28

Format
Uint16 TIM_FRT_GET_ICRA(void)
input
none
output
none
function value
register value
function
Get input capture register A.

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