periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright(C) 2016,2017, Imagination Technologies Limited and/or its
3  * affiliated group companies.
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  *
9  */
10 
21 #ifndef PERIPH_CONF_H
22 #define PERIPH_CONF_H
23 
24 #include "cpu.h"
25 #include "periph_cpu.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
37 #define PERIPHERAL_CLOCK (96000000) /* Hz */
38 
43 #define TIMER_NUMOF (1)
44 #define TIMER_0_CHANNELS (3)
45 
51 static const uart_conf_t uart_config[] = {
52  { /* UART port available on MikroBus */
53  .base = (volatile unsigned int *)_UART3_BASE_ADDRESS,
54  .clock = PERIPHERAL_CLOCK,
55  .rx_pin = GPIO_PIN(PORT_F, 5),
56  .tx_pin = GPIO_PIN(PORT_F, 4),
57  .rx_mux_reg = &U3RXR,
58  .tx_mux_reg = &RPF4R,
59  .rx_af = GPIO_AF2,
60  .tx_af = GPIO_AF1,
61  .vector = _UART_3_VECTOR,
62  .irq = _UART3_RX_IRQ,
63  },
64 };
65 
66 #define UART_0_ISR (isr_usart3)
67 #define UART_NUMOF ((unsigned int)ARRAY_SIZE(uart_config))
68 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* PERIPH_CONF_H */
75 
PERIPHERAL_CLOCK
#define PERIPHERAL_CLOCK
The peripheral clock is required for the UART Baud rate calculation It is configured by the 'config' ...
Definition: periph_conf.h:37
uart_conf_t
UART device configuration.
Definition: periph_cpu.h:166
PORT_F
@ PORT_F
port F
Definition: periph_cpu.h:41
GPIO_AF1
@ GPIO_AF1
use alternate function 1
Definition: periph_cpu_common.h:87
uart_conf_t::base
volatile unsigned int * base
UART device base register address.
Definition: periph_cpu_common.h:108
GPIO_PIN
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35
GPIO_AF2
@ GPIO_AF2
use alternate function 2
Definition: periph_cpu_common.h:88