1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

58 Commits

Author SHA1 Message Date
Francois Berder
4a31f94cfc many typo fixes
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-23 22:39:07 +01:00
Benjamin Valentin
a9d1825e2e cpu/lpc2387: implement periph/pm
Enable IDLE and Deep Powerdown mode.

IDLE is pretty straightforward - insteady of busy waiting, the CPU will
enter an idle state from which it will resume on any event.

Deep Power Down shuts off the entite system except for the battery backup
power domain.
That means the CPU will reset on resume and can be woken by e.g. RTC.

SLEEP and POWERDOWN disable the PLL and the PLL and Flash respectively.
This requires some proper wake-up handling.

Since this turned out to be a major time sink and those modes are never
currently never used in RIOT outside of tests, I left this as an exercise
for a future reader.
2019-11-22 09:11:39 +01:00
Benjamin Valentin
9e68556393 boards/msba2: configure remaining UARTs
All UARTs on the MSBA2 are exposed through pin headers on the board.
Configure them according to the data sheet.
2019-11-07 21:55:25 +01:00
Benjamin Valentin
d6a94d4e18 cpu/lpc2387: uart driver overhaul
This converts the hard-coded UART driver to the new ways.

 - allow the board to configure the RX & TX pins
 - allow for more than one UART
 - allow setting the baudrate
 - implement poweron()/poweroff() functions
2019-11-07 21:55:24 +01:00
Benjamin Valentin
985fb53c9f cpu/lpc2387: enable RTC on init
All other CPU implementations have the RTC running after
rtc_init() was called.

Fix this for lpc2387.
2019-10-27 01:33:13 +02:00
Benjamin Valentin
b1724a7d1b periph/rtc: normalize struct tm before usage
A naive implementation may set a RTC alarm in 30s by calling

	struct tm now;
	rtc_get_time(&now);
	now.tm_sec += 30;
	rtc_set_alarm(&now, _cb, NULL);

This works for RTC implementations that use a RTT internally and call
mktime() to convert the struct tm to a unix timestamp, as mktime() will
normalize the struct in the process.

Call rtc_tm_normalize() when the RTC uses separate registers for time / date
components to ensure it is normalized.

