29 #if defined(_SILICON_LABS_32B_SERIES_2)
35 #include "em_device.h"
41 #if defined(_SILICON_LABS_32B_SERIES_0)
43 #elif defined (_SILICON_LABS_32B_SERIES_1) || defined(_SILICON_LABS_32B_SERIES_2)
55 CMU_Clock_TypeDef
clk;
56 CMU_Select_TypeDef
src;
63 CMU_Clock_TypeDef
clk;
64 CMU_ClkDiv_TypeDef
div;
71 #define CPUID_LEN (8U)
76 #define CLOCK_CORECLOCK SystemCoreClock
78 #if defined(DAC_COUNT) && DAC_COUNT > 0
85 CMU_Clock_TypeDef cmu;
96 #elif defined(VDAC_COUNT) && VDAC_COUNT > 0
102 VDAC_Ref_TypeDef ref;
103 CMU_Clock_TypeDef cmu;
120 #if defined(_RTC_CNT_MASK)
121 #define RTT_MAX_VALUE _RTC_CNT_MASK
122 #elif defined(_RTCC_CNT_MASK)
123 #define RTT_MAX_VALUE _RTCC_CNT_MASK
125 #define RTT_MAX_FREQUENCY (32768U)
126 #define RTT_MIN_FREQUENCY (1U)
127 #define RTT_CLOCK_FREQUENCY (32768U)
142 #define GPIO_UNDEF (0xffffffff)
147 #define GPIO_PIN(x, y) ((gpio_t) ((x << 4) | y))
152 #define GPIO_MODE(x, y) ((x << 1) | y)
158 #if (_GPIO_PORT_A_PIN_COUNT > 0)
161 #if (_GPIO_PORT_B_PIN_COUNT > 0)
164 #if (_GPIO_PORT_C_PIN_COUNT > 0)
167 #if (_GPIO_PORT_D_PIN_COUNT > 0)
170 #if (_GPIO_PORT_E_PIN_COUNT > 0)
173 #if (_GPIO_PORT_F_PIN_COUNT > 0)
176 #if (_GPIO_PORT_G_PIN_COUNT > 0)
179 #if (_GPIO_PORT_H_PIN_COUNT > 0)
182 #if (_GPIO_PORT_I_PIN_COUNT > 0)
185 #if (_GPIO_PORT_J_PIN_COUNT > 0)
188 #if (_GPIO_PORT_K_PIN_COUNT > 0)
198 #define HAVE_GPIO_MODE_T
213 #define HAVE_GPIO_FLANK_T
222 #if defined(_SILICON_LABS_32B_SERIES_2)
230 #if defined(_IADC_CFG_DIGAVG_MASK)
231 #define ADC_MODE(osr, avg, res) ((osr << 16) | (avg << 8) | res)
233 #define ADC_MODE(osr, res) ((osr << 16) | res)
239 #define ADC_MODE_OSR(mode) ((mode & 0xff0000) >> 16)
241 #if defined(_IADC_CFG_DIGAVG_MASK)
245 #define ADC_MODE_AVG(mode) ((mode & 0x00ff00) >> 8)
251 #define ADC_MODE_RES(mode) ((mode & 0x0000ff) >> 0)
257 #define HAVE_ADC_RES_T
258 #if defined(_IADC_CFG_DIGAVG_MASK)
290 CMU_Clock_TypeDef cmu;
295 IADC_CfgReference_t reference;
302 uint32_t reference_mV;
310 IADC_CfgAnalogGain_t gain;
319 adc_res_t available_res[IADC0_CONFIGNUM];
352 #define ADC_MODE(x, y) ((y << 4) | x)
357 #define ADC_MODE_UNDEF(x) (ADC_MODE(x, 15))
364 #define HAVE_ADC_RES_T
389 #if defined(_SILICON_LABS_32B_SERIES_0)
390 ADC_SingleInput_TypeDef input;
391 #elif defined(_SILICON_LABS_32B_SERIES_1)
392 ADC_PosSel_TypeDef input;
403 #define HAVE_HWCRYPTO_AES128
404 #ifdef AES_CTRL_AES256
405 #define HAVE_HWCRYPTO_AES256
407 #if defined(_SILICON_LABS_32B_SERIES_1)
408 #define HAVE_HWCRYPTO_SHA1
409 #define HAVE_HWCRYPTO_SHA256
418 #define HAVE_I2C_SPEED_T
436 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
448 #define PERIPH_I2C_NEED_READ_REG
449 #define PERIPH_I2C_NEED_WRITE_REG
457 #define HAVE_PWM_MODE_T
491 #define HAVE_SPI_MODE_T
504 #define HAVE_SPI_CLK_T
523 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
534 #define PERIPH_SPI_NEEDS_INIT_CS
535 #define PERIPH_SPI_NEEDS_TRANSFER_BYTE
536 #define PERIPH_SPI_NEEDS_TRANSFER_REG
537 #define PERIPH_SPI_NEEDS_TRANSFER_REGS
548 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
556 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
563 CMU_Clock_TypeDef cmu;
568 #define LETIMER_MAX_VALUE _LETIMER_TOP_MASK
569 #define TIMER_MAX_VALUE _TIMER_TOP_MASK
575 #ifndef CONFIG_EFM32_XTIMER_USE_LETIMER
576 #define CONFIG_EFM32_XTIMER_USE_LETIMER 0
586 #define UART_MODE_UNSUPPORTED 0xf0
592 #define HAVE_UART_PARITY_T
593 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
616 #define HAVE_UART_DATA_BITS_T
617 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
638 #define HAVE_UART_STOP_BITS_T
639 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1)
657 #if defined(_SILICON_LABS_32B_SERIES_0) || defined(_SILICON_LABS_32B_SERIES_1) || defined(DOXYGEN)
667 #define PROVIDES_PM_OFF
672 #define PROVIDES_PM_LAYERED_OFF
677 #define PM_NUM_MODES (3U)
683 #define EFM32_PM_MODE_EM3 (0U)
684 #define EFM32_PM_MODE_EM2 (1U)
685 #define EFM32_PM_MODE_EM1 (2U)
692 #define WDT_CLOCK_HZ (1000U)
694 #define NWDT_TIME_LOWER_LIMIT ((1U << (3U + wdogPeriod_9)) + 1U)
695 #define NWDT_TIME_UPPER_LIMIT ((1U << (3U + wdogPeriod_256k)) + 1U)
697 #if defined(_SILICON_LABS_32B_SERIES_1) || defined(_SILICON_LABS_32B_SERIES_2)
698 #define WDT_TIME_LOWER_LIMIT NWDT_TIME_LOWER_LIMIT
699 #define WDT_TIME_UPPER_LIMIT NWDT_TIME_UPPER_LIMIT
702 #define WDT_HAS_STOP (1U)
709 #define USBDEV_NUM_ENDPOINTS 7
716 #define HAVE_GPIO_SLEW_T
725 #define HAVE_GPIO_PULL_STRENGTH_T
734 #define HAVE_GPIO_DRIVE_STRENGTH_T
@ GPIO_OUT
select GPIO MASK as output
@ GPIO_IN
select GPIO MASK as input
gpio_t adc_conf_t
ADC configuration wrapper.
#define GPIO_MODE(x, y)
Internal macro for combining pin mode (x) and pull-up/down (y).
#define ADC_MODE(x, y)
Internal macro for combining ADC resolution (x) with number of shifts (y).
#define ADC_MODE_UNDEF(x)
Internal define to note that resolution is not supported.
enum IRQn IRQn_Type
Interrupt Number Definition.
gpio_mode_t
Available pin modes.
adc_res_t
Possible ADC resolution settings.
@ ADC_RES_16BIT
ADC resolution: 16 bit.
@ ADC_RES_8BIT
ADC resolution: 8 bit.
@ ADC_RES_14BIT
ADC resolution: 14 bit.
@ ADC_RES_6BIT
ADC resolution: 6 bit.
@ ADC_RES_10BIT
ADC resolution: 10 bit.
@ ADC_RES_12BIT
ADC resolution: 12 bit.
gpio_pull_strength_t
Enumeration of pull resistor values.
gpio_slew_t
Enumeration of slew rate settings.
gpio_drive_strength_t
Enumeration of drive strength options.
@ GPIO_PULL_WEAKEST
Use the weakest (highest Ohm value) resistor.
@ GPIO_PULL_WEAK
Use a weak pull resistor.
@ GPIO_PULL_STRONG
Use a strong pull resistor.
@ GPIO_PULL_STRONGEST
Use the strongest pull resistor.
@ GPIO_SLEW_SLOWEST
let the output voltage level rise/fall as slow as possible
@ GPIO_SLEW_FAST
let the output voltage level rise/fall fast
@ GPIO_SLEW_SLOW
let the output voltage level rise/fall slowly
@ GPIO_SLEW_FASTEST
let the output voltage level rise/fall as fast as possible
@ GPIO_DRIVE_STRONG
Use a strong drive strength.
@ GPIO_DRIVE_WEAK
Use a weak drive strength.
@ GPIO_DRIVE_STRONGEST
Use the strongest drive strength.
@ GPIO_DRIVE_WEAKEST
Use the weakest drive strength.
unsigned int gpio_t
GPIO type identifier.
@ GPIO_FALLING
emit interrupt on falling flank
@ GPIO_RISING
emit interrupt on rising flank
@ GPIO_BOTH
emit interrupt on both flanks
@ GPIO_OD
configure as output in open-drain mode without pull resistor
@ GPIO_IN_PU
configure as input with pull-up resistor
@ GPIO_OD_PU
configure as output in open-drain mode with pull resistor enabled
@ GPIO_IN_PD
configure as input with pull-down resistor
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
@ I2C_SPEED_FAST_PLUS
fast plus mode: ~1000 kbit/s
@ I2C_SPEED_LOW
low speed mode: ~10 kbit/s
@ I2C_SPEED_HIGH
high speed mode: ~3400 kbit/s
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
@ PWM_CENTER
center aligned
@ SPI_MODE_0
CPOL=0, CPHA=0.
@ SPI_MODE_2
CPOL=1, CPHA=0.
@ SPI_MODE_1
CPOL=0, CPHA=1.
@ SPI_MODE_3
CPOL=1, CPHA=1.
@ SPI_CLK_10MHZ
drive the SPI bus with 10MHz
@ SPI_CLK_5MHZ
drive the SPI bus with 5MHz
@ SPI_CLK_400KHZ
drive the SPI bus with 400KHz
@ SPI_CLK_1MHZ
drive the SPI bus with 1MHz
@ SPI_CLK_100KHZ
drive the SPI bus with 100KHz
@ UART_PARITY_SPACE
space parity
@ UART_PARITY_NONE
no parity
@ UART_PARITY_EVEN
even parity
@ UART_PARITY_ODD
odd parity
@ UART_PARITY_MARK
mark parity
@ UART_STOP_BITS_2
2 stop bits
@ UART_STOP_BITS_1
1 stop bit
@ UART_DATA_BITS_6
6 data bits
@ UART_DATA_BITS_5
5 data bits
@ UART_DATA_BITS_7
7 data bits
@ UART_DATA_BITS_8
8 data bits
Common macros and compiler attributes/pragmas configuration.
spi_mode_t
Support SPI modes.
Mutex for thread synchronization.
uart_parity_t
Definition of possible parity modes.
uart_stop_bits_t
Definition of possible stop bits lengths.
uart_data_bits_t
Definition of possible data bits lengths in a UART frame.
Implementation specific CPU configuration options.
ADC channel configuration.
ADC_AcqTime_TypeDef acq_time
channel acquisition time
ADC_Ref_TypeDef reference
channel voltage reference
ADC_TypeDef * dev
ADC device used.
CMU_Clock_TypeDef cmu
the device CMU channel
Clock divider configuration.
CMU_ClkDiv_TypeDef div
Divisor.
CMU_Clock_TypeDef clk
Clock domain.
CMU_Select_TypeDef src
Source clock.
CMU_Clock_TypeDef clk
Clock domain.
DAC line configuration data.
I2C configuration structure.
CMU_Clock_TypeDef cmu
the device CMU channel
I2C_TypeDef * dev
USART device used.
uint32_t speed
the bus speed
IRQn_Type irq
the devices base IRQ channel
PWM channel configuration.
uint32_t loc
location of the pin
uint8_t index
TIMER channel to use.
gpio_t pin
pin used for pwm
PWM device configuration.
IRQn_Type irq
the devices base IRQ channel
const pwm_chan_conf_t * channel
pointer to first channel config
TIMER_TypeDef * dev
TIMER device used.
CMU_Clock_TypeDef cmu
the device CMU channel
uint8_t channels
the number of available channels
SPI device configuration.
gpio_t clk_pin
pin used for CLK
gpio_t mosi_pin
pin used for MOSI
USART_TypeDef * dev
USART device used.
CMU_Clock_TypeDef cmu
the device CMU channel
IRQn_Type irq
the devices base IRQ channel
gpio_t miso_pin
pin used for MISO
Timer device configuration.
IRQn_Type irq
number of the higher timer IRQ channel
timer_dev_t prescaler
the lower neighboring timer (not initialized for LETIMER)
timer_dev_t timer
the higher numbered timer
uint8_t channel_numof
number of channels per timer
Define timer configuration values.
void * dev
TIMER_TypeDef or LETIMER_TypeDef device used.
CMU_Clock_TypeDef cmu
the device CMU channel
UART device configuration.
CMU_Clock_TypeDef cmu
the device CMU channel
IRQn_Type irq
the devices base IRQ channel
uint32_t loc
location of UART pins
void * dev
UART, USART or LEUART device used.