]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/hal/TARGET_Maxim/TARGET_MAX32600/objects.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / hal / TARGET_Maxim / TARGET_MAX32600 / objects.h
1 /*******************************************************************************
2  * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
18  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20  * OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * Except as contained in this notice, the name of Maxim Integrated
23  * Products, Inc. shall not be used except as stated in the Maxim Integrated
24  * Products, Inc. Branding Policy.
25  *
26  * The mere transfer of this software does not imply any licenses
27  * of trade secrets, proprietary technology, copyrights, patents,
28  * trademarks, maskwork rights, or any other form of intellectual
29  * property whatsoever. Maxim Integrated Products, Inc. retains all
30  * ownership rights.
31  *******************************************************************************
32  */
33  
34 #ifndef MBED_OBJECTS_H
35 #define MBED_OBJECTS_H
36
37 #include "cmsis.h"
38 #include "PortNames.h"
39 #include "PeripheralNames.h"
40 #include "PinNames.h"
41 #include "gpio_object.h"
42 #include "gpio_regs.h"
43 #include "uart_regs.h"
44 #include "i2cm_regs.h"
45 #include "spi_regs.h"
46 #include "pt_regs.h"
47 #include "adc_regs.h"
48 #include "dac_regs.h"
49
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53
54 struct port_s {
55     PortName port;
56     uint32_t mask;
57     __IO uint32_t *reg_out;
58     __I  uint32_t *reg_in;
59 };
60
61 struct gpio_irq_s {
62     uint8_t port;
63     uint8_t pin;
64 };
65
66 struct serial_s {
67     int index;
68     mxc_uart_regs_t *uart;
69 };
70
71 struct i2c_s {
72     int index;
73     mxc_i2cm_regs_t *i2c;
74     volatile uint16_t *txfifo;
75     volatile uint16_t *rxfifo;
76     int start_pending;
77     int stop_pending;
78 };
79
80 struct spi_s {
81     int index;
82     mxc_spi_regs_t *spi;
83     mxc_spi_rxfifo_regs_t *rxfifo;
84     mxc_spi_txfifo_regs_t *txfifo;
85 };
86
87 struct pwmout_s {
88     mxc_pt_regs_t *pwm;
89     int period;
90     int pulse_width;
91 };
92
93 struct analogin_s {
94     mxc_adc_regs_t *adc;
95     mxc_adccfg_regs_t *adccfg;
96     mxc_adc_fifo_regs_t * adc_fifo;
97     PinName adc_pin;
98 };
99
100 struct dac_s {
101     int index;
102     uint16_t out;
103     mxc_dac_regs_t *dac;
104     mxc_dac_fifo_t * dac_fifo;
105 };
106
107 typedef struct {
108     volatile uint32_t *reg_req;
109     volatile uint32_t *reg_ack;
110     uint32_t req_val;
111     uint32_t ack_mask;
112 } pin_function_t;
113
114 #ifdef __cplusplus
115 }
116 #endif
117
118 #endif