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

52 Commits

Author SHA1 Message Date
Marian Buschsieweke
675dcc381c
cpu/msp430: rework MSP430 x1xx periph drivers
- Move common code for USART (shared SPI / UART peripheral) to its
  own file and allow sharing the USART peripheral to provide both
  UART and SPI in round-robin fashion.
- Configure both UART and SPI bus via a `struct` in the board's
  `periph_conf.h`
    - this allows allocating the two UARTs as needed by the use case
    - since both USARTs signals have a fixed connection to a single
      GPIO, most configuration is moved to the CPU
    - the board now only needs to decide which bus is provided by
      which USART

Note: Sharing an USART used as UART requires cooperation from the app:
- If the UART is used in TX-only mode (no RX callback), the driver
  will release the USART while not sending
- If the UART is used to also receive, the application needs to power
  the UART down while not expecting something to send. An
  `spi_acquire()` will be blocked while the UART is powered up.
2024-01-22 16:59:23 +01:00
Marian Buschsieweke
b51ea4ca24
boards: clean up MSP430 board configuration
Move common configuration for MSP430 based boards to
`boards/common/msp430` and make use of that.
2023-12-10 09:11:24 +01:00
Marian Buschsieweke
7044699388
cpu/msp430: improve periph_timer
- add support for multiple timers
- add support for selecting clock source in the board's `periph_conf.h`
- add support for the prescaler
- implement `periph_timer_query_freqs`
- add a second timer to all MSP430 boards
    - the first timer is fast ticking, high-power
    - the second is slow ticking, low-power
2023-12-10 09:11:23 +01:00
Marian Buschsieweke
0ae471116e
boards/msb-430: Fix periph config & improve doc
The pins P5.2, P5.1, P5.3 configured as SPI pins are only routed to
USART1 and not to USART0, but previously USART0 was configured as
peripheral backing the bus. This fixes the peripheral configuration by
changing it to USART1.

This is quite unfortunate as USART1 is also used to provide the UART
interface used for `stdio`. Hence, one can either use `stdio` or SPI.
A feature conflict between UART and SPI has therefore been added.

Note that while it would be possible to use P3.2, P3.1, P3.3 to provide
SPI with USART0, this would not work in practise: P3.1 and P3.3 are
connected to the CC1020 transceiver.

Switching to P3.4/P3.5 for UART to provide it using USART 0 would also
resolve the resource conflict. However, these pins are not available
via any of the header and would require soldering the UART<->USB
adapter directly to the pins of the MCU chip on the PCB. It is therefore
much more user friendly to keep the UART bus backed by USART1 to use
pins P3.6 and P3.7 that are easily accessible via the pin header.
2023-09-14 14:38:05 +02:00
Marian Buschsieweke
45b353c6ef
cpu/msp430: make use of vendor header files
The MSP430 vendor files already provide macros containing register
constants and symbols (provided via linker scripts) containing addresses
of peripheral registers. So lets make use of that rather than
maintaining a long list of constants.
2023-07-04 20:21:05 +02:00
Marian Buschsieweke
ff7f8ae2f0
cpu/msp430: reorganize code
RIOT supports two distinct families of the MSP430: The [MSP430 x1xx]
MCU family and the [MSP430 F2xx/G2xx] MCU family. For both incompatible
MCU families the code was located in the msp430fxyz folder, resulting
in case of the UART driver in particularly bizarre code looking roughly
like this:

    #ifndef UART_USE_USCI
    /* implementation of x1xx peripheral ... */
    #else
    /* implementation of F2xx/G2xx peripheral ... */
    #endif
    /* zero shared code between both variants */

This splits the peripheral drivers for USCI and USART serial IP blocks
into separate files and relocates everything in cpu/msp430, similar to
how cpu/stm32 is organized.

