Search found 51 matches

by tannewt
Mon Oct 24, 2016 7:07 pm
Forum: Development of MicroPython
Topic: RFC: Hardware API: finalising machine.I2C
Replies: 36
Views: 26862

Re: RFC: Hardware API: finalising machine.I2C

Consider a program, that only initializes the peripherals when it first needs them, based on what the user selects from the user interface. For instance, a weather station that has a temperature sensor, a humidity sensor and a wind speed sensor. The user can select any two measurements to be displa...
by tannewt
Sun Oct 23, 2016 10:28 pm
Forum: Development of MicroPython
Topic: RFC: Hardware API: finalising machine.I2C
Replies: 36
Views: 26862

Re: RFC: Hardware API: finalising machine.I2C

For picking the peripheral, the port code should know all available peripherals that can output on the given pins and iterate through them until one is free. On the ESP32 this is super easy, if you initialize an I2C object on pins 3 and 5 you get I2C1. If you do another set of pins you get I2C2. Of...
by tannewt
Sun Oct 23, 2016 10:22 pm
Forum: Development of MicroPython
Topic: RFC: Hardware API: finalising machine.Pin
Replies: 62
Views: 44575

Re: RFC: Hardware API: finalising machine.Pin

@tannewt Actually, after a moment of thought, you already have your DigitalIO objects in the current machine API -- they are called Pin. Sure but my original idea I was getting at was to split Pin as direct IO from Pin as a resource for a peripheral. Doesn't it make sense to split the class that do...
by tannewt
Sun Oct 23, 2016 5:00 pm
Forum: Development of MicroPython
Topic: RFC: Hardware API: finalising machine.I2C
Replies: 36
Views: 26862

Re: RFC: Hardware API: finalising machine.I2C

What has the experience been with the peripheral ID? I know some ports don't have it and it doesn't seem very portable to me. Seems like it'd be better to let the port's implementation match up a hardware peripheral to the given pins where its a different MCU on a board with a standard form factor ...
by tannewt
Sun Oct 23, 2016 4:40 pm
Forum: Development of MicroPython
Topic: RFC: Hardware API: finalising machine.Pin
Replies: 62
Views: 44575

Re: RFC: Hardware API: finalising machine.Pin

First, I agree the duplication between value() and low()/high() is unneeded. Furthermore, why is value a function? Shouldn't it be a property? Its weird to me that a function reads and writes based on its arguments. However, `pin.value = True`, `last_pin_state = pin.value` and `pin.value = not pin....
by tannewt
Sun Oct 23, 2016 4:30 pm
Forum: Development of MicroPython
Topic: RFC: Hardware API: finalising machine.Pin
Replies: 62
Views: 44575

Re: RFC: Hardware API: finalising machine.Pin

Some more notes about the current spec: * I wonder if it should be obligatory to set a pin to ALT mode when there is any peripheral (such as I2C, timer, ADC) using it? What about the software (bit-banging) peripherals? Should it be possible to set the pin to the ALT mode explicitly, or should it on...
by tannewt
Sun Oct 23, 2016 4:28 pm
Forum: Development of MicroPython
Topic: RFC: Hardware API: finalising machine.Pin
Replies: 62
Views: 44575

Re: RFC: Hardware API: finalising machine.Pin

First, I agree the duplication between value() and low()/high() is unneeded. Furthermore, why is value a function? Shouldn't it be a property? Its weird to me that a function reads and writes based on its arguments. However, `pin.value = True`, `last_pin_state = pin.value` and `pin.value = not pin....
by tannewt
Sat Oct 22, 2016 1:43 am
Forum: Development of MicroPython
Topic: Storing and executing compiled code in ROM
Replies: 5
Views: 5107

Re: Storing and executing compiled code in ROM

How big is your ROM? Most ports place a filesystem in ROM if theres enough space. It doesn't need external flash necessarily.
by tannewt
Sat Oct 22, 2016 1:39 am
Forum: Development of MicroPython
Topic: Exit micropython from interrupt in c
Replies: 6
Views: 7403

Re: Exit micropython from interrupt in c

Take a look at mp_keyboard_interrupt it interrupts python code from a C interrupt.
by tannewt
Sat Oct 22, 2016 1:33 am
Forum: Development of MicroPython
Topic: RFC: Hardware API: finalising machine.I2C
Replies: 36
Views: 26862

Re: RFC: Hardware API: finalising machine.I2C

Following from http://forum.micropython.org/viewtopic.php?f=3&t=2545, here we can discuss machine.I2C. This is really critical to get right, and make sure all ports implement it correctly, because it forms the basis of many drivers (eg LCD, env sensors, etc). I think there should be a low-level I2C...