Loading...
Searching...
No Matches
periph_cpu.h File Reference

CPU specific definitions for internal peripheral handling. More...

Detailed Description

CPU specific definitions for internal peripheral handling.

Author

Definition in file periph_cpu.h.

#include <stdint.h>
#include "periph_gba.h"
+ Include dependency graph for periph_cpu.h:

Go to the source code of this file.

#define CLOCK_CORECLOCK   (16780000U) /* 16.78MHz */
 Clock configuration.
 

Timer API defines

#define TIMER_NUMOF   (4U)
 Number of timers.
 
#define TIMER_CHANNEL_NUMOF   (1U)
 Number of channels.
 
#define TIMER_0_MAX_VALUE   (0xffff)
 max value
 
#define TIMER_1_MAX_VALUE   (0xffff)
 max value
 
#define TIMER_2_MAX_VALUE   (0xffff)
 max value
 
#define TIMER_3_MAX_VALUE   (0xffff)
 max value
 
#define PERIPH_TIMER_PROVIDES_SET
 A low-level timer_set() implementation is provided.
 

Ztimer configuration

The timer runs at 262.2 kHz, 3.8 µs resolution, overflow IRQ every 250 ms (best case).

A more precise option would be 16.78MHz, 60 ns resolution, overflow IRQ every 4 ms (best case) (which is too frequent for most applications). A less precise option would be 65.5 kHz, 15.2 µs resolution, overflow IRQ every 1 s (which is too slow compared to most other systems, might not match expectations).

#define CONFIG_ZTIMER_USEC_DEV   (TIMER_DEV(0))
 Timer peripheral for ztimer.
 
#define CONFIG_ZTIMER_USEC_BASE_FREQ   (GBA_TIMER_FRQ_262K)
 Running at 262.2 kHz.
 
#define CONFIG_ZTIMER_USEC_WIDTH   (16)
 Running on a 16-bit timer.
 
#define CONFIG_ZTIMER_USEC_ADJUST_SET   (308)
 Overhead for ztimer_set.
 
#define CONFIG_ZTIMER_USEC_ADJUST_SLEEP   (312)
 Overhead for ztimer_sleep.
 

Macro Definition Documentation

◆ CLOCK_CORECLOCK

#define CLOCK_CORECLOCK   (16780000U) /* 16.78MHz */

Clock configuration.

Definition at line 29 of file periph_cpu.h.

◆ CONFIG_ZTIMER_USEC_ADJUST_SET

#define CONFIG_ZTIMER_USEC_ADJUST_SET   (308)

Overhead for ztimer_set.

Definition at line 59 of file periph_cpu.h.

◆ CONFIG_ZTIMER_USEC_ADJUST_SLEEP

#define CONFIG_ZTIMER_USEC_ADJUST_SLEEP   (312)

Overhead for ztimer_sleep.

Definition at line 60 of file periph_cpu.h.

◆ CONFIG_ZTIMER_USEC_BASE_FREQ

#define CONFIG_ZTIMER_USEC_BASE_FREQ   (GBA_TIMER_FRQ_262K)

Running at 262.2 kHz.

Definition at line 57 of file periph_cpu.h.

◆ CONFIG_ZTIMER_USEC_DEV

#define CONFIG_ZTIMER_USEC_DEV   (TIMER_DEV(0))

Timer peripheral for ztimer.

Definition at line 56 of file periph_cpu.h.

◆ CONFIG_ZTIMER_USEC_WIDTH

#define CONFIG_ZTIMER_USEC_WIDTH   (16)

Running on a 16-bit timer.

Definition at line 58 of file periph_cpu.h.

◆ PERIPH_TIMER_PROVIDES_SET

#define PERIPH_TIMER_PROVIDES_SET

A low-level timer_set() implementation is provided.

Definition at line 41 of file periph_cpu.h.

◆ TIMER_0_MAX_VALUE

#define TIMER_0_MAX_VALUE   (0xffff)

max value

Definition at line 37 of file periph_cpu.h.

◆ TIMER_1_MAX_VALUE

#define TIMER_1_MAX_VALUE   (0xffff)

max value

Definition at line 38 of file periph_cpu.h.

◆ TIMER_2_MAX_VALUE

#define TIMER_2_MAX_VALUE   (0xffff)

max value

Definition at line 39 of file periph_cpu.h.

◆ TIMER_3_MAX_VALUE

#define TIMER_3_MAX_VALUE   (0xffff)

max value

Definition at line 40 of file periph_cpu.h.

◆ TIMER_CHANNEL_NUMOF

#define TIMER_CHANNEL_NUMOF   (1U)

Number of channels.

Definition at line 36 of file periph_cpu.h.

◆ TIMER_NUMOF

#define TIMER_NUMOF   (4U)

Number of timers.

Definition at line 35 of file periph_cpu.h.