periph_cpu.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2015-2017 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
19 #include "kernel_defines.h"
20 #include "mutex.h"
21 
22 #include "cpu.h"
23 #include "cpu_conf.h"
24 
25 #if defined(_SILICON_LABS_32B_SERIES_2)
26 #include "em_iadc.h"
27 #else
28 #include "em_adc.h"
29 #endif
30 #include "em_cmu.h"
31 #include "em_device.h"
32 #include "em_gpio.h"
33 #include "em_timer.h"
34 #include "em_usart.h"
35 #include "em_wdog.h"
36 #include "em_rtc.h"
37 #if defined(_SILICON_LABS_32B_SERIES_0)
38 #include "em_dac.h"
39 #elif defined (_SILICON_LABS_32B_SERIES_1) || defined(_SILICON_LABS_32B_SERIES_2)
40 #include "em_vdac.h"
41 #endif
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
50 typedef struct {
51  CMU_Clock_TypeDef clk;
52  CMU_Select_TypeDef src;
53 } clk_mux_t;
54 
58 typedef struct {
59  CMU_Clock_TypeDef clk;
60  CMU_ClkDiv_TypeDef div;
61 } clk_div_t;
62 
66 #define CPUID_LEN (8U)
67 
71 #define CLOCK_CORECLOCK SystemCoreClock
72 
73 #if defined(DAC_COUNT) && DAC_COUNT > 0
77 typedef struct {
78  DAC_TypeDef *dev;
79  DAC_Ref_TypeDef ref;
80  CMU_Clock_TypeDef cmu;
81 } dac_conf_t;
82 
86 typedef struct {
87  uint8_t dev;
88  uint8_t index;
89 } dac_chan_conf_t;
90 
91 #elif defined(VDAC_COUNT) && VDAC_COUNT > 0
95 typedef struct {
96  VDAC_TypeDef *dev;
97  VDAC_Ref_TypeDef ref;
98  CMU_Clock_TypeDef cmu;
99 } dac_conf_t;
100 
104 typedef struct {
105  uint8_t dev;
106  uint8_t index;
107 } dac_chan_conf_t;
108 #endif
109 
114 /* RTT_MAX_VALUE some are 24bit, some are 32bit */
115 #if defined(_RTC_CNT_MASK)
116 #define RTT_MAX_VALUE _RTC_CNT_MASK /* mask has all bits set ==> MAX*/
117 #elif defined(_RTCC_CNT_MASK)
118 #define RTT_MAX_VALUE _RTCC_CNT_MASK /* mask has all bits set ==> MAX*/
119 #endif
120 #define RTT_MAX_FREQUENCY (32768U) /* in Hz */
121 #define RTT_MIN_FREQUENCY (1U) /* in Hz */
122 #define RTT_CLOCK_FREQUENCY (32768U) /* in Hz, LFCLK*/
123 
130 #define HAVE_GPIO_T
131 typedef uint32_t gpio_t;
137 #define GPIO_UNDEF (0xffffffff)
138 
142 #define GPIO_PIN(x, y) ((gpio_t) ((x << 4) | y))
143 
147 #define GPIO_MODE(x, y) ((x << 1) | y)
148 
152 enum {
153 #if (_GPIO_PORT_A_PIN_COUNT > 0)
154  PA = gpioPortA,
155 #endif
156 #if (_GPIO_PORT_B_PIN_COUNT > 0)
157  PB = gpioPortB,
158 #endif
159 #if (_GPIO_PORT_C_PIN_COUNT > 0)
160  PC = gpioPortC,
161 #endif
162 #if (_GPIO_PORT_D_PIN_COUNT > 0)
163  PD = gpioPortD,
164 #endif
165 #if (_GPIO_PORT_E_PIN_COUNT > 0)
166  PE = gpioPortE,
167 #endif
168 #if (_GPIO_PORT_F_PIN_COUNT > 0)
169  PF = gpioPortF,
170 #endif
171 #if (_GPIO_PORT_G_PIN_COUNT > 0)
172  PG = gpioPortG,
173 #endif
174 #if (_GPIO_PORT_H_PIN_COUNT > 0)
175  PH = gpioPortH,
176 #endif
177 #if (_GPIO_PORT_I_PIN_COUNT > 0)
178  PI = gpioPortI,
179 #endif
180 #if (_GPIO_PORT_J_PIN_COUNT > 0)
181  PJ = gpioPortJ,
182 #endif
183 #if (_GPIO_PORT_K_PIN_COUNT > 0)
184  PK = gpioPortK
185 #endif
186 };
187 
188 #ifndef DOXYGEN
193 #define HAVE_GPIO_MODE_T
194 typedef enum {
195  GPIO_IN = GPIO_MODE(gpioModeInput, 0),
196  GPIO_IN_PD = GPIO_MODE(gpioModeInputPull, 0),
197  GPIO_IN_PU = GPIO_MODE(gpioModeInputPull, 1),
198  GPIO_OUT = GPIO_MODE(gpioModePushPull, 0),
199  GPIO_OD = GPIO_MODE(gpioModeWiredAnd, 1),
200  GPIO_OD_PU = GPIO_MODE(gpioModeWiredAndPullUp, 1),
201 } gpio_mode_t;
208 #define HAVE_GPIO_FLANK_T
209 typedef enum {
210  GPIO_FALLING = 2,
211  GPIO_RISING = 1,
212  GPIO_BOTH = 3
213 } gpio_flank_t;
215 #endif /* ndef DOXYGEN */
216 
217 #if defined(_SILICON_LABS_32B_SERIES_2)
225 #if defined(_IADC_CFG_DIGAVG_MASK)
226 #define ADC_MODE(osr, avg, res) ((osr << 16) | (avg << 8) | res)
227 #else
228 #define ADC_MODE(osr, res) ((osr << 16) | res)
229 #endif
230 
234 #define ADC_MODE_OSR(mode) ((mode & 0xff0000) >> 16)
235 
236 #if defined(_IADC_CFG_DIGAVG_MASK)
240 #define ADC_MODE_AVG(mode) ((mode & 0x00ff00) >> 8)
241 #endif
242 
246 #define ADC_MODE_RES(mode) ((mode & 0x0000ff) >> 0)
247 
252 #define HAVE_ADC_RES_T
253 #if defined(_IADC_CFG_DIGAVG_MASK)
254 typedef enum {
255  ADC_RES_6BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 6),
256  ADC_RES_8BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 8),
257  ADC_RES_10BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 10),
258  ADC_RES_12BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 12),
259  ADC_RES_14BIT = ADC_MODE(iadcCfgOsrHighSpeed8x, iadcDigitalAverage1, 14),
260  ADC_RES_16BIT = ADC_MODE(iadcCfgOsrHighSpeed16x, iadcDigitalAverage2, 16),
261 } adc_res_t;
262 #else
263 typedef enum {
264  ADC_RES_6BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 6),
265  ADC_RES_8BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 8),
266  ADC_RES_10BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 10),
267  ADC_RES_12BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 12),
268  ADC_RES_14BIT = ADC_MODE(iadcCfgOsrHighSpeed8x, 14),
269  ADC_RES_16BIT = ADC_MODE(iadcCfgOsrHighSpeed32x, 16),
270 } adc_res_t;
271 #endif
272 
276 typedef struct {
280  IADC_TypeDef *dev;
281 
285  CMU_Clock_TypeDef cmu;
286 
290  IADC_CfgReference_t reference;
291 
297  uint32_t reference_mV;
298 
305  IADC_CfgAnalogGain_t gain;
306 
314  adc_res_t available_res[IADC0_CONFIGNUM];
315 } adc_conf_t;
316 
320 typedef struct {
324  uint8_t dev;
325 
329  gpio_t input_pos;
330 
340  gpio_t input_neg;
342 #else /* defined(_SILICON_LABS_32B_SERIES_2) */
347 #define ADC_MODE(x, y) ((y << 4) | x)
348 
352 #define ADC_MODE_UNDEF(x) (ADC_MODE(x, 15))
353 
354 #ifndef DOXYGEN
359 #define HAVE_ADC_RES_T
360 typedef enum {
361  ADC_RES_6BIT = ADC_MODE(adcRes6Bit, 0),
362  ADC_RES_8BIT = ADC_MODE(adcRes8Bit, 0),
363  ADC_RES_10BIT = ADC_MODE(adcRes12Bit, 2),
364  ADC_RES_12BIT = ADC_MODE(adcRes12Bit, 0),
367 } adc_res_t;
369 #endif /* ndef DOXYGEN */
370 
374 typedef struct {
375  ADC_TypeDef *dev;
376  CMU_Clock_TypeDef cmu;
377 } adc_conf_t;
378 
382 typedef struct {
383  uint8_t dev;
384 #if defined(_SILICON_LABS_32B_SERIES_0)
385  ADC_SingleInput_TypeDef input;
386 #elif defined(_SILICON_LABS_32B_SERIES_1)
387  ADC_PosSel_TypeDef input;
388 #endif
389  ADC_Ref_TypeDef reference;
390  ADC_AcqTime_TypeDef acq_time;
392 #endif /* !defined(_SILICON_LABS_32B_SERIES_2) */
393 
398 #define HAVE_HWCRYPTO_AES128
399 #ifdef AES_CTRL_AES256
400 #define HAVE_HWCRYPTO_AES256
401 #endif
402 #if defined(_SILICON_LABS_32B_SERIES_1)
403 #define HAVE_HWCRYPTO_SHA1
404 #define HAVE_HWCRYPTO_SHA256
405 #endif
408 #ifndef DOXYGEN
413 #define HAVE_I2C_SPEED_T
414 typedef enum {
415  I2C_SPEED_LOW = 10000,
416  I2C_SPEED_NORMAL = 100000,
417  I2C_SPEED_FAST = 400000,
418  I2C_SPEED_FAST_PLUS = 1000000,
419  I2C_SPEED_HIGH = 3400000,
420 } i2c_speed_t;
422 #endif /* ndef DOXYGEN */
423 
427 typedef struct {
428  I2C_TypeDef *dev;
429  gpio_t sda_pin;
430  gpio_t scl_pin;
431 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
432  uint32_t loc;
433 #endif
434  CMU_Clock_TypeDef cmu;
436  uint32_t speed;
437 } i2c_conf_t;
438 
443 #define PERIPH_I2C_NEED_READ_REG
444 #define PERIPH_I2C_NEED_WRITE_REG
447 #ifndef DOXYGEN
452 #define HAVE_PWM_MODE_T
453 typedef enum {
454  PWM_LEFT = timerModeUp,
455  PWM_RIGHT = timerModeDown,
456  PWM_CENTER = timerModeUp
457 } pwm_mode_t;
459 #endif /* ndef DOXYGEN */
460 
464 typedef struct {
465  uint8_t index;
466  gpio_t pin;
467  uint32_t loc;
469 
473 typedef struct {
474  TIMER_TypeDef *dev;
475  CMU_Clock_TypeDef cmu;
477  uint8_t channels;
479 } pwm_conf_t;
480 
481 #ifndef DOXYGEN
486 #define HAVE_SPI_MODE_T
487 typedef enum {
488  SPI_MODE_0 = usartClockMode0,
489  SPI_MODE_1 = usartClockMode1,
490  SPI_MODE_2 = usartClockMode2,
491  SPI_MODE_3 = usartClockMode3
492 } spi_mode_t;
499 #define HAVE_SPI_CLK_T
500 typedef enum {
501  SPI_CLK_100KHZ = 100000,
502  SPI_CLK_400KHZ = 400000,
503  SPI_CLK_1MHZ = 1000000,
504  SPI_CLK_5MHZ = 5000000,
505  SPI_CLK_10MHZ = 10000000
506 } spi_clk_t;
508 #endif /* ndef DOXYGEN */
509 
513 typedef struct {
514  USART_TypeDef *dev;
515  gpio_t mosi_pin;
516  gpio_t miso_pin;
517  gpio_t clk_pin;
518 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
519  uint32_t loc;
520 #endif
521  CMU_Clock_TypeDef cmu;
523 } spi_dev_t;
524 
529 #define PERIPH_SPI_NEEDS_INIT_CS
530 #define PERIPH_SPI_NEEDS_TRANSFER_BYTE
531 #define PERIPH_SPI_NEEDS_TRANSFER_REG
532 #define PERIPH_SPI_NEEDS_TRANSFER_REGS
543 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
544 typedef struct {
545  void *dev;
546  CMU_Clock_TypeDef cmu;
547 } timer_dev_t;
548 #endif
549 
550 typedef struct {
551 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
555  uint8_t channel_numof;
556 #else
557  void *dev;
558  CMU_Clock_TypeDef cmu;
559  IRQn_Type irq;
560 #endif
561 } timer_conf_t;
562 
563 #define LETIMER_MAX_VALUE _LETIMER_TOP_MASK
564 #define TIMER_MAX_VALUE _TIMER_TOP_MASK
570 #ifndef CONFIG_EFM32_XTIMER_USE_LETIMER
571 #define CONFIG_EFM32_XTIMER_USE_LETIMER 0
572 #endif
573 
577 #ifndef DOXYGEN
581 #define UART_MODE_UNSUPPORTED 0xf0
582 
587 #define HAVE_UART_PARITY_T
588 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
589 typedef enum {
590  UART_PARITY_NONE = 0,
591  UART_PARITY_ODD = 1,
592  UART_PARITY_EVEN = 2,
593  UART_PARITY_MARK = 3,
594  UART_PARITY_SPACE = 4,
595 } uart_parity_t;
596 #else
597 typedef enum {
598  UART_PARITY_NONE = 0,
599  UART_PARITY_EVEN = 2,
600  UART_PARITY_ODD = 3,
601  UART_PARITY_MARK = UART_MODE_UNSUPPORTED | 0,
602  UART_PARITY_SPACE = UART_MODE_UNSUPPORTED | 1,
603 } uart_parity_t;
604 #endif
611 #define HAVE_UART_DATA_BITS_T
612 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
613 typedef enum {
614  UART_DATA_BITS_5 = 5,
615  UART_DATA_BITS_6 = 6,
616  UART_DATA_BITS_7 = 7,
617  UART_DATA_BITS_8 = 8,
619 #else
620 typedef enum {
621  UART_DATA_BITS_5 = UART_MODE_UNSUPPORTED | 0,
622  UART_DATA_BITS_6 = UART_MODE_UNSUPPORTED | 1,
623  UART_DATA_BITS_7 = 1,
624  UART_DATA_BITS_8 = 2,
626 #endif
633 #define HAVE_UART_STOP_BITS_T
634 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
635 typedef enum {
636  UART_STOP_BITS_1 = 2,
637  UART_STOP_BITS_2 = 4,
639 #else
640 typedef enum {
641  UART_STOP_BITS_1 = 1,
642  UART_STOP_BITS_2 = 3,
644 #endif
646 #endif /* ndef DOXYGEN */
647 
648 typedef struct {
649  void *dev;
650  gpio_t rx_pin;
651  gpio_t tx_pin;
652 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
653  uint32_t loc;
654 #endif
655  CMU_Clock_TypeDef cmu;
657 } uart_conf_t;
658 
662 #define PROVIDES_PM_OFF
663 
667 #define PROVIDES_PM_LAYERED_OFF
668 
672 #define PM_NUM_MODES (3U)
673 
678 #define EFM32_PM_MODE_EM3 (0U)
679 #define EFM32_PM_MODE_EM2 (1U)
680 #define EFM32_PM_MODE_EM1 (2U)
687 #define WDT_CLOCK_HZ (1000U)
688 
689 #define NWDT_TIME_LOWER_LIMIT ((1U << (3U + wdogPeriod_9)) + 1U)
690 #define NWDT_TIME_UPPER_LIMIT ((1U << (3U + wdogPeriod_256k)) + 1U)
691 
692 #if defined(_SILICON_LABS_32B_SERIES_1) || defined(_SILICON_LABS_32B_SERIES_2)
693 #define WDT_TIME_LOWER_LIMIT NWDT_TIME_LOWER_LIMIT
694 #define WDT_TIME_UPPER_LIMIT NWDT_TIME_UPPER_LIMIT
695 #endif
696 
697 #define WDT_HAS_STOP (1U)
704 #define USBDEV_NUM_ENDPOINTS 7
707 /* GPIO_LL's overrides */
708 #ifndef DOXYGEN
709 
710 /* Not supported by hardware */
711 #define HAVE_GPIO_SLEW_T
712 typedef enum {
713  GPIO_SLEW_SLOWEST = 0,
714  GPIO_SLEW_SLOW = 0,
715  GPIO_SLEW_FAST = 0,
716  GPIO_SLEW_FASTEST = 0,
717 } gpio_slew_t;
718 
719 /* Not supported by hardware */
720 #define HAVE_GPIO_PULL_STRENGTH_T
721 typedef enum {
722  GPIO_PULL_WEAKEST = 0,
723  GPIO_PULL_WEAK = 0,
724  GPIO_PULL_STRONG = 0,
727 
728 /* Not implemented, see gpio_ll_arch.h comments */
729 #define HAVE_GPIO_DRIVE_STRENGTH_T
730 typedef enum {
731  GPIO_DRIVE_WEAKEST = 0,
732  GPIO_DRIVE_WEAK = 0,
733  GPIO_DRIVE_STRONG = 0,
736 
737 #endif
738 
739 #ifdef __cplusplus
740 }
741 #endif
742 
gpio_flank_t
Definition: periph_cpu.h:176
@ GPIO_OUT
select GPIO MASK as output
Definition: periph_cpu.h:161
@ GPIO_IN
select GPIO MASK as input
Definition: periph_cpu.h:160
i2c_speed_t
Definition: periph_cpu.h:272
spi_clk_t
Definition: periph_cpu.h:348
pwm_mode_t
Definition: periph_conf.h:216
gpio_t adc_conf_t
ADC configuration wrapper.
Definition: periph_cpu.h:333
#define GPIO_MODE(x, y)
Internal macro for combining pin mode (x) and pull-up/down (y).
Definition: periph_cpu.h:147
#define ADC_MODE(x, y)
Internal macro for combining ADC resolution (x) with number of shifts (y).
Definition: periph_cpu.h:347
#define ADC_MODE_UNDEF(x)
Internal define to note that resolution is not supported.
Definition: periph_cpu.h:352
enum IRQn IRQn_Type
Interrupt Number Definition.
gpio_mode_t
Available pin modes.
Definition: periph_cpu.h:91
adc_res_t
Possible ADC resolution settings.
Definition: adc.h:92
@ ADC_RES_16BIT
ADC resolution: 16 bit.
Definition: adc.h:98
@ ADC_RES_8BIT
ADC resolution: 8 bit.
Definition: adc.h:94
@ ADC_RES_14BIT
ADC resolution: 14 bit.
Definition: adc.h:97
@ ADC_RES_6BIT
ADC resolution: 6 bit.
Definition: adc.h:93
@ ADC_RES_10BIT
ADC resolution: 10 bit.
Definition: adc.h:95
@ ADC_RES_12BIT
ADC resolution: 12 bit.
Definition: adc.h:96
gpio_pull_strength_t
Enumeration of pull resistor values.
Definition: gpio_ll.h:275
gpio_slew_t
Enumeration of slew rate settings.
Definition: gpio_ll.h:339
gpio_drive_strength_t
Enumeration of drive strength options.
Definition: gpio_ll.h:306
@ GPIO_PULL_WEAKEST
Use the weakest (highest Ohm value) resistor.
Definition: gpio_ll.h:276
@ GPIO_PULL_WEAK
Use a weak pull resistor.
Definition: gpio_ll.h:277
@ GPIO_PULL_STRONG
Use a strong pull resistor.
Definition: gpio_ll.h:278
@ GPIO_PULL_STRONGEST
Use the strongest pull resistor.
Definition: gpio_ll.h:279
@ GPIO_SLEW_SLOWEST
let the output voltage level rise/fall as slow as possible
Definition: gpio_ll.h:340
@ GPIO_SLEW_FAST
let the output voltage level rise/fall fast
Definition: gpio_ll.h:343
@ GPIO_SLEW_SLOW
let the output voltage level rise/fall slowly
Definition: gpio_ll.h:342
@ GPIO_SLEW_FASTEST
let the output voltage level rise/fall as fast as possible
Definition: gpio_ll.h:344
@ GPIO_DRIVE_STRONG
Use a strong drive strength.
Definition: gpio_ll.h:309
@ GPIO_DRIVE_WEAK
Use a weak drive strength.
Definition: gpio_ll.h:308
@ GPIO_DRIVE_STRONGEST
Use the strongest drive strength.
Definition: gpio_ll.h:310
@ GPIO_DRIVE_WEAKEST
Use the weakest drive strength.
Definition: gpio_ll.h:307
unsigned int gpio_t
GPIO type identifier.
Definition: gpio.h:91
@ GPIO_FALLING
emit interrupt on falling flank
Definition: periph_cpu.h:109
@ GPIO_RISING
emit interrupt on rising flank
Definition: periph_cpu.h:110
@ GPIO_BOTH
emit interrupt on both flanks
Definition: periph_cpu.h:111
@ GPIO_OD
configure as output in open-drain mode without pull resistor
Definition: gpio.h:123
@ GPIO_IN_PU
configure as input with pull-up resistor
Definition: gpio.h:121
@ GPIO_OD_PU
configure as output in open-drain mode with pull resistor enabled
Definition: gpio.h:125
@ GPIO_IN_PD
configure as input with pull-down resistor
Definition: gpio.h:120
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition: periph_cpu.h:274
@ I2C_SPEED_FAST_PLUS
fast plus mode: ~1000 kbit/s
Definition: periph_cpu.h:276
@ I2C_SPEED_LOW
low speed mode: ~10 kbit/s
Definition: periph_cpu.h:273
@ I2C_SPEED_HIGH
high speed mode: ~3400 kbit/s
Definition: periph_cpu.h:278
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition: periph_cpu.h:275
@ PWM_CENTER
center aligned
Definition: periph_conf.h:219
@ PWM_LEFT
left aligned
Definition: periph_conf.h:217
@ PWM_RIGHT
right aligned
Definition: periph_conf.h:218
@ SPI_MODE_0
CPOL=0, CPHA=0.
Definition: periph_cpu.h:43
@ SPI_MODE_2
CPOL=1, CPHA=0.
Definition: periph_cpu.h:45
@ SPI_MODE_1
CPOL=0, CPHA=1.
Definition: periph_cpu.h:44
@ SPI_MODE_3
CPOL=1, CPHA=1.
Definition: periph_cpu.h:46
@ SPI_CLK_10MHZ
drive the SPI bus with 10MHz
Definition: periph_cpu.h:353
@ SPI_CLK_5MHZ
drive the SPI bus with 5MHz
Definition: periph_cpu.h:352
@ SPI_CLK_400KHZ
drive the SPI bus with 400KHz
Definition: periph_cpu.h:350
@ SPI_CLK_1MHZ
drive the SPI bus with 1MHz
Definition: periph_cpu.h:351
@ SPI_CLK_100KHZ
drive the SPI bus with 100KHz
Definition: periph_cpu.h:349
@ UART_PARITY_SPACE
space parity
Definition: periph_cpu.h:506
@ UART_PARITY_NONE
no parity
Definition: periph_cpu.h:502
@ UART_PARITY_EVEN
even parity
Definition: periph_cpu.h:503
@ UART_PARITY_ODD
odd parity
Definition: periph_cpu.h:504
@ UART_PARITY_MARK
mark parity
Definition: periph_cpu.h:505
@ UART_STOP_BITS_2
2 stop bits
Definition: periph_cpu.h:535
@ UART_STOP_BITS_1
1 stop bit
Definition: periph_cpu.h:534
@ UART_DATA_BITS_6
6 data bits
Definition: periph_cpu.h:519
@ UART_DATA_BITS_5
5 data bits
Definition: periph_cpu.h:518
@ UART_DATA_BITS_7
7 data bits
Definition: periph_cpu.h:520
@ UART_DATA_BITS_8
8 data bits
Definition: periph_cpu.h:521
Common macros and compiler attributes/pragmas configuration.
spi_mode_t
Support SPI modes.
Definition: periph_cpu.h:42
Mutex for thread synchronization.
uart_parity_t
Definition of possible parity modes.
Definition: periph_cpu.h:501
uart_stop_bits_t
Definition of possible stop bits lengths.
Definition: periph_cpu.h:533
uart_data_bits_t
Definition of possible data bits lengths in a UART frame.
Definition: periph_cpu.h:517
@ PB
port B
@ PC
port C
@ PA
port A
@ PD
port D
Implementation specific CPU configuration options.
ADC channel configuration.
Definition: periph_cpu.h:382
ADC_AcqTime_TypeDef acq_time
channel acquisition time
Definition: periph_cpu.h:390
uint8_t dev
device index
Definition: periph_cpu.h:383
ADC_Ref_TypeDef reference
channel voltage reference
Definition: periph_cpu.h:389
ADC_TypeDef * dev
ADC device used.
Definition: periph_cpu.h:375
CMU_Clock_TypeDef cmu
the device CMU channel
Definition: periph_cpu.h:376
Clock divider configuration.
Definition: periph_cpu.h:58
CMU_ClkDiv_TypeDef div
Divisor.
Definition: periph_cpu.h:60
CMU_Clock_TypeDef clk
Clock domain.
Definition: periph_cpu.h:59
Clock mux configuration.
Definition: periph_cpu.h:50
CMU_Select_TypeDef src
Source clock.
Definition: periph_cpu.h:52
CMU_Clock_TypeDef clk
Clock domain.
Definition: periph_cpu.h:51
DAC line configuration data.
Definition: periph_cpu.h:300
I2C configuration structure.
Definition: periph_cpu.h:295
CMU_Clock_TypeDef cmu
the device CMU channel
Definition: periph_cpu.h:434
I2C_TypeDef * dev
USART device used.
Definition: periph_cpu.h:428
uint32_t speed
the bus speed
Definition: periph_cpu.h:436
IRQn_Type irq
the devices base IRQ channel
Definition: periph_cpu.h:435
PWM channel configuration.
Definition: periph_cpu.h:464
uint32_t loc
location of the pin
Definition: periph_cpu.h:467
uint8_t index
TIMER channel to use.
Definition: periph_cpu.h:465
gpio_t pin
pin used for pwm
Definition: periph_cpu.h:466
PWM device configuration.
IRQn_Type irq
the devices base IRQ channel
Definition: periph_cpu.h:476
const pwm_chan_conf_t * channel
pointer to first channel config
Definition: periph_cpu.h:478
TIMER_TypeDef * dev
TIMER device used.
Definition: periph_cpu.h:474
CMU_Clock_TypeDef cmu
the device CMU channel
Definition: periph_cpu.h:475
uint8_t channels
the number of available channels
Definition: periph_cpu.h:477
SPI device configuration.
Definition: periph_cpu.h:513
gpio_t clk_pin
pin used for CLK
Definition: periph_cpu.h:517
gpio_t mosi_pin
pin used for MOSI
Definition: periph_cpu.h:515
USART_TypeDef * dev
USART device used.
Definition: periph_cpu.h:514
CMU_Clock_TypeDef cmu
the device CMU channel
Definition: periph_cpu.h:521
IRQn_Type irq
the devices base IRQ channel
Definition: periph_cpu.h:522
gpio_t miso_pin
pin used for MISO
Definition: periph_cpu.h:516
Timer device configuration.
Definition: periph_cpu.h:260
IRQn_Type irq
number of the higher timer IRQ channel
Definition: periph_cpu.h:554
timer_dev_t prescaler
the lower neighboring timer (not initialized for LETIMER)
Definition: periph_cpu.h:552
timer_dev_t timer
the higher numbered timer
Definition: periph_cpu.h:553
uint8_t channel_numof
number of channels per timer
Definition: periph_cpu.h:555
Define timer configuration values.
Definition: periph_cpu.h:544
void * dev
TIMER_TypeDef or LETIMER_TypeDef device used.
Definition: periph_cpu.h:545
CMU_Clock_TypeDef cmu
the device CMU channel
Definition: periph_cpu.h:546
UART device configuration.
Definition: periph_cpu.h:214
CMU_Clock_TypeDef cmu
the device CMU channel
Definition: periph_cpu.h:655
IRQn_Type irq
the devices base IRQ channel
Definition: periph_cpu.h:656
uint32_t loc
location of UART pins
Definition: periph_cpu.h:653
void * dev
UART, USART or LEUART device used.
Definition: periph_cpu.h:649