t
Fork of mbed-dev by
targets/TARGET_Atmel/TARGET_SAM_CortexM0P/objects.h@178:c26431f84b0d, 2017-11-09 (annotated)
- Committer:
- amithy
- Date:
- Thu Nov 09 22:14:37 2017 +0000
- Revision:
- 178:c26431f84b0d
- Parent:
- 149:156823d33999
test export
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 15:a81a8d6c1dfe | 1 | /* mbed Microcontroller Library |
mbed_official | 15:a81a8d6c1dfe | 2 | * Copyright (c) 2006-2015 ARM Limited |
mbed_official | 15:a81a8d6c1dfe | 3 | * |
mbed_official | 15:a81a8d6c1dfe | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
mbed_official | 15:a81a8d6c1dfe | 5 | * you may not use this file except in compliance with the License. |
mbed_official | 15:a81a8d6c1dfe | 6 | * You may obtain a copy of the License at |
mbed_official | 15:a81a8d6c1dfe | 7 | * |
mbed_official | 15:a81a8d6c1dfe | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
mbed_official | 15:a81a8d6c1dfe | 9 | * |
mbed_official | 15:a81a8d6c1dfe | 10 | * Unless required by applicable law or agreed to in writing, software |
mbed_official | 15:a81a8d6c1dfe | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
mbed_official | 15:a81a8d6c1dfe | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbed_official | 15:a81a8d6c1dfe | 13 | * See the License for the specific language governing permissions and |
mbed_official | 15:a81a8d6c1dfe | 14 | * limitations under the License. |
mbed_official | 15:a81a8d6c1dfe | 15 | */ |
mbed_official | 15:a81a8d6c1dfe | 16 | #ifndef MBED_OBJECTS_H |
mbed_official | 15:a81a8d6c1dfe | 17 | #define MBED_OBJECTS_H |
mbed_official | 15:a81a8d6c1dfe | 18 | |
mbed_official | 15:a81a8d6c1dfe | 19 | #include "cmsis.h" |
mbed_official | 15:a81a8d6c1dfe | 20 | #include "PortNames.h" |
mbed_official | 15:a81a8d6c1dfe | 21 | #include "PeripheralNames.h" |
mbed_official | 15:a81a8d6c1dfe | 22 | #include "gpio_object.h" |
mbed_official | 15:a81a8d6c1dfe | 23 | #include "tc.h" |
mbed_official | 15:a81a8d6c1dfe | 24 | #include "tcc.h" |
mbed_official | 15:a81a8d6c1dfe | 25 | #include "adc.h" |
mbed_official | 15:a81a8d6c1dfe | 26 | #include "extint.h" |
mbed_official | 15:a81a8d6c1dfe | 27 | #include "i2c_master.h" |
mbed_official | 15:a81a8d6c1dfe | 28 | #include "i2c_slave.h" |
mbed_official | 15:a81a8d6c1dfe | 29 | #include "dma_api.h" |
mbed_official | 15:a81a8d6c1dfe | 30 | |
mbed_official | 15:a81a8d6c1dfe | 31 | #if DEVICE_ANALOGOUT |
mbed_official | 15:a81a8d6c1dfe | 32 | #include "dac.h" |
mbed_official | 15:a81a8d6c1dfe | 33 | #endif |
mbed_official | 15:a81a8d6c1dfe | 34 | |
mbed_official | 15:a81a8d6c1dfe | 35 | #ifdef __cplusplus |
mbed_official | 15:a81a8d6c1dfe | 36 | extern "C" { |
mbed_official | 15:a81a8d6c1dfe | 37 | #endif |
mbed_official | 15:a81a8d6c1dfe | 38 | |
mbed_official | 15:a81a8d6c1dfe | 39 | struct gpio_irq_s { |
mbed_official | 15:a81a8d6c1dfe | 40 | uint8_t irqmask; |
mbed_official | 15:a81a8d6c1dfe | 41 | uint32_t port; |
mbed_official | 15:a81a8d6c1dfe | 42 | uint32_t pin; |
mbed_official | 15:a81a8d6c1dfe | 43 | uint32_t ch; |
mbed_official | 15:a81a8d6c1dfe | 44 | struct extint_chan_conf config_extint_chan; |
mbed_official | 15:a81a8d6c1dfe | 45 | }; |
mbed_official | 15:a81a8d6c1dfe | 46 | |
mbed_official | 15:a81a8d6c1dfe | 47 | struct port_s { |
mbed_official | 15:a81a8d6c1dfe | 48 | __IO uint32_t *OUTCLR; |
mbed_official | 15:a81a8d6c1dfe | 49 | __IO uint32_t *OUTSET; |
mbed_official | 15:a81a8d6c1dfe | 50 | __I uint32_t *IN; |
mbed_official | 15:a81a8d6c1dfe | 51 | __I uint32_t *OUT; |
mbed_official | 15:a81a8d6c1dfe | 52 | |
mbed_official | 15:a81a8d6c1dfe | 53 | PortName port; |
mbed_official | 15:a81a8d6c1dfe | 54 | uint32_t mask; |
mbed_official | 15:a81a8d6c1dfe | 55 | uint8_t powersave; |
mbed_official | 15:a81a8d6c1dfe | 56 | uint8_t mode; |
mbed_official | 15:a81a8d6c1dfe | 57 | uint8_t direction; |
mbed_official | 15:a81a8d6c1dfe | 58 | }; |
mbed_official | 15:a81a8d6c1dfe | 59 | |
mbed_official | 15:a81a8d6c1dfe | 60 | struct serial_s { |
mbed_official | 15:a81a8d6c1dfe | 61 | Sercom *usart; |
mbed_official | 15:a81a8d6c1dfe | 62 | uint32_t index; |
mbed_official | 15:a81a8d6c1dfe | 63 | uint32_t parity; |
mbed_official | 15:a81a8d6c1dfe | 64 | uint32_t stopbits; |
mbed_official | 15:a81a8d6c1dfe | 65 | uint32_t character_size; |
mbed_official | 15:a81a8d6c1dfe | 66 | uint32_t mux_setting; |
mbed_official | 15:a81a8d6c1dfe | 67 | uint32_t baudrate; |
mbed_official | 15:a81a8d6c1dfe | 68 | PinName pins[4]; |
mbed_official | 15:a81a8d6c1dfe | 69 | #if DEVICE_SERIAL_ASYNCH |
mbed_official | 15:a81a8d6c1dfe | 70 | uint32_t events; |
mbed_official | 15:a81a8d6c1dfe | 71 | #endif |
mbed_official | 15:a81a8d6c1dfe | 72 | }; |
mbed_official | 15:a81a8d6c1dfe | 73 | |
mbed_official | 15:a81a8d6c1dfe | 74 | struct analogin_s { |
mbed_official | 15:a81a8d6c1dfe | 75 | ADCName adc; |
mbed_official | 15:a81a8d6c1dfe | 76 | struct adc_config config_adc; |
mbed_official | 15:a81a8d6c1dfe | 77 | }; |
mbed_official | 15:a81a8d6c1dfe | 78 | |
mbed_official | 15:a81a8d6c1dfe | 79 | #if DEVICE_ANALOGOUT |
mbed_official | 15:a81a8d6c1dfe | 80 | struct dac_s { |
mbed_official | 15:a81a8d6c1dfe | 81 | DACName dac; |
mbed_official | 18:da299f395b9e | 82 | PinName pin; |
mbed_official | 18:da299f395b9e | 83 | uint32_t channel; |
mbed_official | 18:da299f395b9e | 84 | struct dac_module dac_instance; |
mbed_official | 15:a81a8d6c1dfe | 85 | }; |
mbed_official | 15:a81a8d6c1dfe | 86 | #endif |
mbed_official | 15:a81a8d6c1dfe | 87 | |
mbed_official | 15:a81a8d6c1dfe | 88 | struct pwmout_s { |
mbed_official | 15:a81a8d6c1dfe | 89 | struct tcc_module tcc; |
mbed_official | 15:a81a8d6c1dfe | 90 | PinName pin; |
mbed_official | 15:a81a8d6c1dfe | 91 | uint32_t period; |
mbed_official | 15:a81a8d6c1dfe | 92 | float duty_cycle; |
mbed_official | 15:a81a8d6c1dfe | 93 | double us_per_cycle; |
mbed_official | 15:a81a8d6c1dfe | 94 | enum gclk_generator clock_source; |
mbed_official | 15:a81a8d6c1dfe | 95 | enum tc_clock_prescaler clock_prescaler; |
mbed_official | 15:a81a8d6c1dfe | 96 | }; |
mbed_official | 15:a81a8d6c1dfe | 97 | |
mbed_official | 15:a81a8d6c1dfe | 98 | struct i2c_s { |
mbed_official | 15:a81a8d6c1dfe | 99 | struct i2c_master_module master; |
mbed_official | 15:a81a8d6c1dfe | 100 | struct i2c_slave_module slave; |
mbed_official | 15:a81a8d6c1dfe | 101 | uint8_t mode; |
mbed_official | 15:a81a8d6c1dfe | 102 | uint32_t baud_rate; |
mbed_official | 15:a81a8d6c1dfe | 103 | uint32_t baud_rate_high_speed; |
mbed_official | 15:a81a8d6c1dfe | 104 | uint8_t start_pending; |
mbed_official | 15:a81a8d6c1dfe | 105 | PinName pins[2]; |
mbed_official | 15:a81a8d6c1dfe | 106 | #if DEVICE_I2C_ASYNCH |
mbed_official | 15:a81a8d6c1dfe | 107 | uint32_t events; |
mbed_official | 15:a81a8d6c1dfe | 108 | uint32_t handler; |
mbed_official | 15:a81a8d6c1dfe | 109 | struct i2c_master_packet wr_packet; |
mbed_official | 15:a81a8d6c1dfe | 110 | struct i2c_master_packet rd_packet; |
mbed_official | 15:a81a8d6c1dfe | 111 | #endif |
mbed_official | 15:a81a8d6c1dfe | 112 | }; |
mbed_official | 15:a81a8d6c1dfe | 113 | |
mbed_official | 15:a81a8d6c1dfe | 114 | struct spi_s { |
mbed_official | 15:a81a8d6c1dfe | 115 | Sercom *spi; |
mbed_official | 15:a81a8d6c1dfe | 116 | uint8_t mode; |
mbed_official | 15:a81a8d6c1dfe | 117 | PinName pins[4]; |
mbed_official | 15:a81a8d6c1dfe | 118 | #if DEVICE_SPI_ASYNCH |
mbed_official | 15:a81a8d6c1dfe | 119 | uint8_t status; |
mbed_official | 15:a81a8d6c1dfe | 120 | uint32_t mask; |
mbed_official | 15:a81a8d6c1dfe | 121 | uint32_t event; |
mbed_official | 15:a81a8d6c1dfe | 122 | void *tx_buffer; |
mbed_official | 15:a81a8d6c1dfe | 123 | void *rx_buffer; |
mbed_official | 15:a81a8d6c1dfe | 124 | uint8_t dma_usage; |
mbed_official | 15:a81a8d6c1dfe | 125 | #endif |
mbed_official | 15:a81a8d6c1dfe | 126 | }; |
mbed_official | 15:a81a8d6c1dfe | 127 | |
mbed_official | 15:a81a8d6c1dfe | 128 | #ifdef __cplusplus |
mbed_official | 15:a81a8d6c1dfe | 129 | } |
mbed_official | 15:a81a8d6c1dfe | 130 | #endif |
mbed_official | 15:a81a8d6c1dfe | 131 | |
mbed_official | 15:a81a8d6c1dfe | 132 | #endif |