Benjamin Valentin
08b3e2bd6b
cpu/cc2538: GPIO: use bitarithm_test_and_clear()
2020-07-28 12:44:23 +02:00
Francisco Molina
da171f2254
cpu/cc2538/uart: uart_write wait for all bytes to be sent
...
uart_write should block until all bytes are sent out, so wait for
transmit fifo to empty before returning.
2020-07-22 12:56:12 +02:00
Benjamin Valentin
9d836888c2
treewide: fix file permissions
...
C files should not be executable.
2020-07-08 17:32:36 +02:00
Leandro Lanzieri
7d543fe091
cpu/cc2538: Add Kconfig symbols
...
Also specify CPU_FAM in Makefile.features
2020-06-24 15:15:43 +02:00
Leandro Lanzieri
4d65bc8e0a
cpu: Rename CPU_ARCH to CPU_CORE
2020-06-16 12:05:40 +02:00
Matthew Bradbury
ba51e90228
cpu/cc2538: Flush the RX FIFO (if overflowed) after a receive
2020-04-20 18:19:23 +01:00
Matthew Bradbury
bcfb437746
cpu/cc2538: Do not check XREG_RSSISTATbits for RSSI_VALID
2020-04-20 18:18:56 +01:00
Matthew Bradbury
ecfe4a4e8f
cpu/cc2538: Check CRC of received message after reading message contents
2020-04-20 18:18:56 +01:00
Matthew Bradbury
fc0581056a
cpu/cc2538: Check for a minimum length to read from a received frame
2020-04-20 18:18:56 +01:00
Matthew Bradbury
f0e48f0741
cpu/cc2538: Prevent underflow of the RX FIFO
2020-04-20 18:18:53 +01:00
Jose Alamos
77325b4cde
ieee802154: add CONFIG_ prefix to config macros
2020-04-08 19:08:25 +02:00
Leandro Lanzieri
64552a3b9a
cpu/cortexm_common: Move common modules to Makefile.dep
...
This moves the following modules to a architecture-specific Makefile.dep
file:
- cortexm_common
- cortexm_common_periph
- newlib
- newlib_nano
- periph
2020-04-01 09:46:21 +02:00
Francisco Molina
dcd6b7f226
cpu/cc2538/timer: fix GPT enabling wait
2020-03-25 20:16:23 +01:00
benpicco
e9b71254ff
Merge pull request #13694 from fjmolinas/pr_boards_common_cc2538
...
boards: add common cc2538
2020-03-25 11:11:50 +01:00
Francisco Molina
194af687a0
boards/common: add cc2538
2020-03-25 08:20:52 +01:00
benpicco
457c5245ce
Merge pull request #13507 from benpicco/cpu/cc2538-gpio-cycles
...
cpu/cc2538: gpio: save a few cycles in handle_isr()
2020-03-23 20:53:52 +01:00
Francisco Molina
0cc6a51ea8
cpu/cc2538/periph/timer: cleanup styling
2020-03-23 10:59:53 +01:00
Francisco Molina
7e913fe0d9
cpu/cc2538/periph/timer: set pending timer_set_absolute
...
GPT timer needs to be gated to write to TnMATCHR register. If set
when timer is stopped save values and set on next timer_start()
2020-03-23 10:59:30 +01:00
Francisco Molina
ce696c6caa
cpu/cc2538/timer: enable GPT clock in active, sleep and PM0
2020-03-23 10:58:56 +01:00
Benjamin Valentin
345827ce7b
cpu/cc2538: gpio: save a few cycles in handle_isr()
...
If only one it is set in state (one GPIO pin caused an interrupt),
don't loop over all 8 bits.
Use clz to get the position of the first interrupt bit and clear it,
looping only as many times as there are actual interrupts.
2020-03-23 09:21:14 +01:00
Francisco Molina
9a2190cd24
cpu/cc2538/periph/pm: unset OSC_PD when running on 32Mhz
...
Setting OSC_PD before WFI allows for faster wakeup from sleep.
Wait for cc2538_sys_ctrl_clk_sta and not cc2538_sys_ctrl_clk_ctrl
to be set.
2020-03-21 19:32:24 +01:00
Francisco Molina
8c35335668
cpu/cc2538/cpu: cleanup clock intialization
2020-03-21 19:32:22 +01:00
Francisco
b98e4bf0d1
Merge pull request #13658 from fjmolinas/pr_periph_timer_cc2538
...
cpu/cc2538: fix GPT3 IRQ definition
2020-03-20 14:31:05 +01:00
Gunar Schorcht
df19c6d1b4
Merge pull request #13519 from benpicco/rtt_rtc
...
drivers/rtt_rtc: add RTT based RTC implementation, enable it for cpu/cc2538, nrf5x_common
2020-03-19 17:18:43 +01:00
Francisco Molina
226e1b5daf
cpu/cc2538: fix GPT3 timer IRQ definition
2020-03-19 16:31:57 +01:00
Benjamin Valentin
f9346e1e2b
cpu/cc2538: use RTT based RTC implementation
2020-03-19 15:25:14 +01:00
Francisco
d77ecc1cde
Merge pull request #13598 from benpicco/cpu/cc2538-spi-fix
...
cpu/cc2538: fix spi_transfer_bytes()
2020-03-17 17:29:49 +01:00
benpicco
5d038a24bf
Merge pull request #13510 from benpicco/cpu/cc2538-pm
...
cpu/cc2538: implement periph/pm
2020-03-12 12:18:18 +01:00
Dylan Laduranty
077a15f254
cpu/cc2538: use generic hw fc module
2020-03-10 14:22:34 +01:00
Benjamin Valentin
5d8c00e302
cpu/cc2538: implement periph/pm
...
cc2538 implements 4 sleep modes.
In the lightest mode (3) any interrupt source can wake up the CPU.
In mode 2, only RTT, GPIO or USB may wake the CPU.
In mode 1 only RTT and GPIO can wake the CPU.
In mode 0 only GPIO can wake the CPU.
In mode 0 and 1 the lower 16k RAM are lost. This is a problem since those
are usually used by RIOT.
The linkerscripts in cc2538/ldscripts take different approaches towards that.
Some only use the upper 16k and leave the other half to be managed by the
application.
`cc2538sf53.ld` which is used by `openmote-b` uses the entire RAM starting
at the lower half, so it will not be able to wake up from those modes.
A quick fix to test those modes with `tests/periph_pm` would be
--- a/cpu/cc2538/ldscripts/cc2538sf53.ld
+++ b/cpu/cc2538/ldscripts/cc2538sf53.ld
@@ -21,7 +21,7 @@ MEMORY
{
rom (rx) : ORIGIN = 0x00200000, LENGTH = 512K - 44
cca : ORIGIN = 0x0027ffd4, LENGTH = 44
- ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 32K
+ ram (w!rx) : ORIGIN = 0x20004000, LENGTH = 16K
}
2020-03-10 10:35:46 +01:00
Benjamin Valentin
80392dc644
cpu/cc2538: spi: unify spi_transfer_bytes()
...
Use a common helper function to read/write the data register.
2020-03-09 16:37:07 +01:00
Benjamin Valentin
68b2c57d2d
cpu/cc2538: spi: fix spi_transfer_bytes() with in_buf = NULL
...
We have to read the DR for every byte that we write.
Just reading DR while SPI is busy in a loop can lead to bytes being
left in the fifo, corrupting subsequent reads.
2020-03-09 16:22:37 +01:00
benpicco
7396d05605
Merge pull request #13575 from fjmolinas/pr_cc2538_rf_deps
...
cpu/cc2538: handle cc2538_rf deps in Makefile.dep
2020-03-06 18:00:51 +01:00
Francisco Molina
ff6f6618fb
cpu/cc2538: handle cc2538_rf deps in Makefile.dep
2020-03-06 14:17:19 +01:00
Jose Alamos
3ad574a822
drivers/netdev: use netdev_trigger_event_isr function
2020-03-06 14:03:43 +01:00
68ec8b2c2b
Merge pull request #13391 from kaspar030/mpu_feature
...
cpu/cortex-m: turn MPU support into a feature
2020-03-04 07:09:40 +01:00
a3c527fdbc
cpu/*: add cortex_mpu to known-to-support CPU families
2020-03-03 22:59:41 +01:00
Francisco
3f062a78b2
Merge pull request #13045 from aabadie/pr/boards/remote_factorize
...
boards/remote*: cleanup and factorize code in peripheral configuration headers
2020-03-03 13:21:04 +01:00
d7c0102115
cpu/cortexm: move CPU_ARCH/FAM to Makefile.features
2020-02-17 16:02:48 +01:00
Gunar Schorcht
42db6861e1
cpu/cc2538: fix I2C compilation error with NDEBUG
...
When NDEBUG macro is defined during compilation, the assert macro produces empty code. The dev parameter is then unused.
2020-01-30 11:57:36 +01:00
Marian Buschsieweke
c4a84f01c0
cpu/cc2538/periph: adc_sample() now returns int32_t
2020-01-10 14:13:14 +01:00
82d1d40042
cpu/cc2538: define radio irq prio at cpu level
2020-01-08 14:41:01 +01:00
Francisco Molina
1801f4f085
cpu/cc2538: add periph_rtt
2020-01-08 09:16:49 +01:00
b01c6707a5
cpu/cc2538: fix typos
2019-11-23 22:39:36 +01:00
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
Yegor Yefremov
df7e760588
doxygen/I2C: don't include overridden typedefs
...
Add missing #ifndefs to overridden I2C typedefs.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-11-15 10:35:33 +01:00
Yegor Yefremov
cf65070b06
doxygen/GPIO: don't include overridden typedefs
...
Add missing #ifndefs to overridden GPIO typedefs.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-11-15 10:35:33 +01:00
Yegor Yefremov
fa3b0ff04b
doxygen/SPI: don't include overridden typedefs
...
Add missing #ifndefs to overridden SPI typedefs.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-11-15 10:35:32 +01:00
Yegor Yefremov
5b0252b150
doxygen/ADC: don't include overridden typedefs
...
Add missing #ifndefs to overridden ADC resolution typedefs.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-11-15 10:35:32 +01:00
5578740fc4
Merge pull request #12397 from fjmolinas/pr_CPU_ARCH_FAM
...
makefiles/vars.inc.mk: move definition and export of CPU_FAM and CPU_ARCH to vars.inc.mk
2019-10-21 08:23:51 +02:00
Francisco Molina
b4f9b74e1a
cpu/cc2*: remove immediate expansion of CPU_ARCH
2019-10-18 08:55:33 +02:00
Francisco Molina
5e9b92a326
cpu: remove CPU_ARCH exports
2019-10-18 08:55:33 +02:00
cba293a9a9
cpu/cc2538: provide gpio feature at cpu level
2019-10-17 22:05:23 +02:00
Kevin "Tristate Tom" Weiss
5bbfe92c11
Merge pull request #12336 from benpicco/cc2538-spi_fix
...
cpu/cc2538: fix spi_transfer_bytes()
2019-10-02 10:52:16 +02:00
Gunar Schorcht
02d81b717e
Merge pull request #12063 from maribu/i2c_release
...
drivers/periph/i2c: Updated i2c_release() to return void
2019-10-01 19:50:38 +02:00
Benjamin Valentin
bf1eca338f
cpu/cc2538: fix spi_transfer_bytes()
...
Always wait for RNE before reading DR.
Fixes always reading in the !out_buf case.
2019-09-30 13:11:11 +02:00
Sebastian Meiling
cabaaebff4
cpu/cc2538: adapt timer to return 0 on success
...
Adapt periph/timer implementation of cc2538 based MCUs
to return 0 on success for all functions.
2019-09-11 13:44:46 +02:00
Marian Buschsieweke
df27dbef7a
cpu: Moved stdio_init() into cpu_init()
...
- Removed stdio_init() from newlib's _init(), as this is too late in the boot
process to allow DEBUG()ing during periph_init()
- Added stdio_init() to the various cpu_init() routines of the ARM CPUs just
before periph_init()
2019-09-06 16:54:23 +02:00
Marian Buschsieweke
1a51b01db9
cpu/cc2538/periph/i2c: Made cppcheck happy
2019-08-27 13:59:23 +02:00
Marian Buschsieweke
6917934946
cpu/cc2538: Updated i2c_release()
2019-08-22 12:03:07 +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
MrKevinWeiss
0aa6b04249
cpu/cc2538: Add periph_uart_mode implementation
...
This commit adds the periph_uart_mode USEMODULE
It implements all functionality defined in the common uart driver
This means all parity modes, data bits, and stop bits
2019-05-15 09:26:56 +02:00
smlng
6183d5f5c5
netdev: remove layer2 netstats from netdev drivers
...
Removing usage of netdev->stats in all net drivers, as it is
handled by gnrc_netif.
2019-02-01 11:25:27 +02:00
Sebastian Meiling
4eaf1d8135
Merge pull request #10384 from bergzand/pr/netdev/ref_nid
...
netdev_ieee802154/radios: refactor PAN ID reset to generic ieee802154 reset
2018-11-28 12:15:45 +01:00
da0866a6a0
cc2538_rf: Remove PAN ID initialization from reset
2018-11-28 11:31:02 +01:00
Martine Lenders
7a8469f1aa
Merge pull request #10426 from bergzand/pr/cc2538_rf/undedup_channel
...
cc2538_rf: Don't use netdev_ieee802154_t for channel
2018-11-25 13:26:57 +01:00
897044623a
cc2538_rf: Don't propagate channel to 802154 layer
2018-11-25 10:38:13 +01:00
40b4af1905
cc2538_rf: Add NETOPT_CHANNEL to getters
2018-11-25 10:38:08 +01:00
08dd9a1df8
cc2538_rf: Don't propagate address to 802154 layer
2018-11-17 22:38:18 +01:00
ffe6aed83e
cc2538_rf: Add NETOPT_ADDRESS{,_LONG} to getters
2018-11-17 22:38:17 +01:00
Semjon Kerner
5b0152f4f7
drivers/netdev_ieee802154: drop NETOPT_MAX_PKT_SIZE
2018-10-16 13:28:03 +02:00
Martine Lenders
73061ae70e
cc2538: mark closing #endif for MODULE_PERIPH_GPIO_IRQ
2018-10-09 15:10:59 +02:00
Hauke Petersen
36d88c2c40
cpu/cc2538/gpio: use gpio_irq feature
2018-09-21 08:16:37 +02:00
smlng
214ddc4fc4
cpu/cc2538: adapt and cleanup periph/hwrng
...
Some minor adaptions due to cleanup in periph/adc and usage of
vendor header files.
2018-09-03 09:01:42 +02:00
smlng
d40cfab95a
cpu/cc2538: enhance periph ADC
...
Adapt the periph ADC implementation to use vendor defines where
ever possible. Remove duplicate or obsolete defines and adapt
board configuration as required.
2018-09-03 09:01:42 +02:00
Peter Kietzmann
a05e2f22e2
Merge pull request #9693 from smlng/pr/cc2538/timer
...
cc2538: cleanup and optimisation of periph timer
2018-08-13 08:40:51 +02:00
smlng
d9c9c9479e
cpu/cc2538: add debug output in periph/spi
2018-08-10 10:38:51 +02:00
smlng
e246c19fe1
cpu/cc2538: adapt periph/spi to gpio API
...
Rework SPI periph driver to use proper RIOT GPIO API functions.
Also cleanup header files by using vendor defines and remove
obsolete code. Further, adapt board config accordingly.
2018-08-10 10:38:51 +02:00
smlng
d8e2611ed9
cpu/cc2538: refine gpio_init_mux
...
Introduces a define to inidicate an unused function parameter.
2018-08-10 10:38:51 +02:00
smlng
459f7ebce0
cpu/cc2538: generalise SPI clock configuration
...
The SPI bus frequency/clock is calculated relative to the MCUs
core clock. Currently all boards use the default 32MHz, hence
prescaler settings for SPI are all the same. This PR moves the
default config for 32MHz to the CPU and allows to be overriden
by board config if needed.
2018-08-07 12:15:45 +02:00
smlng
7ff2e44821
cpu/cc2538: cleanup periph timer headers and code
...
Remove unused or obsolete defines in headers, due to usage of
vendor headers. Also remove register bit definition in timer
struct because they where not used in the implementation.
2018-08-07 08:13:47 +02:00
smlng
b7ab6b4b36
cpu/cc2538: cleanup periph timer implementation
...
Refine periph timer implementation to use vendor header defines
where possible, remove unnecessary structs and general cleanup.
2018-08-07 08:13:47 +02:00
smlng
df37e69b90
cpu/cc2538: add TI vendor headers
...
Currently the cc2538 is based on from-scratch adaption which is
not feature complete and thus lacks defines etc. Introducing the
official vendor header will ease future extension and adaptions
of the CPU and its features.
2018-08-03 08:29:32 +02:00
smlng
eee4f36ef5
cpu/cc2538: adapt periph/i2c to new api
2018-07-25 12:01:38 +02:00
smlng
a27ae261b8
cpu/cc2538: add gpio_init_mux function
2018-07-25 12:01:38 +02:00
smlng
0067be035c
cpu/cc2538: cleanup netdev calls in radio driver
...
Cleanup netdev calls using &dev->netdev for all functions and
thereby omiting the explicit cast.
2018-07-13 12:17:03 +02:00
smlng
520f5b60b3
cpu/cc2538: use netdev reset function in radio driver
2018-07-13 12:17:03 +02:00
PeterKietzmann
2f86d6fcd8
cpu/cc2538: add SRAM based random seed
2018-07-04 17:55:20 +02:00
938677cc83
cpu*: fix doxygen grouping
2018-06-11 19:12:02 +02:00
ecb2e4767d
Merge pull request #8955 from aabadie/pr/cpu/guard_cc2538
...
cpu/cc2538: remove obsolete periph file guard
2018-05-14 22:46:47 +02:00
Joakim Nohlgård
e3a27a74cc
cc2538: Adjust ldscript memory segment attributes
2018-05-09 06:41:57 +02:00
ebbb071e0a
cpu/cc2538: remove useless periph file guard
2018-04-16 10:07:00 +02:00
23b414b732
drivers: net: adapt to iolist-using netdev
2018-03-06 14:00:31 +01:00
danpetry
cd449e388b
cpu/cc2538: Adapted UART driver incl. board config
...
Changed the style of the UART configuration for different boards,
from a define based configuration to one based on an array of
structs, one struct for each UART, with the format of the struct defined
in cc2538/include/periph_cpu.h.
- Defined the fields of the struct in periph_cpu.h
- Removed the compilation includes that were in uart.c for each UART
- Implemented a generic ISR subroutine for clarity
- combined uart_base and uart_init in uart.c
- used bitmask for the interrupt setup
- took the uart Rx, Tx, and IRQ numbers out of the config
(as this has to match the .dev field). Replaced with
macros from the uart number
- took out some unused code
- implemented power on/off commands
- removed reset function - now bytes are just discarded on error
- Rx now not initialised if Rx callback = NULL, as per
drivers/periph/uart.h
- device is now enabled after callbacks are set, not before
- asserts raised if rts and cts are enabled for UART0
- BIT macro removed
2018-02-08 14:36:51 +01:00
4dd854da74
cpu/cc2538: DEBUG fixes
2018-01-15 14:37:05 +01:00
smlng
ba324ef07c
cpu, cc2538: adapt uart to RIOT gpio API
2017-12-14 10:32:04 +01:00
Martine Lenders
39c122155c
Merge pull request #7995 from smlng/make/fix/unused_params
...
make: fix unused-params error
2017-11-28 14:46:23 +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
smlng
e381317fbf
make: fix sign-compare errors
...
cpu, nrf5x_common: fix sign-compare in periph/flashpage
drivers, periph_common: fix sign-compare in flashpage
cpu, sam0_common: fix sign-compare error in periph/gpio
cpu, cc2538: fix sign-compare in periph/timer
cpu, sam3: fix sign-compare in periph/gpio
cpu, stm32_common: fix sign-compare in periph/pwm
cpu, stm32_common: fix sign-compare in periph/timer
cpu, stm32_common: fix sign-compare in periph/flashpage
cpu, nrf5x_common: fix sign-compare in radio/nrfmin
cpu, samd21: fix sign-compare in periph/pwm
cpu, ezr32wg: fix sign-compare in periph/gpio
cpu, ezr32wg: fix sign-compare in periph/timer
drivers, ethos: fix sign-compare
sys, net: fix sign-compare
cpu, atmega_common: fix sign-compare error
cpu, msp430fxyz: fix sign-compare in periph/gpio
boards, msb-430-common: fix sign-compare in board_init
driver, cc2420: fix sign-compared
sys/net: fix sign-compare in gnrc_tftp
driver, pcd8544: fix sign-compare
driver, pn532: fix sign-compare
driver, sdcard_spi: fix sign-compare
tests: fix sign_compare
sys/net, lwmac: fix sign_compare
pkg, lwip: fix sign-compare
boards, waspmote: make CORECLOCK unsigned long to fix sign_compare error
tests, sock_ip: fix sign compare
tests, msg_avail: fix sign compare
tests, sock_udp: fix sign compare
boards: fix sign-compare for calliope and microbit matrix
2017-11-28 11:55:48 +01:00
smlng
d03551756f
cpu, cc2538: adapt periph drivers to refined gpio handling
2017-11-17 20:06:41 +01:00