19#ifndef F2XX_G2XX_PERIPH_CPU_H
20#define F2XX_G2XX_PERIPH_CPU_H
24#include "periph_cpu_common.h"
34#define HAVE_SPI_MODE_T
72#define PERIPH_SPI_NEEDS_INIT_CS
73#define PERIPH_SPI_NEEDS_TRANSFER_BYTE
74#define PERIPH_SPI_NEEDS_TRANSFER_REG
75#define PERIPH_SPI_NEEDS_TRANSFER_REGS
84#ifdef __MSP430_HAS_USCI_AB0__
88#ifdef __MSP430_HAS_USCI_AB1__
#define REG8
Register types.
@ SPI_CLK_10MHZ
drive the SPI bus with 10MHz
@ SPI_CLK_5MHZ
drive the SPI bus with 5MHz
@ SPI_CLK_400KHZ
drive the SPI bus with 400KHz
@ SPI_CLK_1MHZ
drive the SPI bus with 1MHz
@ SPI_CLK_100KHZ
drive the SPI bus with 100KHz
#define UCSSEL_ACLK
Clock USCI using auxiliary clock.
#define UCSSEL_SMCLK
Clock USCI using sub-system master clock.
#define UCSSEL_UCLKI
Clock USCI using CLKI (n/a in SPI mode)
msp430_port_p7_p8_t PORT_8
Register map of GPIO PORT 8.
const msp430_usci_spi_params_t usci_b1_as_spi
MSP430 F2xx/G2xx USCI B1 in SPI configuration.
void msp430_usci_acquire(const msp430_usci_params_t *params, const msp430_usci_conf_t *conf)
Acquire and initialize USCI for use a SPI/UART peripheral.
void msp430_usci_release(const msp430_usci_params_t *params)
Release an USCI, so that it can be used to provide other peripherals.
const msp430_usci_spi_params_t usci_a1_as_spi
MSP430 F2xx/G2xx USCI A1 in SPI configuration.
msp430_port_p7_p8_t PORT_7
Register map of GPIO PORT 7.
const msp430_usci_spi_params_t usci_b0_as_spi
MSP430 F2xx/G2xx USCI B0 in SPI configuration.
const msp430_usci_uart_params_t usci_a1_as_uart
MSP430 F2xx/G2xx USCI A1 in UART configuration.
msp430_usci_clk_t
MSP430 F2xx/G2xx USCI clock source.
@ USCI_CLK_SUBMAIN
sub-system master clock source
@ USCI_CLK_AUX
auxiliary clock source
@ USCI_CLK_UCLKI
UCLKI clock source (not supported yet)
const msp430_usci_spi_params_t usci_a0_as_spi
MSP430 F2xx/G2xx USCI A0 in SPI configuration.
const msp430_usci_uart_params_t usci_a0_as_uart
MSP430 F2xx/G2xx USCI A0 in UART configuration.
spi_mode_t
Support SPI modes.
@ SPI_MODE_0
CPOL=0, CPHA=0.
@ SPI_MODE_2
CPOL=1, CPHA=0.
@ SPI_MODE_1
CPOL=0, CPHA=1.
@ SPI_MODE_3
CPOL=1, CPHA=1.
msp430_usci_prescaler_t msp430_usci_prescale(uint32_t target_hz)
Calculate prescaler settings for the given target frequency.
msp430_usci_id_t
Identifiers for USCI instances.
@ MSP430_USCI_ID_NUMOF
Number of USCI IDs (also: number of USCI instances)
GPIO Port 7/8 (different register layout than Ports 1-6)
Universal Serial Control Interface Type B (USCI_B) Registers.
MSP430 F2xx/G2xx USCI configuration registers.
uint8_t ctl0
USCI control register 0.
msp430_usci_prescaler_t prescaler
Prescaler configuration.
MSP430 F2xx/G2xx USCI configuration.
REG8 * interrupt_enable
The interrupt enable register matching the USCI.
msp430_usci_b_t * dev
The USCI device to use.
REG8 * interrupt_flag
The interrupt flag register matching the USCI.
uint8_t rx_irq_mask
The bitmask to enable the TX IRQ for this USCI.
msp430_usci_id_t id
ID of the USCI.
uint8_t tx_irq_mask
The bitmask to enable the TX IRQ for this USCI.
MSP430 F2xx/G2xx USCI prescaler configuration.
uint8_t br0
What to write in the BR0 register.
msp430_usci_clk_t clk_source
Clock source to use.
uint8_t br1
What to write in the BR1 register.
uint8_t mctl
USCI modulation control register.
MSP430 F2xx/G2xx SPI configuration, CPU level.
gpio_t mosi
COPI (MOSI) pin.
gpio_t miso
CIPO (MISO) pin.
msp430_usci_params_t usci_params
The USCI parameters.
MSP430 F2xx/G2xx UART configuration, CPU level.
msp430_usci_params_t usci_params
The USCI params.
SPI device configuration.
const msp430_usci_spi_params_t * spi
The SPI configuration to use.
UART device configuration.
const msp430_usci_uart_params_t * uart
The UART configuration to use.