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#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
125# define RTT_MIN_OFFSET (1U) /* min offset for all Series 0 and Series 1 */
126#endif
128
133#define HAVE_GPIO_T
134typedef uint32_t gpio_t;
136
140#define GPIO_UNDEF (0xffffffff)
141
145#define GPIO_PIN(x, y) ((gpio_t) ((x << 4) | y))
146
150#define GPIO_MODE(x, y) ((x << 1) | y)
151
155enum {
156#if (_GPIO_PORT_A_PIN_COUNT > 0)
157 PA = gpioPortA,
158#endif
159#if (_GPIO_PORT_B_PIN_COUNT > 0)
160 PB = gpioPortB,
161#endif
162#if (_GPIO_PORT_C_PIN_COUNT > 0)
163 PC = gpioPortC,
164#endif
165#if (_GPIO_PORT_D_PIN_COUNT > 0)
166 PD = gpioPortD,
167#endif
168#if (_GPIO_PORT_E_PIN_COUNT > 0)
169 PE = gpioPortE,
170#endif
171#if (_GPIO_PORT_F_PIN_COUNT > 0)
172 PF = gpioPortF,
173#endif
174#if (_GPIO_PORT_G_PIN_COUNT > 0)
175 PG = gpioPortG,
176#endif
177#if (_GPIO_PORT_H_PIN_COUNT > 0)
178 PH = gpioPortH,
179#endif
180#if (_GPIO_PORT_I_PIN_COUNT > 0)
181 PI = gpioPortI,
182#endif
183#if (_GPIO_PORT_J_PIN_COUNT > 0)
184 PJ = gpioPortJ,
185#endif
186#if (_GPIO_PORT_K_PIN_COUNT > 0)
187 PK = gpioPortK
188#endif
189};
190
191#ifndef DOXYGEN
196#define HAVE_GPIO_MODE_T
197typedef enum {
198 GPIO_IN = GPIO_MODE(gpioModeInput, 0),
199 GPIO_IN_PD = GPIO_MODE(gpioModeInputPull, 0),
200 GPIO_IN_PU = GPIO_MODE(gpioModeInputPull, 1),
201 GPIO_OUT = GPIO_MODE(gpioModePushPull, 0),
202 GPIO_OD = GPIO_MODE(gpioModeWiredAnd, 1),
203 GPIO_OD_PU = GPIO_MODE(gpioModeWiredAndPullUp, 1),
206
211#define HAVE_GPIO_FLANK_T
212typedef enum {
213 GPIO_FALLING = 2,
214 GPIO_RISING = 1,
215 GPIO_BOTH = 3
218#endif /* ndef DOXYGEN */
219
220#if defined(_SILICON_LABS_32B_SERIES_2)
228#if defined(_IADC_CFG_DIGAVG_MASK)
229#define ADC_MODE(osr, avg, res) ((osr << 16) | (avg << 8) | res)
230#else
231#define ADC_MODE(osr, res) ((osr << 16) | res)
232#endif
233
237#define ADC_MODE_OSR(mode) ((mode & 0xff0000) >> 16)
238
239#if defined(_IADC_CFG_DIGAVG_MASK)
243#define ADC_MODE_AVG(mode) ((mode & 0x00ff00) >> 8)
244#endif
245
249#define ADC_MODE_RES(mode) ((mode & 0x0000ff) >> 0)
250
255#define HAVE_ADC_RES_T
256#if defined(_IADC_CFG_DIGAVG_MASK)
257typedef enum {
258 ADC_RES_6BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 6),
259 ADC_RES_8BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 8),
260 ADC_RES_10BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 10),
261 ADC_RES_12BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, iadcDigitalAverage1, 12),
262 ADC_RES_14BIT = ADC_MODE(iadcCfgOsrHighSpeed8x, iadcDigitalAverage1, 14),
263 ADC_RES_16BIT = ADC_MODE(iadcCfgOsrHighSpeed16x, iadcDigitalAverage2, 16),
264} adc_res_t;
265#else
266typedef enum {
267 ADC_RES_6BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 6),
268 ADC_RES_8BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 8),
269 ADC_RES_10BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 10),
270 ADC_RES_12BIT = ADC_MODE(iadcCfgOsrHighSpeed2x, 12),
271 ADC_RES_14BIT = ADC_MODE(iadcCfgOsrHighSpeed8x, 14),
272 ADC_RES_16BIT = ADC_MODE(iadcCfgOsrHighSpeed32x, 16),
273} adc_res_t;
274#endif
275
279typedef struct {
283 IADC_TypeDef *dev;
284
288 CMU_Clock_TypeDef cmu;
289
293 IADC_CfgReference_t reference;
294
300 uint32_t reference_mV;
301
308 IADC_CfgAnalogGain_t gain;
309
317 adc_res_t available_res[IADC0_CONFIGNUM];
318} adc_conf_t;
319
323typedef struct {
327 uint8_t dev;
328
332 gpio_t input_pos;
333
343 gpio_t input_neg;
345#else /* defined(_SILICON_LABS_32B_SERIES_2) */
350#define ADC_MODE(x, y) ((y << 4) | x)
351
355#define ADC_MODE_UNDEF(x) (ADC_MODE(x, 15))
356
357#ifndef DOXYGEN
362#define HAVE_ADC_RES_T
363typedef enum {
364 ADC_RES_6BIT = ADC_MODE(adcRes6Bit, 0),
365 ADC_RES_8BIT = ADC_MODE(adcRes8Bit, 0),
366 ADC_RES_10BIT = ADC_MODE(adcRes12Bit, 2),
367 ADC_RES_12BIT = ADC_MODE(adcRes12Bit, 0),
370} adc_res_t;
372#endif /* ndef DOXYGEN */
373
377typedef struct {
378 ADC_TypeDef *dev;
379 CMU_Clock_TypeDef cmu;
380} adc_conf_t;
381
385typedef struct {
386 uint8_t dev;
387#if defined(_SILICON_LABS_32B_SERIES_0)
388 ADC_SingleInput_TypeDef input;
389#elif defined(_SILICON_LABS_32B_SERIES_1)
390 ADC_PosSel_TypeDef input;
391#endif
392 ADC_Ref_TypeDef reference;
393 ADC_AcqTime_TypeDef acq_time;
395#endif /* !defined(_SILICON_LABS_32B_SERIES_2) */
396
401#define HAVE_HWCRYPTO_AES128
402#ifdef AES_CTRL_AES256
403#define HAVE_HWCRYPTO_AES256
404#endif
405#if defined(_SILICON_LABS_32B_SERIES_1)
406#define HAVE_HWCRYPTO_SHA1
407#define HAVE_HWCRYPTO_SHA256
408#endif
410
411#ifndef DOXYGEN
416#define HAVE_I2C_SPEED_T
417typedef enum {
418 I2C_SPEED_LOW = 10000,
419 I2C_SPEED_NORMAL = 100000,
420 I2C_SPEED_FAST = 400000,
421 I2C_SPEED_FAST_PLUS = 1000000,
422 I2C_SPEED_HIGH = 3400000,
425#endif /* ndef DOXYGEN */
426
430typedef struct {
431 I2C_TypeDef *dev;
432 gpio_t sda_pin;
433 gpio_t scl_pin;
434#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
435 uint32_t loc;
436#endif
437 uint32_t speed;
438 CMU_Clock_TypeDef cmu;
441} i2c_conf_t;
442
447#define PERIPH_I2C_NEED_READ_REG
448#define PERIPH_I2C_NEED_WRITE_REG
450
451#ifndef DOXYGEN
456#define HAVE_PWM_MODE_T
457typedef enum {
458 PWM_LEFT = timerModeUp,
459 PWM_RIGHT = timerModeDown,
460 PWM_CENTER = timerModeUpDown
461} pwm_mode_t;
463#endif /* ndef DOXYGEN */
464
468typedef struct {
469 uint8_t index;
470 gpio_t pin;
471 uint32_t loc;
473
477typedef struct {
478 TIMER_TypeDef *dev;
479 CMU_Clock_TypeDef cmu;
481 uint8_t channels;
483} pwm_conf_t;
484
485#ifndef DOXYGEN
490#define HAVE_SPI_MODE_T
491typedef enum {
492 SPI_MODE_0 = usartClockMode0,
493 SPI_MODE_1 = usartClockMode1,
494 SPI_MODE_2 = usartClockMode2,
495 SPI_MODE_3 = usartClockMode3
496} spi_mode_t;
498
503#define HAVE_SPI_CLK_T
504typedef enum {
505 SPI_CLK_100KHZ = 100000,
506 SPI_CLK_400KHZ = 400000,
507 SPI_CLK_1MHZ = 1000000,
508 SPI_CLK_5MHZ = 5000000,
509 SPI_CLK_10MHZ = 10000000
510} spi_clk_t;
512#endif /* ndef DOXYGEN */
513
517typedef struct {
518 USART_TypeDef *dev;
519 gpio_t mosi_pin;
520 gpio_t miso_pin;
521 gpio_t clk_pin;
522#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
523 uint32_t loc;
524#endif
525 CMU_Clock_TypeDef cmu;
527} spi_dev_t;
528
533#define PERIPH_SPI_NEEDS_INIT_CS
534#define PERIPH_SPI_NEEDS_TRANSFER_BYTE
535#define PERIPH_SPI_NEEDS_TRANSFER_REG
536#define PERIPH_SPI_NEEDS_TRANSFER_REGS
538
547#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
548typedef struct {
549 void *dev;
550 CMU_Clock_TypeDef cmu;
552#endif
553
554typedef struct {
555#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
560#else
561 void *dev;
562 CMU_Clock_TypeDef cmu;
563 IRQn_Type irq;
564#endif
566
567#define LETIMER_MAX_VALUE _LETIMER_TOP_MASK
568#define TIMER_MAX_VALUE _TIMER_TOP_MASK
570
574#ifndef DOXYGEN
578#define UART_MODE_UNSUPPORTED 0xf0
579
584#define HAVE_UART_PARITY_T
585#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
586typedef enum {
588 UART_PARITY_ODD = 1,
593#else
594typedef enum {
597 UART_PARITY_ODD = 3,
598 UART_PARITY_MARK = UART_MODE_UNSUPPORTED | 0,
599 UART_PARITY_SPACE = UART_MODE_UNSUPPORTED | 1,
601#endif
603
608#define HAVE_UART_DATA_BITS_T
609#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
610typedef enum {
616#else
617typedef enum {
618 UART_DATA_BITS_5 = UART_MODE_UNSUPPORTED | 0,
619 UART_DATA_BITS_6 = UART_MODE_UNSUPPORTED | 1,
623#endif
625
630#define HAVE_UART_STOP_BITS_T
631#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
632typedef enum {
636#else
637typedef enum {
641#endif
643#endif /* ndef DOXYGEN */
644
645typedef struct {
646 void *dev;
647 gpio_t rx_pin;
648 gpio_t tx_pin;
649#if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
650 uint32_t loc;
651#endif
652 CMU_Clock_TypeDef cmu;
655
659typedef struct {
660 gpio_t phy_en_pin;
661 gpio_t phy_rst_pin;
662 uint32_t routeloc1;
663 uint16_t speed;
664 uint8_t phy_addr;
665} eth_conf_t;
666
670#define PROVIDES_PM_OFF
671
675#define PROVIDES_PM_LAYERED_OFF
676
680#define PM_NUM_MODES (3U)
681
686#define EFM32_PM_MODE_EM3 (0U)
687#define EFM32_PM_MODE_EM2 (1U)
688#define EFM32_PM_MODE_EM1 (2U)
690
695#define WDT_CLOCK_HZ (1000U)
696
697#define NWDT_TIME_LOWER_LIMIT ((1U << (3U + wdogPeriod_9)) + 1U)
698#define NWDT_TIME_UPPER_LIMIT ((1U << (3U + wdogPeriod_256k)) + 1U)
699
700#if defined(_SILICON_LABS_32B_SERIES_1) || defined(_SILICON_LABS_32B_SERIES_2)
701#define WDT_TIME_LOWER_LIMIT NWDT_TIME_LOWER_LIMIT
702#define WDT_TIME_UPPER_LIMIT NWDT_TIME_UPPER_LIMIT
703#endif
704
705#define WDT_HAS_STOP (1U)
707
712#define USBDEV_NUM_ENDPOINTS 7
714
715/* GPIO_LL's overrides */
716#ifndef DOXYGEN
717
718/* Not supported by hardware */
719#define HAVE_GPIO_SLEW_T
720typedef enum {
722 GPIO_SLEW_SLOW = 0,
723 GPIO_SLEW_FAST = 0,
726
727/* Not supported by hardware */
728#define HAVE_GPIO_PULL_STRENGTH_T
729typedef enum {
731 GPIO_PULL_WEAK = 0,
735
736/* Not implemented, see gpio_ll_arch.h comments */
737#define HAVE_GPIO_DRIVE_STRENGTH_T
738typedef enum {
740 GPIO_DRIVE_WEAK = 0,
744
745#endif
746
747#ifdef __cplusplus
748}
749#endif
750
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:150
#define ADC_MODE(x, y)
Internal macro for combining ADC resolution (x) with number of shifts (y).
Definition periph_cpu.h:350
#define ADC_MODE_UNDEF(x)
Internal define to note that resolution is not supported.
Definition periph_cpu.h:355
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:89
@ ADC_RES_16BIT
ADC resolution: 16 bit.
Definition adc.h:95
@ ADC_RES_8BIT
ADC resolution: 8 bit.
Definition adc.h:91
@ ADC_RES_14BIT
ADC resolution: 14 bit.
Definition adc.h:94
@ ADC_RES_6BIT
ADC resolution: 6 bit.
Definition adc.h:90
@ ADC_RES_10BIT
ADC resolution: 10 bit.
Definition adc.h:92
@ ADC_RES_12BIT
ADC resolution: 12 bit.
Definition adc.h:93
gpio_pull_strength_t
Enumeration of pull resistor values.
Definition gpio_ll.h:272
gpio_slew_t
Enumeration of slew rate settings.
Definition gpio_ll.h:336
gpio_drive_strength_t
Enumeration of drive strength options.
Definition gpio_ll.h:303
@ GPIO_PULL_WEAKEST
Use the weakest (highest Ohm value) resistor.
Definition gpio_ll.h:273
@ GPIO_PULL_WEAK
Use a weak pull resistor.
Definition gpio_ll.h:274
@ GPIO_PULL_STRONG
Use a strong pull resistor.
Definition gpio_ll.h:275
@ GPIO_PULL_STRONGEST
Use the strongest pull resistor.
Definition gpio_ll.h:276
@ GPIO_SLEW_SLOWEST
let the output voltage level rise/fall as slow as possible
Definition gpio_ll.h:337
@ GPIO_SLEW_FAST
let the output voltage level rise/fall fast
Definition gpio_ll.h:340
@ GPIO_SLEW_SLOW
let the output voltage level rise/fall slowly
Definition gpio_ll.h:339
@ GPIO_SLEW_FASTEST
let the output voltage level rise/fall as fast as possible
Definition gpio_ll.h:341
@ GPIO_DRIVE_STRONG
Use a strong drive strength.
Definition gpio_ll.h:306
@ GPIO_DRIVE_WEAK
Use a weak drive strength.
Definition gpio_ll.h:305
@ GPIO_DRIVE_STRONGEST
Use the strongest drive strength.
Definition gpio_ll.h:307
@ GPIO_DRIVE_WEAKEST
Use the weakest drive strength.
Definition gpio_ll.h:304
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:385
ADC_AcqTime_TypeDef acq_time
channel acquisition time
Definition periph_cpu.h:393
uint8_t dev
device index
Definition periph_cpu.h:386
ADC_Ref_TypeDef reference
channel voltage reference
Definition periph_cpu.h:392
ADC device configuration.
Definition periph_cpu.h:377
ADC_TypeDef * dev
ADC device used.
Definition periph_cpu.h:378
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:379
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
Ethernet peripheral configuration.
Definition periph_cpu.h:659
gpio_t phy_en_pin
PHY power enable, GPIO_UNDEF if unused.
Definition periph_cpu.h:660
uint32_t routeloc1
Pre-shifted bits for ETH->ROUTELOC1.
Definition periph_cpu.h:662
uint8_t phy_addr
MIIM address.
Definition periph_cpu.h:664
gpio_t phy_rst_pin
PHY reset, GPIO_UNDEF if unused.
Definition periph_cpu.h:661
uint16_t speed
Default link speed (MII BMCR speed/duplex bits)
Definition periph_cpu.h:663
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:438
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:439
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:440
gpio_t scl_pin
SCL GPIO pin.
Definition periph_cpu.h:299
PWM channel configuration.
Definition periph_cpu.h:468
uint32_t loc
location of the pin
Definition periph_cpu.h:471
uint8_t index
TIMER channel to use.
Definition periph_cpu.h:469
gpio_t pin
pin used for pwm
Definition periph_cpu.h:470
PWM device configuration.
IRQn_Type irq
the devices base IRQ channel
Definition periph_cpu.h:480
const pwm_chan_conf_t * channel
pointer to first channel config
Definition periph_cpu.h:482
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:479
uint8_t channels
the number of available channels
Definition periph_cpu.h:481
mini_timer_t * dev
Timer used.
SPI device configuration.
Definition periph_cpu.h:517
gpio_t clk_pin
pin used for CLK
Definition periph_cpu.h:521
gpio_t mosi_pin
pin used for MOSI
Definition periph_cpu.h:519
USART_TypeDef * dev
USART device used.
Definition periph_cpu.h:518
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:525
IRQn_Type irq
the devices base IRQ channel
Definition periph_cpu.h:526
gpio_t miso_pin
pin used for MISO
Definition periph_cpu.h:520
Timer device configuration.
Definition periph_cpu.h:260
IRQn_Type irq
number of the higher timer IRQ channel
Definition periph_cpu.h:558
timer_dev_t prescaler
the lower neighboring timer (not initialized for LETIMER)
Definition periph_cpu.h:556
timer_dev_t timer
the higher numbered timer
Definition periph_cpu.h:557
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:559
Define timer configuration values.
Definition periph_cpu.h:548
void * dev
TIMER_TypeDef or LETIMER_TypeDef device used.
Definition periph_cpu.h:549
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:550
UART device configuration.
Definition periph_cpu.h:214
CMU_Clock_TypeDef cmu
the device CMU channel
Definition periph_cpu.h:652
IRQn_Type irq
the devices base IRQ channel
Definition periph_cpu.h:653
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:650
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