Go to the documentation of this file.
27 #include "vendor/hw_soc_adc.h"
30 #include "vendor/hw_ssi.h"
31 #include "vendor/hw_uart.h"
40 #define CPUID_ADDR (&IEEE_ADDR_MSWORD)
45 #define CPUID_LEN (8U)
59 #define PM_NUM_MODES (4)
65 #define GPIO_UNDEF (0xffffffff)
70 #define GPIO_MUX_NONE (0xff)
77 #define GPIO_PIN(port, pin) (gpio_t)(((uint32_t)GPIO_BASE + \
78 (port << GPIO_PORTNUM_SHIFT)) | pin)
87 void gpio_init_af(gpio_t pin, uint8_t sel, uint8_t over);
97 void gpio_init_mux(gpio_t pin, uint8_t over, uint8_t sel, uint8_t func);
103 #define PERIPH_I2C_NEED_READ_REG
104 #define PERIPH_I2C_NEED_READ_REGS
105 #define PERIPH_I2C_NEED_WRITE_REG
106 #define PERIPH_I2C_NEED_WRITE_REGS
114 #define HAVE_I2C_SPEED_T
138 #define PERIPH_SPI_NEEDS_INIT_CS
139 #define PERIPH_SPI_NEEDS_TRANSFER_BYTE
140 #define PERIPH_SPI_NEEDS_TRANSFER_REG
141 #define PERIPH_SPI_NEEDS_TRANSFER_REGS
149 #define HAVE_GPIO_MODE_T
151 GPIO_IN = ((uint8_t)OVERRIDE_DISABLE),
152 GPIO_IN_ANALOG = ((uint8_t)OVERRIDE_ANALOG),
155 GPIO_OUT = ((uint8_t)OVERRIDE_ENABLE),
170 #ifdef MODULE_PERIPH_UART_HW_FC
182 #define HAVE_UART_PARITY_T
196 #define HAVE_UART_DATA_BITS_T
209 #define HAVE_UART_STOP_BITS_T
220 #define HAVE_SPI_MODE_T
233 #define HAVE_SPI_CLK_T
252 #ifndef BOARD_HAS_SPI_CLK_CONF
261 { .
cpsr = 64, .scr = 4 },
262 { .cpsr = 16, .scr = 4 },
263 { .cpsr = 32, .scr = 0 },
264 { .cpsr = 2, .scr = 2 },
265 { .cpsr = 2, .scr = 1 }
298 #define HAVE_ADC_RES_T
301 ADC_RES_7BIT = (0 << 4),
303 ADC_RES_9BIT = (1 << 4),
321 #define SOC_ADC_ADCCON3_EREF_INT (0 << SOC_ADC_ADCCON3_EREF_S)
322 #define SOC_ADC_ADCCON3_EREF_EXT (1 << SOC_ADC_ADCCON3_EREF_S)
323 #define SOC_ADC_ADCCON3_EREF_AVDD5 (2 << SOC_ADC_ADCCON3_EREF_S)
324 #define SOC_ADC_ADCCON3_EREF_DIFF (3 << SOC_ADC_ADCCON3_EREF_S)
331 #define SOCADC_7_BIT_RSHIFT (9U)
332 #define SOCADC_9_BIT_RSHIFT (7U)
333 #define SOCADC_10_BIT_RSHIFT (6U)
334 #define SOCADC_12_BIT_RSHIFT (4U)
341 #define RTT_DEV SMWDTHROSC
342 #define RTT_IRQ SM_TIMER_ALT_IRQn
343 #define RTT_IRQ_PRIO 1
344 #define RTT_ISR isr_sleepmode
345 #define RTT_MAX_VALUE (0xffffffff)
346 #define RTT_FREQUENCY (CLOCK_OSC32K)
350 #define RTT_MIN_OFFSET (5U)
359 #define NWDT_TIME_LOWER_LIMIT (2U)
360 #define NWDT_TIME_UPPER_LIMIT (1000U)
@ SPI_CLK_400KHZ
drive the SPI bus with 400KHz
@ SPI_MODE_3
CPOL=1, CPHA=1.
@ UART_PARITY_NONE
no parity
@ UART_DATA_BITS_5
5 data bits
@ SPI_CLK_100KHZ
drive the SPI bus with 100KHz
gpio_t scl_pin
pin used for SCL
@ ADC_RES_6BIT
ADC resolution: 6 bit.
gpio_t rx_pin
pin used for RX
uart_stop_bits_t
Definition of possible stop bits lengths in a UART frame.
@ I2C_SPEED_LOW
low speed mode: ~10 kbit/s
@ GPIO_IN_PD
configure as input with pull-down resistor
static const spi_clk_conf_t spi_clk_config[]
Pre-calculated clock divider values based on a CLOCK_CORECLOCK (32MHz)
@ UART_STOP_BITS_2
2 stop bits
@ SPI_MODE_0
CPOL=0, CPHA=0.
@ GPIO_OD
configure as output in open-drain mode without pull resistor
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
@ UART_DATA_BITS_8
8 data bits
@ ADC_RES_14BIT
ADC resolution: 14 bit.
adc_res_t
Possible ADC resolution settings.
gpio_t sck_pin
pin used for SCK
@ GPIO_OUT
configure as output in push-pull mode
@ ADC_RES_16BIT
ADC resolution: 16 bit.
@ UART_DATA_BITS_6
6 data bits
uart_parity_t
Definition of possible parity modes.
i2c_speed_t
Default mapping of I2C bus speed values.
spi_mode_t
Available SPI modes, defining the configuration of clock polarity and clock phase.
@ ADC_RES_8BIT
ADC resolution: 8 bit.
uint8_t scr
SCR clock divider.
@ GPIO_IN_PU
configure as input with pull-up resistor
uint8_t cpsr
CPSR clock divider.
@ SPI_CLK_10MHZ
drive the SPI bus with 10MHz
uint32_t spi_clk_t
SPI clock type.
@ GPIO_IN
configure as input without pull resistor
void gpio_init_mux(gpio_t pin, uint8_t over, uint8_t sel, uint8_t func)
Configure an alternate function for the given pin.
UART device configuration.
@ SPI_CLK_5MHZ
drive the SPI bus with 5MHz
@ GPIO_OD_PU
configure as output in open-drain mode with pull resistor enabled
@ UART_PARITY_SPACE
space parity
gpio_t sda_pin
pin used for SDA
uint8_t num
number of SSI device, i.e.
void gpio_init_af(gpio_t pin, uint8_t sel, uint8_t over)
Configure an alternate function for the given pin.
cc2538_uart_t * dev
pointer to the used UART device
gpio_t cs_pin
pin used for CS
@ UART_PARITY_EVEN
even parity
gpio_t adc_conf_t
ADC configuration wrapper.
uint_fast8_t chn
number of channels
gpio_t tx_pin
pin used for TX
gpio_mode_t
Available pin modes.
@ ADC_RES_10BIT
ADC resolution: 10 bit.
@ UART_DATA_BITS_7
7 data bits
@ ADC_RES_12BIT
ADC resolution: 12 bit.
i2c_speed_t speed
baudrate used for the bus
Datafields for static SPI clock configuration values.
@ UART_PARITY_MARK
mark parity
@ UART_STOP_BITS_1
1 stop bit
uart_data_bits_t
Definition of possible data bits lengths in a UART frame.
@ UART_PARITY_ODD
odd parity
unsigned int gpio_t
GPIO type identifier.
I2C configuration options.
@ I2C_SPEED_FAST_PLUS
fast plus mode: ~1000 kbit/s
@ SPI_CLK_1MHZ
drive the SPI bus with 1MHz
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
uint_fast8_t cfg
timer config word
@ I2C_SPEED_HIGH
high speed mode: ~3400 kbit/s
SPI configuration structure type.
UART component registers.
@ SPI_MODE_1
CPOL=0, CPHA=1.
@ SPI_MODE_2
CPOL=1, CPHA=0.
gpio_t mosi_pin
pin used for MOSI
gpio_t miso_pin
pin used for MISO