periph_conf.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2015 Rakendra Thapa <rakendrathapa@gmail.com>
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #include "periph_cpu.h"
19 #include "macros/units.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
29 #define CLK80 1
30 #define CLK50 2
31 #define CLK40 3
32 #define CLK16 4
33 #define CLK1 5
34 #define CLOCK_SOURCE CLK40
35 #define CLOCK_CORECLOCK MHZ(80)
42 static const timer_conf_t timer_config[] = {
43  {
44  .dev = WTIMER0_BASE,
45  .max = 0xffffffff,
46  .irqn = Timer0A_IRQn,
47  .sysctl = SYSCTL_PERIPH_WTIMER0,
48  .intbase = INT_WTIMER0A,
49  .channels = 1
50  },
51  {
52  .dev = WTIMER1_BASE,
53  .max = 0xffffffff,
54  .irqn = Timer1A_IRQn,
55  .sysctl = SYSCTL_PERIPH_WTIMER1,
56  .intbase = INT_WTIMER1A,
57  .channels = 1
58  },
59 };
60 
61 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
62 
63 #define TIMER_0_ISR isr_wtimer0a
64 #define TIMER_1_ISR isr_wtimer1a
71 #define UART_NUMOF (1U)
72 #define UART_IRQ_PRIO 1
73 /* UART clock runs with 40MHz */
74 #define UART_CLK ROM_SysCtlClockGet()
75 /* UART 0 device configuration */
76 #define UART_0_DEV UART0_BASE
77 #define UART_0_CLK (40000000)
78 #define UART_0_IRQ_CHAN UART0_IRQn
79 #define UART_0_ISR isr_uart0
80 /* UART 0 pin configuration */
81 #define UART_0_PORT GPIOA
82 #define UART_0_TX_PIN UART_PA1_U0TX
83 #define UART_0_RX_PIN UART_PA0_U0RX
90 #define ADC_NUMOF (12)
97 static const spi_conf_t spi_confs[] = {
98  {
99  .ssi_sysctl = SYSCTL_PERIPH_SSI0,
100  .ssi_base = SSI0_BASE,
101  .gpio_sysctl = SYSCTL_PERIPH_GPIOA,
102  .gpio_port = GPIO_PORTA_BASE,
103  .pins = {
104  .clk = GPIO_PA2_SSI0CLK,
105  .fss = GPIO_PA3_SSI0FSS,
106  .rx = GPIO_PA4_SSI0RX,
107  .tx = GPIO_PA5_SSI0TX,
108  .mask = GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5
109  }
110  },
111  {
112  .ssi_sysctl = SYSCTL_PERIPH_SSI1,
113  .ssi_base = SSI1_BASE,
114  .gpio_sysctl = SYSCTL_PERIPH_GPIOF,
115  .gpio_port = GPIO_PORTF_BASE,
116  .pins = {
117  .clk = GPIO_PF2_SSI1CLK,
118  .fss = GPIO_PF3_SSI1FSS,
119  .rx = GPIO_PF0_SSI1RX,
120  .tx = GPIO_PF1_SSI1TX,
121  .mask = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3
122  }
123  },
124  {
125  .ssi_sysctl = SYSCTL_PERIPH_SSI2,
126  .ssi_base = SSI2_BASE,
127  .gpio_sysctl = SYSCTL_PERIPH_GPIOB,
128  .gpio_port = GPIO_PORTB_BASE,
129  .pins = {
130  .clk = GPIO_PB4_SSI2CLK,
131  .fss = GPIO_PB5_SSI2FSS,
132  .rx = GPIO_PB6_SSI2RX,
133  .tx = GPIO_PB7_SSI2TX,
134  .mask = GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7
135  }
136  },
137  {
138  .ssi_sysctl = SYSCTL_PERIPH_SSI3,
139  .ssi_base = SSI3_BASE,
140  .gpio_sysctl = SYSCTL_PERIPH_GPIOD,
141  .gpio_port = GPIO_PORTD_BASE,
142  .pins = {
143  .clk = GPIO_PD0_SSI3CLK,
144  .fss = GPIO_PD1_SSI3FSS,
145  .rx = GPIO_PD2_SSI3RX,
146  .tx = GPIO_PD3_SSI3TX,
147  .mask = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3
148  }
149  },
150 };
151 
152 #define SPI_NUMOF ARRAY_SIZE(spi_confs)
155 #ifdef __cplusplus
156 }
157 #endif
158 
static const timer_conf_t timer_config[]
All timers on board.
Definition: periph_conf.h:36
SPI device configuration.
Definition: periph_cpu.h:333
unsigned long ssi_sysctl
SSI device in sysctl.
Definition: periph_cpu.h:131
Timer device configuration.
Definition: periph_cpu.h:260
TC0_t * dev
Pointer to the used as Timer device.
Definition: periph_cpu.h:261
Unit helper macros.