Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_B96B_F446VE/objects.h@69:41db872bbc3a, 2016-02-22 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Feb 22 13:15:10 2016 +0000
- Revision:
- 69:41db872bbc3a
- Parent:
- 60:6e6ed0527880
- Child:
- 75:245e7931bad6
Synchronized with git revision 028465a9b8e42300bf0eb1b362f8f474f40fae9b
Full URL: https://github.com/mbedmicro/mbed/commit/028465a9b8e42300bf0eb1b362f8f474f40fae9b/
Use only the index, not the UARTName any more.
In case of app with 2 serial (using DMA) + 1 serial (stdio), we have found a bug. The dma handler is overwritten by the last initialized serial object.
Therefore read and write functions did not work anymore.
We have reworked this file to save 1 handler per UART IP, and align it with MBED OS file.
Tests have been passed. Same status as before (OK except MBED_37, manual test for SERIAL_ASYNC also OK).
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mbed_official | 45:faebcbaa5f6d | 1 | /* mbed Microcontroller Library |
| mbed_official | 45:faebcbaa5f6d | 2 | ******************************************************************************* |
| mbed_official | 45:faebcbaa5f6d | 3 | * Copyright (c) 2015, STMicroelectronics |
| mbed_official | 45:faebcbaa5f6d | 4 | * All rights reserved. |
| mbed_official | 45:faebcbaa5f6d | 5 | * |
| mbed_official | 45:faebcbaa5f6d | 6 | * Redistribution and use in source and binary forms, with or without |
| mbed_official | 45:faebcbaa5f6d | 7 | * modification, are permitted provided that the following conditions are met: |
| mbed_official | 45:faebcbaa5f6d | 8 | * |
| mbed_official | 45:faebcbaa5f6d | 9 | * 1. Redistributions of source code must retain the above copyright notice, |
| mbed_official | 45:faebcbaa5f6d | 10 | * this list of conditions and the following disclaimer. |
| mbed_official | 45:faebcbaa5f6d | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| mbed_official | 45:faebcbaa5f6d | 12 | * this list of conditions and the following disclaimer in the documentation |
| mbed_official | 45:faebcbaa5f6d | 13 | * and/or other materials provided with the distribution. |
| mbed_official | 45:faebcbaa5f6d | 14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| mbed_official | 45:faebcbaa5f6d | 15 | * may be used to endorse or promote products derived from this software |
| mbed_official | 45:faebcbaa5f6d | 16 | * without specific prior written permission. |
| mbed_official | 45:faebcbaa5f6d | 17 | * |
| mbed_official | 45:faebcbaa5f6d | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| mbed_official | 45:faebcbaa5f6d | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| mbed_official | 45:faebcbaa5f6d | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| mbed_official | 45:faebcbaa5f6d | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| mbed_official | 45:faebcbaa5f6d | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| mbed_official | 45:faebcbaa5f6d | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| mbed_official | 45:faebcbaa5f6d | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| mbed_official | 45:faebcbaa5f6d | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| mbed_official | 45:faebcbaa5f6d | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| mbed_official | 45:faebcbaa5f6d | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| mbed_official | 45:faebcbaa5f6d | 28 | ******************************************************************************* |
| mbed_official | 45:faebcbaa5f6d | 29 | */ |
| mbed_official | 45:faebcbaa5f6d | 30 | #ifndef MBED_OBJECTS_H |
| mbed_official | 45:faebcbaa5f6d | 31 | #define MBED_OBJECTS_H |
| mbed_official | 45:faebcbaa5f6d | 32 | |
| mbed_official | 45:faebcbaa5f6d | 33 | #include "cmsis.h" |
| mbed_official | 45:faebcbaa5f6d | 34 | #include "PortNames.h" |
| mbed_official | 45:faebcbaa5f6d | 35 | #include "PeripheralNames.h" |
| mbed_official | 45:faebcbaa5f6d | 36 | #include "PinNames.h" |
| mbed_official | 45:faebcbaa5f6d | 37 | |
| mbed_official | 45:faebcbaa5f6d | 38 | #ifdef __cplusplus |
| mbed_official | 45:faebcbaa5f6d | 39 | extern "C" { |
| mbed_official | 45:faebcbaa5f6d | 40 | #endif |
| mbed_official | 45:faebcbaa5f6d | 41 | |
| mbed_official | 45:faebcbaa5f6d | 42 | struct gpio_irq_s { |
| mbed_official | 45:faebcbaa5f6d | 43 | IRQn_Type irq_n; |
| mbed_official | 45:faebcbaa5f6d | 44 | uint32_t irq_index; |
| mbed_official | 45:faebcbaa5f6d | 45 | uint32_t event; |
| mbed_official | 45:faebcbaa5f6d | 46 | PinName pin; |
| mbed_official | 45:faebcbaa5f6d | 47 | }; |
| mbed_official | 45:faebcbaa5f6d | 48 | |
| mbed_official | 45:faebcbaa5f6d | 49 | struct port_s { |
| mbed_official | 45:faebcbaa5f6d | 50 | PortName port; |
| mbed_official | 45:faebcbaa5f6d | 51 | uint32_t mask; |
| mbed_official | 45:faebcbaa5f6d | 52 | PinDirection direction; |
| mbed_official | 45:faebcbaa5f6d | 53 | __IO uint32_t *reg_in; |
| mbed_official | 45:faebcbaa5f6d | 54 | __IO uint32_t *reg_out; |
| mbed_official | 45:faebcbaa5f6d | 55 | }; |
| mbed_official | 45:faebcbaa5f6d | 56 | |
| mbed_official | 45:faebcbaa5f6d | 57 | struct analogin_s { |
| mbed_official | 45:faebcbaa5f6d | 58 | ADCName adc; |
| mbed_official | 45:faebcbaa5f6d | 59 | PinName pin; |
| mbed_official | 45:faebcbaa5f6d | 60 | uint8_t channel; |
| mbed_official | 45:faebcbaa5f6d | 61 | }; |
| mbed_official | 45:faebcbaa5f6d | 62 | |
| mbed_official | 45:faebcbaa5f6d | 63 | struct dac_s { |
| mbed_official | 45:faebcbaa5f6d | 64 | DACName dac; |
| mbed_official | 45:faebcbaa5f6d | 65 | uint8_t channel; |
| mbed_official | 45:faebcbaa5f6d | 66 | }; |
| mbed_official | 45:faebcbaa5f6d | 67 | |
| mbed_official | 45:faebcbaa5f6d | 68 | struct serial_s { |
| mbed_official | 69:41db872bbc3a | 69 | int index; |
| mbed_official | 45:faebcbaa5f6d | 70 | uint32_t baudrate; |
| mbed_official | 45:faebcbaa5f6d | 71 | uint32_t databits; |
| mbed_official | 45:faebcbaa5f6d | 72 | uint32_t stopbits; |
| mbed_official | 45:faebcbaa5f6d | 73 | uint32_t parity; |
| mbed_official | 45:faebcbaa5f6d | 74 | PinName pin_tx; |
| mbed_official | 45:faebcbaa5f6d | 75 | PinName pin_rx; |
| mbed_official | 55:814265bf5462 | 76 | #if DEVICE_SERIAL_ASYNCH |
| mbed_official | 55:814265bf5462 | 77 | uint32_t events; |
| mbed_official | 55:814265bf5462 | 78 | #endif |
| mbed_official | 60:6e6ed0527880 | 79 | #if DEVICE_SERIAL_FC |
| mbed_official | 60:6e6ed0527880 | 80 | uint32_t hw_flow_ctl; |
| mbed_official | 60:6e6ed0527880 | 81 | PinName pin_rts; |
| mbed_official | 60:6e6ed0527880 | 82 | PinName pin_cts; |
| mbed_official | 60:6e6ed0527880 | 83 | #endif |
| mbed_official | 45:faebcbaa5f6d | 84 | }; |
| mbed_official | 45:faebcbaa5f6d | 85 | |
| mbed_official | 45:faebcbaa5f6d | 86 | struct spi_s { |
| mbed_official | 45:faebcbaa5f6d | 87 | SPIName spi; |
| mbed_official | 45:faebcbaa5f6d | 88 | uint32_t bits; |
| mbed_official | 45:faebcbaa5f6d | 89 | uint32_t cpol; |
| mbed_official | 45:faebcbaa5f6d | 90 | uint32_t cpha; |
| mbed_official | 45:faebcbaa5f6d | 91 | uint32_t mode; |
| mbed_official | 45:faebcbaa5f6d | 92 | uint32_t nss; |
| mbed_official | 45:faebcbaa5f6d | 93 | uint32_t br_presc; |
| mbed_official | 45:faebcbaa5f6d | 94 | PinName pin_miso; |
| mbed_official | 45:faebcbaa5f6d | 95 | PinName pin_mosi; |
| mbed_official | 45:faebcbaa5f6d | 96 | PinName pin_sclk; |
| mbed_official | 45:faebcbaa5f6d | 97 | PinName pin_ssel; |
| mbed_official | 45:faebcbaa5f6d | 98 | }; |
| mbed_official | 45:faebcbaa5f6d | 99 | |
| mbed_official | 45:faebcbaa5f6d | 100 | struct i2c_s { |
| mbed_official | 45:faebcbaa5f6d | 101 | I2CName i2c; |
| mbed_official | 45:faebcbaa5f6d | 102 | uint32_t slave; |
| mbed_official | 45:faebcbaa5f6d | 103 | }; |
| mbed_official | 45:faebcbaa5f6d | 104 | |
| mbed_official | 45:faebcbaa5f6d | 105 | struct pwmout_s { |
| mbed_official | 45:faebcbaa5f6d | 106 | PWMName pwm; |
| mbed_official | 45:faebcbaa5f6d | 107 | PinName pin; |
| mbed_official | 45:faebcbaa5f6d | 108 | uint32_t period; |
| mbed_official | 45:faebcbaa5f6d | 109 | uint32_t pulse; |
| mbed_official | 45:faebcbaa5f6d | 110 | uint8_t channel; |
| mbed_official | 45:faebcbaa5f6d | 111 | uint8_t inverted; |
| mbed_official | 45:faebcbaa5f6d | 112 | }; |
| mbed_official | 45:faebcbaa5f6d | 113 | |
| mbed_official | 45:faebcbaa5f6d | 114 | #include "gpio_object.h" |
| mbed_official | 45:faebcbaa5f6d | 115 | |
| mbed_official | 45:faebcbaa5f6d | 116 | #ifdef __cplusplus |
| mbed_official | 45:faebcbaa5f6d | 117 | } |
| mbed_official | 45:faebcbaa5f6d | 118 | #endif |
| mbed_official | 45:faebcbaa5f6d | 119 | |
| mbed_official | 45:faebcbaa5f6d | 120 | #endif |


