nrf52/include/periph_cpu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2017 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef PERIPH_CPU_H
20 #define PERIPH_CPU_H
21 
22 #include "periph_cpu_common.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 #define CLOCK_CORECLOCK (64000000U)
32 
37 #define UART_IRQN (UARTE0_UART0_IRQn)
38 #define SPI_SCKSEL (dev(bus)->PSEL.SCK)
39 #define SPI_MOSISEL (dev(bus)->PSEL.MOSI)
40 #define SPI_MISOSEL (dev(bus)->PSEL.MISO)
41 
46 #define ADC_NUMOF (9U)
47 
51 enum {
52  NRF52_AIN0 = 0,
53  NRF52_AIN1 = 1,
54  NRF52_AIN2 = 2,
55  NRF52_AIN3 = 3,
56  NRF52_AIN4 = 4,
57  NRF52_AIN5 = 5,
58  NRF52_AIN6 = 6,
59  NRF52_AIN7 = 7,
60  NRF52_VDD = 8,
61 };
62 
67 #define HAVE_ADC_RES_T
68 typedef enum {
69  ADC_RES_6BIT = 0xf0,
70  ADC_RES_8BIT = 0x00,
71  ADC_RES_10BIT = 0x01,
72  ADC_RES_12BIT = 0x02,
73  ADC_RES_14BIT = 0xf1,
74  ADC_RES_16BIT = 0xf2
75 } adc_res_t;
82 #define HAVE_I2C_SPEED_T
83 typedef enum {
84  I2C_SPEED_LOW = 0xff,
85  I2C_SPEED_NORMAL = TWIM_FREQUENCY_FREQUENCY_K100,
86  I2C_SPEED_FAST = TWIM_FREQUENCY_FREQUENCY_K400,
88  I2C_SPEED_HIGH = 0xfd,
89 } i2c_speed_t;
95 typedef struct {
96  NRF_TWIM_Type *dev;
97  uint8_t scl;
98  uint8_t sda;
99 } i2c_conf_t;
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* PERIPH_CPU_H */
106 
Analog Input 2.
I2C configuration options.
ADC resolution: 12 bit.
NRF_TWIM_Type * dev
TWIM hardware device.
Analog Input 7.
uint8_t scl
SCL pin.
Analog Input 4.
VDD, not useful if VDD is reference...
supported with oversampling, not implemented
ADC resolution: 10 bit.
not supported by hardware
ADC resolution: 8 bit.
not supported by hardware
Analog Input 0.
Analog Input 6.
uint8_t sda
SDA pin.
Analog Input 3.
Analog Input 1.
Analog Input 5.