stm32f1/include/periph_cpu.h

CPU specific definitions for internal peripheral handling.

ADC_DEVS

Available number of ADC devices.

1
(2U)
CPUID_ADDR

Starting address of the CPU ID.

1
(0x1ffff7e8)
TIMER_CHANNELS

All timers for the STM32F1 have 4 CC channels.

1
(4U)
TIMER_MAXVAL

All timers have a width of 16-bit.

1
(0xffff)
GPIO_MODE( mode, cnf, odr)

Generate GPIO mode bitfields.

1
(mode | (cnf << 2) | (odr << 4))

We use 4 bit to determine the pin functions:

  • bit 4: ODR value
  • bit 2+3: in/out
  • bit 1: PU enable
  • bit 2: OD enable

PM_NUM_MODES

Define the number of available PM modes.

1
(2U)
PM_BLOCKER_INITIAL

Override the default initial PM blocker.

1
{ .val_u32 = 0x01010101 }

we block all modes per default, until PM is cleanly implemented

PM_STOP_CONFIG

Define the config flag for stop mode.

1
(PWR_CR_LPDS)
HAVE_GPIO_PP_T

Override values for pull register configuration.

enum gpio_pp_t
GPIO_NOPULL = 4
do not use internal pull resistors
GPIO_PULLUP = 9
enable internal pull-up resistor
GPIO_PULLDOWN = 8
enable internal pull-down resistor
enum @83
PORT_A = 0
port A
PORT_B = 1
port B
PORT_C = 2
port C
PORT_D = 3
port D
PORT_E = 4
port E
PORT_F = 5
port F
PORT_G = 6
port G
struct adc_conf_t

ADC device configuration.

Available number of ADC devices.

ADC channel configuration data.

ADC line configuration values.

CPU specific ADC configuration.

ADC channel configuration data

CMU_Clock_TypeDef cmu

the device CMU channel

ADC_Type * dev

ADC module.

gpio.h::gpio_t pin

pin to use

pin connected to the channel

Use GPIO_UNDEF non-muxed ADC pins, e.g. ADC0_DP, or for internal channels, e.g. Bandgap

uint8_t chan

ADC channel.

CPU ADC channel connected to the pin.

internal channel the pin is connected to

Written as-is to ADCx_SC1x before conversion. This also decides single-ended or differential sampling, see CPU reference manual for ADCx_SC1x

uint8_t avg

Hardware averaging configuration.

Written as-is to ADCx_SC3 before conversion, use kinetis/include/periph_cpu.h::ADC_AVG_NONE and kinetis/include/periph_cpu.h::ADC_AVG_MAX as a shorthand notation in the board configuration

ADC_TypeDef * dev

ADC device used.

ADCx - 1 device used for the channel.