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
<> 149:156823d33999 1 /* mbed Microcontroller Library
<> 149:156823d33999 2 * Copyright (c) 2015-2016 Nuvoton
<> 149:156823d33999 3 *
<> 149:156823d33999 4 * Licensed under the Apache License, Version 2.0 (the "License");
<> 149:156823d33999 5 * you may not use this file except in compliance with the License.
<> 149:156823d33999 6 * You may obtain a copy of the License at
<> 149:156823d33999 7 *
<> 149:156823d33999 8 * http://www.apache.org/licenses/LICENSE-2.0
<> 149:156823d33999 9 *
<> 149:156823d33999 10 * Unless required by applicable law or agreed to in writing, software
<> 149:156823d33999 11 * distributed under the License is distributed on an "AS IS" BASIS,
<> 149:156823d33999 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<> 149:156823d33999 13 * See the License for the specific language governing permissions and
<> 149:156823d33999 14 * limitations under the License.
<> 149:156823d33999 15 */
<> 149:156823d33999 16
<> 149:156823d33999 17 #ifndef MBED_OBJECTS_H
<> 149:156823d33999 18 #define MBED_OBJECTS_H
<> 149:156823d33999 19
<> 149:156823d33999 20 #include "cmsis.h"
<> 149:156823d33999 21 #include "PortNames.h"
<> 149:156823d33999 22 #include "PeripheralNames.h"
<> 149:156823d33999 23 #include "PinNames.h"
<> 149:156823d33999 24 #include "dma_api.h"
<> 149:156823d33999 25
<> 149:156823d33999 26 #ifdef __cplusplus
<> 149:156823d33999 27 extern "C" {
<> 149:156823d33999 28 #endif
<> 149:156823d33999 29
<> 149:156823d33999 30 struct gpio_irq_s {
<> 149:156823d33999 31 //IRQn_Type irq_n;
<> 149:156823d33999 32 //uint32_t irq_index;
<> 149:156823d33999 33 //uint32_t event;
<> 149:156823d33999 34
<> 149:156823d33999 35 PinName pin;
<> 149:156823d33999 36 uint32_t irq_handler;
<> 149:156823d33999 37 uint32_t irq_id;
<> 149:156823d33999 38 };
<> 149:156823d33999 39
<> 149:156823d33999 40 struct port_s {
<> 149:156823d33999 41 PortName port;
<> 149:156823d33999 42 uint32_t mask;
<> 149:156823d33999 43 PinDirection direction;
<> 149:156823d33999 44 };
<> 149:156823d33999 45
<> 149:156823d33999 46 struct analogin_s {
<> 149:156823d33999 47 ADCName adc;
<> 149:156823d33999 48 //PinName pin;
<> 149:156823d33999 49 };
<> 149:156823d33999 50
<> 149:156823d33999 51 struct serial_s {
<> 149:156823d33999 52 UARTName uart;
<> 149:156823d33999 53
<> 149:156823d33999 54 uint32_t baudrate;
<> 149:156823d33999 55 uint32_t databits;
<> 149:156823d33999 56 uint32_t parity;
<> 149:156823d33999 57 uint32_t stopbits;
<> 149:156823d33999 58
<> 149:156823d33999 59 void (*vec)(void);
<> 149:156823d33999 60 uint32_t irq_handler;
<> 149:156823d33999 61 uint32_t irq_id;
AnnaBridge 165:e614a9f1c9e2 62 uint32_t irq_en;
<> 149:156823d33999 63 uint32_t inten_msk;
<> 149:156823d33999 64
<> 149:156823d33999 65 // Async transfer related fields
<> 149:156823d33999 66 DMAUsage dma_usage_tx;
<> 149:156823d33999 67 DMAUsage dma_usage_rx;
<> 149:156823d33999 68 int dma_chn_id_tx;
<> 149:156823d33999 69 int dma_chn_id_rx;
<> 149:156823d33999 70 uint32_t event;
<> 149:156823d33999 71 void (*irq_handler_tx_async)(void);
<> 149:156823d33999 72 void (*irq_handler_rx_async)(void);
<> 149:156823d33999 73 };
<> 149:156823d33999 74
<> 149:156823d33999 75 struct spi_s {
<> 149:156823d33999 76 SPIName spi;
<> 149:156823d33999 77 PinName pin_miso;
<> 149:156823d33999 78 PinName pin_mosi;
<> 149:156823d33999 79 PinName pin_sclk;
<> 149:156823d33999 80 PinName pin_ssel;
<> 149:156823d33999 81
<> 149:156823d33999 82 //void (*vec)(void);
<> 149:156823d33999 83
<> 149:156823d33999 84 // Async transfer related fields
<> 149:156823d33999 85 DMAUsage dma_usage;
<> 149:156823d33999 86 int dma_chn_id_tx;
<> 149:156823d33999 87 int dma_chn_id_rx;
<> 149:156823d33999 88 uint32_t event;
<> 149:156823d33999 89 //void (*irq_handler_tx_async)(void);
<> 149:156823d33999 90 //void (*irq_handler_rx_async)(void);
<> 149:156823d33999 91 };
<> 149:156823d33999 92
<> 149:156823d33999 93 struct i2c_s {
<> 149:156823d33999 94 I2CName i2c;
<> 149:156823d33999 95 //void (*vec)(void);
<> 149:156823d33999 96 int slaveaddr_state;
<> 149:156823d33999 97
<> 149:156823d33999 98 uint32_t tran_ctrl;
<> 149:156823d33999 99 char * tran_beg;
<> 149:156823d33999 100 char * tran_pos;
<> 149:156823d33999 101 char * tran_end;
<> 149:156823d33999 102 int inten;
<> 149:156823d33999 103
<> 149:156823d33999 104
<> 149:156823d33999 105 // Async transfer related fields
<> 149:156823d33999 106 DMAUsage dma_usage;
<> 149:156823d33999 107 uint32_t event;
<> 149:156823d33999 108 int stop;
<> 149:156823d33999 109 uint32_t address;
<> 149:156823d33999 110 };
<> 149:156823d33999 111
<> 149:156823d33999 112 struct pwmout_s {
<> 149:156823d33999 113 PWMName pwm;
<> 149:156823d33999 114 //PinName pin;
<> 149:156823d33999 115 uint32_t period_us;
<> 149:156823d33999 116 uint32_t pulsewidth_us;
<> 149:156823d33999 117 };
<> 149:156823d33999 118
<> 149:156823d33999 119 struct trng_s {
<> 149:156823d33999 120 uint8_t dummy;
<> 149:156823d33999 121 };
<> 149:156823d33999 122
<> 150:02e0a0aed4ec 123 struct can_s {
<> 150:02e0a0aed4ec 124 CANName can;
<> 150:02e0a0aed4ec 125 char index;
<> 150:02e0a0aed4ec 126 };
<> 149:156823d33999 127 #ifdef __cplusplus
<> 149:156823d33999 128 }
<> 149:156823d33999 129 #endif
<> 149:156823d33999 130
<> 149:156823d33999 131 #include "gpio_object.h"
<> 149:156823d33999 132
<> 149:156823d33999 133 #endif