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

222 Commits

Author SHA1 Message Date
Benjamin Valentin
e3b0874305 cpu/lpc2387: clean up the platform
- move clock setup from boards/ to cpu/
 - reduce code duplication
2019-09-16 13:08:56 +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
Marian Buschsieweke
2d415d16c9
cpu/arm7_common: Cleaned up interrupt vectors
- split up interrupt vector code from bootloader.c to vectors.c
- moved bootloader.c to arm7_init.c
- Use consistent naming:
    - use lower case for everything but preprocessor stuff
    - ISRs now named isr_foo()
2019-07-25 22:41:08 +02:00
smlng
2de4b3011b periph_common: add as dependency to periph drivers
Rational: the periph_common module is required by (most) other periph drivers
and also during startup of the CPU/MCU to run periph_init. The latter is only
required if other periph drivers are used, hence periph_common should be a
depency of periph_* modules and *not* of the CPU/MCU. This PR fixes that
by making periph_common a depency of periph_* and removing the explicit
include in the CPU/MCU implementation.
2019-06-03 13:44:10 +02:00
Benjamin Valentin
1c3f96495d ldscripts: move .noinit section behind .bss section
If the .noinit section starts at the beginning of the RAM,
a bootloader that is unaware of it will clear it.
Instead, move it behind the .bss section, hoping that a bootloader
will always use less .bss memory than RIOT proper.
2019-05-16 23:11:45 +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
Marian Buschsieweke
f31375a152
cpu/lpc2387: Use PRIu32 in DEBUG() in mci 2018-08-14 15:35:12 +02:00
Marian Buschsieweke
6358e75f01
cpu/lpc2387: Fixed bug and readability in IAP
- Previous cast was to a function pointer was not legal
- Using already present function pointer to store the IAP entry point to improve
  readability. (Which also fixes the cast issue.)
2018-08-14 15:31:43 +02:00
Marian Buschsieweke
18ae7652a9
cpu/lpc2387: Fixed doc and attribute of arm_reset
- arm_reset was completely undocumented, even though technical details buried
  deeply in the data sheet of the LPC2387 are involved in the code
- The attribute "naked" is misplaced, it should only be used when no C code
  is present. However, the function consists of C code only
- The attribute "noreturn" has to be used in the declaration [1] of a function,
  not in the implementation. Otherwise the caller is not informed and code using
  the function will not be optimized.

[1]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
2018-08-14 10:40:09 +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
938677cc83 cpu*: fix doxygen grouping 2018-06-11 19:12:02 +02:00
Marian Buschsieweke
2c901ff181
cpu/lpc2387: Fixed invalid call to send_msg in lpc2387-mci.c
At `lpc2387-mci.c:383` in `send_cmd()` an `assert()` enforces that parameter
`buff` is not `NULL`. At `lpc2387-mci.c:538` in `mci_initialize()` `send_cmd()`
was called with `buff==NULL`.
2018-05-30 09:09:22 +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
Joakim Nohlgård
60b13e680c lpc2387: Adjust ldscript memory segment attributes 2018-05-09 06:46:05 +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
7847a91e12 cpu: instead of cpp-style, use C-style comments 2018-02-06 16:59:58 +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
942cc7598b cpu: arm7: reorganize Makefile.features 2017-11-02 12:59:45 +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
0fcc7d3834 cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
Hauke Petersen
9aad0e528f cpu: cleanup unused/umimplemented isr stack code
- removed ISR_STACKSIZE define where unused (set to 0)
- removed thread_arch_isr_stack_usage(), thread_arch_isr_stack_start(),
  and/or thread_arch_isr_stack_pointer() where not implemented
2017-05-12 18:07:08 +02:00
Oleg Hahm
4219011b66 cpu: lpc2387: make comment a comment 2017-04-14 14:36:16 +02:00
Hauke Petersen
37d4f44379 cpus: mv vendor headers to include/vendor/. 2017-03-07 08:55:15 +01:00
Hauke Petersen
fc6b7f0575 Merge pull request #6564 from haukepetersen/opt_periph_pwmpower
periph/pwm: remove pwm_(start|stop) + doc
2017-02-23 10:58:44 +01:00
Oleg Hahm
4b79950656 Merge pull request #6558 from haukepetersen/opt_lpc2387_rmadc
cpu/lpc2387: remove (unused) legacy ADC driver
2017-02-22 11:01:04 +01:00
Joakim Nohlgård
ba31acae58 cpu/lpc2387: Add missing assert(buff != NULL) 2017-02-16 17:12:51 +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
1dd806bb28 cpu/lpc2387: remove (unused) legacy ADC driver 2017-02-07 10:56:33 +01:00
Hauke Petersen
c560e28eb6 cpu/lpc2387: remove deprecatd I2C driver 2017-01-30 16:14:19 +01:00
Hauke Petersen
5bdb3bfa61 misc: aggregated doxygen fixes 2017-01-25 16:46:46 +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
Oleg Hahm
7ee7801c10 *: remove trailing underscores from header guards 2017-01-19 18:30:53 +01:00
Oleg Hahm
4f4214235b timex: unambiguous time conversion macros 2017-01-19 13:18:08 +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
Francisco Acosta
84d0d61279 Merge pull request #5608 from gebart/pr/xtimer-ticks
xtimer: Allow arbitrary timer frequency, second attempt
2016-11-29 23:00:31 +01:00
Joakim Nohlgård
7c48c891a0 xtimer: Update xtimer usage to match API changes 2016-11-29 20:44:31 +01:00
Hauke Petersen
2eebf36eb2 cpu/uart: make use of named return values 2016-10-28 10:32:00 +02:00
Oleg Hahm
b428979a1d debug: add missing line breaks 2016-09-27 23:38:41 +02:00
Lucas Jenss
1cf1f59ca9 lpc2378: Fix wrong factor in driver poll-timer
Fixes #4530
2016-08-30 19:59:34 +02:00