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:
187:0387e8f68319
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 187:0387e8f68319 1 /* mbed Microcontroller Library
AnnaBridge 187:0387e8f68319 2 * (C)Copyright TOSHIBA ELECTRONIC DEVICES & STORAGE CORPORATION 2018 All rights reserved
AnnaBridge 187:0387e8f68319 3 *
AnnaBridge 187:0387e8f68319 4 * Licensed under the Apache License, Version 2.0 (the "License");
AnnaBridge 187:0387e8f68319 5 * you may not use this file except in compliance with the License.
AnnaBridge 187:0387e8f68319 6 * You may obtain a copy of the License at
AnnaBridge 187:0387e8f68319 7 *
AnnaBridge 187:0387e8f68319 8 * http://www.apache.org/licenses/LICENSE-2.0
AnnaBridge 187:0387e8f68319 9 *
AnnaBridge 187:0387e8f68319 10 * Unless required by applicable law or agreed to in writing, software
AnnaBridge 187:0387e8f68319 11 * distributed under the License is distributed on an "AS IS" BASIS,
AnnaBridge 187:0387e8f68319 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AnnaBridge 187:0387e8f68319 13 * See the License for the specific language governing permissions and
AnnaBridge 187:0387e8f68319 14 * limitations under the License.
AnnaBridge 187:0387e8f68319 15 */
AnnaBridge 187:0387e8f68319 16 #ifndef MBED_OBJECTS_H
AnnaBridge 187:0387e8f68319 17 #define MBED_OBJECTS_H
AnnaBridge 187:0387e8f68319 18
AnnaBridge 187:0387e8f68319 19 #include <stddef.h>
AnnaBridge 187:0387e8f68319 20 #include "PortNames.h"
AnnaBridge 187:0387e8f68319 21 #include "PeripheralNames.h"
AnnaBridge 187:0387e8f68319 22 #include "txz_tspi.h"
AnnaBridge 187:0387e8f68319 23 #include "PinNames.h"
AnnaBridge 187:0387e8f68319 24 #include "TMPM3H6.h"
AnnaBridge 187:0387e8f68319 25 #include "gpio_include.h"
AnnaBridge 187:0387e8f68319 26
AnnaBridge 187:0387e8f68319 27 #ifdef __cplusplus
AnnaBridge 187:0387e8f68319 28 extern "C" {
AnnaBridge 187:0387e8f68319 29 #endif
AnnaBridge 187:0387e8f68319 30
AnnaBridge 187:0387e8f68319 31 typedef struct {
AnnaBridge 187:0387e8f68319 32 uint32_t BaudRate;
AnnaBridge 187:0387e8f68319 33 uint32_t DataBits;
AnnaBridge 187:0387e8f68319 34 uint32_t StopBits;
AnnaBridge 187:0387e8f68319 35 uint32_t Parity;
AnnaBridge 187:0387e8f68319 36 uint32_t Mode;
AnnaBridge 187:0387e8f68319 37 uint32_t FlowCtrl;
AnnaBridge 187:0387e8f68319 38 } uart_inittypedef_t;
AnnaBridge 187:0387e8f68319 39
AnnaBridge 187:0387e8f68319 40 struct port_s {
AnnaBridge 187:0387e8f68319 41 PortName port;
AnnaBridge 187:0387e8f68319 42 uint32_t mask;
AnnaBridge 187:0387e8f68319 43 };
AnnaBridge 187:0387e8f68319 44
AnnaBridge 187:0387e8f68319 45 typedef struct {
AnnaBridge 187:0387e8f68319 46 uint8_t PinDATA;
AnnaBridge 187:0387e8f68319 47 uint8_t PinCR;
AnnaBridge 187:0387e8f68319 48 uint8_t PinFR[6];
AnnaBridge 187:0387e8f68319 49 uint8_t PinOD;
AnnaBridge 187:0387e8f68319 50 uint8_t PinPUP;
AnnaBridge 187:0387e8f68319 51 uint8_t PinPDN;
AnnaBridge 187:0387e8f68319 52 uint8_t PinIE;
AnnaBridge 187:0387e8f68319 53 } gpio_regtypedef_t;
AnnaBridge 187:0387e8f68319 54
AnnaBridge 187:0387e8f68319 55 typedef struct {
AnnaBridge 187:0387e8f68319 56 __IO uint32_t DATA;
AnnaBridge 187:0387e8f68319 57 __IO uint32_t CR;
AnnaBridge 187:0387e8f68319 58 __IO uint32_t FR[6];
AnnaBridge 187:0387e8f68319 59 uint32_t RESERVED0[2];
AnnaBridge 187:0387e8f68319 60 __IO uint32_t OD;
AnnaBridge 187:0387e8f68319 61 __IO uint32_t PUP;
AnnaBridge 187:0387e8f68319 62 __IO uint32_t PDN;
AnnaBridge 187:0387e8f68319 63 uint32_t RESERVED1;
AnnaBridge 187:0387e8f68319 64 __IO uint32_t IE;
AnnaBridge 187:0387e8f68319 65 } TSB_Port_TypeDef;
AnnaBridge 187:0387e8f68319 66
AnnaBridge 187:0387e8f68319 67 struct serial_s {
AnnaBridge 187:0387e8f68319 68 PinName pin;
AnnaBridge 187:0387e8f68319 69 uint32_t index;
AnnaBridge 187:0387e8f68319 70 TSB_UART_TypeDef *UARTx;
AnnaBridge 187:0387e8f68319 71 uart_inittypedef_t uart_config;
AnnaBridge 187:0387e8f68319 72 };
AnnaBridge 187:0387e8f68319 73
AnnaBridge 187:0387e8f68319 74 struct analogin_s {
AnnaBridge 187:0387e8f68319 75 PinName pin;
AnnaBridge 187:0387e8f68319 76 ADCName adc;
AnnaBridge 187:0387e8f68319 77 TSB_AD_TypeDef *obj;
AnnaBridge 187:0387e8f68319 78 };
AnnaBridge 187:0387e8f68319 79
AnnaBridge 187:0387e8f68319 80 struct dac_s {
AnnaBridge 187:0387e8f68319 81 DACName dac;
AnnaBridge 187:0387e8f68319 82 TSB_DA_TypeDef *handler;
AnnaBridge 187:0387e8f68319 83 };
AnnaBridge 187:0387e8f68319 84
AnnaBridge 187:0387e8f68319 85 struct pwmout_s {
AnnaBridge 187:0387e8f68319 86 PinName pin;
AnnaBridge 187:0387e8f68319 87 TSB_T32A_TypeDef *channel;
AnnaBridge 187:0387e8f68319 88 uint16_t trailing_timing;
AnnaBridge 187:0387e8f68319 89 uint16_t leading_timing;
AnnaBridge 187:0387e8f68319 90 uint16_t divisor;
AnnaBridge 187:0387e8f68319 91 float period;
AnnaBridge 187:0387e8f68319 92 };
AnnaBridge 187:0387e8f68319 93
AnnaBridge 187:0387e8f68319 94 struct i2c_s {
AnnaBridge 187:0387e8f68319 95 uint32_t address;
AnnaBridge 187:0387e8f68319 96 IRQn_Type IRQn;
AnnaBridge 187:0387e8f68319 97 TSB_I2C_TypeDef *i2c;
AnnaBridge 187:0387e8f68319 98 };
AnnaBridge 187:0387e8f68319 99
AnnaBridge 187:0387e8f68319 100 struct spi_s {
AnnaBridge 187:0387e8f68319 101 tspi_t p_obj;
AnnaBridge 187:0387e8f68319 102 SPIName module;
AnnaBridge 187:0387e8f68319 103 uint8_t bits;
AnnaBridge 187:0387e8f68319 104 };
AnnaBridge 187:0387e8f68319 105
AnnaBridge 187:0387e8f68319 106 extern const gpio_regtypedef_t GPIO_SFRs[];
AnnaBridge 187:0387e8f68319 107 extern const uint32_t GPIO_Base[];
AnnaBridge 187:0387e8f68319 108
AnnaBridge 187:0387e8f68319 109 #include "gpio_object.h"
AnnaBridge 187:0387e8f68319 110
AnnaBridge 187:0387e8f68319 111 #ifdef __cplusplus
AnnaBridge 187:0387e8f68319 112 }
AnnaBridge 187:0387e8f68319 113 #endif
AnnaBridge 187:0387e8f68319 114
AnnaBridge 187:0387e8f68319 115 #endif