[MSP430 x1xx]: https://www.ti.com/lit/ug/slau049f/slau049f.pdf
[MSP430 F2xx/G2xx]: https://www.ti.com/lit/ug/slau144k/slau144k.pdf
2023-06-19 17:14:57 +02:00
Marian Buschsieweke
df5c319978
cpu/msp430fxyz: clean up clock initialization
Provide a common clock initialization driver rather than leaving
clock initialization to the boards code. A declarative description of
the board's clock configuration using a struct does still allow to
fine-tune settings. In addition, a board is still allowed to just
provide a custom `void clock_init(void)` if there really is the need
to do crazy things.
2023-05-16 10:05:09 +02:00
Karl Fessel
05f114d0af doc: fix unbalaced grouping
- most were trivial
    - missing group close or open
    - extra space
    - no doxygen comment
- name commad might open an implicit group
    this hould also be implicit cosed but does not happen somtimes
- crazy: internal declared groups have to be closed internal
2022-09-14 15:05:25 +02:00
MrKevinWeiss
1acf37c6f3 boards/msb-430: Remove unused UART_x_EN macro 2020-09-09 10:25:37 +02:00
Gunar Schorcht
f7a40c1a6f boards/msb-430h: fix broken links 2020-03-24 10:38:40 +01:00
Jose Alamos
7b28fbf110 boards: fix Doxygen group directives 2018-08-01 15:24:55 +02:00
Marian Buschsieweke
de9b67bdc2
drivers/sht1x: Major refactoring
- Use RIOT's GPIO interface to access the sensor to increase portability
- Changed API to allow more than one sensor per board
- Added `sht1x_params.h` that specifies how the sensors is connected - each
  board can overwrite default settings by #defining SHT1X_PARAM_CLK and
  SHT1X_PARAM_DATA
- Changed arithmetic to use integer calculations only instead of floating point
  arithmetic
- Added support for checking the CRC sum
- Allow optional skipping of the CRC check to speed up measuring
- Added support for advanced features like reducing the resolution and skipping
  calibration to speed up measuring
- Allow specifying the supply voltage of sensor which heavily influences the
  temperature result (and use that information to calculate the correct
  temperature)
- Reset sensor on initialization to bring it in a well known state
- Support for the obscure heater feature. (Can be useful to check the
  temperature sensor?)
- Updated old SHT11 shell commands to the new driver interface, thus allowing
  more than one SHT10/11/15 sensor to be used
- Added new shell command to allow full configuration of all attached SHT1x
  sensors
- Removed old command for setting the SHT11 temperature offset, as this feature
  is implemented in the new configuration command
