BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Fields
sBSP430halSERIAL Struct Reference

#include <bsp430/serial_.h>

Data Fields

sBSP430hplHALStatePrefix hal_state
 
sBSP430resource resource
 
union {
   volatile void *   any
 
   volatile struct sBSP430hplUSCI *   usci
 
   volatile struct sBSP430hplUSCI5 *   usci5
 
   volatile struct sBSP430hplEUSCIA *   euscia
 
   volatile struct sBSP430hplEUSCIB *   euscib
 
hpl
 
union {
   void *   any
 
   struct sBSP430usciHPLAux *   usci
 
hpl_aux
 
uint8_t rx_byte
 
uint8_t tx_byte
 
const struct sBSP430halISRVoidChainNode *volatile rx_cbchain_ni
 
const struct sBSP430halISRVoidChainNode *volatile tx_cbchain_ni
 
unsigned long num_rx
 
unsigned long num_tx
 

Detailed Description

Structure holding hardware abstraction layer state for serial devices.

Examples:
bootstrap/applpm/main.c, bootstrap/console/main.c, rf/cc110x/main.c, sensors/hh10d/main.c, sensors/tmp102/main.c, and utility/u8glib/main.c.

Field Documentation

volatile void* sBSP430halSERIAL::any

Access to the HPL pointer ignoring its underlying type

Examples:
utility/u8glib/main.c.
void* sBSP430halSERIAL::any

Access to the HPL auxiliary pointer ignoring its underlying type

volatile struct sBSP430hplEUSCIA* sBSP430halSERIAL::euscia

Access to the HPL pointer as a 5xx/6xx eUSCI type A peripheral

Examples:
bootstrap/console/main.c.
volatile struct sBSP430hplEUSCIB* sBSP430halSERIAL::euscib

Access to the HPL pointer as a 5xx/6xx eUSCI type B peripheral

sBSP430hplHALStatePrefix sBSP430halSERIAL::hal_state

Common header used to extract the correct HPL pointer type from the hpl union.

union { ... } sBSP430halSERIAL::hpl

Allow the HAL state to be independent of the underlying HPL layout.

Use BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(), or the selector macros like BSP430_SERIAL_HAL_HPL_VARIANT_IS_USCI() and BSP430_SERIAL_HAL_GET_HPL_USCI(), to introspect a HAL instance.

Examples:
bootstrap/console/main.c, and utility/u8glib/main.c.
union { ... } sBSP430halSERIAL::hpl_aux

Support for additional data specific to the HPL that is not part of the standard HPL structure.

This is necessary for 2xx/4xx USCI, where the interrupt enable and flag registers are outside the sBSP430hplUSCI structure. Future HPL implementations (e.g., USART) might need a similar facility.

Use BSP430_SERIAL_HAL_GET_HPLAUX_USCI() to access the corresponding structure, which is declared within the peripheral-specific header.

unsigned long sBSP430halSERIAL::num_rx

Total number of received octets

Examples:
bootstrap/console/main.c.
unsigned long sBSP430halSERIAL::num_tx

Total number of transmitted octets

Examples:
bootstrap/console/main.c.
sBSP430resource sBSP430halSERIAL::resource

Optional resource management structure specific to this peripheral.

Dependency:
BSP430_SERIAL_ENABLE_RESOURCE
uint8_t sBSP430halSERIAL::rx_byte

Location in which an incoming character is stored when an rx_cbchain_ni is non-null.

Examples:
bootstrap/applpm/main.c.
const struct sBSP430halISRVoidChainNode* volatile sBSP430halSERIAL::rx_cbchain_ni

The callback chain to invoke when a byte is received.

A non-null value enables interrupt-driven reception, and data will be provided to the callbacks on receiption. The received character will be stored in rx_byte.

Note
This field has an _ni suffix and must not be traversed or manipulated unless interrupts are disabled. However, the head of the chain may be compared against NULL in _rh functions even if interrupts are enabled.
Examples:
bootstrap/applpm/main.c.
uint8_t sBSP430halSERIAL::tx_byte

Location in which an outgoing character is stored when a tx_cbchain_ni is non-null.

const struct sBSP430halISRVoidChainNode* volatile sBSP430halSERIAL::tx_cbchain_ni

The callback chain to invoke when space is available in the transmission buffer

A non-null value enables interrupt-driven transmission, and the chain will be invoked as necessary. The infrastructure must be made aware of data to be transmitted, so it can enable the interrupt that will request the data through the callback. This is done using vBSP430serialWakeupTransmit_rh(). If the callback has data to transmit, it should store it in tx_byte and include BSP430_HAL_ISR_CALLBACK_BREAK_CHAIN in its return value. It should also include BSP430_HAL_ISR_CALLBACK_DISABLE_INTERRUPT if it is known that there will not be data available after the transmission. If the callback has no data to transmit, it should return zero.

Note
This field has an _ni suffix and must not be traversed or manipulated unless interrupts are disabled. However, the head of the chain may be compared against NULL in _rh functions even if interrupts are enabled.
volatile struct sBSP430hplUSCI* sBSP430halSERIAL::usci

Access to the HPL pointer as a 2xx/4xx USCI peripheral

Examples:
bootstrap/console/main.c.
struct sBSP430usciHPLAux* sBSP430halSERIAL::usci

Access to the HPL auxiliary pointer for the 2xx/4xx USCI peripheral

volatile struct sBSP430hplUSCI5* sBSP430halSERIAL::usci5

Access to the HPL pointer as a 5xx/6xx USCI peripheral

Examples:
bootstrap/console/main.c.

The documentation for this struct was generated from the following file: