periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2016 Freie Universität Berlin
3  * 2015 Zolertia SL
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 #pragma once
11 
24 #include "periph_cpu.h"
25 #include "cfg_clk_default.h"
26 #include "cfg_timer_default.h"
27 #include "cfg_uart_default.h"
28 
29 #ifdef __cplusplus
30  extern "C" {
31 #endif
32 
37 #define I2C_IRQ_PRIO 1
38 
39 static const i2c_conf_t i2c_config[] = {
40  {
42  .scl_pin = GPIO_PIN(1, 1),
43  .sda_pin = GPIO_PIN(1, 0)
44  },
45 };
46 
47 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
54 static const spi_conf_t spi_config[] = {
55  {
56  .num = 0,
57  .mosi_pin = GPIO_PIN(3, 0),
58  .miso_pin = GPIO_PIN(2, 4),
59  .sck_pin = GPIO_PIN(3, 1),
60  .cs_pin = GPIO_PIN(3, 3)
61  },
62  {
63  .num = 1,
64  .mosi_pin = GPIO_PIN(2, 7),
65  .miso_pin = GPIO_PIN(0, 4),
66  .sck_pin = GPIO_PIN(1 ,5),
67  .cs_pin = SPI_CS_UNDEF,
68  }
69 };
70 
71 #define SPI_NUMOF ARRAY_SIZE(spi_config)
78 #define SOC_ADC_ADCCON3_EREF SOC_ADC_ADCCON3_EREF_AVDD5
79 
80 static const adc_conf_t adc_config[] = {
81  GPIO_PIN(0, 6),
82  GPIO_PIN(0, 7),
83 };
84 
85 #define ADC_NUMOF ARRAY_SIZE(adc_config)
88 #ifdef __cplusplus
89 } /* end extern "C" */
90 #endif
91 
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:45
static const spi_conf_t spi_config[]
SPI configuration.
Definition: periph_conf.h:96
static const i2c_conf_t i2c_config[]
I2C configuration.
Definition: periph_conf.h:68
static const adc_conf_t adc_config[]
ADC configuration.
Definition: periph_conf.h:250
Default clock configuration for cc2538 based boards.
#define SPI_CS_UNDEF
Define value for unused CS line.
Definition: periph_cpu.h:362
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition: periph_cpu.h:278
ADC device configuration.
Definition: periph_cpu.h:377
I2C configuration structure.
Definition: periph_cpu.h:298
i2c_speed_t speed
Configured bus speed, actual speed may be lower but never higher.
Definition: periph_cpu.h:303
SPI device configuration.
Definition: periph_cpu.h:336
uint8_t num
number of SSI device, i.e.
Definition: periph_cpu.h:295