nrf51/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 (16000000U)
32 
37 #define UART_IRQN (UART0_IRQn)
38 #define SPI_SCKSEL (dev(bus)->PSELSCK)
39 #define SPI_MOSISEL (dev(bus)->PSELMOSI)
40 #define SPI_MISOSEL (dev(bus)->PSELMISO)
41 
47 #define HAVE_I2C_SPEED_T
48 typedef enum {
49  I2C_SPEED_LOW = 0x01,
50  I2C_SPEED_NORMAL = TWI_FREQUENCY_FREQUENCY_K100,
51  I2C_SPEED_FAST = TWI_FREQUENCY_FREQUENCY_K400,
53  I2C_SPEED_HIGH = 0x03,
54 } i2c_speed_t;
61 #define HAVE_ADC_RES_T
62 typedef enum {
63  ADC_RES_6BIT = 0xf0,
64  ADC_RES_8BIT = 0x00,
65  ADC_RES_10BIT = 0x02,
66  ADC_RES_12BIT = 0xf1,
67  ADC_RES_14BIT = 0xf2,
68  ADC_RES_16BIT = 0xf3
69 } adc_res_t;
75 typedef struct {
76  NRF_TWI_Type *dev;
77  uint8_t pin_scl;
78  uint8_t pin_sda;
79  uint8_t ppi;
80 } i2c_conf_t;
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif /* PERIPH_CPU_H */
87 
I2C configuration options.
uint8_t ppi
PPI channel to use.
ADC resolution: 12 bit (not supported)
NRF_TWI_Type * dev
hardware device
ADC resolution: 14 bit (not supported)
ADC resolution: 10 bit.
ADC resolution: 16 bit (not supported)
ADC resolution: 8 bit.
ADC resolution: 6 bit (not supported)
uint8_t pin_scl
SCL pin.
uint8_t pin_sda
SDA pin.