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