periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Rakendra Thapa <rakendrathapa@gmail.com>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
19 #ifndef PERIPH_CONF_H
20 #define PERIPH_CONF_H
21 
22 #include "periph_cpu.h"
23 #include "macros/units.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 #define CLK80 1
34 #define CLK50 2
35 #define CLK40 3
36 #define CLK16 4
37 #define CLK1 5
38 #define CLOCK_SOURCE CLK40
39 #define CLOCK_CORECLOCK MHZ(80)
40 
46 static const timer_conf_t timer_config[] = {
47  {
48  .dev = WTIMER0_BASE,
49  .max = 0xffffffff,
50  .irqn = Timer0A_IRQn,
51  .sysctl = SYSCTL_PERIPH_WTIMER0,
52  .intbase = INT_WTIMER0A,
53  .channels = 1
54  },
55  {
56  .dev = WTIMER1_BASE,
57  .max = 0xffffffff,
58  .irqn = Timer1A_IRQn,
59  .sysctl = SYSCTL_PERIPH_WTIMER1,
60  .intbase = INT_WTIMER1A,
61  .channels = 1
62  },
63 };
64 
65 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
66 
67 #define TIMER_0_ISR isr_wtimer0a
68 #define TIMER_1_ISR isr_wtimer1a
69 
74 #define UART_NUMOF (1U)
75 #define UART_IRQ_PRIO 1
76 /* UART clock runs with 40MHz */
77 #define UART_CLK ROM_SysCtlClockGet()
78 /* UART 0 device configuration */
79 #define UART_0_DEV UART0_BASE
80 #define UART_0_CLK (40000000)
81 #define UART_0_IRQ_CHAN UART0_IRQn
82 #define UART_0_ISR isr_uart0
83 /* UART 0 pin configuration */
84 #define UART_0_PORT GPIOA
85 #define UART_0_TX_PIN UART_PA1_U0TX
86 #define UART_0_RX_PIN UART_PA0_U0RX
87 
93 #define ADC_NUMOF (12)
94 
100 static const spi_conf_t spi_confs[] = {
101  {
102  .ssi_sysctl = SYSCTL_PERIPH_SSI0,
103  .ssi_base = SSI0_BASE,
104  .gpio_sysctl = SYSCTL_PERIPH_GPIOA,
105  .gpio_port = GPIO_PORTA_BASE,
106  .pins = {
107  .clk = GPIO_PA2_SSI0CLK,
108  .fss = GPIO_PA3_SSI0FSS,
109  .rx = GPIO_PA4_SSI0RX,
110  .tx = GPIO_PA5_SSI0TX,
111  .mask = GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5
112  }
113  },
114  {
115  .ssi_sysctl = SYSCTL_PERIPH_SSI1,
116  .ssi_base = SSI1_BASE,
117  .gpio_sysctl = SYSCTL_PERIPH_GPIOF,
118  .gpio_port = GPIO_PORTF_BASE,
119  .pins = {
120  .clk = GPIO_PF2_SSI1CLK,
121  .fss = GPIO_PF3_SSI1FSS,
122  .rx = GPIO_PF0_SSI1RX,
123  .tx = GPIO_PF1_SSI1TX,
124  .mask = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3
125  }
126  },
127  {
128  .ssi_sysctl = SYSCTL_PERIPH_SSI2,
129  .ssi_base = SSI2_BASE,
130  .gpio_sysctl = SYSCTL_PERIPH_GPIOB,
131  .gpio_port = GPIO_PORTB_BASE,
132  .pins = {
133  .clk = GPIO_PB4_SSI2CLK,
134  .fss = GPIO_PB5_SSI2FSS,
135  .rx = GPIO_PB6_SSI2RX,
136  .tx = GPIO_PB7_SSI2TX,
137  .mask = GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7
138  }
139  },
140  {
141  .ssi_sysctl = SYSCTL_PERIPH_SSI3,
142  .ssi_base = SSI3_BASE,
143  .gpio_sysctl = SYSCTL_PERIPH_GPIOD,
144  .gpio_port = GPIO_PORTD_BASE,
145  .pins = {
146  .clk = GPIO_PD0_SSI3CLK,
147  .fss = GPIO_PD1_SSI3FSS,
148  .rx = GPIO_PD2_SSI3RX,
149  .tx = GPIO_PD3_SSI3TX,
150  .mask = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3
151  }
152  },
153 };
154 
155 #define SPI_NUMOF ARRAY_SIZE(spi_confs)
156 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #endif /* PERIPH_CONF_H */
163 
spi_conf_t::ssi_sysctl
unsigned long ssi_sysctl
SSI device in sysctl.
Definition: periph_cpu.h:132
timer_conf_t
Timer configuration.
Definition: periph_cpu.h:288
units.h
Unit helper macros.
timer_conf_t::dev
uint32_t dev
Address of timer base.
Definition: periph_cpu.h:112
spi_conf_t
SPI configuration structure type.
Definition: periph_cpu.h:273