Skip to content

Commit

Permalink
fixup! renamed module to dbgpin
Browse files Browse the repository at this point in the history
  • Loading branch information
haukepetersen committed Nov 9, 2017
1 parent d9b91ed commit 52d54f2
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 70 deletions.
8 changes: 4 additions & 4 deletions cpu/cortexm_common/vectors_cortexm.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include "panic.h"
#include "vectors_cortexm.h"

#ifdef MODULE_PINDBG
#include "pindbg.h"
#ifdef MODULE_DBGPIN
#include "dbgpin.h"
#endif

#ifndef SRAM_BASE
Expand Down Expand Up @@ -117,9 +117,9 @@ void reset_handler_default(void)

post_startup();

#ifdef MODULE_PINDBG
#ifdef MODULE_DBGPIN
/* initialize debug pins if configured */
pindbg_init();
dbgpin_init();
#endif

/* initialize the board (which also initiates CPU initialization) */
Expand Down
49 changes: 49 additions & 0 deletions cpu/stm32_common/include/dbgpin_cpu.h
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 */
/** @} */
49 changes: 0 additions & 49 deletions cpu/stm32_common/include/pindbg_cpu.h

This file was deleted.

File renamed without changes.
14 changes: 7 additions & 7 deletions sys/pindbg/pindbg.c → drivers/dbgpin/dbgpin.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

/**
* @ingroup sys_pindbg
* @ingroup sys_dbgpin
* @{
*
* @file
Expand All @@ -18,15 +18,15 @@
* @}
*/

#include "pindbg.h"
#include "dbgpin.h"
#include "periph/gpio.h"

void pindbg_init(void)
void dbgpin_init(void)
{
#ifdef PINDBG0
gpio_init(PINDBG0, GPIO_OUT);
#ifdef DBGPIN0
gpio_init(DBGPIN0, GPIO_OUT);
#endif
#ifdef PINDBG1
gpio_init(PINDBG1, GPIO_OUT);
#ifdef DBGPIN1
gpio_init(DBGPIN1, GPIO_OUT);
#endif
}
20 changes: 10 additions & 10 deletions sys/include/pindbg.h → drivers/include/dbgpin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" {
Expand All @@ -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 */
/** @} */

0 comments on commit 52d54f2

Please sign in to comment.