Each board now needs an mpconfigboard.mk file which defines AF_FILE and
LD_FILE.
Also moved stm32f405.ld to boards/ directory to keep things organised.
acoshf, asinhf, atanhf were added from musl. mathsincos.c was
split up into its original, separate files (from newlibe-nano-2).
tan was added.
All of the important missing float functions are now implemented,
and pyboard now passes tests/float/math_fun.py (finally!).
This patch overhauls the network driver interface. A generic NIC must
provide a set of C-level functions to implement low-level socket control
(eg socket, bind, connect, send, recv). Doing this, the network and
usocket modules can then use such a NIC to implement proper socket
control at the Python level.
This patch also updates the CC3K and WIZNET5K drivers to conform to the
new interface, and fixes some bugs in the drivers. They now work
reasonably well.
As per issue #876, the network module is used to configure NICs
(hardware modules) and configure routing. The usocket module is
supposed to implement the normal Python socket module and selects the
underlying NIC using routing logic.
Right now the routing logic is brain dead: first-initialised,
first-used. And the routing table is just a list of registered NICs.
cc3k and wiznet5k work, but not at the same time due to C name clashes
(to be fixed).
Note that the usocket module has alias socket, so that one can import
socket and it works as normal. But you can also override socket with
your own module, using usocket at the backend.
Pulled in and modified work done by mux/iabdalkader on cc3k driver, from
iabdalkader-cc3k-update branch. That branch was terribly messy and had
too many conflicts to merge neatly.
Allows to create socket objects that support TCP and UDP in server and
client mode. Interface is very close to standard Python socket class,
except bind and accept do not work the same (due to hardware not
supporting them in the usual way).
Not compiled by default. To compile this module, use:
make MICROPY_PY_WIZNET5K=1
Top-level lib directory is for standard C libraries that we want to
provide our own versions of (for efficiency and stand-alone reasons).
It currently has libm in it for math functions.
Also add atanf and atan2f, which addresses issue #837.
Converts generted pins to use qstrs instead of string pointers.
This patch also adds the following functions:
pyb.Pin.names()
pyb.Pin.af_list()
pyb.Pin.gpio()
dir(pyb.Pin.board) and dir(pyb.Pin.cpu) also produce useful results.
pyb.Pin now takes kw args.
pyb.Pin.__str__ now prints more useful information about the pin
configuration.
I found the following functions in my boot.py to be useful:
```python
def pins():
for pin_name in dir(pyb.Pin.board):
pin = pyb.Pin(pin_name)
print('{:10s} {:s}'.format(pin_name, str(pin)))
def af():
for pin_name in dir(pyb.Pin.board):
pin = pyb.Pin(pin_name)
print('{:10s} {:s}'.format(pin_name, str(pin.af_list())))
```
This patch updates ST's HAL to the latest version, V1.3.0, dated 19 June
2014. Files were copied verbatim from the ST package. Only change was
to suppress compiler warning of unused variables in 4 places.
A lot of the changes from ST are cosmetic: comments and white space.
Some small code changes here and there, and addition of F411 header.
Main code change is how SysTick interrupt is set: it now has a
configuration variable to set the priority, so we no longer need to work
around this (originall in system_stm32f4xx.c).