-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9b91ed
commit 52d54f2
Showing
6 changed files
with
70 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (C) 2017 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_stm32_common | ||
* | ||
* @{ | ||
* @file | ||
* @brief CPU specific handlers for direct control of debug pins | ||
* | ||
* @author Hauke Petersen <[email protected]> | ||
*/ | ||
|
||
#ifndef DBGPIN_CPU_H | ||
#define DBGPIN_CPU_H | ||
|
||
#include "cpu.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifdef DBGPIN0 | ||
#define DBGPIN0_PORT ((GPIO_TypeDef *)(DBGPIN0 & ~(0x0f))) | ||
#define DBGPIN0_MASK (1 << (DBGPIN0 & 0xf)) | ||
#define DBGPIN0_SET (DBGPIN0_PORT->BSRR = DBGPIN0_MASK) | ||
#define DBGPIN0_CLR (DBGPIN0_PORT->BSRR = (DBGPIN0_MASK << 16)) | ||
#define DBGPIN0_TGL (DBGPIN0_PORT->ODR ^= DBGPIN0_MASK) | ||
#endif | ||
|
||
#ifdef DBGPIN1 | ||
#define DBGPIN1_PORT ((GPIO_TypeDef *)(DBGPIN1 & ~(0x0f))) | ||
#define DBGPIN1_MASK (1 << (DBGPIN1 & 0xf)) | ||
#define DBGPIN1_SET (DBGPIN1_PORT->BSRR = DBGPIN1_MASK) | ||
#define DBGPIN1_CLR (DBGPIN1_PORT->BSRR = (DBGPIN1_MASK << 16)) | ||
#define DBGPIN1_TGL (DBGPIN1_PORT->ODR ^= DBGPIN1_MASK) | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* DBGPIN_CPU_H */ | ||
/** @} */ |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,19 +7,19 @@ | |
*/ | ||
|
||
/** | ||
* @defgroup sys_pindbg Direct pin control for debugging/profiling | ||
* @defgroup sys_dbgpin Direct pin control for debugging/profiling | ||
* @ingroup sys | ||
* | ||
* This module gives the possibility to directly control a number of GPIO pins | ||
* without the least possible overhead for debugging and profiling purposes. For | ||
* this, the module provides a number of macros for setting, clearing, and | ||
* toggling some defined pins: `PINDBG[\d]_[SET|CLR|TGL]`, for example | ||
* `PINDBG0_SET` or `PINDBG1_TGL`. | ||
* toggling some defined pins: `DBGPIN[\d]_[SET|CLR|TGL]`, for example | ||
* `DBGPIN0_SET` or `DBGPIN1_TGL`. | ||
* | ||
* To use this module, you have to do two things: | ||
* 1. the module has to be selected in your project: `USEMODULE += pindbg` | ||
* 1. the module has to be selected in your project: `USEMODULE += dbgpin` | ||
* 2. you have to define the pins you want to use for debugging, e.g.: | ||
* `CFLAGS += -DPINDBG0=GPIO_PIN\(0,15\) -DPINDBG1=GPIO_PIN\(1,24\)` | ||
* `CFLAGS += -DDBGPIN0=GPIO_PIN\(0,15\) -DDBGPIN1=GPIO_PIN\(1,24\)` | ||
* | ||
* It is of course up to you to add these settings to your application Makefile | ||
* for the duration of debugging/profiling or to set them through environment | ||
|
@@ -36,10 +36,10 @@ | |
* @author Hauke Petersen <[email protected]> | ||
*/ | ||
|
||
#ifndef PINDBG_H | ||
#define PINDBG_H | ||
#ifndef DBGPIN_H | ||
#define DBGPIN_H | ||
|
||
#include "pindbg_cpu.h" | ||
#include "dbgpin_cpu.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
|
@@ -48,12 +48,12 @@ extern "C" { | |
/** | ||
* @brief Initialize all configured debug pins | ||
*/ | ||
void pindbg_init(void); | ||
void dbgpin_init(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* PINDBG_H */ | ||
#endif /* DBGPIN_H */ | ||
/** @} */ | ||
|