mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
0ae471116e
The pins P5.2, P5.1, P5.3 configured as SPI pins are only routed to USART1 and not to USART0, but previously USART0 was configured as peripheral backing the bus. This fixes the peripheral configuration by changing it to USART1. This is quite unfortunate as USART1 is also used to provide the UART interface used for `stdio`. Hence, one can either use `stdio` or SPI. A feature conflict between UART and SPI has therefore been added. Note that while it would be possible to use P3.2, P3.1, P3.3 to provide SPI with USART0, this would not work in practise: P3.1 and P3.3 are connected to the CC1020 transceiver. Switching to P3.4/P3.5 for UART to provide it using USART 0 would also resolve the resource conflict. However, these pins are not available via any of the header and would require soldering the UART<->USB adapter directly to the pins of the MCU chip on the PCB. It is therefore much more user friendly to keep the UART bus backed by USART1 to use pins P3.6 and P3.7 that are easily accessible via the pin header.
99 lines
2.3 KiB
C
99 lines
2.3 KiB
C
/*
|
|
* Copyright (C) 2014 INRIA
|
|
* 2015 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 boards_msb430
|
|
* @{
|
|
*
|
|
* @file
|
|
* @brief MSB-430 peripheral configuration
|
|
*
|
|
* @author Oliver Hahm <oliver.hahm@inria.fr>
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
*/
|
|
|
|
#ifndef PERIPH_CONF_H
|
|
#define PERIPH_CONF_H
|
|
|
|
#include "periph_cpu.h"
|
|
#include "macros/units.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define CLOCK_CORECLOCK msp430_dco_freq
|
|
|
|
/**
|
|
* @brief Clock configuration
|
|
*/
|
|
static const msp430_clock_params_t clock_params = {
|
|
.target_dco_frequency = 7372800U,
|
|
.lfxt1_frequency = 32768,
|
|
.main_clock_source = MAIN_CLOCK_SOURCE_DCOCLK,
|
|
.submain_clock_source = SUBMAIN_CLOCK_SOURCE_DCOCLK,
|
|
.main_clock_divier = MAIN_CLOCK_DIVIDE_BY_1,
|
|
.submain_clock_divier = SUBMAIN_CLOCK_DIVIDE_BY_1,
|
|
.auxiliary_clock_divier = AUXILIARY_CLOCK_DIVIDE_BY_1,
|
|
.has_r_osc = true,
|
|
};
|
|
|
|
/**
|
|
* @name Timer configuration
|
|
* @{
|
|
*/
|
|
#define TIMER_NUMOF (1U)
|
|
#define TIMER_BASE (&TIMER_A)
|
|
#define TIMER_CHAN (3)
|
|
#define TIMER_ISR_CC0 (TIMERA0_VECTOR)
|
|
#define TIMER_ISR_CCX (TIMERA1_VECTOR)
|
|
/** @} */
|
|
|
|
/**
|
|
* @name UART configuration
|
|
* @{
|
|
*/
|
|
#define UART_NUMOF (1U)
|
|
|
|
#define UART_BASE (&USART_1)
|
|
#define UART_SFR (&USART_1_SFR)
|
|
#define UART_IE_RX_BIT (1 << 4)
|
|
#define UART_IE_TX_BIT (1 << 5)
|
|
#define UART_ME_BITS (0x30)
|
|
#define UART_PORT (&PORT_3)
|
|
#define UART_RX_PIN (1 << 6)
|
|
#define UART_TX_PIN (1 << 7)
|
|
#define UART_RX_ISR (USART1RX_VECTOR)
|
|
#define UART_TX_ISR (USART1TX_VECTOR)
|
|
/** @} */
|
|
|
|
/**
|
|
* @name SPI configuration
|
|
* @{
|
|
*/
|
|
#define SPI_NUMOF (1U)
|
|
|
|
/* SPI configuration */
|
|
#define SPI_BASE (&USART_1)
|
|
#define SPI_SFR (&USART_1_SFR)
|
|
#define SPI_IE_RX_BIT (1 << 6)
|
|
#define SPI_IE_TX_BIT (1 << 7)
|
|
#define SPI_ME_BIT (1 << 6)
|
|
#define SPI_PIN_MISO GPIO_PIN(P5, 2)
|
|
#define SPI_PIN_MOSI GPIO_PIN(P5, 1)
|
|
#define SPI_PIN_CLK GPIO_PIN(P5, 3)
|
|
/** @} */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* PERIPH_CONF_H */
|
|
/** @} */
|