mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
181:57724642e740
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew 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_OBJECTS_H
<> 149:156823d33999 31 #define MBED_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 gpio_irq_s {
<> 149:156823d33999 43 IRQn_Type irq_n;
<> 149:156823d33999 44 uint32_t irq_index;
<> 149:156823d33999 45 uint32_t event;
<> 149:156823d33999 46 PinName pin;
<> 149:156823d33999 47 };
<> 149:156823d33999 48
<> 149:156823d33999 49 struct port_s {
<> 149:156823d33999 50 PortName port;
<> 149:156823d33999 51 uint32_t mask;
<> 149:156823d33999 52 PinDirection direction;
<> 149:156823d33999 53 __IO uint32_t *reg_in;
<> 149:156823d33999 54 __IO uint32_t *reg_out;
<> 149:156823d33999 55 };
<> 149:156823d33999 56
<> 149:156823d33999 57 struct analogin_s {
AnnaBridge 171:89b338f31ef1 58 ADC_HandleTypeDef handle;
<> 149:156823d33999 59 PinName pin;
<> 149:156823d33999 60 uint8_t channel;
<> 149:156823d33999 61 };
<> 149:156823d33999 62
<> 149:156823d33999 63 struct dac_s {
<> 149:156823d33999 64 DACName dac;
AnnaBridge 177:d650f5d4c87a 65 PinName pin;
AnnaBridge 177:d650f5d4c87a 66 uint32_t channel;
AnnaBridge 168:9672193075cf 67 DAC_HandleTypeDef handle;
<> 149:156823d33999 68 };
<> 149:156823d33999 69
<> 149:156823d33999 70 struct serial_s {
<> 149:156823d33999 71 UARTName uart;
<> 149:156823d33999 72 int index; // Used by irq
<> 149:156823d33999 73 uint32_t baudrate;
<> 149:156823d33999 74 uint32_t databits;
<> 149:156823d33999 75 uint32_t stopbits;
<> 149:156823d33999 76 uint32_t parity;
<> 149:156823d33999 77 PinName pin_tx;
<> 149:156823d33999 78 PinName pin_rx;
<> 149:156823d33999 79 #if DEVICE_SERIAL_ASYNCH
<> 149:156823d33999 80 uint32_t events;
<> 149:156823d33999 81 #endif
<> 149:156823d33999 82 #if DEVICE_SERIAL_FC
<> 149:156823d33999 83 uint32_t hw_flow_ctl;
<> 149:156823d33999 84 PinName pin_rts;
<> 149:156823d33999 85 PinName pin_cts;
<> 149:156823d33999 86 #endif
<> 149:156823d33999 87 };
<> 149:156823d33999 88
<> 149:156823d33999 89 struct spi_s {
<> 149:156823d33999 90 SPI_HandleTypeDef handle;
<> 149:156823d33999 91 IRQn_Type spiIRQ;
<> 149:156823d33999 92 SPIName spi;
<> 149:156823d33999 93 PinName pin_miso;
<> 149:156823d33999 94 PinName pin_mosi;
<> 149:156823d33999 95 PinName pin_sclk;
<> 149:156823d33999 96 PinName pin_ssel;
AnnaBridge 189:f392fc9709a3 97 #if DEVICE_SPI_ASYNCH
<> 149:156823d33999 98 uint32_t event;
<> 149:156823d33999 99 uint8_t transfer_type;
<> 149:156823d33999 100 #endif
<> 149:156823d33999 101 };
<> 149:156823d33999 102
<> 149:156823d33999 103 struct i2c_s {
<> 153:fa9ff456f731 104 /* The 1st 2 members I2CName i2c
<> 153:fa9ff456f731 105 * and I2C_HandleTypeDef handle should
<> 153:fa9ff456f731 106 * be kept as the first members of this struct
<> 153:fa9ff456f731 107 */
<> 149:156823d33999 108 I2CName i2c;
<> 153:fa9ff456f731 109 I2C_HandleTypeDef handle;
<> 153:fa9ff456f731 110 uint8_t index;
<> 153:fa9ff456f731 111 int hz;
<> 153:fa9ff456f731 112 PinName sda;
<> 153:fa9ff456f731 113 PinName scl;
<> 153:fa9ff456f731 114 IRQn_Type event_i2cIRQ;
<> 153:fa9ff456f731 115 IRQn_Type error_i2cIRQ;
<> 153:fa9ff456f731 116 uint8_t XferOperation;
<> 153:fa9ff456f731 117 volatile uint8_t event;
<> 153:fa9ff456f731 118 #if DEVICE_I2CSLAVE
<> 153:fa9ff456f731 119 uint8_t slave;
<> 153:fa9ff456f731 120 volatile uint8_t pending_slave_tx_master_rx;
<> 153:fa9ff456f731 121 volatile uint8_t pending_slave_rx_maxter_tx;
<> 153:fa9ff456f731 122 #endif
<> 153:fa9ff456f731 123 #if DEVICE_I2C_ASYNCH
<> 153:fa9ff456f731 124 uint32_t address;
<> 153:fa9ff456f731 125 uint8_t stop;
<> 153:fa9ff456f731 126 uint8_t available_events;
<> 153:fa9ff456f731 127 #endif
<> 149:156823d33999 128 };
<> 149:156823d33999 129
<> 149:156823d33999 130 struct pwmout_s {
<> 149:156823d33999 131 PWMName pwm;
<> 149:156823d33999 132 PinName pin;
<> 160:d5399cc887bb 133 uint32_t prescaler;
<> 149:156823d33999 134 uint32_t period;
<> 149:156823d33999 135 uint32_t pulse;
<> 149:156823d33999 136 uint8_t channel;
<> 149:156823d33999 137 uint8_t inverted;
<> 149:156823d33999 138 };
<> 149:156823d33999 139
AnnaBridge 189:f392fc9709a3 140 #if DEVICE_CAN
<> 149:156823d33999 141 struct can_s {
AnnaBridge 174:b96e65c34a4d 142 CAN_HandleTypeDef CanHandle;
<> 149:156823d33999 143 int index;
AnnaBridge 174:b96e65c34a4d 144 int hz;
<> 149:156823d33999 145 };
AnnaBridge 174:b96e65c34a4d 146 #endif
<> 149:156823d33999 147
AnnaBridge 189:f392fc9709a3 148 struct trng_s {
AnnaBridge 189:f392fc9709a3 149 RNG_HandleTypeDef handle;
AnnaBridge 189:f392fc9709a3 150 };
AnnaBridge 189:f392fc9709a3 151
AnnaBridge 181:57724642e740 152 #if DEVICE_FLASH
AnnaBridge 181:57724642e740 153 struct flash_s {
AnnaBridge 181:57724642e740 154 /* nothing to be stored for now */
AnnaBridge 181:57724642e740 155 uint32_t dummy;
AnnaBridge 181:57724642e740 156 };
AnnaBridge 181:57724642e740 157 #endif
AnnaBridge 181:57724642e740 158
<> 157:ff67d9f36b67 159 #define GPIO_IP_WITHOUT_BRR
<> 149:156823d33999 160 #include "gpio_object.h"
<> 149:156823d33999 161
<> 149:156823d33999 162 #ifdef __cplusplus
<> 149:156823d33999 163 }
<> 149:156823d33999 164 #endif
<> 149:156823d33999 165
<> 149:156823d33999 166 #endif