mirror of https://github.com/ARMmbed/mbed-os.git
Adding SPI and I2C instances support to SAM21
parent
fa85c6f74d
commit
d6109db325
|
@ -16,6 +16,7 @@
|
||||||
#ifndef MBED_PERIPHERALNAMES_H
|
#ifndef MBED_PERIPHERALNAMES_H
|
||||||
#define MBED_PERIPHERALNAMES_H
|
#define MBED_PERIPHERALNAMES_H
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
#include "cmsis.h"
|
#include "cmsis.h"
|
||||||
#include "PinNames.h"
|
#include "PinNames.h"
|
||||||
|
|
||||||
|
@ -23,6 +24,14 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define _SERCOM_SPI_NAME(n, unused) \
|
||||||
|
SPI##n,
|
||||||
|
|
||||||
|
#define _SERCOM_I2C_NAME(n, unused) \
|
||||||
|
I2C##n,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
UART_0 = (int)0x42000800UL // Base address of SERCOM0
|
UART_0 = (int)0x42000800UL // Base address of SERCOM0
|
||||||
} UARTName;
|
} UARTName;
|
||||||
|
@ -40,19 +49,16 @@ typedef enum {
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DAC_0 = 0
|
DAC_0 = 0
|
||||||
} DACName;
|
} DACName;*/
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SPI_0 = (int)LPC_SSP0_BASE,
|
MREPEAT(SERCOM_INST_NUM, _SERCOM_SPI_NAME, ~)
|
||||||
SPI_1 = (int)LPC_SSP1_BASE
|
|
||||||
} SPIName;
|
} SPIName;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
I2C_0 = (int)LPC_I2C0_BASE,
|
MREPEAT(SERCOM_INST_NUM, _SERCOM_I2C_NAME, ~)
|
||||||
I2C_1 = (int)LPC_I2C1_BASE,
|
|
||||||
I2C_2 = (int)LPC_I2C2_BASE
|
|
||||||
} I2CName;
|
} I2CName;
|
||||||
|
/*
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PWM_1 = 1,
|
PWM_1 = 1,
|
||||||
PWM_2,
|
PWM_2,
|
||||||
|
|
Loading…
Reference in New Issue