Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
9e4c08d8
Commit
9e4c08d8
authored
9 years ago
by
Hauke Petersen
Browse files
Options
Downloads
Patches
Plain Diff
cpu/atmega2560: added CMSIS style defs for timers
parent
5b386597
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cpu/atmega2560/include/atmega2560_regs.h
+74
-0
74 additions, 0 deletions
cpu/atmega2560/include/atmega2560_regs.h
cpu/atmega2560/include/cpu_conf.h
+2
-0
2 additions, 0 deletions
cpu/atmega2560/include/cpu_conf.h
with
76 additions
and
0 deletions
cpu/atmega2560/include/atmega2560_regs.h
0 → 100644
+
74
−
0
View file @
9e4c08d8
/*
* Copyright (C) 2016 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup cpu_atmega2560
* @{
*
* @file
* @brief CMSIS style register definitions for the atmega2560
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef ATMEGA2560_REGS_H
#define ATMEGA2560_REGS_H
#include
<avr/io.h>
#ifdef __cplusplus
extern
"C"
{
#endif
/**
* @brief Register types
* @{
*/
#define REG8 volatile uint8_t
#define REG16 volatile uint16_t
/** @} */
/**
* @brief Timer register map
*/
typedef
struct
{
REG8
CRA
;
/**< control A */
REG8
CRB
;
/**< control B */
REG8
CRC
;
/**< control C */
REG8
reserved
;
/**< reserved */
REG16
CNT
;
/**< counter */
REG16
ICR
;
/**< input capture */
REG16
OCR
[
3
];
/**< output compare */
}
mega_timer_t
;
/**
* @brief Base register address definitions
* @{
*/
#define MEGA_TIMER1_BASE (uint16_t *)(&TCCR1A)
#define MEGA_TIMER3_BASE (uint16_t *)(&TCCR3A)
#define MEGA_TIMER4_BASE (uint16_t *)(&TCCR4A)
#define MEGA_TIMER5_BASE (uint16_t *)(&TCCR5A)
/** @} */
/**
* @brief Peripheral instances
* @{
*/
#define MEGA_TIMER1 ((mega_timer_t *)MEGA_TIMER1_BASE)
#define MEGA_TIMER3 ((mega_timer_t *)MEGA_TIMER3_BASE)
#define MEGA_TIMER4 ((mega_timer_t *)MEGA_TIMER4_BASE)
#define MEGA_TIMER5 ((mega_timer_t *)MEGA_TIMER5_BASE)
/** @} */
#ifdef __cplusplus
}
#endif
#endif
/* ATMEGA2560_REGS_H */
/** @} */
This diff is collapsed.
Click to expand it.
cpu/atmega2560/include/cpu_conf.h
+
2
−
0
View file @
9e4c08d8
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
*/
*/
/**
/**
* @ingroup cpu_atmega2560
* @{
* @{
*
*
* @file
* @file
...
@@ -19,6 +20,7 @@
...
@@ -19,6 +20,7 @@
#ifndef __CPU_CONF_H
#ifndef __CPU_CONF_H
#define __CPU_CONF_H
#define __CPU_CONF_H
#include
"atmega2560_regs.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment