24 #include "periph_cpu.h" 39 #define CLOCK_CORECLOCK (96000000U) 42 #define CLOCK_HSE (8000000U) 47 #define CLOCK_AHB_DIV RCC_CFGR_HPRE_DIV1 48 #define CLOCK_AHB (CLOCK_CORECLOCK / 1) 49 #define CLOCK_APB1_DIV RCC_CFGR_PPRE1_DIV2 50 #define CLOCK_APB1 (CLOCK_CORECLOCK / 2) 51 #define CLOCK_APB2_DIV RCC_CFGR_PPRE2_DIV1 52 #define CLOCK_APB2 (CLOCK_CORECLOCK / 1) 55 #define CLOCK_PLL_M (4) 56 #define CLOCK_PLL_N (192) 57 #define CLOCK_PLL_P (4) 58 #define CLOCK_PLL_Q (8) 69 .rcc_mask = RCC_APB1ENR_TIM5EN,
75 #define TIMER_0_ISR isr_tim5 76 #define TIMER_1_ISR isr_tim4 78 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0])) 88 .rcc_mask = RCC_APB1ENR_USART2EN,
102 .rcc_mask = RCC_APB2ENR_USART1EN,
116 .rcc_mask = RCC_APB2ENR_USART6EN,
131 #define UART_0_ISR isr_usart2 132 #define UART_0_DMA_ISR isr_dma1_stream6 133 #define UART_1_ISR isr_usart1 134 #define UART_1_DMA_ISR isr_dma1_stream6 135 #define UART_2_ISR isr_usart6 136 #define UART_2_DMA_ISR isr_dma1_stream6 139 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0])) 148 .rcc_mask = RCC_APB1ENR_TIM2EN,
152 { .pin = GPIO_UNDEF, .cc_chan = 0 } },
158 .rcc_mask = RCC_APB1ENR_TIM3EN,
168 #define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0])) 178 static const uint8_t spi_divtable[2][5] = {
203 .rccmask = RCC_APB2ENR_SPI1EN,
208 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0])) 215 #define I2C_NUMOF (1U) 217 #define I2C_IRQ_PRIO 1 218 #define I2C_APBCLK (CLOCK_APB1) 221 #define I2C_0_DEV I2C1 222 #define I2C_0_CLKEN() (RCC->APB1ENR |= RCC_APB1ENR_I2C1EN) 223 #define I2C_0_CLKDIS() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C1EN)) 224 #define I2C_0_EVT_IRQ I2C1_EV_IRQn 225 #define I2C_0_EVT_ISR isr_i2c1_ev 226 #define I2C_0_ERR_IRQ I2C1_ER_IRQn 227 #define I2C_0_ERR_ISR isr_i2c1_er 229 #define I2C_0_SCL_PORT GPIOB 230 #define I2C_0_SCL_PIN 8 231 #define I2C_0_SCL_AF 4 232 #define I2C_0_SCL_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN) 233 #define I2C_0_SDA_PORT GPIOB 234 #define I2C_0_SDA_PIN 9 235 #define I2C_0_SDA_AF 4 236 #define I2C_0_SDA_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN) 249 #define ADC_NUMOF (6U) 250 #define ADC_CONFIG { \ 251 {GPIO_PIN(PORT_A, 0), 0, 0}, \ 252 {GPIO_PIN(PORT_A, 1), 0, 1}, \ 253 {GPIO_PIN(PORT_A, 4), 0, 4}, \ 254 {GPIO_PIN(PORT_B, 0), 0, 8}, \ 255 {GPIO_PIN(PORT_C, 1), 0, 11}, \ 256 {GPIO_PIN(PORT_C, 0), 0, 10}, \
cc2538_uart_t * dev
pointer to the used UART device
TIMER_TypeDef * dev
TIMER device used.
PWM device configuration.
NRF_TIMER_Type * dev
timer device
UART device configuration.
SPI module configuration options.
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
cc2538_ssi_t * dev
SSI device.