24 #include "periph_cpu.h" 39 #define CLOCK_CORECLOCK (168000000U) 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_DIV4 50 #define CLOCK_APB1 (CLOCK_CORECLOCK / 4) 51 #define CLOCK_APB2_DIV RCC_CFGR_PPRE2_DIV2 52 #define CLOCK_APB2 (CLOCK_CORECLOCK / 2) 55 #define CLOCK_PLL_M (4) 56 #define CLOCK_PLL_N (168) 57 #define CLOCK_PLL_P (2) 58 #define CLOCK_PLL_Q (7) 69 .rcc_mask = RCC_APB1ENR_TIM5EN,
75 #define TIMER_0_ISR isr_tim5 77 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0])) 87 .rcc_mask = RCC_APB1ENR_USART3EN,
101 .rcc_mask = RCC_APB2ENR_USART6EN,
115 .rcc_mask = RCC_APB1ENR_USART2EN,
129 #define UART_0_ISR (isr_usart3) 130 #define UART_0_DMA_ISR (isr_dma1_stream6) 131 #define UART_1_ISR (isr_usart6) 132 #define UART_1_DMA_ISR (isr_dma1_stream5) 133 #define UART_2_ISR (isr_usart2) 134 #define UART_2_DMA_ISR (isr_dma1_stream4) 136 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0])) 146 .rcc_mask = RCC_APB2ENR_TIM1EN,
150 { .pin = GPIO_UNDEF, .cc_chan = 0} },
156 .rcc_mask = RCC_APB1ENR_TIM4EN,
158 { .pin = GPIO_UNDEF, .cc_chan = 0},
159 { .pin = GPIO_UNDEF, .cc_chan = 0},
160 { .pin = GPIO_UNDEF, .cc_chan = 0} },
166 #define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0])) 176 static const uint8_t spi_divtable[2][5] = {
199 .cs_pin = GPIO_UNDEF,
201 .rccmask = RCC_APB2ENR_SPI1EN,
206 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0])) 213 #define I2C_NUMOF (1U) 215 #define I2C_IRQ_PRIO 1 216 #define I2C_APBCLK (42000000U) 219 #define I2C_0_DEV I2C1 220 #define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN)) 221 #define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN)) 222 #define I2C_0_EVT_IRQ I2C1_EV_IRQn 223 #define I2C_0_EVT_ISR isr_i2c1_ev 224 #define I2C_0_ERR_IRQ I2C1_ER_IRQn 225 #define I2C_0_ERR_ISR isr_i2c1_er 227 #define I2C_0_SCL_PORT GPIOB 228 #define I2C_0_SCL_PIN 8 229 #define I2C_0_SCL_AF 4 230 #define I2C_0_SCL_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) 231 #define I2C_0_SDA_PORT GPIOB 232 #define I2C_0_SDA_PIN 9 233 #define I2C_0_SDA_AF 4 234 #define I2C_0_SDA_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) 247 #define ADC_NUMOF (6U) 248 #define ADC_CONFIG { \ 249 {GPIO_PIN(PORT_A, 3), 2, 3}, \ 250 {GPIO_PIN(PORT_C, 0), 2, 10}, \ 251 {GPIO_PIN(PORT_C, 3), 2, 13}, \ 252 {GPIO_PIN(PORT_F, 3), 2, 9}, \ 253 {GPIO_PIN(PORT_F, 5), 2, 15}, \ 254 {GPIO_PIN(PORT_F, 10), 2, 8}, \
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.