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