meh
Fork of mbed by
TARGET_NUCLEO_F334R8/TARGET_STM/TARGET_NUCLEO_F334R8/objects.h@86:04dd9b1680ae, 2014-07-02 (annotated)
- Committer:
- bogdanm
- Date:
- Wed Jul 02 13:22:23 2014 +0100
- Revision:
- 86:04dd9b1680ae
Release 86 of the mbed library
Main changes:
- bug fixes in various backends
- mbed "error" replaced by assert logic (mbed_assert)
- new ST Nucleo targets
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 86:04dd9b1680ae | 1 | /* mbed Microcontroller Library |
bogdanm | 86:04dd9b1680ae | 2 | ******************************************************************************* |
bogdanm | 86:04dd9b1680ae | 3 | * Copyright (c) 2014, STMicroelectronics |
bogdanm | 86:04dd9b1680ae | 4 | * All rights reserved. |
bogdanm | 86:04dd9b1680ae | 5 | * |
bogdanm | 86:04dd9b1680ae | 6 | * Redistribution and use in source and binary forms, with or without |
bogdanm | 86:04dd9b1680ae | 7 | * modification, are permitted provided that the following conditions are met: |
bogdanm | 86:04dd9b1680ae | 8 | * |
bogdanm | 86:04dd9b1680ae | 9 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 86:04dd9b1680ae | 10 | * this list of conditions and the following disclaimer. |
bogdanm | 86:04dd9b1680ae | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 86:04dd9b1680ae | 12 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 86:04dd9b1680ae | 13 | * and/or other materials provided with the distribution. |
bogdanm | 86:04dd9b1680ae | 14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 86:04dd9b1680ae | 15 | * may be used to endorse or promote products derived from this software |
bogdanm | 86:04dd9b1680ae | 16 | * without specific prior written permission. |
bogdanm | 86:04dd9b1680ae | 17 | * |
bogdanm | 86:04dd9b1680ae | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 86:04dd9b1680ae | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 86:04dd9b1680ae | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 86:04dd9b1680ae | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 86:04dd9b1680ae | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 86:04dd9b1680ae | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 86:04dd9b1680ae | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 86:04dd9b1680ae | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 86:04dd9b1680ae | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 86:04dd9b1680ae | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 86:04dd9b1680ae | 28 | ******************************************************************************* |
bogdanm | 86:04dd9b1680ae | 29 | */ |
bogdanm | 86:04dd9b1680ae | 30 | #ifndef MBED_OBJECTS_H |
bogdanm | 86:04dd9b1680ae | 31 | #define MBED_OBJECTS_H |
bogdanm | 86:04dd9b1680ae | 32 | |
bogdanm | 86:04dd9b1680ae | 33 | #include "cmsis.h" |
bogdanm | 86:04dd9b1680ae | 34 | #include "PortNames.h" |
bogdanm | 86:04dd9b1680ae | 35 | #include "PeripheralNames.h" |
bogdanm | 86:04dd9b1680ae | 36 | #include "PinNames.h" |
bogdanm | 86:04dd9b1680ae | 37 | |
bogdanm | 86:04dd9b1680ae | 38 | #ifdef __cplusplus |
bogdanm | 86:04dd9b1680ae | 39 | extern "C" { |
bogdanm | 86:04dd9b1680ae | 40 | #endif |
bogdanm | 86:04dd9b1680ae | 41 | |
bogdanm | 86:04dd9b1680ae | 42 | struct gpio_irq_s { |
bogdanm | 86:04dd9b1680ae | 43 | IRQn_Type irq_n; |
bogdanm | 86:04dd9b1680ae | 44 | uint32_t irq_index; |
bogdanm | 86:04dd9b1680ae | 45 | uint32_t event; |
bogdanm | 86:04dd9b1680ae | 46 | PinName pin; |
bogdanm | 86:04dd9b1680ae | 47 | }; |
bogdanm | 86:04dd9b1680ae | 48 | |
bogdanm | 86:04dd9b1680ae | 49 | struct port_s { |
bogdanm | 86:04dd9b1680ae | 50 | PortName port; |
bogdanm | 86:04dd9b1680ae | 51 | uint32_t mask; |
bogdanm | 86:04dd9b1680ae | 52 | PinDirection direction; |
bogdanm | 86:04dd9b1680ae | 53 | __IO uint32_t *reg_in; |
bogdanm | 86:04dd9b1680ae | 54 | __IO uint32_t *reg_out; |
bogdanm | 86:04dd9b1680ae | 55 | }; |
bogdanm | 86:04dd9b1680ae | 56 | |
bogdanm | 86:04dd9b1680ae | 57 | struct analogin_s { |
bogdanm | 86:04dd9b1680ae | 58 | ADCName adc; |
bogdanm | 86:04dd9b1680ae | 59 | PinName pin; |
bogdanm | 86:04dd9b1680ae | 60 | }; |
bogdanm | 86:04dd9b1680ae | 61 | |
bogdanm | 86:04dd9b1680ae | 62 | struct dac_s { |
bogdanm | 86:04dd9b1680ae | 63 | DACName dac; |
bogdanm | 86:04dd9b1680ae | 64 | PinName pin; |
bogdanm | 86:04dd9b1680ae | 65 | }; |
bogdanm | 86:04dd9b1680ae | 66 | |
bogdanm | 86:04dd9b1680ae | 67 | struct serial_s { |
bogdanm | 86:04dd9b1680ae | 68 | UARTName uart; |
bogdanm | 86:04dd9b1680ae | 69 | int index; // Used by irq |
bogdanm | 86:04dd9b1680ae | 70 | uint32_t baudrate; |
bogdanm | 86:04dd9b1680ae | 71 | uint32_t databits; |
bogdanm | 86:04dd9b1680ae | 72 | uint32_t stopbits; |
bogdanm | 86:04dd9b1680ae | 73 | uint32_t parity; |
bogdanm | 86:04dd9b1680ae | 74 | PinName pin_tx; |
bogdanm | 86:04dd9b1680ae | 75 | PinName pin_rx; |
bogdanm | 86:04dd9b1680ae | 76 | }; |
bogdanm | 86:04dd9b1680ae | 77 | |
bogdanm | 86:04dd9b1680ae | 78 | struct spi_s { |
bogdanm | 86:04dd9b1680ae | 79 | SPIName spi; |
bogdanm | 86:04dd9b1680ae | 80 | uint32_t bits; |
bogdanm | 86:04dd9b1680ae | 81 | uint32_t cpol; |
bogdanm | 86:04dd9b1680ae | 82 | uint32_t cpha; |
bogdanm | 86:04dd9b1680ae | 83 | uint32_t mode; |
bogdanm | 86:04dd9b1680ae | 84 | uint32_t nss; |
bogdanm | 86:04dd9b1680ae | 85 | uint32_t br_presc; |
bogdanm | 86:04dd9b1680ae | 86 | PinName pin_miso; |
bogdanm | 86:04dd9b1680ae | 87 | PinName pin_mosi; |
bogdanm | 86:04dd9b1680ae | 88 | PinName pin_sclk; |
bogdanm | 86:04dd9b1680ae | 89 | PinName pin_ssel; |
bogdanm | 86:04dd9b1680ae | 90 | }; |
bogdanm | 86:04dd9b1680ae | 91 | |
bogdanm | 86:04dd9b1680ae | 92 | struct i2c_s { |
bogdanm | 86:04dd9b1680ae | 93 | I2CName i2c; |
bogdanm | 86:04dd9b1680ae | 94 | uint32_t slave; |
bogdanm | 86:04dd9b1680ae | 95 | }; |
bogdanm | 86:04dd9b1680ae | 96 | |
bogdanm | 86:04dd9b1680ae | 97 | struct pwmout_s { |
bogdanm | 86:04dd9b1680ae | 98 | PWMName pwm; |
bogdanm | 86:04dd9b1680ae | 99 | PinName pin; |
bogdanm | 86:04dd9b1680ae | 100 | uint32_t period; |
bogdanm | 86:04dd9b1680ae | 101 | uint32_t pulse; |
bogdanm | 86:04dd9b1680ae | 102 | }; |
bogdanm | 86:04dd9b1680ae | 103 | |
bogdanm | 86:04dd9b1680ae | 104 | #include "gpio_object.h" |
bogdanm | 86:04dd9b1680ae | 105 | |
bogdanm | 86:04dd9b1680ae | 106 | #ifdef __cplusplus |
bogdanm | 86:04dd9b1680ae | 107 | } |
bogdanm | 86:04dd9b1680ae | 108 | #endif |
bogdanm | 86:04dd9b1680ae | 109 | |
bogdanm | 86:04dd9b1680ae | 110 | #endif |