2018-06-27 08:58:00 +02:00
0fcc7d3834 cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
882bcff048 boards: replace @brief with @name when necessary 2017-04-13 12:10:30 +02:00
Bas Stottelaar
3b14a584b8 boards: *: remove SPI_*_EN now rework is merged 2017-01-31 19:38:41 +01:00
ebc35a0613 boards: fix doxygen @brief in periph.conf 2017-01-27 10:31:56 +01:00
Hauke Petersen
d5e00e594a cpu/msp430fxyz+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
Hauke Petersen
363b883d51 boards: fixed doxygen in msp430 and x86 board.h 2016-03-15 18:37:54 +01:00
Hauke Petersen
195b067790 boards/msb-430: unified LED defines 2016-03-15 16:24:49 +01:00
Hauke Petersen
c11517138e boards/msb-430: cleanup in common files
- renamed board-conf.h to board_common.h
- moved common defines to board_common.h
2016-03-15 15:48:46 +01:00
Ludwig Knüpfer
9dd666768a boards/msb-430: fix style 2016-03-07 22:45:09 +01:00
Ludwig Knüpfer
94709cfcdf boards/msb-430: fix and improve Doxygen
Add reference URL, fix typos.
2016-03-07 22:45:08 +01:00
Ludwig Knüpfer
5ad3073a7d boards/msb-430: fix components documentation 2016-03-07 22:45:08 +01:00
Hauke Petersen
08d1e8de91 boards/msb-430(h): style fixed in board.h
fixed indention and parens for LED defines
2016-02-24 15:59:14 +01:00
Hauke Petersen
6dc4f0d007 boards/msb-430(h): added LED_GREEN_x macros 2016-02-18 17:17:27 +01:00
Hauke Petersen
db25206a58 boards: use default values for STDIO defines 2016-01-05 12:08:31 +01:00
Hauke Petersen
a8502e2991 boards/msb-430: adjusted to UART changes 2015-10-27 14:59:38 +01:00
Hauke Petersen
e395dfd91e boards: s/GPIO(x,y)/GPIO_PIN(x,y)/ 2015-10-13 14:59:53 +02:00
Hauke Petersen
a3e11cad93 boards: s/TIMER_DEV/TIMER_BASE/ for msp430 boards 2015-09-17 13:57:58 +02:00
Thomas Eichinger
d339a84059 msb-430: add missing SPI periph_conf definitions 2015-09-17 11:32:38 +02:00
44cdec0e1e boards: msp430*: added (x)timer XTIMER_SHIFT_ON_COMPARE values 2015-09-16 11:13:41 +02:00
a650b9487e boards: msb-430: remove hwtimer from board.h 2015-09-16 10:58:53 +02:00
Hauke Petersen
5e2a1d226b boards/msb-430: adapted to periph UART driver 2015-09-03 12:00:33 +02:00
Hauke Petersen
3c3c0b914c board/msb-430: added (x)timer configuration 2015-09-02 17:10:28 +02:00
830af458ea oldnet: remove radio_packet_length_t define 2015-08-06 12:13:18 +02:00
Oleg Hahm
5ca37400b8 boards: remove all C++ comments 2015-06-24 15:54:36 +02:00
BigDaddyD
b6bd067863 boards: removed leading underscores from macros
* also added a trailing underscore to header guards for consistency

Commit for PR 2623, repairing header file include guards.
This PR is intended to fix the include guards in files under RIOT/boards

SQUASH ME: fix underscore removal overdos

SQUASH ME: consistent macro naming

SQUASH ME: missed that one

SQUASH ME: fixed overdo

SQUASH ME: consistency
2015-06-24 15:54:36 +02:00
Oleg Hahm
f7b197007d travis: make travis happy for empty header files 2014-12-16 17:02:44 +01:00
Oleg Hahm
ed54a5765a boards: created periph-conf.h for remaining boards 2014-12-16 17:02:44 +01:00
BytesGalore
fc56535dd3 boards: add extern "C" to header files 2014-10-31 11:27:59 +01:00
Oleg Hahm
3c0d91720b Revert "boards: introduced a HAS_RADIO define"
This reverts commit 4238f40429.
2014-10-30 23:13:52 +01:00
Oleg Hahm
4238f40429 boards: introduced a HAS_RADIO define 2014-10-30 17:52:37 +01:00
Oleg Hahm
481d4f2ee3 doc: fix ambiguous file name warnings
doxygen does a good job itself, identifying the unique part of the path
to identify a file.
2014-10-23 20:53:00 +02:00
Ludwig Ortmann
2439bd839c doc: fix more license headers
Remove some cruft, set correct lgpl versions, update to lgpl where
this had been overlooked in the past, fix odd comment style...
2014-08-27 19:20:49 +02:00
Cenk Gündoğan
7ca2e874e1 converting tabs to spaces in boards (#1439)
This PR converts tabs to white spaces.
The statement I used for the conversion:
'''find . -name "*.[ch]" -exec zsh -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;'''
Afterwards, I had a quick overview of the converted files to prevent odd indentation.
2014-07-31 20:34:28 +02:00
Oleg Hahm
4ddc9539fd documentation: unified descriptive text for boards 2014-05-24 15:03:06 +02:00
Ludwig Ortmann
088b15783b license: %s/FeuerWare/RIOT/g 2014-05-13 17:10:48 +02:00
Kévin Roussel
5d393d270b Sets MCU frequency in 'board.h', instead of the common 'cpu.h' file 2013-12-24 15:41:32 +01:00
Kévin Roussel
afce119138 Added definition of correct MCU model in MSP430-based board headers 2013-12-18 10:51:45 +01:00