fixed drive strength
Fork of mbed-dev by
targets/TARGET_STM/TARGET_STM32F1/common_objects.h@154:37f96f9d4de2, 2017-01-04 (annotated)
- Committer:
- <>
- Date:
- Wed Jan 04 16:58:05 2017 +0000
- Revision:
- 154:37f96f9d4de2
- Parent:
- 153:fa9ff456f731
This updates the lib to the mbed lib v133
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 149:156823d33999 | 1 | /* mbed Microcontroller Library |
<> | 149:156823d33999 | 2 | ******************************************************************************* |
<> | 149:156823d33999 | 3 | * Copyright (c) 2016, STMicroelectronics |
<> | 149:156823d33999 | 4 | * All rights reserved. |
<> | 149:156823d33999 | 5 | * |
<> | 149:156823d33999 | 6 | * Redistribution and use in source and binary forms, with or without |
<> | 149:156823d33999 | 7 | * modification, are permitted provided that the following conditions are met: |
<> | 149:156823d33999 | 8 | * |
<> | 149:156823d33999 | 9 | * 1. Redistributions of source code must retain the above copyright notice, |
<> | 149:156823d33999 | 10 | * this list of conditions and the following disclaimer. |
<> | 149:156823d33999 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
<> | 149:156823d33999 | 12 | * this list of conditions and the following disclaimer in the documentation |
<> | 149:156823d33999 | 13 | * and/or other materials provided with the distribution. |
<> | 149:156823d33999 | 14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
<> | 149:156823d33999 | 15 | * may be used to endorse or promote products derived from this software |
<> | 149:156823d33999 | 16 | * without specific prior written permission. |
<> | 149:156823d33999 | 17 | * |
<> | 149:156823d33999 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
<> | 149:156823d33999 | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
<> | 149:156823d33999 | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
<> | 149:156823d33999 | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
<> | 149:156823d33999 | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
<> | 149:156823d33999 | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
<> | 149:156823d33999 | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
<> | 149:156823d33999 | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
<> | 149:156823d33999 | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
<> | 149:156823d33999 | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
<> | 149:156823d33999 | 28 | ******************************************************************************* |
<> | 149:156823d33999 | 29 | */ |
<> | 149:156823d33999 | 30 | #ifndef MBED_COMMON_OBJECTS_H |
<> | 149:156823d33999 | 31 | #define MBED_COMMON_OBJECTS_H |
<> | 149:156823d33999 | 32 | |
<> | 149:156823d33999 | 33 | #include "cmsis.h" |
<> | 149:156823d33999 | 34 | #include "PortNames.h" |
<> | 149:156823d33999 | 35 | #include "PeripheralNames.h" |
<> | 149:156823d33999 | 36 | #include "PinNames.h" |
<> | 149:156823d33999 | 37 | |
<> | 149:156823d33999 | 38 | #ifdef __cplusplus |
<> | 149:156823d33999 | 39 | extern "C" { |
<> | 149:156823d33999 | 40 | #endif |
<> | 149:156823d33999 | 41 | |
<> | 149:156823d33999 | 42 | struct pwmout_s { |
<> | 149:156823d33999 | 43 | PWMName pwm; |
<> | 149:156823d33999 | 44 | PinName pin; |
<> | 149:156823d33999 | 45 | uint32_t prescaler; |
<> | 149:156823d33999 | 46 | uint32_t period; |
<> | 149:156823d33999 | 47 | uint32_t pulse; |
<> | 149:156823d33999 | 48 | uint8_t channel; |
<> | 149:156823d33999 | 49 | uint8_t inverted; |
<> | 149:156823d33999 | 50 | }; |
<> | 149:156823d33999 | 51 | |
<> | 149:156823d33999 | 52 | struct serial_s { |
<> | 149:156823d33999 | 53 | UARTName uart; |
<> | 149:156823d33999 | 54 | int index; // Used by irq |
<> | 149:156823d33999 | 55 | uint32_t baudrate; |
<> | 149:156823d33999 | 56 | uint32_t databits; |
<> | 149:156823d33999 | 57 | uint32_t stopbits; |
<> | 149:156823d33999 | 58 | uint32_t parity; |
<> | 149:156823d33999 | 59 | PinName pin_tx; |
<> | 149:156823d33999 | 60 | PinName pin_rx; |
<> | 149:156823d33999 | 61 | #if DEVICE_SERIAL_ASYNCH |
<> | 149:156823d33999 | 62 | uint32_t events; |
<> | 149:156823d33999 | 63 | #endif |
<> | 149:156823d33999 | 64 | #if DEVICE_SERIAL_FC |
<> | 149:156823d33999 | 65 | uint32_t hw_flow_ctl; |
<> | 149:156823d33999 | 66 | PinName pin_rts; |
<> | 149:156823d33999 | 67 | PinName pin_cts; |
<> | 149:156823d33999 | 68 | #endif |
<> | 149:156823d33999 | 69 | }; |
<> | 149:156823d33999 | 70 | |
<> | 149:156823d33999 | 71 | struct spi_s { |
<> | 149:156823d33999 | 72 | SPI_HandleTypeDef handle; |
<> | 149:156823d33999 | 73 | IRQn_Type spiIRQ; |
<> | 149:156823d33999 | 74 | SPIName spi; |
<> | 149:156823d33999 | 75 | PinName pin_miso; |
<> | 149:156823d33999 | 76 | PinName pin_mosi; |
<> | 149:156823d33999 | 77 | PinName pin_sclk; |
<> | 149:156823d33999 | 78 | PinName pin_ssel; |
<> | 149:156823d33999 | 79 | #ifdef DEVICE_SPI_ASYNCH |
<> | 149:156823d33999 | 80 | uint32_t event; |
<> | 149:156823d33999 | 81 | uint8_t transfer_type; |
<> | 149:156823d33999 | 82 | #endif |
<> | 149:156823d33999 | 83 | }; |
<> | 149:156823d33999 | 84 | |
<> | 154:37f96f9d4de2 | 85 | struct i2c_s { |
<> | 154:37f96f9d4de2 | 86 | /* The 1st 2 members I2CName i2c |
<> | 154:37f96f9d4de2 | 87 | * and I2C_HandleTypeDef handle should |
<> | 154:37f96f9d4de2 | 88 | * be kept as the first members of this struct |
<> | 154:37f96f9d4de2 | 89 | * to ensure i2c_get_obj to work as expected |
<> | 154:37f96f9d4de2 | 90 | */ |
<> | 154:37f96f9d4de2 | 91 | I2CName i2c; |
<> | 154:37f96f9d4de2 | 92 | I2C_HandleTypeDef handle; |
<> | 154:37f96f9d4de2 | 93 | uint8_t index; |
<> | 154:37f96f9d4de2 | 94 | int hz; |
<> | 154:37f96f9d4de2 | 95 | PinName sda; |
<> | 154:37f96f9d4de2 | 96 | PinName scl; |
<> | 154:37f96f9d4de2 | 97 | IRQn_Type event_i2cIRQ; |
<> | 154:37f96f9d4de2 | 98 | IRQn_Type error_i2cIRQ; |
<> | 154:37f96f9d4de2 | 99 | uint32_t XferOperation; |
<> | 154:37f96f9d4de2 | 100 | volatile uint8_t event; |
<> | 154:37f96f9d4de2 | 101 | #if DEVICE_I2CSLAVE |
<> | 154:37f96f9d4de2 | 102 | uint8_t slave; |
<> | 154:37f96f9d4de2 | 103 | volatile uint8_t pending_slave_tx_master_rx; |
<> | 154:37f96f9d4de2 | 104 | volatile uint8_t pending_slave_rx_maxter_tx; |
<> | 154:37f96f9d4de2 | 105 | #endif |
<> | 154:37f96f9d4de2 | 106 | #if DEVICE_I2C_ASYNCH |
<> | 154:37f96f9d4de2 | 107 | uint32_t address; |
<> | 154:37f96f9d4de2 | 108 | uint8_t stop; |
<> | 154:37f96f9d4de2 | 109 | uint8_t available_events; |
<> | 154:37f96f9d4de2 | 110 | #endif |
<> | 154:37f96f9d4de2 | 111 | }; |
<> | 154:37f96f9d4de2 | 112 | |
<> | 149:156823d33999 | 113 | #include "gpio_object.h" |
<> | 149:156823d33999 | 114 | |
<> | 149:156823d33999 | 115 | #ifdef __cplusplus |
<> | 149:156823d33999 | 116 | } |
<> | 149:156823d33999 | 117 | #endif |
<> | 149:156823d33999 | 118 | |
<> | 154:37f96f9d4de2 | 119 | /* STM32F1 HAL doesn't provide this API called in rtc_api.c */ |
<> | 154:37f96f9d4de2 | 120 | #define __HAL_RCC_RTC_CLKPRESCALER(__RTCCLKSource__) |
<> | 154:37f96f9d4de2 | 121 | |
<> | 149:156823d33999 | 122 | #endif |
<> | 149:156823d33999 | 123 |