Loading...
Searching...
No Matches
i2c_conf_t Struct Reference

I2C configuration structure. More...

Detailed Description

I2C configuration structure.

Structure for I2C configuration data.

I2C device configuration The frequency f() of the clock gclk_src must fulfill the condition.

I2C (TWI) configuration options.

I2C configuration structure type.

I2C device configuration.

I2C configuration options.

4 * speed ≤ f(gclk_src) ≤ 512 * speed

if speed ≤ 1 MHz and

12 * speed ≤ f(gclk_src) ≤ 520 * speed

if speed > 1 MHz

Definition at line 299 of file periph_cpu.h.

#include <periph_cpu.h>

Data Fields

TWI_t * dev
 Pointer to hardware module registers.
 
pwr_reduction_t pwr
 Power Management.
 
gpio_t sda_pin
 SDA GPIO pin.
 
gpio_t scl_pin
 SCL GPIO pin.
 
i2c_speed_t speed
 Configured bus speed, actual speed may be lower but never higher.
 
cpu_int_lvl_t int_lvl
 Serial Interrupt Level.
 
I2C_TypeDef * dev
 USART device used.
 
CMU_Clock_TypeDef cmu
 the device CMU channel
 
IRQn_Type irq
 the devices base IRQ channel
 
uint32_t speed
 the bus speed
 
uint8_t i2c_speed_t speed
 < I2C module identifier
 
gpio_t scl
 GPIO used as SCL pin.
 
gpio_t sda
 GPIO used as SDA pin.
 
bool scl_pullup
 Pullup enabled for SCL pin.
 
bool sda_pullup
 Pullup enabled for SDA pin.
 
uint32_t addr
 device base address
 
I2C_Type * dev
 i2c device
 
uint32_t rcu_mask
 bit in clock enable register
 
IRQn_Type irqn
 I2C event interrupt number.
 
I2C_Type * i2c
 Pointer to hardware module registers.
 
uint32_t freq
 I2C module clock frequency, usually CLOCK_BUSCLOCK or CLOCK_CORECLOCK.
 
uint32_t scl_pcr
 PORT module PCR setting for the SCL pin.
 
uint32_t sda_pcr
 PORT module PCR setting for the SDA pin.
 
lpc23xx_i2c_t * dev
 pointer to the I2C device

 
uint8_t irq_prio
 priority of the I2C IRQ

 
uint8_t pinsel_sda
 PINSEL# of the SDA pin

 
uint8_t pinsel_scl
 PINSEL# of the SCL pin

 
uint32_t pinsel_msk_sda
 SDA PINSEL Mask

 
uint32_t pinsel_msk_scl
 SCL PINSEL Mask

 
NRF_TWI_Type * dev
 hardware device
 
gpio_t pin_scl
 SCL pin.
 
gpio_t pin_sda
 SDA pin.
 
uint8_t ppi
 PPI channel to use.
 
NRF_TWIM_Type * dev
 TWIM hardware device.
 
SercomI2cm * dev
 pointer to the used I2C device
 
gpio_mux_t mux
 alternate function (mux)
 
uint8_t gclk_src
 GCLK source which supplys SERCOM.
 
uint8_t flags
 allow SERCOM to run in standby mode
 
gpio_af_t scl_af
 scl pin alternate function value
 
gpio_af_t sda_af
 sda pin alternate function value
 
uint8_t bus
 APB bus.
 
uint32_t rcc_mask
 bit in clock enable register
 
uint8_t irqn
 I2C event interrupt number.
 

Field Documentation

◆ addr

uint32_t i2c_conf_t::addr

device base address

Definition at line 129 of file periph_cpu.h.

◆ bus

uint8_t i2c_conf_t::bus

APB bus.

Definition at line 89 of file cpu_i2c.h.

◆ cmu

CMU_Clock_TypeDef i2c_conf_t::cmu

the device CMU channel

Definition at line 439 of file periph_cpu.h.

◆ dev [1/7]

I2C_TypeDef * i2c_conf_t::dev

Pointer to hardware module registers.

i2c device

hardware device

Definition at line 300 of file periph_cpu.h.

◆ dev [2/7]

I2C_TypeDef* i2c_conf_t::dev

USART device used.

i2c device

Definition at line 433 of file periph_cpu.h.

◆ dev [3/7]

I2C_Type* i2c_conf_t::dev

i2c device

hardware device

Definition at line 458 of file periph_cpu.h.

◆ dev [4/7]

lpc23xx_i2c_t* i2c_conf_t::dev

pointer to the I2C device

Definition at line 224 of file periph_cpu.h.

◆ dev [5/7]

NRF_TWI_Type* i2c_conf_t::dev

hardware device

Definition at line 94 of file periph_cpu.h.

◆ dev [6/7]

NRF_TWIM_Type* i2c_conf_t::dev

TWIM hardware device.

Definition at line 597 of file periph_cpu_common.h.

◆ dev [7/7]

SercomI2cm* i2c_conf_t::dev

pointer to the used I2C device

Definition at line 562 of file periph_cpu_common.h.

◆ flags

uint8_t i2c_conf_t::flags

allow SERCOM to run in standby mode

Definition at line 568 of file periph_cpu_common.h.

◆ freq

uint32_t i2c_conf_t::freq

I2C module clock frequency, usually CLOCK_BUSCLOCK or CLOCK_CORECLOCK.

