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