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