Definition at line 462 of file periph_cpu.h.

◆ gclk_src

uint8_t i2c_conf_t::gclk_src

GCLK source which supplys SERCOM.

Definition at line 567 of file periph_cpu_common.h.

◆ i2c

I2C_Type* i2c_conf_t::i2c

Pointer to hardware module registers.

Definition at line 459 of file periph_cpu.h.

◆ int_lvl

cpu_int_lvl_t i2c_conf_t::int_lvl

Serial Interrupt Level.

Definition at line 305 of file periph_cpu.h.

◆ irq

IRQn_Type i2c_conf_t::irq

the devices base IRQ channel

Definition at line 440 of file periph_cpu.h.

◆ irq_prio

uint8_t i2c_conf_t::irq_prio

priority of the I2C IRQ

Definition at line 226 of file periph_cpu.h.

◆ irqn [1/2]

IRQn_Type i2c_conf_t::irqn

I2C event interrupt number.

IRQ number for this module.

Definition at line 463 of file periph_cpu.h.

◆ irqn [2/2]

uint8_t i2c_conf_t::irqn

I2C event interrupt number.

Definition at line 104 of file cpu_i2c.h.

◆ mux

gpio_mux_t i2c_conf_t::mux

alternate function (mux)

Definition at line 566 of file periph_cpu_common.h.

◆ pin_scl

gpio_t i2c_conf_t::pin_scl

SCL pin.

Definition at line 95 of file periph_cpu.h.

◆ pin_sda

gpio_t i2c_conf_t::pin_sda

SDA pin.

Definition at line 96 of file periph_cpu.h.

◆ pinsel_msk_scl

uint32_t i2c_conf_t::pinsel_msk_scl

SCL PINSEL Mask

Definition at line 230 of file periph_cpu.h.

◆ pinsel_msk_sda

uint32_t i2c_conf_t::pinsel_msk_sda

SDA PINSEL Mask

Definition at line 229 of file periph_cpu.h.

◆ pinsel_scl

uint8_t i2c_conf_t::pinsel_scl

PINSEL# of the SCL pin

Definition at line 228 of file periph_cpu.h.

◆ pinsel_sda

uint8_t i2c_conf_t::pinsel_sda

PINSEL# of the SDA pin

Definition at line 227 of file periph_cpu.h.

◆ ppi

uint8_t i2c_conf_t::ppi

PPI channel to use.

Definition at line 97 of file periph_cpu.h.

◆ pwr

pwr_reduction_t i2c_conf_t::pwr

Power Management.

Definition at line 301 of file periph_cpu.h.

◆ rcc_mask

uint32_t i2c_conf_t::rcc_mask

bit in clock enable register

Definition at line 90 of file cpu_i2c.h.

◆ rcu_mask

uint32_t i2c_conf_t::rcu_mask

bit in clock enable register

Definition at line 462 of file periph_cpu.h.

◆ scl

gpio_t i2c_conf_t::scl

GPIO used as SCL pin.

SCL pin.

Definition at line 470 of file periph_cpu.h.

◆ scl_af

gpio_af_t i2c_conf_t::scl_af

scl pin alternate function value

Definition at line 86 of file cpu_i2c.h.

◆ scl_pcr

uint32_t i2c_conf_t::scl_pcr

PORT module PCR setting for the SCL pin.

Definition at line 465 of file periph_cpu.h.

◆ scl_pin

gpio_t i2c_conf_t::scl_pin

SCL GPIO pin.

used SCL pin

scl pin number

pin used for SCL

Definition at line 303 of file periph_cpu.h.

◆ scl_pullup

bool i2c_conf_t::scl_pullup

Pullup enabled for SCL pin.

Definition at line 472 of file periph_cpu.h.

◆ sda

gpio_t i2c_conf_t::sda

GPIO used as SDA pin.

SDA pin.

Definition at line 471 of file periph_cpu.h.

◆ sda_af

gpio_af_t i2c_conf_t::sda_af

sda pin alternate function value

Definition at line 87 of file cpu_i2c.h.

◆ sda_pcr

uint32_t i2c_conf_t::sda_pcr

PORT module PCR setting for the SDA pin.

Definition at line 466 of file periph_cpu.h.

◆ sda_pin

gpio_t i2c_conf_t::sda_pin

SDA GPIO pin.

used MOSI pin

sda pin number

pin used for SDA

Definition at line 302 of file periph_cpu.h.

◆ sda_pullup

bool i2c_conf_t::sda_pullup

Pullup enabled for SDA pin.

Definition at line 473 of file periph_cpu.h.

◆ speed [1/3]

i2c_speed_t i2c_conf_t::speed

Configured bus speed, actual speed may be lower but never higher.

bus speed in bit/s

Bus speed.

bus speed

I2C bus speed

i2c bus speed

I2C speed.

I2C bus speed.

baudrate used for the bus

Definition at line 304 of file periph_cpu.h.

◆ speed [2/3]

uint32_t i2c_conf_t::speed

the bus speed

bus speed in bit/s

Definition at line 441 of file periph_cpu.h.

◆ speed [3/3]

uint8_t i2c_speed_t i2c_conf_t::speed

< I2C module identifier

I2C bus speed

Definition at line 469 of file periph_cpu.h.


The documentation for this struct was generated from the following files: