mbed library sources. Supersedes mbed-src.
Fork of mbed-dev by
targets/TARGET_Maxim/TARGET_MAX32625/objects.h@162:16168a1438f3, 2017-04-08 (annotated)
- Committer:
- funshine
- Date:
- Sat Apr 08 17:03:55 2017 +0000
- Revision:
- 162:16168a1438f3
- Parent:
- 150:02e0a0aed4ec
add code to handle serial port rx error in uart_irq()
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 150:02e0a0aed4ec | 1 | /******************************************************************************* |
<> | 150:02e0a0aed4ec | 2 | * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. |
<> | 150:02e0a0aed4ec | 3 | * |
<> | 150:02e0a0aed4ec | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
<> | 150:02e0a0aed4ec | 5 | * copy of this software and associated documentation files (the "Software"), |
<> | 150:02e0a0aed4ec | 6 | * to deal in the Software without restriction, including without limitation |
<> | 150:02e0a0aed4ec | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
<> | 150:02e0a0aed4ec | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
<> | 150:02e0a0aed4ec | 9 | * Software is furnished to do so, subject to the following conditions: |
<> | 150:02e0a0aed4ec | 10 | * |
<> | 150:02e0a0aed4ec | 11 | * The above copyright notice and this permission notice shall be included |
<> | 150:02e0a0aed4ec | 12 | * in all copies or substantial portions of the Software. |
<> | 150:02e0a0aed4ec | 13 | * |
<> | 150:02e0a0aed4ec | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
<> | 150:02e0a0aed4ec | 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
<> | 150:02e0a0aed4ec | 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
<> | 150:02e0a0aed4ec | 17 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
<> | 150:02e0a0aed4ec | 18 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
<> | 150:02e0a0aed4ec | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
<> | 150:02e0a0aed4ec | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
<> | 150:02e0a0aed4ec | 21 | * |
<> | 150:02e0a0aed4ec | 22 | * Except as contained in this notice, the name of Maxim Integrated |
<> | 150:02e0a0aed4ec | 23 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
<> | 150:02e0a0aed4ec | 24 | * Products, Inc. Branding Policy. |
<> | 150:02e0a0aed4ec | 25 | * |
<> | 150:02e0a0aed4ec | 26 | * The mere transfer of this software does not imply any licenses |
<> | 150:02e0a0aed4ec | 27 | * of trade secrets, proprietary technology, copyrights, patents, |
<> | 150:02e0a0aed4ec | 28 | * trademarks, maskwork rights, or any other form of intellectual |
<> | 150:02e0a0aed4ec | 29 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
<> | 150:02e0a0aed4ec | 30 | * ownership rights. |
<> | 150:02e0a0aed4ec | 31 | ******************************************************************************* |
<> | 150:02e0a0aed4ec | 32 | */ |
<> | 150:02e0a0aed4ec | 33 | |
<> | 150:02e0a0aed4ec | 34 | #ifndef MBED_OBJECTS_H |
<> | 150:02e0a0aed4ec | 35 | #define MBED_OBJECTS_H |
<> | 150:02e0a0aed4ec | 36 | |
<> | 150:02e0a0aed4ec | 37 | #include "cmsis.h" |
<> | 150:02e0a0aed4ec | 38 | #include "PortNames.h" |
<> | 150:02e0a0aed4ec | 39 | #include "PeripheralNames.h" |
<> | 150:02e0a0aed4ec | 40 | #include "PinNames.h" |
<> | 150:02e0a0aed4ec | 41 | #include "gpio_object.h" |
<> | 150:02e0a0aed4ec | 42 | #include "gpio_regs.h" |
<> | 150:02e0a0aed4ec | 43 | #include "uart_regs.h" |
<> | 150:02e0a0aed4ec | 44 | #include "i2cm_regs.h" |
<> | 150:02e0a0aed4ec | 45 | #include "spim_regs.h" |
<> | 150:02e0a0aed4ec | 46 | #include "pt_regs.h" |
<> | 150:02e0a0aed4ec | 47 | #include "adc_regs.h" |
<> | 150:02e0a0aed4ec | 48 | #include "uart.h" |
<> | 150:02e0a0aed4ec | 49 | #include "adc.h" |
<> | 150:02e0a0aed4ec | 50 | |
<> | 150:02e0a0aed4ec | 51 | #ifdef __cplusplus |
<> | 150:02e0a0aed4ec | 52 | extern "C" { |
<> | 150:02e0a0aed4ec | 53 | #endif |
<> | 150:02e0a0aed4ec | 54 | |
<> | 150:02e0a0aed4ec | 55 | struct port_s { |
<> | 150:02e0a0aed4ec | 56 | PortName port; |
<> | 150:02e0a0aed4ec | 57 | uint32_t mask; |
<> | 150:02e0a0aed4ec | 58 | __IO uint32_t *reg_out; |
<> | 150:02e0a0aed4ec | 59 | __I uint32_t *reg_in; |
<> | 150:02e0a0aed4ec | 60 | PinMode mode; |
<> | 150:02e0a0aed4ec | 61 | }; |
<> | 150:02e0a0aed4ec | 62 | |
<> | 150:02e0a0aed4ec | 63 | struct gpio_irq_s { |
<> | 150:02e0a0aed4ec | 64 | uint8_t port; |
<> | 150:02e0a0aed4ec | 65 | uint8_t pin; |
<> | 150:02e0a0aed4ec | 66 | uint8_t rise_en; |
<> | 150:02e0a0aed4ec | 67 | uint8_t fall_en; |
<> | 150:02e0a0aed4ec | 68 | uint32_t id; |
<> | 150:02e0a0aed4ec | 69 | }; |
<> | 150:02e0a0aed4ec | 70 | |
<> | 150:02e0a0aed4ec | 71 | struct serial_s { |
<> | 150:02e0a0aed4ec | 72 | int index; |
<> | 150:02e0a0aed4ec | 73 | mxc_uart_regs_t *uart; |
<> | 150:02e0a0aed4ec | 74 | mxc_uart_fifo_regs_t *fifo; |
<> | 150:02e0a0aed4ec | 75 | uint32_t id; |
<> | 150:02e0a0aed4ec | 76 | uart_cfg_t cfg; |
<> | 150:02e0a0aed4ec | 77 | sys_cfg_uart_t sys_cfg; |
<> | 150:02e0a0aed4ec | 78 | PinName tx; |
<> | 150:02e0a0aed4ec | 79 | PinName rx; |
<> | 150:02e0a0aed4ec | 80 | }; |
<> | 150:02e0a0aed4ec | 81 | |
<> | 150:02e0a0aed4ec | 82 | struct i2c_s { |
<> | 150:02e0a0aed4ec | 83 | mxc_i2cm_regs_t *i2c; |
<> | 150:02e0a0aed4ec | 84 | mxc_i2cm_fifo_regs_t *fifo; |
<> | 150:02e0a0aed4ec | 85 | int start_pending; |
<> | 150:02e0a0aed4ec | 86 | }; |
<> | 150:02e0a0aed4ec | 87 | |
<> | 150:02e0a0aed4ec | 88 | struct spi_s { |
<> | 150:02e0a0aed4ec | 89 | int index; |
<> | 150:02e0a0aed4ec | 90 | mxc_spim_regs_t *spi; |
<> | 150:02e0a0aed4ec | 91 | }; |
<> | 150:02e0a0aed4ec | 92 | |
<> | 150:02e0a0aed4ec | 93 | struct pwmout_s { |
<> | 150:02e0a0aed4ec | 94 | mxc_pt_regs_t *pwm; |
<> | 150:02e0a0aed4ec | 95 | int period; |
<> | 150:02e0a0aed4ec | 96 | int pulse_width; |
<> | 150:02e0a0aed4ec | 97 | }; |
<> | 150:02e0a0aed4ec | 98 | |
<> | 150:02e0a0aed4ec | 99 | struct analogin_s { |
<> | 150:02e0a0aed4ec | 100 | mxc_adc_regs_t *adc; |
<> | 150:02e0a0aed4ec | 101 | mxc_adc_chsel_t channel; |
<> | 150:02e0a0aed4ec | 102 | }; |
<> | 150:02e0a0aed4ec | 103 | |
<> | 150:02e0a0aed4ec | 104 | typedef struct { |
<> | 150:02e0a0aed4ec | 105 | volatile uint32_t *reg_req; |
<> | 150:02e0a0aed4ec | 106 | volatile uint32_t *reg_ack; |
<> | 150:02e0a0aed4ec | 107 | uint32_t req_val; |
<> | 150:02e0a0aed4ec | 108 | uint32_t ack_mask; |
<> | 150:02e0a0aed4ec | 109 | } pin_function_t; |
<> | 150:02e0a0aed4ec | 110 | |
<> | 150:02e0a0aed4ec | 111 | #ifdef __cplusplus |
<> | 150:02e0a0aed4ec | 112 | } |
<> | 150:02e0a0aed4ec | 113 | #endif |
<> | 150:02e0a0aed4ec | 114 | |
<> | 150:02e0a0aed4ec | 115 | #endif |
<> | 150:02e0a0aed4ec | 116 |