BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
Structures for abstracted serial interface. More...
Go to the source code of this file.
Data Structures | |
struct | sBSP430halSERIAL |
Typedefs | |
typedef struct sBSP430halSERIAL | sBSP430halSERIAL |
typedef struct sBSP430halSERIAL * | hBSP430halSERIAL |
Structures for abstracted serial interface.
The MSP430 line has a variety of peripherals that support serial communications, including the origin 2xx/4xx family USCI, 5xx USCI, and 5xx eUSCI. These are sufficiently similar in function that it is useful to have a hardware abstraction layer that delegates to the peripherals available on the current platform.
To break circular dependencies between the shared <bsp430/serial.h> file and the individual peripherals that are supported by it, this header contains the structures that are required by the individual peripherals to declare their own interfaces. Those headers then include this one, and <bsp430/serial.h> includes the relevant individual peripheral headers.
#define BSP430_SERIAL_ENABLE_RESOURCE 0 |
Indicate whether serial HAL structures should include a resource object.
The bulk of the serial interface requires exclusive access consistent with The _rh "resource held" suffix. By defining this to a true value the sBSP430halSERIAL::resource field will be available in each hBSP430halSERIAL instance to simplify resource management between subsystems.
#define BSP430_SERIAL_HAL_GET_HPL_EUSCIA | ( | hal_ | ) | ((BSP430_SERIAL_HAL_HPL_VARIANT_IS_EUSCIA(hal_)) ? (hal_)->hpl.euscia : (void *)0) |
Get the serial HPL pointer if the HAL is a EUSCIA variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_SERIAL_HAL_GET_HPL_EUSCIB | ( | hal_ | ) | ((BSP430_SERIAL_HAL_HPL_VARIANT_IS_EUSCIB(hal_)) ? (hal_)->hpl.euscib : (void *)0) |
Get the serial HPL pointer if the HAL is a EUSCIB variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_SERIAL_HAL_GET_HPL_USCI | ( | hal_ | ) | ((BSP430_SERIAL_HAL_HPL_VARIANT_IS_USCI(hal_)) ? (hal_)->hpl.usci : (void *)0) |
Get the serial HPL pointer if the HAL is a USCI variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_SERIAL_HAL_GET_HPL_USCI5 | ( | hal_ | ) | ((BSP430_SERIAL_HAL_HPL_VARIANT_IS_USCI5(hal_)) ? (hal_)->hpl.usci5 : (void *)0) |
Get the serial HPL pointer if the HAL is a USCI5 variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_SERIAL_HAL_GET_HPLAUX_EUSCIA | ( | hal_ | ) | ((BSP430_SERIAL_HAL_HPL_VARIANT_IS_EUSCIA(hal_)) ? (hal_)->hpl_aux.euscia : (void *)0) |
Get the serial HPL auxiliary pointer if the HAL is a EUSCIA variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_SERIAL_HAL_GET_HPLAUX_EUSCIB | ( | hal_ | ) | ((BSP430_SERIAL_HAL_HPL_VARIANT_IS_EUSCIB(hal_)) ? (hal_)->hpl_aux.euscib : (void *)0) |
Get the serial HPL auxiliary pointer if the HAL is a EUSCIB variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_SERIAL_HAL_GET_HPLAUX_USCI | ( | hal_ | ) | ((BSP430_SERIAL_HAL_HPL_VARIANT_IS_USCI(hal_)) ? (hal_)->hpl_aux.usci : (void *)0) |
Get the serial HPL auxiliary pointer if the HAL is a USCI variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_SERIAL_HAL_GET_HPLAUX_USCI5 | ( | hal_ | ) | ((BSP430_SERIAL_HAL_HPL_VARIANT_IS_USCI5(hal_)) ? (hal_)->hpl_aux.usci5 : (void *)0) |
Get the serial HPL auxiliary pointer if the HAL is a USCI5 variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_SERIAL_HAL_HPL_VARIANT_EUSCIA 3 |
Field value for variant stored in sBSP430halSERIAL.hal_state.cflags when HPL reference is to an sBSP430hplEUSCIA.
#define BSP430_SERIAL_HAL_HPL_VARIANT_EUSCIB 4 |
Field value for variant stored in sBSP430halSERIAL.hal_state.cflags when HPL reference is to an sBSP430hplEUSCIA.
#define BSP430_SERIAL_HAL_HPL_VARIANT_IS_EUSCIA | ( | hal_ | ) | (BSP430_SERIAL_HAL_HPL_VARIANT_EUSCIA == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the serial HAL is a EUSCIA variant.
#define BSP430_SERIAL_HAL_HPL_VARIANT_IS_EUSCIB | ( | hal_ | ) | (BSP430_SERIAL_HAL_HPL_VARIANT_EUSCIB == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the serial HAL is a EUSCIB variant.
#define BSP430_SERIAL_HAL_HPL_VARIANT_IS_USCI | ( | hal_ | ) | (BSP430_SERIAL_HAL_HPL_VARIANT_USCI == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the serial HAL is a USCI variant.
#define BSP430_SERIAL_HAL_HPL_VARIANT_IS_USCI5 | ( | hal_ | ) | (BSP430_SERIAL_HAL_HPL_VARIANT_USCI5 == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the serial HAL is a USCI5 variant.
#define BSP430_SERIAL_HAL_HPL_VARIANT_USCI 1 |
Field value for variant stored in sBSP430halSERIAL.hal_state.cflags when HPL reference is to an sBSP430hplUSCI.
#define BSP430_SERIAL_HAL_HPL_VARIANT_USCI5 2 |
Field value for variant stored in sBSP430halSERIAL.hal_state.cflags when HPL reference is to an sBSP430hplUSCI5.
#define BSP430_SERIAL_SPI_READ_TX_BYTE | ( | i_ | ) | (i_) |
Specify byte written when reading a SPI byte.
The SPI protocal requires that a byte be written for every byte received; the reception occurs during the write. In many cases, the value of the byte written is completely irrelevant. For the purposes of debugging a SPI bus trace, it's nice to have an ordinal value written, so this is the default.
However, some peripherals require a specific value; in particular an MMC-based SD card apparently requires 0xFF. Allow the default to be overridden by the application.
i_ | the ordinal of the received byte |
typedef struct sBSP430halSERIAL* hBSP430halSERIAL |
Handle for a serial HAL instance
typedef struct sBSP430halSERIAL sBSP430halSERIAL |
Structure holding hardware abstraction layer state for serial devices.