mbed library sources. Supersedes mbed-src.
Fork of mbed-dev by
targets/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/objects.h@152:9a67f0b066fc, 2016-12-15 (annotated)
- Committer:
- <>
- Date:
- Thu Dec 15 11:48:27 2016 +0000
- Revision:
- 152:9a67f0b066fc
- Parent:
- 150:02e0a0aed4ec
This updates the lib to the mbed lib v131
Who changed what in which revision?
User | Revision | Line number | New 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; |
<> | 149:156823d33999 | 64 | uint32_t inten_msk; |
<> | 149:156823d33999 | 65 | |
<> | 149:156823d33999 | 66 | // Async transfer related fields |
<> | 149:156823d33999 | 67 | DMAUsage dma_usage_tx; |
<> | 149:156823d33999 | 68 | DMAUsage dma_usage_rx; |
<> | 149:156823d33999 | 69 | int dma_chn_id_tx; |
<> | 149:156823d33999 | 70 | int dma_chn_id_rx; |
<> | 149:156823d33999 | 71 | uint32_t event; |
<> | 149:156823d33999 | 72 | void (*irq_handler_tx_async)(void); |
<> | 149:156823d33999 | 73 | void (*irq_handler_rx_async)(void); |
<> | 149:156823d33999 | 74 | }; |
<> | 149:156823d33999 | 75 | |
<> | 149:156823d33999 | 76 | struct spi_s { |
<> | 149:156823d33999 | 77 | SPIName spi; |
<> | 149:156823d33999 | 78 | PinName pin_miso; |
<> | 149:156823d33999 | 79 | PinName pin_mosi; |
<> | 149:156823d33999 | 80 | PinName pin_sclk; |
<> | 149:156823d33999 | 81 | PinName pin_ssel; |
<> | 149:156823d33999 | 82 | |
<> | 149:156823d33999 | 83 | //void (*vec)(void); |
<> | 149:156823d33999 | 84 | |
<> | 149:156823d33999 | 85 | // Async transfer related fields |
<> | 149:156823d33999 | 86 | DMAUsage dma_usage; |
<> | 149:156823d33999 | 87 | int dma_chn_id_tx; |
<> | 149:156823d33999 | 88 | int dma_chn_id_rx; |
<> | 149:156823d33999 | 89 | uint32_t event; |
<> | 149:156823d33999 | 90 | //void (*irq_handler_tx_async)(void); |
<> | 149:156823d33999 | 91 | //void (*irq_handler_rx_async)(void); |
<> | 149:156823d33999 | 92 | }; |
<> | 149:156823d33999 | 93 | |
<> | 149:156823d33999 | 94 | struct i2c_s { |
<> | 149:156823d33999 | 95 | I2CName i2c; |
<> | 149:156823d33999 | 96 | //void (*vec)(void); |
<> | 149:156823d33999 | 97 | int slaveaddr_state; |
<> | 149:156823d33999 | 98 | |
<> | 149:156823d33999 | 99 | uint32_t tran_ctrl; |
<> | 149:156823d33999 | 100 | char * tran_beg; |
<> | 149:156823d33999 | 101 | char * tran_pos; |
<> | 149:156823d33999 | 102 | char * tran_end; |
<> | 149:156823d33999 | 103 | int inten; |
<> | 149:156823d33999 | 104 | |
<> | 149:156823d33999 | 105 | |
<> | 149:156823d33999 | 106 | // Async transfer related fields |
<> | 149:156823d33999 | 107 | DMAUsage dma_usage; |
<> | 149:156823d33999 | 108 | uint32_t event; |
<> | 149:156823d33999 | 109 | int stop; |
<> | 149:156823d33999 | 110 | uint32_t address; |
<> | 149:156823d33999 | 111 | }; |
<> | 149:156823d33999 | 112 | |
<> | 149:156823d33999 | 113 | struct pwmout_s { |
<> | 149:156823d33999 | 114 | PWMName pwm; |
<> | 149:156823d33999 | 115 | //PinName pin; |
<> | 149:156823d33999 | 116 | uint32_t period_us; |
<> | 149:156823d33999 | 117 | uint32_t pulsewidth_us; |
<> | 149:156823d33999 | 118 | }; |
<> | 149:156823d33999 | 119 | |
<> | 149:156823d33999 | 120 | struct sleep_s { |
<> | 149:156823d33999 | 121 | uint32_t start_us; |
<> | 149:156823d33999 | 122 | uint32_t end_us; |
<> | 149:156823d33999 | 123 | uint32_t period_us; |
<> | 149:156823d33999 | 124 | int powerdown; |
<> | 149:156823d33999 | 125 | }; |
<> | 149:156823d33999 | 126 | |
<> | 149:156823d33999 | 127 | struct trng_s { |
<> | 149:156823d33999 | 128 | uint8_t dummy; |
<> | 149:156823d33999 | 129 | }; |
<> | 149:156823d33999 | 130 | |
<> | 150:02e0a0aed4ec | 131 | struct can_s { |
<> | 150:02e0a0aed4ec | 132 | CANName can; |
<> | 150:02e0a0aed4ec | 133 | char index; |
<> | 150:02e0a0aed4ec | 134 | }; |
<> | 149:156823d33999 | 135 | #ifdef __cplusplus |
<> | 149:156823d33999 | 136 | } |
<> | 149:156823d33999 | 137 | #endif |
<> | 149:156823d33999 | 138 | |
<> | 149:156823d33999 | 139 | #include "gpio_object.h" |
<> | 149:156823d33999 | 140 | |
<> | 149:156823d33999 | 141 | #endif |