Mesh4all
May the mesh be with you
periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 DAI Labor Technische Universität Berlin
3  * Copyright (C) 2022 Mesh4all<contact@mesh4all.org>
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser General
6  * Public License v2.1. See the file LICENSE in the top level directory for more
7  * details.
8  */
9 
20 #ifndef PERIPH_CONF_H
21 #define PERIPH_CONF_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <stdint.h>
28 
29 #include "cpu.h"
30 #include "periph_cpu.h"
31 
32 #include "cfg_clk_default.h"
33 #include "cfg_timer_default.h"
34 
53 #define SOC_ADC_ADCCON3_EREF SOC_ADC_ADCCON3_EREF_AVDD5
54 
68 #define SOC_ADC_RES ADC_RES_12BIT
69 
73 static const adc_conf_t adc_config[] = {
74  GPIO_PIN(PORT_A, 6),
75  GPIO_PIN(PORT_A, 7),
76 };
77 
78 #define ADC_NUMOF ARRAY_SIZE(adc_config)
94 static const uart_conf_t uart_config[] = {
95  {
96  .dev = UART0_BASEADDR,
97  .rx_pin = GPIO_PIN(PORT_A, 0),
98  .tx_pin = GPIO_PIN(PORT_A, 1),
99 #ifdef MODULE_PERIPH_UART_HW_FC
100  .cts_pin = GPIO_UNDEF,
101  .rts_pin = GPIO_UNDEF,
102 #endif
103  },
104 };
105 
106 #define UART_0_ISR isr_uart0
107 #define UART_NUMOF ARRAY_SIZE(uart_config)
114 #define I2C_IRQ_PRIO 1
128 static const i2c_conf_t i2c_config[] = {
129  {
130  .speed = I2C_SPEED_FAST,
131  .scl_pin = GPIO_PIN(PORT_B, 0),
132  .sda_pin = GPIO_PIN(PORT_B, 1),
133  },
134 };
135 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
151 static const spi_conf_t spi_config[] = {
152  {
153  .num = 0,
154  .mosi_pin = GPIO_PIN(PORT_B, 4),
155  .miso_pin = GPIO_PIN(PORT_B, 5),
156  .sck_pin = GPIO_PIN(PORT_B, 6),
157  .cs_pin = GPIO_PIN(PORT_B, 7),
158  },
159 };
160 
161 #define SPI_NUMOF ARRAY_SIZE(spi_config)
164 #ifdef __cplusplus
165 }
166 #endif
167 
168 #endif /* PERIPH_CONF_H */
static const adc_conf_t adc_config[]
Available ADC lines.
Definition: periph_conf.h:73
static const uart_conf_t uart_config[]
Two available UART ports but only one is set as follows:
Definition: periph_conf.h:94
static const spi_conf_t spi_config[]
There are 2 SPI ports available but only one is set as follows:
Definition: periph_conf.h:151
static const i2c_conf_t i2c_config[]
There are 2 I2C ports available but only one is set as follows:
Definition: periph_conf.h:128