mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
1496149bba
Instead of hard-coding the peripheral clocks to CLOCK_CORECLOCK introduce helper functions to return the frequency of the individual GCLKs and use those for baud-rate calculations. This requires the GCLK to be part of the peripheral's config struct. While this is already the case for most peripherals, this also adds it for those where it wasn't used before. As it defaults to 0 (CLOCK_CORECLOCK) no change is to be expected.
52 lines
927 B
C
52 lines
927 B
C
/*
|
|
* Copyright (C) 2016 Kees Bakker, SODAQ
|
|
*
|
|
* 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 boards_common_sodaq
|
|
* @{
|
|
*
|
|
* @file
|
|
* @brief Default usbdev configuration for SODAQ boards
|
|
*
|
|
* @author Kees Bakker <kees@sodaq.com>
|
|
*/
|
|
|
|
#ifndef CFG_USBDEV_DEFAULT_H
|
|
#define CFG_USBDEV_DEFAULT_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "cpu.h"
|
|
#include "periph_cpu.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @name USB peripheral configuration
|
|
* @{
|
|
*/
|
|
static const sam0_common_usb_config_t sam_usbdev_config[] = {
|
|
{
|
|
.dm = GPIO_PIN(PA, 24),
|
|
.dp = GPIO_PIN(PA, 25),
|
|
.d_mux = GPIO_MUX_G,
|
|
.device = &USB->DEVICE,
|
|
.gclk_src = 0
|
|
}
|
|
};
|
|
/** @} */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* CFG_USBDEV_DEFAULT_H */
|
|
/** @} */
|