Search found 8 matches

by XIVN1987
Tue Apr 07, 2020 1:11 pm
Forum: General Discussion and Questions
Topic: how to new an array.array in C code?
Replies: 5
Views: 3143

Re: how to new an array.array in C code?

jimmo wrote:
Tue Apr 07, 2020 5:38 am
In that case what I suggested to make a mp_type_array should do the trick.
I know your method works, but it's too subtle. I wish there was a more direct way, like adding the mp_obj_new_array API.
by XIVN1987
Tue Apr 07, 2020 3:38 am
Forum: General Discussion and Questions
Topic: how to new an array.array in C code?
Replies: 5
Views: 3143

Re: how to new an array.array in C code?

but I want to return an array, how to do? memoryviews are arrays, is there any particular reason why you need it to specifically be an array? (they share the same underlying struct). But if you want to explicitly make it an array (this will add more code size), you can just follow the implementatio...
by XIVN1987
Fri Apr 03, 2020 6:17 am
Forum: General Discussion and Questions
Topic: how to new an array.array in C code?
Replies: 5
Views: 3143

how to new an array.array in C code?

I need to new an array and return in my C function. but I cannot find mp_obj_new_array in micropython API. I only find mp_obj_new_memoryview, so I can only return a memoryview instead, like this: STATIC mp_obj_t pyb_spi_read(mp_obj_t self_in, mp_obj_t cnt_in) { pyb_spi_obj_t *self = self_in; uint cn...
by XIVN1987
Fri Feb 15, 2019 6:53 am
Forum: General Discussion and Questions
Topic: share my MCU peripheral debug tool
Replies: 0
Views: 1783

share my MCU peripheral debug tool

through this tool, you can display peripheral register value, display peripheral register field value, even change peripheral register and field value (by click value)

the source code: https://github.com/XIVN1987/JSVDView
by XIVN1987
Fri Feb 15, 2019 5:35 am
Forum: MicroPython pyboard
Topic: opening internal pull-up for I2C is so complex!!
Replies: 3
Views: 2867

opening internal pull-up for I2C is so complex!!

import pyb, stm, time i2c = pyb.I2C(1, pyb.I2C.MASTER, baudrate=20000) ''' opening internal pull-up for I2C ''' PUPDR = stm.mem32[stm.GPIOB + stm.GPIO_PUPDR] PUPDR &= ~((3 << 6*2) | (3 << 7*2)) PUPDR |= ((1 << 6*2) | (0 << 7*2)) stm.mem32[stm.GPIOB + stm.GPIO_PUPDR] = PUPDR time.sleep(1) PUPDR |= (...
by XIVN1987
Mon Dec 03, 2018 6:21 am
Forum: Other Boards
Topic: K210 core board
Replies: 6
Views: 4577

Re: K210 core board

They are porting micropython to the chip K210, https://github.com/sipeed/MaixPy

and implement a simple vi text editor on their port
by XIVN1987
Sun Nov 25, 2018 8:31 am
Forum: General Discussion and Questions
Topic: Awesome MicroPython list, pfalcon's version
Replies: 8
Views: 11947

Re: Awesome MicroPython list, pfalcon's version

Great work. Thank you.

I think uPyCraft and Jupyter MicroPython Kernel are both good tools for micropython
by XIVN1987
Wed Oct 31, 2018 3:12 am
Forum: General Discussion and Questions
Topic: Windows development enviroment/IDE?
Replies: 10
Views: 7808

Re: Windows development enviroment/IDE?

I think uPyCraft is the easiest used micropython development enviroment.