mbed library sources. Supersedes mbed-src.

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

Committer:
AnnaBridge
Date:
Thu Sep 06 13:40:20 2018 +0100
Revision:
187:0387e8f68319
Parent:
targets/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/objects.h@176:447f873cad2f
Child:
189:f392fc9709a3
mbed-dev library. Release version 163

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 PinName pin_tx;
<> 149:156823d33999 54 PinName pin_rx;
<> 149:156823d33999 55
<> 149:156823d33999 56 uint32_t baudrate;
<> 149:156823d33999 57 uint32_t databits;
<> 149:156823d33999 58 uint32_t parity;
<> 149:156823d33999 59 uint32_t stopbits;
<> 149:156823d33999 60
<> 149:156823d33999 61 void (*vec)(void);
<> 149:156823d33999 62 uint32_t irq_handler;
<> 149:156823d33999 63 uint32_t irq_id;
AnnaBridge 165:e614a9f1c9e2 64 uint32_t irq_en;
<> 149:156823d33999 65 uint32_t inten_msk;
<> 149:156823d33999 66
<> 149:156823d33999 67 // Async transfer related fields
<> 149:156823d33999 68 DMAUsage dma_usage_tx;
<> 149:156823d33999 69 DMAUsage dma_usage_rx;
<> 149:156823d33999 70 int dma_chn_id_tx;
<> 149:156823d33999 71 int dma_chn_id_rx;
<> 149:156823d33999 72 uint32_t event;
<> 149:156823d33999 73 void (*irq_handler_tx_async)(void);
<> 149:156823d33999 74 void (*irq_handler_rx_async)(void);
<> 149:156823d33999 75 };
<> 149:156823d33999 76
<> 149:156823d33999 77 struct spi_s {
<> 149:156823d33999 78 SPIName spi;
<> 149:156823d33999 79 PinName pin_miso;
<> 149:156823d33999 80 PinName pin_mosi;
<> 149:156823d33999 81 PinName pin_sclk;
<> 149:156823d33999 82 PinName pin_ssel;
<> 149:156823d33999 83
<> 149:156823d33999 84 //void (*vec)(void);
<> 149:156823d33999 85
<> 149:156823d33999 86 // Async transfer related fields
<> 149:156823d33999 87 DMAUsage dma_usage;
<> 149:156823d33999 88 int dma_chn_id_tx;
<> 149:156823d33999 89 int dma_chn_id_rx;
<> 149:156823d33999 90 uint32_t event;
<> 149:156823d33999 91 //void (*irq_handler_tx_async)(void);
<> 149:156823d33999 92 //void (*irq_handler_rx_async)(void);
<> 149:156823d33999 93 };
<> 149:156823d33999 94
<> 149:156823d33999 95 struct i2c_s {
<> 149:156823d33999 96 I2CName i2c;
<> 149:156823d33999 97 //void (*vec)(void);
<> 149:156823d33999 98 int slaveaddr_state;
<> 149:156823d33999 99
<> 149:156823d33999 100 uint32_t tran_ctrl;
<> 149:156823d33999 101 char * tran_beg;
<> 149:156823d33999 102 char * tran_pos;
<> 149:156823d33999 103 char * tran_end;
<> 149:156823d33999 104 int inten;
<> 149:156823d33999 105
<> 149:156823d33999 106
<> 149:156823d33999 107 // Async transfer related fields
<> 149:156823d33999 108 DMAUsage dma_usage;
<> 149:156823d33999 109 uint32_t event;
<> 149:156823d33999 110 int stop;
<> 149:156823d33999 111 uint32_t address;
<> 149:156823d33999 112 };
<> 149:156823d33999 113
<> 149:156823d33999 114 struct pwmout_s {
<> 149:156823d33999 115 PWMName pwm;
<> 149:156823d33999 116 //PinName pin;
<> 149:156823d33999 117 uint32_t period_us;
<> 149:156823d33999 118 uint32_t pulsewidth_us;
<> 149:156823d33999 119 };
<> 149:156823d33999 120
<> 149:156823d33999 121 struct trng_s {
<> 149:156823d33999 122 uint8_t dummy;
<> 149:156823d33999 123 };
<> 149:156823d33999 124
<> 150:02e0a0aed4ec 125 struct can_s {
<> 150:02e0a0aed4ec 126 CANName can;
<> 150:02e0a0aed4ec 127 char index;
<> 150:02e0a0aed4ec 128 };
<> 149:156823d33999 129 #ifdef __cplusplus
<> 149:156823d33999 130 }
<> 149:156823d33999 131 #endif
<> 149:156823d33999 132
<> 149:156823d33999 133 #include "gpio_object.h"
<> 149:156823d33999 134
<> 149:156823d33999 135 #endif