mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Jul 17 09:15:10 2015 +0100
Revision:
592:a274ee790e56
Parent:
579:53297373a894
Synchronized with git revision e7144f83a8d75df80c4877936b6ffe552b0be9e6

Full URL: https://github.com/mbedmicro/mbed/commit/e7144f83a8d75df80c4877936b6ffe552b0be9e6/

More API implementation for SAMR21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 579:53297373a894 1 /* mbed Microcontroller Library
mbed_official 579:53297373a894 2 * Copyright (c) 2006-2013 ARM Limited
mbed_official 579:53297373a894 3 *
mbed_official 579:53297373a894 4 * Licensed under the Apache License, Version 2.0 (the "License");
mbed_official 579:53297373a894 5 * you may not use this file except in compliance with the License.
mbed_official 579:53297373a894 6 * You may obtain a copy of the License at
mbed_official 579:53297373a894 7 *
mbed_official 579:53297373a894 8 * http://www.apache.org/licenses/LICENSE-2.0
mbed_official 579:53297373a894 9 *
mbed_official 579:53297373a894 10 * Unless required by applicable law or agreed to in writing, software
mbed_official 579:53297373a894 11 * distributed under the License is distributed on an "AS IS" BASIS,
mbed_official 579:53297373a894 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbed_official 579:53297373a894 13 * See the License for the specific language governing permissions and
mbed_official 579:53297373a894 14 * limitations under the License.
mbed_official 579:53297373a894 15 */
mbed_official 579:53297373a894 16 #ifndef MBED_OBJECTS_H
mbed_official 579:53297373a894 17 #define MBED_OBJECTS_H
mbed_official 579:53297373a894 18
mbed_official 579:53297373a894 19 #include "cmsis.h"
mbed_official 579:53297373a894 20 #include "PortNames.h"
mbed_official 579:53297373a894 21 #include "PeripheralNames.h"
mbed_official 579:53297373a894 22 #include "gpio_object.h"
mbed_official 592:a274ee790e56 23 #include "adc.h"
mbed_official 592:a274ee790e56 24 #include "extint.h"
mbed_official 579:53297373a894 25
mbed_official 579:53297373a894 26 #ifdef __cplusplus
mbed_official 579:53297373a894 27 extern "C" {
mbed_official 579:53297373a894 28 #endif
mbed_official 579:53297373a894 29
mbed_official 579:53297373a894 30 struct gpio_irq_s {
mbed_official 592:a274ee790e56 31 uint8_t irqmask;
mbed_official 579:53297373a894 32 uint32_t port;
mbed_official 579:53297373a894 33 uint32_t pin;
mbed_official 579:53297373a894 34 uint32_t ch;
mbed_official 592:a274ee790e56 35 struct extint_chan_conf config_extint_chan;
mbed_official 579:53297373a894 36 };
mbed_official 579:53297373a894 37
mbed_official 579:53297373a894 38 struct port_s {
mbed_official 579:53297373a894 39 __IO uint32_t *OUTCLR;
mbed_official 579:53297373a894 40 __IO uint32_t *OUTSET;
mbed_official 579:53297373a894 41 __I uint32_t *IN;
mbed_official 592:a274ee790e56 42 __I uint32_t *OUT;
mbed_official 579:53297373a894 43
mbed_official 579:53297373a894 44 PortName port;
mbed_official 579:53297373a894 45 uint32_t mask;
mbed_official 579:53297373a894 46 };
mbed_official 579:53297373a894 47
mbed_official 579:53297373a894 48 struct serial_s {
mbed_official 579:53297373a894 49 Sercom *usart;
mbed_official 579:53297373a894 50 uint32_t index;
mbed_official 579:53297373a894 51 uint32_t parity;
mbed_official 579:53297373a894 52 uint32_t stopbits;
mbed_official 579:53297373a894 53 uint32_t character_size;
mbed_official 579:53297373a894 54 uint32_t mux_setting;
mbed_official 579:53297373a894 55 uint32_t baudrate;
mbed_official 592:a274ee790e56 56 PinName pins[4];
mbed_official 579:53297373a894 57 #if DEVICE_SERIAL_ASYNCH
mbed_official 579:53297373a894 58 uint32_t events;
mbed_official 579:53297373a894 59 #endif
mbed_official 579:53297373a894 60 };
mbed_official 592:a274ee790e56 61
mbed_official 592:a274ee790e56 62 struct analogin_s {
mbed_official 592:a274ee790e56 63 ADCName adc;
mbed_official 592:a274ee790e56 64 struct adc_module adc_instance;
mbed_official 592:a274ee790e56 65 struct adc_config config_adc;
mbed_official 592:a274ee790e56 66 };
mbed_official 579:53297373a894 67 /*
mbed_official 579:53297373a894 68 struct pwmout_s {
mbed_official 579:53297373a894 69 __IO uint32_t *MR;
mbed_official 579:53297373a894 70 PWMName pwm;
mbed_official 579:53297373a894 71 };
mbed_official 579:53297373a894 72
mbed_official 579:53297373a894 73 struct serial_s {
mbed_official 579:53297373a894 74 LPC_UART_TypeDef *uart;
mbed_official 579:53297373a894 75 int index;
mbed_official 579:53297373a894 76 };
mbed_official 579:53297373a894 77
mbed_official 579:53297373a894 78 struct dac_s {
mbed_official 579:53297373a894 79 DACName dac;
mbed_official 579:53297373a894 80 };
mbed_official 579:53297373a894 81
mbed_official 579:53297373a894 82 struct can_s {
mbed_official 579:53297373a894 83 LPC_CAN_TypeDef *dev;
mbed_official 579:53297373a894 84 int index;
mbed_official 579:53297373a894 85 };
mbed_official 579:53297373a894 86
mbed_official 579:53297373a894 87 struct i2c_s {
mbed_official 579:53297373a894 88 LPC_I2C_TypeDef *i2c;
mbed_official 579:53297373a894 89 };
mbed_official 579:53297373a894 90 */
mbed_official 579:53297373a894 91
mbed_official 579:53297373a894 92 struct spi_s {
mbed_official 579:53297373a894 93 Sercom *spi;
mbed_official 579:53297373a894 94 uint8_t mode;
mbed_official 592:a274ee790e56 95 PinName pins[4];
mbed_official 579:53297373a894 96 #if DEVICE_SPI_ASYNCH
mbed_official 579:53297373a894 97 uint8_t status;
mbed_official 579:53297373a894 98 uint32_t mask;
mbed_official 579:53297373a894 99 uint32_t event;
mbed_official 579:53297373a894 100 void *tx_buffer;
mbed_official 579:53297373a894 101 void *rx_buffer;
mbed_official 579:53297373a894 102 uint8_t dma_usage;
mbed_official 579:53297373a894 103 #endif
mbed_official 579:53297373a894 104 };
mbed_official 579:53297373a894 105
mbed_official 579:53297373a894 106 #ifdef __cplusplus
mbed_official 579:53297373a894 107 }
mbed_official 579:53297373a894 108 #endif
mbed_official 579:53297373a894 109
mbed_official 579:53297373a894 110 #endif