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 
32 #define UART_IRQN (UART0_IRQn)
33 #define SPI_SCKSEL (dev(bus)->PSELSCK)
34 #define SPI_MOSISEL (dev(bus)->PSELMOSI)
35 #define SPI_MISOSEL (dev(bus)->PSELMISO)
36 
42 #define HAVE_I2C_SPEED_T
43 typedef enum {
44  I2C_SPEED_LOW = 0x01,
45  I2C_SPEED_NORMAL = TWI_FREQUENCY_FREQUENCY_K100,
46  I2C_SPEED_FAST = TWI_FREQUENCY_FREQUENCY_K400,
48  I2C_SPEED_HIGH = 0x03,
49 } i2c_speed_t;
55 typedef struct {
56  NRF_TWI_Type *dev;
57  uint8_t pin_scl;
58  uint8_t pin_sda;
59  uint8_t ppi;
60 } i2c_conf_t;
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif /* PERIPH_CPU_H */
67 
I2C configuration options.
uint8_t ppi
PPI channel to use.
uint8_t pin_scl
SCL pin.
NRF_TWI_Type * dev
hardware device
uint8_t pin_sda
SDA pin.