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