1
+ /*
2
+ * This file is part of the MicroPython project, http://micropython.org/
3
+ *
4
+ * The MIT License (MIT)
5
+ *
6
+ * Copyright (c) 2017 "Eric Poulsen" <eric@zyxod.com>
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ */
1
26
2
-
3
- const mp_obj_type_t machine_mcpwm_capture_type ;
27
+ #include "py/obj.h"
28
+ #include "py/runtime.h"
4
29
5
30
typedef struct {
6
31
mp_obj_base_t base ;
7
32
8
33
9
34
} mmcpwm_capture_obj_t ;
10
35
11
- STATIC mp_obj_t mmcpwm_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw ,
36
+ /******************************************************************************/
37
+ // MicroPython bindings for hw_spi
38
+
39
+ STATIC void mmcpwm_capture_print (const mp_print_t * print , mp_obj_t self_in , mp_print_kind_t kind ) {
40
+
41
+ mmcpwm_capture_obj_t * self = MP_OBJ_TO_PTR (self_in );
42
+ mp_printf (print , "Capture(%p)" , self );
43
+ }
44
+
45
+ const mp_obj_type_t machine_mcpwm_capture_type ;
46
+
47
+
48
+ STATIC mp_obj_t mmcpwm_capture_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw ,
12
49
const mp_obj_t * args ) {
13
50
//FIXME
51
+ //
52
+ return mp_const_none ;
14
53
}
15
54
16
55
// MCPWM Module
@@ -21,7 +60,7 @@ STATIC const mp_rom_map_elem_t mp_module_mcpwm_globals_table[] = {
21
60
22
61
STATIC MP_DEFINE_CONST_DICT (mp_module_mcpwm_globals , mp_module_mcpwm_globals_table );
23
62
24
- const mp_obj_type_t mp_module_mcpwm = {
63
+ const mp_obj_module_t mp_module_mcpwm = {
25
64
{ & mp_type_module },
26
65
.globals = (mp_obj_t )& mp_module_mcpwm_globals ,
27
66
};
@@ -30,7 +69,7 @@ const mp_obj_type_t mp_module_mcpwm = {
30
69
31
70
STATIC const mp_rom_map_elem_t mmcpwm_capture_locals_dict_table [] = {
32
71
//{ MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mmcpwm_read_obj) },
33
- { MP_ROM_QSTR (MP_QSTR_WIDTH_12BIT ), MP_ROM_INT (ADC_WIDTH_12Bit ) },
72
+ { MP_ROM_QSTR (MP_QSTR_WIDTH_12BIT ), MP_ROM_INT (0 ) },
34
73
};
35
74
36
75
STATIC MP_DEFINE_CONST_DICT (mmcpwm_capture_locals_dict , mmcpwm_capture_locals_dict_table );
0 commit comments