Loading...
Searching...
No Matches
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
18
19#include "kernel_defines.h"
20#include "mutex.h"
21
22#include "config.h"
23#include "cpu.h"
24#include "cpu_conf.h"
25
26#if defined(_SILICON_LABS_32B_SERIES_2)
27#include "em_iadc.h"
28#else
29#include "em_adc.h"
30#endif
31#include "em_cmu.h"
32#include "em_device.h"
33#include "em_gpio.h"
34#include "em_timer.h"
35#include "em_usart.h"
36#include "em_wdog.h"
37#include "em_rtc.h"
38#if defined(_SILICON_LABS_32B_SERIES_0)
39#include "em_dac.h"
40#elif defined (_SILICON_LABS_32B_SERIES_1) || defined(_SILICON_LABS_32B_SERIES_2)
41#include "em_vdac.h"
42#endif
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
51typedef struct {
52 CMU_Clock_TypeDef clk;
53 CMU_Select_TypeDef src;
54} clk_mux_t;
55
59typedef struct {
60 CMU_Clock_TypeDef clk;
61 CMU_ClkDiv_TypeDef div;
62} clk_div_t;
63
67#define CPUID_LEN (8U)
68
72#define CLOCK_CORECLOCK SystemCoreClock
73
74#if defined(DAC_COUNT) && DAC_COUNT > 0
78typedef struct {
79 DAC_TypeDef *dev;
80 DAC_Ref_TypeDef ref;
81 CMU_Clock_TypeDef cmu;
83
87typedef struct {
88 uint8_t dev;
89 uint8_t index;
90} dac_chan_conf_t;
91
92#elif defined(VDAC_COUNT) && VDAC_COUNT > 0
96typedef struct {
97 VDAC_TypeDef *dev;
98 VDAC_Ref_TypeDef ref;
99 CMU_Clock_TypeDef cmu;
100} dac_conf_t;
101
105typedef struct {
106 uint8_t dev;
107 uint8_t index;
108} dac_chan_conf_t;
109#endif
110
115/* RTT_MAX_VALUE some are 24bit, some are 32bit */
116#if defined(_RTC_CNT_MASK)
117#define RTT_MAX_VALUE _RTC_CNT_MASK /* mask has all bits set ==> MAX*/
118#elif defined(_RTCC_CNT_MASK)
119#define RTT_MAX_VALUE _RTCC_CNT_MASK /* mask has all bits set ==> MAX*/
120#endif
121#define RTT_MAX_FREQUENCY (32768U) /* in Hz */
122#define RTT_MIN_FREQUENCY (1U) /* in Hz */
123#define RTT_CLOCK_FREQUENCY (32768U) /* in Hz, LFCLK*/
124
126
131#define HAVE_GPIO_T
132typedef uint32_t gpio_t;
134
138#define GPIO_UNDEF (0xffffffff)
139
143#define GPIO_PIN(x, y) ((gpio_t) ((x << 4) | y))
144
148#define GPIO_MODE(x, y) ((x << 1) | y)
149
153enum {
154#if (_GPIO_PORT_A_PIN_COUNT > 0)
155 PA = gpioPortA,
156#endif
157#if (_GPIO_PORT_B_PIN_COUNT > 0)
158 PB = gpioPortB,
159#endif
160#if (_GPIO_PORT_C_PIN_COUNT > 0)
161 PC = gpioPortC,
162#endif
163#if (_GPIO_PORT_D_PIN_COUNT > 0)
164 PD = gpioPortD,
165#endif
166#if (_GPIO_PORT_E_PIN_COUNT > 0)
167 PE = gpioPortE,
168#endif
169#if (_GPIO_PORT_F_PIN_COUNT > 0)
170 PF = gpioPortF,
171#endif
172#if (_GPIO_PORT_G_PIN_COUNT > 0)
173 PG = gpioPortG,
174#endif
175#if (_GPIO_PORT_H_PIN_COUNT > 0)
176 PH = gpioPortH,
177#endif
178#if (_GPIO_PORT_I_PIN_COUNT > 0)
179 PI = gpioPortI,
180#endif
181#if (_GPIO_PORT_J_PIN_COUNT > 0)
182 PJ = gpioPortJ,
183#endif
184#if (_GPIO_PORT_K_PIN_COUNT > 0)
185 PK = gpioPortK
186#endif
187};
188
189#ifndef DOXYGEN
194#define HAVE_GPIO_MODE_T
195typedef enum {
196 GPIO_IN = GPIO_MODE(gpioModeInput, 0),
197 GPIO_IN_PD = GPIO_MODE(gpioModeInputPull, 0),
198 GPIO_IN_PU = GPIO_MODE(gpioModeInputPull, 1),
199 GPIO_OUT = GPIO_MODE(gpioModePushPull, 0),
200 GPIO_OD = GPIO_MODE(gpioModeWiredAnd, 1),
201 GPIO_OD_PU = GPIO_MODE(gpioModeWiredAndPullUp, 1),
204
209#define HAVE_GPIO_FLANK_T
210typedef enum {
211 GPIO_FALLING = 2,
212 GPIO_RISING = 1,
213 GPIO_BOTH = 3
216#endif /* ndef DOXYGEN */
217
218#if defined(_SILICON_LABS_32B_SERIES_2)
226#if defined(_IADC_CFG_DIGAVG_MASK)
227#define ADC_MODE(osr, avg, res) ((osr << 16) | (avg << 8) | res)
228#else
229#define ADC_MODE(osr, res) ((osr << 16) | res)
230#endif
231
235#define ADC_MODE_OSR(mode) ((mode & 0xff0000) >> 16)
236
237#if defined(_IADC_CFG_DIGAVG_MASK)
241#define ADC_MODE_AVG(mode) ((mode & 0x00ff00) >> 8)
242#endif
243
247#define ADC_MODE_RES(mode) ((mode & 0x0000ff) >> 0)
248
253#define HAVE_ADC_RES_T
254#if defined(_IADC_CFG_DIGAVG_MASK)
255typedef enum {
256 ADC_RES_6BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 6),
257 ADC_RES_8BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 8),
258 ADC_RES_10BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 10),
259 ADC_RES_12BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 12),
260 ADC_RES_14BIT = ADC_MODE(iadcCfgOsrHighSpeed8x, iadcDigitalAverage1, 14),
261 ADC_RES_16BIT = ADC_MODE(iadcCfgOsrHighSpeed16x, iadcDigitalAverage2, 16),
262} adc_res_t;
263#else
264typedef enum {
265 ADC_RES_6BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 6),
266 ADC_RES_8BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 8),
267 ADC_RES_10BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 10),
268 ADC_RES_12BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 12),
269 ADC_RES_14BIT = ADC_MODE(iadcCfgOsrHighSpeed8x, 14),
270 ADC_RES_16BIT = ADC_MODE(iadcCfgOsrHighSpeed32x, 16),
271} adc_res_t;
272#endif
273
277typedef struct {
281 IADC_TypeDef *dev;
282
286 CMU_Clock_TypeDef cmu;
287
291 IADC_CfgReference_t reference;
292
298 uint32_t reference_mV;
299
306 IADC_CfgAnalogGain_t gain;
307
315 adc_res_t available_res[IADC0_CONFIGNUM];
316} adc_conf_t;
317
321typedef struct {
325 uint8_t dev;
326
330 gpio_t input_pos;
331
341 gpio_t input_neg;
343#else /* defined(_SILICON_LABS_32B_SERIES_2) */
348#define ADC_MODE(x, y) ((y << 4) | x)
349
353#define ADC_MODE_UNDEF(x) (ADC_MODE(x, 15))
354
355#ifndef DOXYGEN
360#define HAVE_ADC_RES_T
361typedef enum {
362 ADC_RES_6BIT = ADC_MODE(adcRes6Bit, 0),
363 ADC_RES_8BIT = ADC_MODE(adcRes8Bit, 0),
364 ADC_RES_10BIT = ADC_MODE(adcRes12Bit, 2),
365 ADC_RES_12BIT = ADC_MODE(adcRes12Bit, 0),
368} adc_res_t;
370#endif /* ndef DOXYGEN */
371
375typedef struct {
376 ADC_TypeDef *dev;
377 CMU_Clock_TypeDef cmu;
378} adc_conf_t;
379
383typedef struct {
384 uint8_t dev;
385#if defined(_SILICON_LABS_32B_SERIES_0)
386 ADC_SingleInput_TypeDef input;
387#elif defined(_SILICON_LABS_32B_SERIES_1)
388 ADC_PosSel_TypeDef input;
389#endif
390 ADC_Ref_TypeDef reference;
391 ADC_AcqTime_TypeDef acq_time;
393#endif /* !defined(_SILICON_LABS_32B_SERIES_2) */
394
399#define HAVE_HWCRYPTO_AES128
400#ifdef AES_CTRL_AES256
401#define HAVE_HWCRYPTO_AES256
402#endif
403#if defined(_SILICON_LABS_32B_SERIES_1)
404#define HAVE_HWCRYPTO_SHA1
405#define HAVE_HWCRYPTO_SHA256
406#endif
408
409#ifndef DOXYGEN
414#define HAVE_I2C_SPEED_T
415typedef enum {
416 I2C_SPEED_LOW = 10000,
417 I2C_SPEED_NORMAL = 100000,
418 I2C_SPEED_FAST = 400000,
419 I2C_SPEED_FAST_PLUS = 1000000,
420 I2C_SPEED_HIGH = 3400000,
423#endif /* ndef DOXYGEN */
424
428typedef struct {
429 I2C_TypeDef *dev;
430 gpio_t sda_pin;
431 gpio_t scl_pin;
432#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
433 uint32_t loc;
434#endif
435 uint32_t speed;
436 CMU_Clock_TypeDef cmu;
439} i2c_conf_t;
440
445#define PERIPH_I2C_NEED_READ_REG
446#define PERIPH_I2C_NEED_WRITE_REG
448
449#ifndef DOXYGEN
454#define HAVE_PWM_MODE_T
455typedef enum {
456 PWM_LEFT = timerModeUp,
457 PWM_RIGHT = timerModeDown,
458 PWM_CENTER = timerModeUp
459} pwm_mode_t;
461#endif /* ndef DOXYGEN */
462
466typedef struct {
467 uint8_t index;
468 gpio_t pin;
469 uint32_t loc;
471
475typedef struct {
476 TIMER_TypeDef *dev;
477 CMU_Clock_TypeDef cmu;
479 uint8_t channels;
481} pwm_conf_t;
482
483#ifndef DOXYGEN
488#define HAVE_SPI_MODE_T
489typedef enum {
490 SPI_MODE_0 = usartClockMode0,
491 SPI_MODE_1 = usartClockMode1,
492 SPI_MODE_2 = usartClockMode2,
493 SPI_MODE_3 = usartClockMode3
494} spi_mode_t;
496
501#define HAVE_SPI_CLK_T
502typedef enum {
503 SPI_CLK_100KHZ = 100000,
504 SPI_CLK_400KHZ = 400000,
505 SPI_CLK_1MHZ = 1000000,
506 SPI_CLK_5MHZ = 5000000,
507 SPI_CLK_10MHZ = 10000000
508} spi_clk_t;
510#endif /* ndef DOXYGEN */
511
515typedef struct {
516 USART_TypeDef *dev;
517 gpio_t mosi_pin;
518 gpio_t miso_pin;
519 gpio_t clk_pin;
520#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
521 uint32_t loc;
522#endif
523 CMU_Clock_TypeDef cmu;
525} spi_dev_t;
526
531#define PERIPH_SPI_NEEDS_INIT_CS
532#define PERIPH_SPI_NEEDS_TRANSFER_BYTE
533#define PERIPH_SPI_NEEDS_TRANSFER_REG
534#define PERIPH_SPI_NEEDS_TRANSFER_REGS
536
545#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
546typedef struct {
547 void *dev;
548 CMU_Clock_TypeDef cmu;
550#endif
551
552typedef struct {
553#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
558#else
559 void *dev;
560 CMU_Clock_TypeDef cmu;
561 IRQn_Type irq;
562#endif
564
565#define LETIMER_MAX_VALUE _LETIMER_TOP_MASK
566#define TIMER_MAX_VALUE _TIMER_TOP_MASK
568
572#ifndef DOXYGEN
576#define UART_MODE_UNSUPPORTED 0xf0
577
582#define HAVE_UART_PARITY_T
583#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
584typedef enum {
586 UART_PARITY_ODD = 1,
591#else
592typedef enum {
595 UART_PARITY_ODD = 3,
596 UART_PARITY_MARK = UART_MODE_UNSUPPORTED | 0,
597 UART_PARITY_SPACE = UART_MODE_UNSUPPORTED | 1,
599#endif
601
606#define HAVE_UART_DATA_BITS_T
607#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
608typedef enum {
614#else
615typedef enum {
616 UART_DATA_BITS_5 = UART_MODE_UNSUPPORTED | 0,
617 UART_DATA_BITS_6 = UART_MODE_UNSUPPORTED | 1,
621#endif
623
628#define HAVE_UART_STOP_BITS_T
629#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
630typedef enum {
634#else
635typedef enum {
639#endif
641#endif /* ndef DOXYGEN */
642
643typedef struct {
644 void *dev;
645 gpio_t rx_pin;
646 gpio_t tx_pin;
647#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
648 uint32_t loc;
649#endif
650 CMU_Clock_TypeDef cmu;
653
657#define PROVIDES_PM_OFF
658
662#define PROVIDES_PM_LAYERED_OFF
663
667#define PM_NUM_MODES (3U)
668
673#define EFM32_PM_MODE_EM3 (0U)
674#define EFM32_PM_MODE_EM2 (1U)
675#define EFM32_PM_MODE_EM1 (2U)
677
682#define WDT_CLOCK_HZ (1000U)
683
684#define NWDT_TIME_LOWER_LIMIT ((1U << (3U + wdogPeriod_9)) + 1U)
685#define NWDT_TIME_UPPER_LIMIT ((1U << (3U + wdogPeriod_256k)) + 1U)
686
687#if defined(_SILICON_LABS_32B_SERIES_1) || defined(_SILICON_LABS_32B_SERIES_2)
688#define WDT_TIME_LOWER_LIMIT NWDT_TIME_LOWER_LIMIT
689#define WDT_TIME_UPPER_LIMIT NWDT_TIME_UPPER_LIMIT
690#endif
691
692#define WDT_HAS_STOP (1U)
694
699#define USBDEV_NUM_ENDPOINTS 7
701
702/* GPIO_LL's overrides */
703#ifndef DOXYGEN
704
705/* Not supported by hardware */
706#define HAVE_GPIO_SLEW_T
707typedef enum {
709 GPIO_SLEW_SLOW = 0,
710 GPIO_SLEW_FAST = 0,
713
714/* Not supported by hardware */
715#define HAVE_GPIO_PULL_STRENGTH_T
716typedef enum {
718 GPIO_PULL_WEAK = 0,
722
723/* Not implemented, see gpio_ll_arch.h comments */
724#define HAVE_GPIO_DRIVE_STRENGTH_T
725typedef enum {
727 GPIO_DRIVE_WEAK = 0,
731
732#endif
733
734#ifdef __cplusplus
735}
736#endif
737
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
@ 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
spi_clk_t
Definition periph_cpu.h:348
@ 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
pwm_mode_t
@ PWM_CENTER
center aligned
@ PWM_LEFT
left aligned
@ PWM_RIGHT
right aligned
EFM32 default configuration.
Implementation specific CPU configuration options.
#define GPIO_MODE(x, y)
Internal macro for combining pin mode (x) and pull-up/down (y).
Definition periph_cpu.h:148
#define ADC_MODE(x, y)
Internal macro for combining ADC resolution (x) with number of shifts (y).
Definition periph_cpu.h:348
#define ADC_MODE_UNDEF(x)
Internal define to note that resolution is not supported.
Definition periph_cpu.h:353
enum IRQn IRQn_Type
Interrupt Number Definition.
gpio_mode_t
Available pin modes.
Definition periph_cpu.h:96
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
Common macros and compiler attributes/pragmas configuration.
spi_mode_t
Support SPI modes.
Definition periph_cpu.h:39
@ SPI_MODE_0
CPOL=0, CPHA=0.
Definition periph_cpu.h:40
@ SPI_MODE_2
CPOL=1, CPHA=0.
Definition periph_cpu.h:42
@ SPI_MODE_1
CPOL=0, CPHA=1.
Definition periph_cpu.h:41
@ SPI_MODE_3
CPOL=1, CPHA=1.
Definition periph_cpu.h:43
Mutex for thread synchronization.
uart_parity_t
Definition of possible parity modes.
Definition periph_cpu.h:498
@ UART_PARITY_SPACE
space parity
Definition periph_cpu.h:503
@ UART_PARITY_NONE
no parity
Definition periph_cpu.h:499
@ UART_PARITY_EVEN
even parity
Definition periph_cpu.h:500
@ UART_PARITY_ODD
odd parity
Definition periph_cpu.h:501
@ UART_PARITY_MARK
mark parity
Definition periph_cpu.h:502
uart_stop_bits_t
Definition of possible stop bits lengths.
Definition periph_cpu.h:530
@ UART_STOP_BITS_2
2 stop bits
Definition periph_cpu.h:532
@ UART_STOP_BITS_1
1 stop bit
Definition periph_cpu.h:531
uart_data_bits_t
Definition of possible data bits lengths in a UART frame.
Definition periph_cpu.h:514
@ UART_DATA_BITS_6
6 data bits
Definition periph_cpu.h:516
@ UART_DATA_BITS_5
5 data bits
Definition periph_cpu.h:515
@ UART_DATA_BITS_7
7 data bits
Definition periph_cpu.h:517
@ UART_DATA_BITS_8
8 data bits
Definition periph_cpu.h:518
@ PB
port B
@ PC
port C
@ PA
port A
@ PD
port D
ADC channel configuration.
Definition periph_cpu.h:383
ADC_AcqTime_TypeDef acq_time
channel acquisition time
Definition periph_cpu.h:391
uint8_t dev
device index
Definition periph_cpu.h:384
ADC_Ref_TypeDef reference
channel voltage reference
Definition periph_cpu.h:390
ADC device configuration.
Definition periph_cpu.h:375
ADC_TypeDef * dev
ADC device used.
Definition periph_cpu.h:376
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:377
Clock divider configuration.
Definition periph_cpu.h:59
CMU_ClkDiv_TypeDef div
Divisor.
Definition periph_cpu.h:61
CMU_Clock_TypeDef clk
Clock domain.
Definition periph_cpu.h:60
Clock mux configuration.
Definition periph_cpu.h:51
CMU_Select_TypeDef src
Source clock.
Definition periph_cpu.h:53
CMU_Clock_TypeDef clk
Clock domain.
Definition periph_cpu.h:52
DAC line configuration data.
Definition periph_cpu.h:297
I2C configuration structure.
Definition periph_cpu.h:295
i2c_speed_t speed
Configured bus speed, actual speed may be lower but never higher.
Definition periph_cpu.h:300
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:436
TWI_t * dev
Pointer to hardware module registers.
Definition periph_cpu.h:296
IRQn_Type irq
the devices base IRQ channel
Definition periph_cpu.h:437
gpio_t sda_pin
SDA GPIO pin.
Definition periph_cpu.h:298
bool use_internal_pull_ups
enable internal pull-ups on SDA and SCL pins
Definition periph_cpu.h:438
gpio_t scl_pin
SCL GPIO pin.
Definition periph_cpu.h:299
PWM channel configuration.
Definition periph_cpu.h:466
uint32_t loc
location of the pin
Definition periph_cpu.h:469
uint8_t index
TIMER channel to use.
Definition periph_cpu.h:467
gpio_t pin
pin used for pwm
Definition periph_cpu.h:468
PWM device configuration.
IRQn_Type irq
the devices base IRQ channel
Definition periph_cpu.h:478
const pwm_chan_conf_t * channel
pointer to first channel config
Definition periph_cpu.h:480
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:477
uint8_t channels
the number of available channels
Definition periph_cpu.h:479
mini_timer_t * dev
Timer used.
SPI device configuration.
Definition periph_cpu.h:515
gpio_t clk_pin
pin used for CLK
Definition periph_cpu.h:519
gpio_t mosi_pin
pin used for MOSI
Definition periph_cpu.h:517
USART_TypeDef * dev
USART device used.
Definition periph_cpu.h:516
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:523
IRQn_Type irq
the devices base IRQ channel
Definition periph_cpu.h:524
gpio_t miso_pin
pin used for MISO
Definition periph_cpu.h:518
Timer device configuration.
Definition periph_cpu.h:260
IRQn_Type irq
number of the higher timer IRQ channel
Definition periph_cpu.h:556
timer_dev_t prescaler
the lower neighboring timer (not initialized for LETIMER)
Definition periph_cpu.h:554
timer_dev_t timer
the higher numbered timer
Definition periph_cpu.h:555
TC0_t * dev
Pointer to the used as Timer device.
Definition periph_cpu.h:261
uint8_t channel_numof
number of channels per timer
Definition periph_cpu.h:557
Define timer configuration values.
Definition periph_cpu.h:546
void * dev
TIMER_TypeDef or LETIMER_TypeDef device used.
Definition periph_cpu.h:547
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:548
UART device configuration.
Definition periph_cpu.h:214
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:650
IRQn_Type irq
the devices base IRQ channel
Definition periph_cpu.h:651
USART_t * dev
pointer to the used UART device
Definition periph_cpu.h:215
uint32_t loc
location of UART pins
Definition periph_cpu.h:648
gpio_t tx_pin
pin used for TX
Definition periph_cpu.h:218
gpio_t rx_pin
pin used for RX
Definition periph_cpu.h:217