Commit Graph

59 Commits

Author SHA1 Message Date
Glenn Ruben Bakke c28e94b534 nrf5/modules/machine: Reserving timer0 instance for bluetooth if compiled in. Leaving timer1 and timer2 for application. Note that music module soft-pwm will also occupy timer1 if enabled. 2017-06-02 19:21:51 +02:00
Glenn Ruben Bakke 6ddaba532a nrf5/modules/machine: Updating timer module to use new hal. Adding new parameters to the init to set period, mode and callback. 2017-06-02 19:21:51 +02:00
Glenn Ruben Bakke daf3474247 nrf5/modules/machine: Indention fix in uart module. 2017-06-02 19:18:21 +02:00
Glenn Ruben Bakke ad1076b206 nrf5/modules/machine: Removing unused code from uart module. 2017-06-02 19:18:21 +02:00
Glenn Ruben Bakke 5fb937f147 nrf5/modules/pin: Adding on() and off() methods to Pin object to be forward compatible with upstream master. Legacy high() and low() methods are kept. 2017-05-28 21:11:03 +02:00
Glenn Ruben Bakke f3909c49f5 nrf5/modules/spi: Remove pyb abstraction from SPI module, as there was a bug in transfer of bytes due to casting errors. The update removes the pyb_spi_obj_t wrapper going directly on the machine_hard_spi_obj_t as base for machine SPI objects. SDCard mounting is also tested. 2017-05-28 19:35:07 +02:00
Glenn Ruben Bakke d9813910da nrf5/modules/machine/timer: If timer is used in combination with SOFT_PWM (implicitly use of ticker.c) guard the Timer1 instance from being instantiated trough python timer module. Also disable implementation of the HAL IRQ handler which is for now explicitly implemented in ticker.c for Timer1. 2017-05-25 00:25:14 +02:00
Glenn Ruben Bakke c7cc57eaa0 nrf5/modules/machine: Updating IRQ levels in SPI with IRQ priorities compatible with Bluetooth stacks. 2017-05-25 00:24:50 +02:00
Glenn Ruben Bakke 952c14c4bf nrf5/modules/machine: Quickfix. Update timer object to not allow instanciation of Timer(0) if SOFT_PWM is enabled by board. 2017-05-18 23:11:41 +02:00
Glenn Ruben Bakke b245011259 nrf5/modules/machine: bugfix after changing to MP_ROM_PTR in machine module local dict. 2017-05-11 00:08:44 +02:00
Glenn Ruben Bakke 54656044f7 nrf5: Syncing code with upstream master and converting all module and method tables to use MP_ROM macros. Also adding explicit casting of local dicts to (mp_obj_dict_t*). 2017-05-09 22:54:58 +02:00
Glenn Ruben Bakke 00d96f5695 nrf5/modules/timer: Fixing bug in timer_find(). Function allowed to locate index out of range and started to look up in config pointer (index == size of array). 2017-05-08 23:32:42 +02:00
Glenn Ruben Bakke 1063a44ec6 nrf5/modules/timer: Remove test which is covered by timer_find() function in the line below. 2017-05-08 23:31:14 +02:00
Glenn Ruben Bakke 2cf9e3e625 nrf5/modules/timer: Adding locals dict table and adding start/stop template functions. Also adding constants for oneshot and periodic to locals dict. 2017-05-08 23:24:15 +02:00
Glenn Ruben Bakke 9e6cca66b4 nrf5/modules/timer: Adding timer module to modmachine. 2017-05-08 23:09:15 +02:00
Glenn Ruben Bakke 10cbc83cf0 nrf5/pwm: Updating config name of PWM to hardware PWM to prepare for introduction of soft variant. 2017-05-08 21:10:18 +02:00
Glenn Ruben Bakke 1c756af9a4 nrf5/modules/timer: Adding timer3 and timer4 to timer object in case of nrf52 target. 2017-04-30 20:18:46 +02:00
Glenn Ruben Bakke a0638880b3 nrf5/modules/timer: Optimizing timer object structure and updating the module to use new hal_timer_init structures and parameters. 2017-04-30 20:15:03 +02:00
Glenn Ruben Bakke 7449f8d861 nrf5/hal/timer: Changing hardcoded hal timer instance base to a lookup, so that IRQ num can be detected automatically without the need of using struct param on it. Size of binary does not increase when using Os. 2017-04-30 19:42:19 +02:00
Glenn Ruben Bakke 071e551b79 nrf5/modules/machine: Updating PWM module with two new kwargs parameters. One for setting pulse with more fine grained. This value should not exceed the period value. Also, adding support for setting PWM mode, whether it is LOW duty cycle or HIGH duty cycle. By default, high to low is set (this could be changed). 2017-04-18 21:00:52 +02:00
Glenn Ruben Bakke 1e79bdf0b4 nrf5/modules/machine: Updating Pin module to register a IRQ callback upon GPIO polarity change events. 2017-04-11 13:58:58 +02:00
Glenn Ruben Bakke c7c2285ab9 nrf5/modules/machine: Style fix in pin object, indention. 2017-04-09 23:19:26 +02:00
Glenn Ruben Bakke 320b9ecde7 nrf5/modules/machine: Adding placeholder for irq method to pin object class. 2017-04-09 23:18:00 +02:00
Glenn Ruben Bakke 2c90d94dc7 nrf5/modules/machine: Adding pin irq type and basic functions and structures. 2017-04-09 23:16:07 +02:00
Glenn Ruben Bakke 6446105689 nrf5/modules/machine: Removing toggle event trigger as that will be a combination of the rising and falling together. 2017-04-09 21:52:57 +02:00
Glenn Ruben Bakke 32083a9443 nrf5/modules/machine: Adding new constants to pin object for polarity change triggers using the enumerated values in hal_gpio.h. 2017-04-09 21:50:11 +02:00
Glenn Ruben Bakke 5fc6a9d9a2 nrf5/modules/machine: Cleaning up uart a bit more. Removing unused any() method, and aligning print and local dict names to use machine_uart prefix. 2017-03-13 17:56:39 +01:00
Glenn Ruben Bakke 1aecf560da nrf5/uart: Moving UART from pyb to machine module. 2017-03-10 22:48:43 +01:00
Glenn Ruben Bakke 611b829138 nrf5/uart: Refactoring UART module and HAL driver
Facilitating for adding second HW uart. Moving pyb_uart into
machine_uart. Adding return error codes from hal_uart functions,
if the hardware detects an error.
2017-03-10 22:21:19 +01:00
Glenn Ruben Bakke f8d1ea80ae nrf5/modules: Updating uart object to allow baudrate configuration. 2017-03-07 23:18:03 +01:00
Glenn Ruben Bakke 2e1335b051 nrf5/modules/machine: Adding __WFI() on machine.deepsleep() 2017-03-06 23:36:36 +01:00
Glenn Ruben Bakke 4e1b9aca79 nrf5/modules/machine: Adding __WFE() on machine.sleep() 2017-03-06 23:35:32 +01:00
Glenn Ruben Bakke 4afa41ac36 nrf5/modules/machine: Adding enable_irq() and disable_irq() method to the machine module. No implementation yet for the case where bluetooth stack is used. 2017-03-06 23:30:56 +01:00
Glenn Ruben Bakke 5acba015ef nrf5/modules/rtc: Adding support for stopping and restarting rtc (if periodic) for all the instances of RTC. 2017-03-06 23:05:03 +01:00
Glenn Ruben Bakke 7c50cd26a2 nrf5/modules: Updating RTC kwarg from type to mode to set ONESHOT or PERIODIC mode. 2017-03-06 22:59:43 +01:00
Glenn Ruben Bakke 3debb43e83 nrf5/modules: Adding support for periodic RTC callback. 2017-03-06 21:33:29 +01:00
Glenn Ruben Bakke f50a56dbb5 nrf5/modules: Updating rtc module with non-const machine object list in order to allow setting callback function in constructor. 2017-03-06 20:09:04 +01:00
Glenn Ruben Bakke 7000e0a2a0 nrf5/modules: Moving irq priority settings in RTC object to rtc_init0 when initializing the hardware instances. Also modifying comments a bit. Adding simple example in comment above make_new function on how the object is intended to work. 2017-03-06 01:13:19 +01:00
Glenn Ruben Bakke 1ef7c732e8 nrf5/modules: Added RTC into the machine module globals dict. 2017-03-06 00:56:58 +01:00
Glenn Ruben Bakke 7144696e17 nrf5/modules: Updating rtc module. Not working yet. Updated to align with new hal_rtc interface. Added start and stop methods. Allowing callback function set from init. This should be moved to start function, not set in main. 2017-03-06 00:56:18 +01:00
Glenn Ruben Bakke 9ddd62e73e nrf5/modules: Updating machine uart module to use new hal uart interface name. 2017-03-05 22:37:52 +01:00
Glenn Ruben Bakke ee5884bfe9 nrf5/modules: Updating readfrom function in machine i2c module to use the new hal function which has been implemented. 2017-03-04 21:44:23 +01:00
Bander Ajba 0e723091f9 minor documentation and extra tabs removal fixes 2017-02-28 09:34:13 +03:00
Bander Ajba 12a6cb0fbf fixed temp module to allow for instance support 2017-02-27 21:46:53 +03:00
Bander Ajba e52ebb095c fixed temp module to allow for instance support 2017-02-27 21:37:32 +03:00
Bander Ajba 378c40b4da did required modification to merge the temperature sensore module 2017-02-26 11:14:17 +03:00
Bander Ajba 3882b0e2ff added support for hardware temperature sensor 2017-02-24 00:38:08 +03:00
Glenn Ruben Bakke 7c0195da6c nrf5/modules: Syncing uart module code after upmerge with upstream master. 2017-02-19 19:06:12 +01:00
Glenn Ruben Bakke 0f609cd799 nrf5: Aligning code after upmerge with master. Mostly FAT FS related updates. Not tested after merge. 2017-02-07 23:30:54 +01:00
Glenn Ruben Bakke 42e9b0f735 nrf5/led: Moving led module into modules/machine. 2017-02-05 20:06:06 +01:00