This also modifies tests/periph_rtc to exercise this case.
2019-09-12 11:32:31 +02:00
Martine Lenders
0ed57df4b5 lpc2387: mark closing #endif for MODULE_PERIPH_GPIO_IRQ 2018-10-09 15:11:00 +02:00
Hauke Petersen
72986ecb9b cpu/lpc2387/gpio: use gpio_irq feature 2018-09-21 08:19:15 +02:00
Andreas "Paul" Pauli
1aaeecf5b1
Merge pull request #9296 from maribu/lpc2387
cpu/lpc2387: Various fixes for GPIO driver
2018-06-21 19:28:53 +02:00
Peter Kietzmann
6fd4009b89
Merge pull request #8957 from aabadie/pr/cpu/guard_lpc2387
cpu/lpc2387: remove useless periph file guard
2018-06-20 09:06:31 +02:00
Marian Buschsieweke
1d0f90dcdf
cpu/lpc2387: Various fixes for GPIO driver
- Fixed documentation
- Use bitwise operation instead of multiplication and addition in `GPIO_PIN()`
- Allow GPIOs to be configured as input via `gpio_init()`
- Fixed bugs in `gpio_init_mux`:
    - `0x01 << ((pin & 31) * 2)` was used before to generate the bitmask, but
      this would shift by 62 to the left. Correct is `0x01 << ((pin & 15) * 2)`
      (See [datasheet](https://www.nxp.com/docs/en/user-guide/UM10211.pdf) at
      pages 156ff)
    - Only one of the two bits was cleared previously
- Changed strategy to access GPIO pins:
    - Previous strategy:
        - Set all bits in FIOMASK except the one for the pin to control to
          disable access to them
        - Set/clear/read all pins in the target GPIO port (but access to all but
          the target pin is ignored because of the applied FIOMASK)
    - New strategy:
        - Set/clear/read only the target pin
    - Advantages:
        - Only one access to a GPIO register instead of two
        - Proven approach: Access to GPIOs on lpc2387 is mostly done by
          accessing the GPIO registers directy (e.g. see the sht11 driver).
          Those accesses never touch the FIOMASK register
        - No unwanted side effects: Disabling all but one pin in a GPIO port
          without undoing that seems not to be a good idea
2018-06-18 09:10:25 +02:00
Marian Buschsieweke
17a5101b40
cpu/lpc2387: Fixed broken SPI driver
In commit 513b20ffd3 the SPI API was changed to
power up an configure the SPI bus on spi_acquire(). Sadly, the lpc2387 SPI
apparently needs to be reconfigured after each power up. This commit moves
the initialization code required after each power up from spi_init() to
spi_acquire().
2018-05-19 18:12:25 +02:00
bcab6bd1ba cpu/lpc2387: remove useless periph file guard 2018-04-16 10:11:47 +02:00
Hauke Petersen
2fc724db7e cpu/lpc2487: add empty uart/power_x functions 2018-03-02 10:53:55 +01:00
smlng
7309171303 build: fix unused parameter errors
cpu, sam0_common: fix unused parameter in periph/spi
        cpu, kinetis_common: fix unused parameter in periph/spi
        cpu, cc2538: fix unused param in periph/i2c
        cpu, cc2538: fix unused param in periph/spi
        cpu, sam3: fix unused param in periph/spi
        cpu, stm32_common: fix unused param in periph/pm
        cpu, stm32f3: fix unused params in periph/i2c
        cpu, nrf5x_common: fix unused param in periph/gpio
        cpu, nrf5x_common: fix unused param in periph/spi
        cpu, lpc2387: fix unused params in periph/spi
        cpu, cc2538: fix unused params in radio/netdev
        cpu, cc2650: fix unused params in periph/uart
        cpu, lm4f120: fix unused param in periph/spi
        cpu, lm4f120: fix unused params in periph/timer
        cpu, lm4f120: fix unused params in periph/uart
        cpu, stm32_common: fix unused params in periph/dac
        cpu, stm32l0: fix unused params in periph/i2c
        cpu, msp430fxyz: fix unused params in periph/uart
        cpu, mips: fix unused params
        cpu, cc430: fix unused-params in periph/timer
        cpu, msp430fxyz: fix unused params in periph/spi
        drivers, cc2420: fix unused param
        cpu, mips32r2_common: fix unused params in periph/timer
        cpu, cc2538: fix unused-param in periph/i2c
        cpu, mips32r2_common: fix unused-param in periph/timer
        cpu, msp430fxyz: fix unused params in periph/timer
        cpu, atmega_common: fix unused params in periph/spi
        driver, nrfmin: fix unused params
        cpu, cc2538_rf: fix unused params
        driver, netdev_ieee802514: fix unused param
        cpu, mip_pic32m: fix unused params
        cpu, lpc2387: fix unused params in periph/pwm
        tests/driver_sdcard_spi: fix unused params
        cpu, sam3: fix unused param in periph/pwm
        tests/driver_dynamixel: fix unused params, and style issues
        cpu, cc430: fix unused param in periph/rtc
        cpu, atmega_common: fix unused params in periph/i2c
2017-11-28 14:36:01 +01:00
a20745b6c5 cpu: make use of Makefile.periph 2017-11-06 12:01:19 +01:00
Francisco Acosta
f2efd88f98 Merge pull request #7129 from haukepetersen/opt_periph_sharetimerset
cpu: add and use shared code for timer_set()
2017-08-01 15:09:48 +02:00
smlng
01af6d94c4 cpu, periph: retain constness in spi_transfer_bytes 2017-06-29 15:47:13 +02:00
smlng
692cf96297 doc: fix doxygen grouping of cpu periph drivers 2017-06-26 14:42:11 +02:00
Hauke Petersen
a1499f4190 cpu: add and use shared code for timer_set() 2017-06-02 12:21:56 +02:00
Hauke Petersen
37d4f44379 cpus: mv vendor headers to include/vendor/. 2017-03-07 08:55:15 +01:00
Hauke Petersen
8064bd9fa9 periph/pwm: remove pwm_(start|stop) + doc
- joined start/stop and poweron/poweroff
- added general documentation
2017-02-13 09:37:31 +01:00
Hauke Petersen
10b0013315 cpu/lpc2387+boards: adapted to new SPI API
- adapted the SPI driver
- adapted all boards using the CPU
2017-01-25 16:46:05 +01:00
Hauke Petersen
a35709b4f8 Merge pull request #6360 from OlegHahm/periph_timer_remove_irq
periph timer: remove timer_irq_(en|dis)able
2017-01-18 22:58:21 +01:00
Hauke Petersen
7b5d26340a cpu/lpc2387: cleanup for the PWM driver 2017-01-17 10:50:02 +01:00
Oleg Hahm
d0316fa7ae periph timer: remove timer_irq_(en|dis)able 2017-01-14 15:34:53 +01:00
0194091673 remove obsolete lpm code 2017-01-12 11:24:15 +01:00
Hauke Petersen
2eebf36eb2 cpu/uart: make use of named return values 2016-10-28 10:32:00 +02:00
DipSwitch
0bb4748a94 core: Fix/refactor function naming in core/incude/irq.h 2016-03-20 16:47:34 +01:00
Hauke Petersen
877d06bda8 cpu/lpc2387: adapted GPIO driver 2016-03-17 14:39:11 +01:00
Hauke Petersen
b23cde98cf cpus: adapted UART implementations to cb type change 2016-03-15 11:02:06 +01:00
Joakim Nohlgård
6a52296a35 cpu/lpc2387: Use {} notation for empty while loops 2016-03-03 16:30:06 +01:00
Peter Kietzmann
c8829a49b8 Merge pull request #4838 from haukepetersen/fix_periph_timerarg
drivers/timer: added callback argument
2016-03-01 08:55:54 +01:00
Hauke Petersen
b11a3ad74b cpus: adapted timer implementations to API changes 2016-02-29 14:45:00 +01:00
9082273746 core: header cleanup 2016-02-28 22:46:28 +01:00
Joakim Nohlgård
e2f7ac78f0 Merge pull request #4040 from gebart/pr/periph-timer-init-freq
periph/timer: Change timer_init API to support arbitrary (integer) frequencies
2016-02-15 23:36:44 +01:00
Joakim Nohlgård
1b0e0c62ac cpu/lpc2387: Update to match timer_init API change 2016-02-13 21:29:36 +01:00
Hauke Petersen
b41f915d86 cpu/lpc2387: adapted to PWM interface changes 2016-02-12 16:09:56 +01:00
Hauke Petersen
ad0abdcadd cpus: use default isr_ctx struct in GPIO drivers 2016-01-27 17:00:37 +01:00
Hauke Petersen
178e82c0e9 cpu/lpc2387: s/F_CPU/CLOCK_CORECLOCK/ 2016-01-27 09:52:44 +01:00
Oleg Hahm
d92ec1d11e lpc2387: fix pedantic compiler warnings 2015-12-07 20:28:53 +01:00
Hauke Petersen
fe249b9006 cpu/lpc2387: adapted UART driver 2015-10-27 14:59:38 +01:00
Joakim Nohlgård
cbaeccdb90 periph/timer: Drop timer_reset 2015-10-17 20:11:03 +02:00
Peter Kietzmann
be8f63769c Merge pull request #3879 from sgso/fix_spi_slave_return_codes
cpu: let spi_init_slave() stubs return error codes
2015-09-30 14:07:54 +02:00
d0ff4946ea cpu: lpc2387: add spi_conf_pins() 2015-09-23 19:00:55 +02:00
Sebastian Sontberg
8b4fcc2a14 cpu: let spi_init_slave() stubs return error codes 2015-09-17 11:19:31 +02:00
Martine Lenders
93f555ef69 Merge pull request #3782 from OlegHahm/RIOT_assert
core: RIOT's own assert macro
2015-09-12 13:12:34 +02:00
Oleg Hahm
49917a5797 core: cpu: fix check for DEVELHELP 2015-09-12 12:43:15 +02:00
Hauke Petersen
342d292889 cpu/lpc2387: added low-level timer implementation 2015-09-04 15:32:50 +02:00
4dd63dd24e cpu: lpc2387: add periph/spi support 2015-08-14 16:50:41 +02:00