Skip to content

Commit 3cfb383

Browse files
committed
esp32/Makefile: added modmcpwm.c
esp32/modmcpwm.c: Added a bit esp32/mcpwm_docs.md: Started a doc file
1 parent c61eec6 commit 3cfb383

File tree

1 file changed

+44
-5
lines changed

1 file changed

+44
-5
lines changed

esp32/modmcpwm.c

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,55 @@
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+
*/
126

2-
3-
const mp_obj_type_t machine_mcpwm_capture_type;
27+
#include "py/obj.h"
28+
#include "py/runtime.h"
429

530
typedef struct {
631
mp_obj_base_t base;
732

833

934
} mmcpwm_capture_obj_t;
1035

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,
1249
const mp_obj_t *args) {
1350
//FIXME
51+
//
52+
return mp_const_none;
1453
}
1554

1655
// MCPWM Module
@@ -21,7 +60,7 @@ STATIC const mp_rom_map_elem_t mp_module_mcpwm_globals_table[] = {
2160

2261
STATIC MP_DEFINE_CONST_DICT(mp_module_mcpwm_globals, mp_module_mcpwm_globals_table);
2362

24-
const mp_obj_type_t mp_module_mcpwm = {
63+
const mp_obj_module_t mp_module_mcpwm = {
2564
{ &mp_type_module },
2665
.globals = (mp_obj_t)&mp_module_mcpwm_globals,
2766
};
@@ -30,7 +69,7 @@ const mp_obj_type_t mp_module_mcpwm = {
3069

3170
STATIC const mp_rom_map_elem_t mmcpwm_capture_locals_dict_table[] = {
3271
//{ 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) },
3473
};
3574

3675
STATIC MP_DEFINE_CONST_DICT(mmcpwm_capture_locals_dict, mmcpwm_capture_locals_dict_table);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy