BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
Hardware presentation/abstraction for Digital I/O Port (PORT#/PORT#_R) More...
#include <bsp430/periph.h>
Go to the source code of this file.
Data Structures | |
struct | sBSP430hplPORT_IE_8 |
struct | sBSP430hplPORT_8 |
union | uBSP430hplPORT_16 |
struct | sBSP430hplPORT_16 |
struct | sBSP430hplPORT_5XX_16 |
struct | sBSP430hplPORT_5XX_8 |
struct | sBSP430halPORT |
Typedefs | |
typedef struct sBSP430hplPORT_IE_8 | sBSP430hplPORT_IE_8 |
typedef struct sBSP430hplPORT_8 | sBSP430hplPORT_8 |
typedef union uBSP430hplPORT_16 | uBSP430hplPORT_16 |
typedef struct sBSP430hplPORT_16 | sBSP430hplPORT_16 |
typedef struct sBSP430hplPORT_5XX_16 | sBSP430hplPORT_5XX_16 |
typedef struct sBSP430hplPORT_5XX_8 | sBSP430hplPORT_5XX_8 |
typedef sBSP430hplPORT_IE_8 | sBSP430hplPORTIE |
typedef sBSP430hplPORT_8 | sBSP430hplPORT |
typedef sBSP430hplPORT_16 | sBSP430hplPORTW |
typedef struct sBSP430halPORT | sBSP430halPORT |
typedef struct sBSP430halPORT * | hBSP430halPORT |
Functions | |
static BSP430_CORE_INLINE volatile sBSP430hplPORTIE * | xBSP430hplLookupPORTIE (tBSP430periphHandle periph) |
static BSP430_CORE_INLINE volatile sBSP430hplPORT * | xBSP430hplLookupPORT (tBSP430periphHandle periph) |
static BSP430_CORE_INLINE hBSP430halPORT | hBSP430portLookup (tBSP430periphHandle periph) |
const char * | xBSP430portName (tBSP430periphHandle periph) |
static BSP430_CORE_INLINE int | iBSP430portBitPosition (unsigned int bitx) |
Hardware presentation/abstraction for Digital I/O Port (PORT#/PORT#_R)
A Digital I/O port capability exists on every MSP430 MCU. Differences between families are reflected in the HPL structures below.
Conventional peripheral handles are BSP430_PERIPH_PORT1. The handles are available only when the corresponding HPL is requested. The peripheral handle can be used with xBSP430hplLookupPORT() and xBSP430hplLookupPORTIE() to obtain the HPL handles, and with hBSP430halPORT() to obtain the HAL handle.
Substitute other 8-bit port identifiers (e.g., PORT7) as necessary.
The module defines five distinct HPL structures:
The 16 bit port structures are provided for reference only. All HPL and HAL access in BSP430 is done using the 8-bit structures.
As a convenience, the following two typedefs are provided and resolve to the appropriate underlying structure supported by the target MCU:
The port HAL uses the sBSP430halPORT structure. All variant HPL structures are accessible through this structure.
When enabled by configBSP430_HAL_PORT1_ISR the sBSP430halPORT.pin_cbchain_ni array is used by a provided HAL ISR is enabled to notify application and library code of events that occur on a particular port pin. It is the responsibility of that code to register a callback and to configure the corresponding interrupt enable and edge select bits (e.g. using BSP430_PORT_HAL_GET_HPL_PORTIE to get the sBSP430hplPORTIE handle).
#define BSP430_HAL_PORT1 (&xBSP430hal_PORT1_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT1.
This pointer may be used only if configBSP430_HAL_PORT1 is defined to a true value.
#define BSP430_HAL_PORT10 (&xBSP430hal_PORT10_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT10.
This pointer may be used only if configBSP430_HAL_PORT10 is defined to a true value.
#define BSP430_HAL_PORT11 (&xBSP430hal_PORT11_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT11.
This pointer may be used only if configBSP430_HAL_PORT11 is defined to a true value.
#define BSP430_HAL_PORT2 (&xBSP430hal_PORT2_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT2.
This pointer may be used only if configBSP430_HAL_PORT2 is defined to a true value.
#define BSP430_HAL_PORT3 (&xBSP430hal_PORT3_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT3.
This pointer may be used only if configBSP430_HAL_PORT3 is defined to a true value.
#define BSP430_HAL_PORT4 (&xBSP430hal_PORT4_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT4.
This pointer may be used only if configBSP430_HAL_PORT4 is defined to a true value.
#define BSP430_HAL_PORT5 (&xBSP430hal_PORT5_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT5.
This pointer may be used only if configBSP430_HAL_PORT5 is defined to a true value.
#define BSP430_HAL_PORT6 (&xBSP430hal_PORT6_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT6.
This pointer may be used only if configBSP430_HAL_PORT6 is defined to a true value.
#define BSP430_HAL_PORT7 (&xBSP430hal_PORT7_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT7.
This pointer may be used only if configBSP430_HAL_PORT7 is defined to a true value.
#define BSP430_HAL_PORT8 (&xBSP430hal_PORT8_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT8.
This pointer may be used only if configBSP430_HAL_PORT8 is defined to a true value.
#define BSP430_HAL_PORT9 (&xBSP430hal_PORT9_) |
sBSP430halPORT HAL handle for BSP430_PERIPH_PORT9.
This pointer may be used only if configBSP430_HAL_PORT9 is defined to a true value.
#define BSP430_HPL_PORT1 ((volatile sBSP430hplPORTIE *)BSP430_PERIPH_PORT1) |
HPL pointer for PORT1.
Typed pointer to a volatile structure overlaying the PORT1 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT1 is defined to a true value.
#define BSP430_HPL_PORT10 ((volatile sBSP430hplPORT *)BSP430_PERIPH_PORT10) |
HPL pointer for PORT10.
Typed pointer to a volatile structure overlaying the PORT10 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT10 is defined to a true value.
#define BSP430_HPL_PORT11 ((volatile sBSP430hplPORT *)BSP430_PERIPH_PORT11) |
HPL pointer for PORT11.
Typed pointer to a volatile structure overlaying the PORT11 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT11 is defined to a true value.
#define BSP430_HPL_PORT2 ((volatile sBSP430hplPORTIE *)BSP430_PERIPH_PORT2) |
HPL pointer for PORT2.
Typed pointer to a volatile structure overlaying the PORT2 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT2 is defined to a true value.
#define BSP430_HPL_PORT3 ((volatile sBSP430hplPORT *)BSP430_PERIPH_PORT3) |
HPL pointer for PORT3.
Typed pointer to a volatile structure overlaying the PORT3 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT3 is defined to a true value.
#define BSP430_HPL_PORT4 ((volatile sBSP430hplPORT *)BSP430_PERIPH_PORT4) |
HPL pointer for PORT4.
Typed pointer to a volatile structure overlaying the PORT4 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT4 is defined to a true value.
#define BSP430_HPL_PORT5 ((volatile sBSP430hplPORT *)BSP430_PERIPH_PORT5) |
HPL pointer for PORT5.
Typed pointer to a volatile structure overlaying the PORT5 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT5 is defined to a true value.
#define BSP430_HPL_PORT6 ((volatile sBSP430hplPORT *)BSP430_PERIPH_PORT6) |
HPL pointer for PORT6.
Typed pointer to a volatile structure overlaying the PORT6 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT6 is defined to a true value.
#define BSP430_HPL_PORT7 ((volatile sBSP430hplPORT *)BSP430_PERIPH_PORT7) |
HPL pointer for PORT7.
Typed pointer to a volatile structure overlaying the PORT7 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT7 is defined to a true value.
#define BSP430_HPL_PORT8 ((volatile sBSP430hplPORT *)BSP430_PERIPH_PORT8) |
HPL pointer for PORT8.
Typed pointer to a volatile structure overlaying the PORT8 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT8 is defined to a true value.
#define BSP430_HPL_PORT9 ((volatile sBSP430hplPORT *)BSP430_PERIPH_PORT9) |
HPL pointer for PORT9.
Typed pointer to a volatile structure overlaying the PORT9 peripheral register map.
The pointer may be used only if configBSP430_HPL_PORT9 is defined to a true value.
#define BSP430_MODULE_PORT |
Defined on inclusion of <bsp430/periph/port.h>. The value evaluates to true if the target MCU supports the Digital I/O Module, and false if it does not.
#define BSP430_PERIPH_PORT1 ((tBSP430periphHandle)(BSP430_PERIPH_PORT1_BASEADDRESS_)) |
Handle for the raw PORT1 device.
The handle may be used only if configBSP430_HPL_PORT1 is defined to a true value.
#define BSP430_PERIPH_PORT10 ((tBSP430periphHandle)(BSP430_PERIPH_PORT10_BASEADDRESS_)) |
Handle for the raw PORT10 device.
The handle may be used only if configBSP430_HPL_PORT10 is defined to a true value.
#define BSP430_PERIPH_PORT11 ((tBSP430periphHandle)(BSP430_PERIPH_PORT11_BASEADDRESS_)) |
Handle for the raw PORT11 device.
The handle may be used only if configBSP430_HPL_PORT11 is defined to a true value.
#define BSP430_PERIPH_PORT2 ((tBSP430periphHandle)(BSP430_PERIPH_PORT2_BASEADDRESS_)) |
Handle for the raw PORT2 device.
The handle may be used only if configBSP430_HPL_PORT2 is defined to a true value.
#define BSP430_PERIPH_PORT3 ((tBSP430periphHandle)(BSP430_PERIPH_PORT3_BASEADDRESS_)) |
Handle for the raw PORT3 device.
The handle may be used only if configBSP430_HPL_PORT3 is defined to a true value.
#define BSP430_PERIPH_PORT4 ((tBSP430periphHandle)(BSP430_PERIPH_PORT4_BASEADDRESS_)) |
Handle for the raw PORT4 device.
The handle may be used only if configBSP430_HPL_PORT4 is defined to a true value.
#define BSP430_PERIPH_PORT5 ((tBSP430periphHandle)(BSP430_PERIPH_PORT5_BASEADDRESS_)) |
Handle for the raw PORT5 device.
The handle may be used only if configBSP430_HPL_PORT5 is defined to a true value.
#define BSP430_PERIPH_PORT6 ((tBSP430periphHandle)(BSP430_PERIPH_PORT6_BASEADDRESS_)) |
Handle for the raw PORT6 device.
The handle may be used only if configBSP430_HPL_PORT6 is defined to a true value.
#define BSP430_PERIPH_PORT7 ((tBSP430periphHandle)(BSP430_PERIPH_PORT7_BASEADDRESS_)) |
Handle for the raw PORT7 device.
The handle may be used only if configBSP430_HPL_PORT7 is defined to a true value.
#define BSP430_PERIPH_PORT8 ((tBSP430periphHandle)(BSP430_PERIPH_PORT8_BASEADDRESS_)) |
Handle for the raw PORT8 device.
The handle may be used only if configBSP430_HPL_PORT8 is defined to a true value.
#define BSP430_PERIPH_PORT9 ((tBSP430periphHandle)(BSP430_PERIPH_PORT9_BASEADDRESS_)) |
Handle for the raw PORT9 device.
The handle may be used only if configBSP430_HPL_PORT9 is defined to a true value.
#define BSP430_PORT_HAL_GET_HPL_PORT | ( | hal_ | ) | ((BSP430_PORT_HAL_HPL_VARIANT_IS_PORT(hal_)) ? (hal_)->hpl.port : (void *)0) |
Get the port HPL pointer if the HAL is a PORT variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_PORT_HAL_GET_HPL_PORT_16 | ( | hal_ | ) | ((BSP430_PORT_HAL_HPL_VARIANT_IS_PORT_16(hal_)) ? (hal_)->hpl.port_16 : (void *)0) |
Get the port HPL pointer if the HAL is a PORT_16 variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_PORT_HAL_GET_HPL_PORT_5XX_16 | ( | hal_ | ) | ((BSP430_PORT_HAL_HPL_VARIANT_IS_PORT_5XX_16(hal_)) ? (hal_)->hpl.port_5xx_16 : (void *)0) |
Get the port HPL pointer if the HAL is a PORT_5XX_16 variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_PORT_HAL_GET_HPL_PORT_5XX_8 | ( | hal_ | ) | ((BSP430_PORT_HAL_HPL_VARIANT_IS_PORT_5XX_8(hal_)) ? (hal_)->hpl.port_5xx_8 : (void *)0) |
Get the port HPL pointer if the HAL is a PORT_5XX_8 variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_PORT_HAL_GET_HPL_PORT_8 | ( | hal_ | ) | ((BSP430_PORT_HAL_HPL_VARIANT_IS_PORT_8(hal_)) ? (hal_)->hpl.port_8 : (void *)0) |
Get the port HPL pointer if the HAL is a PORT_8 variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_PORT_HAL_GET_HPL_PORT_IE_8 | ( | hal_ | ) | ((BSP430_PORT_HAL_HPL_VARIANT_IS_PORT_IE_8(hal_)) ? (hal_)->hpl.port_ie_8 : (void *)0) |
Get the port HPL pointer if the HAL is a PORT_IE_8 variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_PORT_HAL_GET_HPL_PORTIE | ( | hal_ | ) | ((BSP430_PORT_HAL_HPL_VARIANT_IS_PORTIE(hal_)) ? (hal_)->hpl.portie : (void *)0) |
Get the port HPL pointer if the HAL is a PORTIE variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_PORT_HAL_GET_HPL_PORTW | ( | hal_ | ) | ((BSP430_PORT_HAL_HPL_VARIANT_IS_PORTW(hal_)) ? (hal_)->hpl.portw : (void *)0) |
Get the port HPL pointer if the HAL is a PORTW variant.
Value is a null pointer if the HAL references a different HPL type.
#define BSP430_PORT_HAL_GET_PERIPH_HANDLE | ( | hal_ | ) | xBSP430periphFromHPL((hal_)->hpl.any) |
Get the port HPL peripheral handle.
This bypasses any structural interpretation of the HPL pointer, converting it to the underlying tBSP430periphHandle value directly.
#define BSP430_PORT_HAL_HPL_DIR | ( | hal_ | ) | (*(BSP430_PORT_HAL_HPL_VARIANT_IS_PORTIE(hal_) ? &BSP430_PORT_HAL_GET_HPL_PORTIE(hal_)->dir : &BSP430_PORT_HAL_GET_HPL_PORT(hal_)->dir)) |
Macro to reference a port DIR register regardless of HPL layout.
#define BSP430_PORT_HAL_HPL_IN | ( | hal_ | ) | (*(BSP430_PORT_HAL_HPL_VARIANT_IS_PORTIE(hal_) ? &BSP430_PORT_HAL_GET_HPL_PORTIE(hal_)->in : &BSP430_PORT_HAL_GET_HPL_PORT(hal_)->in)) |
Macro to reference a port IN register regardless of HPL layout.
#define BSP430_PORT_HAL_HPL_OUT | ( | hal_ | ) | (*(BSP430_PORT_HAL_HPL_VARIANT_IS_PORTIE(hal_) ? &BSP430_PORT_HAL_GET_HPL_PORTIE(hal_)->out : &BSP430_PORT_HAL_GET_HPL_PORT(hal_)->out)) |
Macro to reference a port OUT register regardless of HPL layout.
#define BSP430_PORT_HAL_HPL_REN | ( | hal_ | ) | (*(hal_)->renp) |
Macro to reference a port REN register regardless of HPL layout.
#define BSP430_PORT_HAL_HPL_SEL | ( | hal_ | ) | (*(BSP430_PORT_HAL_HPL_VARIANT_IS_PORTIE(hal_) ? &BSP430_PORT_HAL_GET_HPL_PORTIE(hal_)->sel : &BSP430_PORT_HAL_GET_HPL_PORT(hal_)->sel)) |
Macro to reference a port SEL register regardless of HPL layout.
#define BSP430_PORT_HAL_HPL_VARIANT_IS_PORT | ( | hal_ | ) | (BSP430_PORT_HAL_HPL_VARIANT_PORT == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the port HAL is a PORT variant.
#define BSP430_PORT_HAL_HPL_VARIANT_IS_PORT_16 | ( | hal_ | ) | (BSP430_PORT_HAL_HPL_VARIANT_PORT_16 == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the port HAL is a PORT_16 variant.
#define BSP430_PORT_HAL_HPL_VARIANT_IS_PORT_5XX_16 | ( | hal_ | ) | (BSP430_PORT_HAL_HPL_VARIANT_PORT_5XX_16 == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the port HAL is a PORT_5XX_16 variant.
#define BSP430_PORT_HAL_HPL_VARIANT_IS_PORT_5XX_8 | ( | hal_ | ) | (BSP430_PORT_HAL_HPL_VARIANT_PORT_5XX_8 == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the port HAL is a PORT_5XX_8 variant.
#define BSP430_PORT_HAL_HPL_VARIANT_IS_PORT_8 | ( | hal_ | ) | (BSP430_PORT_HAL_HPL_VARIANT_PORT_8 == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the port HAL is a PORT_8 variant.
#define BSP430_PORT_HAL_HPL_VARIANT_IS_PORT_IE_8 | ( | hal_ | ) | (BSP430_PORT_HAL_HPL_VARIANT_PORT_IE_8 == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the port HAL is a PORT_IE_8 variant.
#define BSP430_PORT_HAL_HPL_VARIANT_IS_PORTIE | ( | hal_ | ) | (BSP430_PORT_HAL_HPL_VARIANT_PORTIE == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the port HAL is a PORTIE variant.
#define BSP430_PORT_HAL_HPL_VARIANT_IS_PORTW | ( | hal_ | ) | (BSP430_PORT_HAL_HPL_VARIANT_PORTW == BSP430_PERIPH_HAL_STATE_CFLAGS_VARIANT(hal_)) |
True iff the HPL pointer of the port HAL is a PORTW variant.
#define BSP430_PORT_HAL_HPL_VARIANT_PORT BSP430_PORT_HAL_HPL_VARIANT_PORT_8 |
Field value for variant stored in sBSP430halPORT.hal_state.cflags when HPL reference is to a byte-accessed port without interrupt capabilities.
This identifies the appropriate structure-specific variant value based on the MCU capabilities.
#define BSP430_PORT_HAL_HPL_VARIANT_PORT_16 3 |
Field value for variant stored in sBSP430halPORT.hal_state.cflags when HPL reference is to an sBSP430hplPORT_16.
#define BSP430_PORT_HAL_HPL_VARIANT_PORT_5XX_16 5 |
Field value for variant stored in sBSP430halPORT.hal_state.cflags when HPL reference is to an sBSP430hplPORT_5XX_16.
#define BSP430_PORT_HAL_HPL_VARIANT_PORT_5XX_8 4 |
Field value for variant stored in sBSP430halPORT.hal_state.cflags when HPL reference is to an sBSP430hplPORT_5XX_8.
#define BSP430_PORT_HAL_HPL_VARIANT_PORT_8 2 |
Field value for variant stored in sBSP430halPORT.hal_state.cflags when HPL reference is to an sBSP430hplPORT_8.
#define BSP430_PORT_HAL_HPL_VARIANT_PORT_IE_8 1 |
Field value for variant stored in sBSP430halPORT.hal_state.cflags when HPL reference is to an sBSP430hplPORT_IE_8.
#define BSP430_PORT_HAL_HPL_VARIANT_PORTIE BSP430_PORT_HAL_HPL_VARIANT_PORT_IE_8 |
Field value for variant stored in sBSP430halPORT.hal_state.cflags when HPL reference is to a byte-accessed port without interrupt capabilities.
This identifies the appropriate structure-specific variant value based on the MCU capabilities.
#define BSP430_PORT_HAL_HPL_VARIANT_PORTW BSP430_PORT_HAL_HPL_VARIANT_PORT_16 |
Field value for variant stored in sBSP430halPORT.hal_state.cflags when HPL reference is to a word-accessed port.
This identifies the appropriate structure-specific variant value based on the MCU capabilities.
#define BSP430_PORT_HAL_SET_REN | ( | hal_, | |
bit_, | |||
rv_ | |||
) |
Set port resistor-enabled configuration via HAL handle.
On MCUs that support internal pullup and pulldown resistors this function macro can be used to configure between those choices and floating inputs. This version is suited for all families, and is required for 2xx/4xx devices where resistor-enable capability is not present within the HPL structure.
hal_ | the handle for the port HAL |
bit_ | the bit for which resistor/impedance is to be configured |
rv_ | the selected configuration, one of BSP430_PORT_REN_HIGH_Z, BSP430_PORT_REN_PULL_DOWN, BSP430_PORT_REN_PULL_UP. |
#define BSP430_PORT_HAL_SET_SEL | ( | hal_, | |
bit_, | |||
sel_ | |||
) |
Set port function selection value via HAL handle.
MSP430 ports support peripheral functions that are enabled through port-specific function selector registers. In some MCUs a second and third function may be selected with a second port-specific function selector register. This function simplifies selecting the peripheral function. It exists to allow a macro to identify the desired function as a single value, and to resolve inconsistencies in selection register naming across the MSP430 product line.
The sel_
parameter value 0 clears all sel registers for the specified port and bit, leaving the pin in its digital i/o role.
Non-zero values are treated as binary numbers, where the least significant bit corresponds to the setting for PxSEL
(PxSEL0
on FRAM devices), the next most significant bit to the setting for PxSEL2
(normally, PxSEL1
on FRAM devices)
sel_
values above 1 under BSP430_PORT_SUPPORTS_SEL2_47XX. Request support if you need this.hal_ | the handle for the port HAL |
bit_ | the bit identifing the pin for which the function is desired |
sel_ | the selection function index, with 0 selecting digital input/output (no peripheral function) |
#define BSP430_PORT_HPL_SET_REN | ( | hpl_, | |
bit_, | |||
rv_ | |||
) |
Set port resistor-enabled configuration via HPL handle.
On MCUs that support internal pullup and pulldown resistors this function macro can be used to configure between those choices and floating inputs. This version is suited for 5xx-family devices for which the resistor-enable functionality is within the port HPL.
hpl_ | the handle for the port HPL |
bit_ | the bit for which resistor/impedance is to be configured |
rv_ | the selected configuration, one of BSP430_PORT_REN_HIGH_Z, BSP430_PORT_REN_PULL_DOWN, BSP430_PORT_REN_PULL_UP. |
#define BSP430_PORT_HPL_SET_SEL | ( | hpl_, | |
bit_, | |||
sel_ | |||
) |
Set port function selection value via HPL handle.
As with BSP430_PORT_HAL_SET_SEL(), but not fully supported for families where the necessary registers cannot be reached from the HPL handle.
sel_
values above 1.hpl_ | the handle for the port HPL |
bit_ | the bit identifing the pin for which the function is desired |
sel_ | the selection function index, with 0 selecting digital input/output (no peripheral function) |
#define BSP430_PORT_REN_HIGH_Z -1 |
Value for BSP430_PORT_HAL_SET_REN() for high impedance input.
This disables any port resistor enabled capability. It corresponds to REN reset, OUT dontcare.
#define BSP430_PORT_REN_PULL_DOWN 0 |
Value for BSP430_PORT_HAL_SET_REN() for pulldown resistor.
This corresponds to REN set, OUT reset.
#define BSP430_PORT_REN_PULL_UP 1 |
Value for BSP430_PORT_HAL_SET_REN() for pullup resistor.
This corresponds to REN set, OUT set.
#define BSP430_PORT_SUPPORTS_REN 0 |
A macro that is defined to a true value if the port peripheral supports a resistor-enable register, and to a false value if it does not.
This can be used in application and library code to use or avoid reference to the ren field of HPL structures, either directly or though the BSP430_PORT_HAL_HPL_REN() macro.
Support for the PxREN register is determined by the MSP430_HAS_PORT1_R
functional presence indicator for <msp430.h>; in all MCUs, if P1 has the feature, so do any other ports.
#define BSP430_PORT_SUPPORTS_SEL2 |
Defined to true value if MCU supports multiple peripheral function selections.
#define BSP430_PORT_SUPPORTS_SEL2_2XX |
Defined to true value if MCU supports multiple peripheral function selections with 2xx API (P1SEL, P1SEL2, no complement, all ports).
The value may be overridden in platform-specific bsp430_config.h
files when the toolchain does not allow inferring the correct setting, as with Code Composer Studio for some families.
#define BSP430_PORT_SUPPORTS_SEL2_47XX |
Defined to true value if MCU supports multiple peripheral function selections with 4xx API (P1SEL, P1SEL2, no complement, only PORT1).
The value may be overridden in platform-specific bsp430_config.h
files when the toolchain does not allow inferring the correct setting, as with Code Composer Studio for some families.
#define BSP430_PORT_SUPPORTS_SEL2_5XX |
Defined to true value if MCU supports multiple peripheral function selections with the base 5xx API (PxSEL0, PxSEL1, no complement function).
The value may be overridden in platform-specific bsp430_config.h
files when the toolchain does not allow inferring the correct setting, as with Code Composer Studio for some families.
#define BSP430_PORT_SUPPORTS_SEL2C_5XX |
Defined to true value if MCU supports multiple peripheral function selections with the FR5xx API (PxSEL0, PxSEL1, PxSELC).
The value may be overridden in platform-specific bsp430_config.h
files when the toolchain does not allow inferring the correct setting, as with Code Composer Studio for some families.
typedef struct sBSP430halPORT* hBSP430halPORT |
Handle for a port HAL instance
typedef struct sBSP430halPORT sBSP430halPORT |
Structure holding hardware abstraction layer state for digital I/O ports.
typedef sBSP430hplPORT_8 sBSP430hplPORT |
Structure used to access ports without interrupt capability.
The underlying structure selected depends on the MCU family.
typedef struct sBSP430hplPORT_16 sBSP430hplPORT_16 |
Layout for 2xx/4xx family 16-bit ports not supporting interrupts.
Access to SEL2 and REN capability for these ports is not available in the hardware-presentation layer.
typedef struct sBSP430hplPORT_5XX_16 sBSP430hplPORT_5XX_16 |
Layout for 5xx family ports, 16-bit access
typedef struct sBSP430hplPORT_5XX_8 sBSP430hplPORT_5XX_8 |
Layout for 5xx family ports, 8-bit access
This structure includes the necessary padding to maintain alignment when referencing the second 8-bit register in a 16-bit bank.
typedef struct sBSP430hplPORT_8 sBSP430hplPORT_8 |
Layout for pre-5xx–family 8-bit ports not supporting interrupts.
Access to SEL2 and REN capability for these ports is not available in the hardware-presentation layer.
typedef struct sBSP430hplPORT_IE_8 sBSP430hplPORT_IE_8 |
Layout for pre-5xx–family ports supporting interrupts.
Access to SEL2 capability for these ports is not available in the hardware-presentation layer.
typedef sBSP430hplPORT_IE_8 sBSP430hplPORTIE |
Structure used to access ports with interrupt capability.
The underlying structure selected depends on the MCU family.
typedef sBSP430hplPORT_16 sBSP430hplPORTW |
Structure used to access 16-bit ports.
The underlying structure selected depends on the MCU family.
typedef union uBSP430hplPORT_16 uBSP430hplPORT_16 |
Helper for accessing 8-bit registers within 16-bit registers
|
static |
Get the HAL handle for a specific port.
periph | The handle identifier, such as BSP430_PERIPH_TA0. |
|
static |
Convert from a bit value to a pin value.
Mostly used for informational messages, but also for ISR IFG queries. The reverse operation is simply a left shift.
bitx | The value of a bit within a byte-addressed port |
bitx
.
|
static |
Get the peripheral register pointer for a non-interrupt-enabled port.
periph | The handle identifier, such as BSP430_PERIPH_PORT1. |
|
static |
Get the peripheral register pointer for an interrupt-enabled port.
periph | The handle identifier, such as BSP430_PERIPH_PORT1. |
const char* xBSP430portName | ( | tBSP430periphHandle | periph | ) |
Get a human-readable identifier for the port
periph | The handle identifier, such as BSP430_PERIPH_PORT1. |