Mesh4all
May the mesh be with you
periph_conf.h File Reference

Peripheral MCU configuration for the Meshme board. More...

#include <stdint.h>
#include "cpu.h"
#include "periph_cpu.h"
#include "cfg_clk_default.h"
#include "cfg_timer_default.h"
+ Include dependency graph for periph_conf.h:

Go to the source code of this file.

[A]nalog to [D]igital [C]onverter configuration

#define SOC_ADC_ADCCON3_EREF   SOC_ADC_ADCCON3_EREF_AVDD5
 Selected [default] voltage reference is [SOC_ADC_ADCCON3_EREF_EXT], this can be changed according to the following table: More...
 
#define SOC_ADC_RES   ADC_RES_12BIT
 Selected default resolution is [ADC_RES_12BIT] but it can be changed according the next table: More...
 
#define ADC_NUMOF   ARRAY_SIZE(adc_config)
 
static const adc_conf_t adc_config []
 Available ADC lines. More...
 

[U]niversal [A]synchronous [R]eceiver [T]ransmitter peripheral.

#define UART_0_ISR   isr_uart0
 
#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
static const uart_conf_t uart_config []
 Two available UART ports but only one is set as follows: More...
 

I2C Settings

#define I2C_IRQ_PRIO   1
 
#define I2C_NUMOF   ARRAY_SIZE(i2c_config)
 
static const i2c_conf_t i2c_config []
 There are 2 I2C ports available but only one is set as follows: More...
 

SPI configuration

#define SPI_NUMOF   ARRAY_SIZE(spi_config)
 
static const spi_conf_t spi_config []
 There are 2 SPI ports available but only one is set as follows: More...
 

Detailed Description

Peripheral MCU configuration for the Meshme board.

Author
Anon Mall anon..nosp@m.mall.nosp@m.@gt-a.nosp@m.rc.c.nosp@m.om
Luis A. Ruiz luisa.nosp@m.n00@.nosp@m.hotma.nosp@m.il.c.nosp@m.om

Definition in file periph_conf.h.

Macro Definition Documentation

◆ ADC_NUMOF

#define ADC_NUMOF   ARRAY_SIZE(adc_config)

Number of available adc lines

Definition at line 78 of file periph_conf.h.

◆ I2C_IRQ_PRIO

#define I2C_IRQ_PRIO   1

i2c IRQ priority

Definition at line 114 of file periph_conf.h.

◆ I2C_NUMOF

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)

Available i2c ports

Definition at line 135 of file periph_conf.h.

◆ SOC_ADC_ADCCON3_EREF

#define SOC_ADC_ADCCON3_EREF   SOC_ADC_ADCCON3_EREF_AVDD5

Selected [default] voltage reference is [SOC_ADC_ADCCON3_EREF_EXT], this can be changed according to the following table:

Register Description
SOC_ADC_ADCCON3_EREF_INT Internal reference
SOC_ADC_ADCCON3_EREF_EXT External reference on AIN7 pin
SOC_ADC_ADCCON3_EREF_AVDD5 AVDD5 pin
SOC_ADC_ADCCON3_EREF_DIFF External reference on AIN6-AIN7 differential input
Note
default is [SOC_ADC_ADCCON3_EREF_EXT]
See also
periph_adc

Definition at line 53 of file periph_conf.h.

◆ SOC_ADC_RES

#define SOC_ADC_RES   ADC_RES_12BIT

Selected default resolution is [ADC_RES_12BIT] but it can be changed according the next table:

Register Description
ADC_RES_7BIT 7 bits per sample resolution
ADC_RES_9BIT 9 bits per sample ""
ADC_RES_10BIT 10 bits per sample ""
ADC_RES_12BIT 12 bits per sample ""
Note
default is [ADC_RES_12BIT]

Definition at line 68 of file periph_conf.h.

◆ SPI_NUMOF

#define SPI_NUMOF   ARRAY_SIZE(spi_config)

Available SPI ports

Definition at line 161 of file periph_conf.h.

◆ UART_0_ISR

#define UART_0_ISR   isr_uart0

interrupt function name mapping

Definition at line 106 of file periph_conf.h.

◆ UART_NUMOF

#define UART_NUMOF   ARRAY_SIZE(uart_config)

Number of UARTs

Definition at line 107 of file periph_conf.h.

Variable Documentation

◆ adc_config

const adc_conf_t adc_config[]
static
Initial value:
= {
GPIO_PIN(PORT_A, 6),
GPIO_PIN(PORT_A, 7),
}

Available ADC lines.

Definition at line 73 of file periph_conf.h.

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.speed = I2C_SPEED_FAST,
.scl_pin = GPIO_PIN(PORT_B, 0),
.sda_pin = GPIO_PIN(PORT_B, 1),
},
}

There are 2 I2C ports available but only one is set as follows:

# SCL SDA Speed
0 PB0 PB1 Fast
Note
I2C speed can be one of two modes available:
  • Standard 100 kbps
  • Fast 400 kbps

Definition at line 128 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static
Initial value:
= {
{
.num = 0,
.mosi_pin = GPIO_PIN(PORT_B, 4),
.miso_pin = GPIO_PIN(PORT_B, 5),
.sck_pin = GPIO_PIN(PORT_B, 6),
.cs_pin = GPIO_PIN(PORT_B, 7),
},
}

There are 2 SPI ports available but only one is set as follows:

Num MOSI MISO SCK CS
0 PB4 PB5 PB6 PB7

Definition at line 151 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static
Initial value:
= {
{
.dev = UART0_BASEADDR,
.rx_pin = GPIO_PIN(PORT_A, 0),
.tx_pin = GPIO_PIN(PORT_A, 1),
},
}

Two available UART ports but only one is set as follows:

UART Dev TX pin RX pin CTS pin RTS pin
0 PA0 PA1 Undef Undef

Definition at line 94 of file periph_conf.h.