2019-06-25 19:16:43 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Ken Rabold
|
2019-12-05 18:53:41 +01:00
|
|
|
* 2019 Inria
|
2019-06-25 19:16:43 +02:00
|
|
|
*
|
|
|
|
* 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_hifive1b
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Peripheral specific definitions for the HiFive1b RISC-V board
|
|
|
|
*
|
|
|
|
* @author Ken Rabold
|
2019-12-05 18:53:41 +01:00
|
|
|
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
2019-06-25 19:16:43 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PERIPH_CONF_H
|
|
|
|
#define PERIPH_CONF_H
|
|
|
|
|
2019-12-05 18:53:41 +01:00
|
|
|
#include "periph_cpu.h"
|
|
|
|
|
2019-06-25 19:16:43 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name Core Clock configuration
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/* As defined in boards/hifive1/board.c CPU_DESIRED_FREQ **/
|
|
|
|
#define CLOCK_CORECLOCK (200000000ul)
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name Timer configuration
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define TIMER_NUMOF (1)
|
|
|
|
/** @} */
|
|
|
|
|
2019-12-05 18:53:41 +01:00
|
|
|
/**
|
|
|
|
* @name UART configuration
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
static const uart_conf_t uart_config[] = {
|
|
|
|
{
|
|
|
|
.addr = UART0_CTRL_ADDR,
|
|
|
|
.rx = GPIO_PIN(0, 16),
|
|
|
|
.tx = GPIO_PIN(0, 17),
|
|
|
|
.isr_num = INT_UART0_BASE,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.addr = UART1_CTRL_ADDR,
|
|
|
|
.rx = GPIO_PIN(0, 18),
|
|
|
|
.tx = GPIO_PIN(0, 23),
|
|
|
|
.isr_num = INT_UART1_BASE,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
#define UART_NUMOF ARRAY_SIZE(uart_config)
|
|
|
|
/** @} */
|
|
|
|
|
2019-06-25 19:16:43 +02:00
|
|
|
/**
|
|
|
|
* @name RTT/RTC configuration
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define RTT_FREQUENCY (1) /* in Hz */
|
|
|
|
#define RTT_MAX_VALUE (0xFFFFFFFF)
|
|
|
|
#define RTT_INTR_PRIORITY (2)
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name GPIO configuration
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define GPIO_INTR_PRIORITY (3)
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name PWM configuration
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define PWM_NUMOF (3)
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* PERIPH_CONF_H */
|
|
|
|
/** @} */
|