Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Hal

Data Structures

struct  buffer_s
 Generic buffer structure. More...
struct  CAN_Message
 Holder for single CAN message. More...
struct  i2c_t
 Asynch I2C HAL structure. More...
struct  serial_t
 Asynch serial HAL structure. More...
struct  spi_t
 Asynch SPI HAL structure. More...
struct  spi_capabilities_t
 Describes the capabilities of a SPI peripherals. More...
struct  _ARM_DRIVER_VERSION
 Driver Version. More...
struct  _ARM_STORAGE_BLOCK_ATTRIBUTES
 Attributes of the storage range within a storage block. More...
struct  _ARM_STORAGE_BLOCK
 A storage block is a range of memory with uniform attributes. More...
struct  _ARM_STORAGE_SECURITY_FEATURES
 Device Data Security Protection Features. More...
struct  _ARM_STORAGE_INFO
 Storage information. More...
struct  _ARM_STORAGE_STATUS
 Operating status of the storage controller. More...
struct  _ARM_STORAGE_CAPABILITIES
 Storage Driver API Capabilities. More...
struct  _ARM_DRIVER_STORAGE
 This is the set of operations constituting the Storage driver. More...
struct  ticker_event_s
 Ticker's event structure. More...
struct  ticker_info_t
 Information about the ticker implementation. More...
struct  ticker_interface_t
 Ticker's interface structure - required API for a ticker. More...
struct  ticker_event_queue_t
 Ticker's event queue structure. More...
struct  ticker_data_t
 Ticker's data structure. More...

Modules

 Analogin hal functions
 

# Defined behaviour * The function analogin_init initializes the analogin_t control structure * The function analogin_free returns the pin owned by the Analogin object to its reset state * The function analogin_read reads the input voltage, represented as a float in the range [0.0 (GND), 1.0 (VCC)] * The function analogin_read_u16 reads the value from analogin pin, represented as an unsigned 16bit value [0.0 (GND), MAX_UINT16 (VCC)] * The accuracy of the ADC is +/- 10% * The ADC operations analogin_read, analogin_read_u16 take less than 20us to complete


 Analogout hal functions
 

# Defined behaviour * The function analogout_init initializes the dac_t control structure * The function analogout_write sets the output voltage, specified as a percentage (float) in range [0.0 (GND), 1.0 (VCC)] * The function analogout_write_u16 sets the output voltage, specified as unsigned 16-bit value [0 (GND), MAX_UINT16 (VCC)] * The function analogout_read reads the current voltage value on the pin and returns a floating-point value representing the current voltage in range [0.0 (GND), 1.0 (VCC)] * The function analogout_read_u16 reads the current voltage value on the pin and returns the output voltage, specified as unsigned 16-bit value [0 (GND), MAX_UINT16 (VCC)] * The accuracy of the DAC is +/- 10% * The DAC operations analogout_write, analogout_write_u16, analogout_read, analogout_read_u16 take less than 20us to complete * The function analogout_free releases the analogout object


 Hardware CRC
 

The Hardware CRC HAL API provides a low-level interface to the Hardware CRC module of a target platform.


 Critical Section HAL functions
 Flash HAL API
 GPIO HAL functions
 

# Defined behavior * gpio_init and other init functions can be called with NC or a valid PinName for the target - Verified by gpio_nc_test * gpio_is_connected can be used to test whether a gpio_t object was initialized with NC - Verified by gpio_nc_test * gpio_init initializes the GPIO pin * gpio_free returns the pin owned by the GPIO object to its reset state * gpio_mode sets the mode of the given pin * gpio_dir sets the direction of the given pin * gpio_write sets the gpio output value * gpio_read reads the input value * gpio_init_in inits the input pin and sets mode to PullDefault * gpio_init_in_ex inits the input pin and sets the mode * gpio_init_out inits the pin as an output, with predefined output value 0 * gpio_init_out_ex inits the pin as an output and sets the output value * gpio_init_inout inits the pin to be input/output and set pin mode and value * The GPIO operations gpio_write, gpio_read take less than 20us to complete


 GPIO IRQ HAL functions
 

# Defined behavior * gpio_irq_init initializes the GPIO IRQ pin * gpio_irq_init attaches the interrupt handler * gpio_irq_free releases the GPIO IRQ pin * gpio_irq_set enables/disables pin IRQ event * gpio_irq_enable enables GPIO IRQ * gpio_irq_disable disables GPIO IRQ


 I2C Events Macros
 I2C Configuration Functions
 

# Defined behavior * i2c_init initializes i2c_t control structure * i2c_init configures the pins used by I2C * i2c_free returns the pins owned by the I2C object to their reset state * i2c_frequency configure the I2C frequency * i2c_start sends START command * i2c_read reads `length` bytes from the I2C slave specified by `address` to the `data` buffer * i2c_read reads generates a stop condition on the bus at the end of the transfer if `stop` parameter is non-zero * i2c_read reads returns the number of symbols received from the bus * i2c_write writes `length` bytes to the I2C slave specified by `address` from the `data` buffer * i2c_write generates a stop condition on the bus at the end of the transfer if `stop` parameter is non-zero * i2c_write returns zero on success, error code otherwise * i2c_reset resets the I2C peripheral * i2c_byte_read reads and return one byte from the specfied I2C slave * i2c_byte_read uses `last` parameter to inform the slave that all bytes have been read * i2c_byte_write writes one byte to the specified I2C slave * i2c_byte_write returns 0 if NAK was received, 1 if ACK was received, 2 for timeout * i2c_slave_mode enables/disables I2S slave mode * i2c_slave_receive returns: 1 - read addresses, 2 - write to all slaves, 3 write addressed, 0 - the slave has not been addressed * i2c_slave_read reads `length` bytes from the I2C master to the `data` buffer * i2c_slave_read returns non-zero if a value is available, 0 otherwise * i2c_slave_write writes `length` bytes to the I2C master from the `data` buffer * i2c_slave_write returns non-zero if a value is available, 0 otherwise * i2c_slave_address configures I2C slave address * i2c_transfer_asynch starts I2C asynchronous transfer * i2c_transfer_asynch writes `tx_length` bytes to the I2C slave specified by `address` from the `tx` buffer * i2c_transfer_asynch reads `rx_length` bytes from the I2C slave specified by `address` to the `rx` buffer * i2c_transfer_asynch generates a stop condition on the bus at the end of the transfer if `stop` parameter is non-zero * The callback given to i2c_transfer_asynch is invoked when the transfer completes * i2c_transfer_asynch specifies the logical OR of events to be registered * The i2c_transfer_asynch function may use the `DMAUsage` hint to select the appropriate async algorithm * i2c_irq_handler_asynch returns event flags if a transfer termination condition was met, otherwise returns 0.


 Synchronous I2C Hardware Abstraction Layer for slave
 Asynchronous I2C Hardware Abstraction Layer
 Instrumented Trace Macrocell HAL API
 Low Power Ticker
 

Low level interface to the low power ticker of a target.


 MPU hal
 

The MPU hal provides a simple MPU API to enhance device security by preventing execution from ram.


 Port HAL functions
 Pwmout hal functions
 

# Defined behavior * pwmout_init initializes the pwmout_t control structure * pwmout_free deinitializes the pwmout object * pwmout_write sets the output duty-cycle in range <0.0f, 1.0f> * pwmout_read returns the current float-point output duty-cycle in range <0.0f, 1.0f> * pwmout_period sets the PWM period specified in seconds, keeping the duty cycle the same * pwmout_period_ms sets the PWM period specified in miliseconds, keeping the duty cycle the same * pwmout_period_us sets the PWM period specified in microseconds, keeping the duty cycle the same * pwmout_pulsewidth sets the PWM pulsewidth specified in seconds, keeping the period the same * pwmout_pulsewidth_ms sets the PWM pulsewidth specified in miliseconds, keeping the period the same * pwmout_pulsewidth_us sets the PWM pulsewidth specified in microseconds, keeping the period the same * The accuracy of the PWM is +/- 10% * The PWM operations pwmout_write, pwmout_read, pwmout_read, pwmout_period_ms, pwmout_period_us pwmout_pulsewidth, pwmout_pulsewidth_ms, pwmout_pulsewidth_us take less than 20us to complete


 QSPI HAL
 ResetReason HAL API
 

Low-level interface to the ResetReason of a target.


 RTC hal
 

The RTC hal provides a low level interface to the Real Time Counter (RTC) of a target.


 Serial TX Events Macros
 Serial RX Events Macros
 Serial Configuration Functions
 

# Defined behavior * serial_init initializes the serial_t * serial_init sets the default parameters for serial peripheral (9600 bps, 8N1 format) * serial_init configures the specified pins * serial_free releases the serial peripheral * serial_baud configures the baud rate * at least 9600 bps the baud rate must be supported * serial_format configures the transmission format (number of bits, parity and the number of stop bits) * at least 8N1 format must be supported * serial_irq_handler registers the interrupt handler which will be invoked when the interrupt fires.


 Asynchronous Serial Hardware Abstraction Layer
 sleep hal requirements
 

Low level interface to the sleep mode of a target.


 SPI Configuration Functions
 

# Defined behavior * spi_init initializes the spi_t control structure * spi_init configures the pins used by SPI * spi_get_capabilities() fills the given `spi_capabilities_t` instance * spi_get_capabilities() should consider the `ssel` pin when evaluation the `support_slave_mode` and `hw_cs_handle` capability * spi_get_capabilities(): if the given `ssel` pin cannot be managed by hardware, `support_slave_mode` and `hw_cs_handle` should be false * At least a symbol width of 8bit must be supported * The supported frequency range must include the range [0.2..2] MHz * spi_free returns the pins owned by the SPI object to their reset state * spi_format sets the number of bits per frame * spi_format configures clock polarity and phase * spi_format configures master/slave mode * spi_frequency sets the SPI baud rate * spi_master_write writes a symbol out in master mode and receives a symbol * spi_master_block_write writes `tx_length` words to the bus * spi_master_block_write reads `rx_length` words from the bus * spi_master_block_write returns the maximum of tx_length and rx_length * spi_master_block_write specifies the write_fill which is default data transmitted while performing a read * spi_get_module returns non-zero if a value is available to read from SPI channel, 0 otherwise * spi_slave_read returns a received value out of the SPI receive buffer in slave mode * spi_slave_read blocks until a value is available * spi_slave_write writes a value to the SPI peripheral in slave mode * spi_slave_write blocks until the SPI peripheral can be written to * spi_busy returns non-zero if the peripheral is currently transmitting, 0 otherwise * spi_master_transfer starts the SPI asynchronous transfer * spi_master_transfer writes `tx_len` words to the bus * spi_master_transfer reads `rx_len` words from the bus * spi_master_transfer specifies the bit width of buffer words * The callback given to spi_master_transfer is invoked when the transfer completes (with a success or an error) * spi_master_transfer specifies the logical OR of events to be registered * The spi_master_transfer function may use the `DMAUsage` hint to select the appropriate async algorithm * spi_irq_handler_asynch reads the received values out of the RX FIFO * spi_irq_handler_asynch writes values into the TX FIFO * spi_irq_handler_asynch checks for transfer termination conditions, such as buffer overflows or transfer complete * spi_irq_handler_asynch returns event flags if a transfer termination condition was met, otherwise 0 * spi_abort_asynch aborts an on-going async transfer * spi_active returns non-zero if the SPI port is active or zero if it is not


 Synchronous SPI Hardware Abstraction Layer
 Asynchronous SPI Hardware Abstraction Layer
 SPM HAL API
 

The HAL functions for PSA SPM.


 Ticker HAL functions
 TRNG hal functions
 Microsecond Ticker
 

Low level interface to the microsecond ticker of a target.


 Watchdog HAL API
 

Low-level interface to the Independent Watchdog Timer of a target.


Typedefs

typedef struct analogin_s analogin_t
 Analogin hal structure.
typedef struct dac_s dac_t
 Analogout hal structure.
typedef struct buffer_s buffer_t
 Generic buffer structure.
typedef enum crc_polynomial crc_polynomial_t
 CRC Polynomial value.
typedef struct gpio_irq_s gpio_irq_t
 GPIO IRQ HAL structure.
typedef struct i2c_s i2c_t
 Non-asynch I2C HAL structure.
typedef struct port_s port_t
 Port HAL structure.
typedef struct pwmout_s pwmout_t
 Pwmout hal structure.
typedef struct serial_s serial_t
 Non-asynch serial HAL structure.
typedef struct spi_s spi_t
 Non-asynch SPI HAL structure.
typedef struct _ARM_DRIVER_VERSION ARM_DRIVER_VERSION
 Driver Version.
typedef enum _ARM_POWER_STATE ARM_POWER_STATE
 General power states.
typedef struct
_ARM_STORAGE_BLOCK_ATTRIBUTES 
ARM_STORAGE_BLOCK_ATTRIBUTES
 Attributes of the storage range within a storage block.
typedef struct _ARM_STORAGE_BLOCK ARM_STORAGE_BLOCK
 A storage block is a range of memory with uniform attributes.
typedef struct
_ARM_STORAGE_SECURITY_FEATURES 
ARM_STORAGE_SECURITY_FEATURES
 Device Data Security Protection Features.
typedef struct _ARM_STORAGE_INFO ARM_STORAGE_INFO
 Storage information.
typedef struct _ARM_STORAGE_STATUS ARM_STORAGE_STATUS
 Operating status of the storage controller.
typedef struct
_ARM_STORAGE_CAPABILITIES 
ARM_STORAGE_CAPABILITIES
 Storage Driver API Capabilities.
typedef enum _ARM_STORAGE_OPERATION ARM_STORAGE_OPERATION
 Command opcodes for Storage.
typedef void(* ARM_Storage_Callback_t )(int32_t status, ARM_STORAGE_OPERATION operation)
 Declaration of the callback-type for command completion.
typedef struct _ARM_DRIVER_STORAGE ARM_DRIVER_STORAGE
 This is the set of operations constituting the Storage driver.
typedef uint32_t timestamp_t
 Legacy format representing a timestamp in us.
typedef uint64_t us_timestamp_t
 A us timestamp stored in a 64 bit integer.
typedef struct ticker_event_s ticker_event_t
 Ticker's event structure.
typedef struct trng_s trng_t
 TRNG HAL structure.

Enumerations

enum  CANFormat
 

Values that represent CAN Format.

More...
enum  CANType
 

Values that represent CAN Type.

More...
enum  crc_polynomial {
  POLY_7BIT_SD = 0x09, POLY_8BIT_CCITT = 0x07, POLY_16BIT_CCITT = 0x1021, POLY_16BIT_IBM = 0x8005,
  POLY_32BIT_ANSI = 0x04C11DB7
}
 

CRC Polynomial value.

More...
enum  gpio_irq_event
 

GPIO IRQ events.

More...
enum  SerialIrq { RxIrq, TxIrq }
 

Serial interrupt sources.

More...
enum  _ARM_POWER_STATE { ARM_POWER_OFF, ARM_POWER_LOW, ARM_POWER_FULL }
 

General power states.

More...
enum  _ARM_STORAGE_OPERATION
 

Command opcodes for Storage.

More...

Functions

const PinMap * can_rd_pinmap (void)
 Get the pins that support CAN RD.
const PinMap * can_td_pinmap (void)
 Get the pins that support CAN TD.
void lp_ticker_wrapper_irq_handler (ticker_irq_handler_type handler)
 Interrupt handler for the wrapped lp ticker.
const ticker_data_tget_lp_ticker_wrapper_data (const ticker_data_t *data)
 Get wrapped lp ticker data.
void lp_ticker_wrapper_suspend (void)
 Suspend the wrapper layer code.
void lp_ticker_wrapper_resume (void)
 Resume the wrapper layer code.
bool pinmap_find_peripheral_pins (const PinList *whitelist, const PinList *blacklist, int per, const PinMap *const *maps, PinName **pins, uint32_t count)
 Find a combination of pins suitable for use given the constraints.
bool pinmap_list_has_pin (const PinList *list, PinName pin)
 Check if the pin is in the list.
bool pinmap_list_has_peripheral (const PeripheralList *list, int peripheral)
 Check if the peripheral is in the list.
const PinList * pinmap_restricted_pins (void)
 Get the pin list of pins to avoid during testing.
const PeripheralList * pinmap_restricted_peripherals (void)
 Get the pin list of peripherals to avoid during testing.
const PinList * pinmap_ff_arduino_pins (void)
 Get the pin list of the Arduino form factor.
const char * pinmap_ff_arduino_pin_to_string (PinName pin)
 Get the string representation of a form factor pin.
const PinList * pinmap_ff_default_pins (void)
 Get the pin list of the default form factor.
const char * pinmap_ff_default_pin_to_string (PinName pin)
 Get the string representation of a form factor pin.
USBPhyget_usb_phy ()
 Return a the USBPhy instance for this hardware.

Typedef Documentation

typedef struct analogin_s analogin_t

Analogin hal structure.

analogin_s is declared in the target's hal

Definition at line 34 of file analogin_api.h.

This is the set of operations constituting the Storage driver.

Their implementation is platform-specific, and needs to be supplied by the porting effort.

Some APIs within `ARM_DRIVER_STORAGE` will always operate synchronously: GetVersion, GetCapabilities, GetStatus, GetInfo, ResolveAddress, GetNextBlock, and GetBlock. This means that control returns to the caller with a relevant status code only after the completion of the operation (or the discovery of a failure condition).

The remainder of the APIs: Initialize, Uninitialize, PowerControl, ReadData, ProgramData, Erase, EraseAll, can function asynchronously if the underlying controller supports it--i.e. if ARM_STORAGE_CAPABILITIES::asynchronous_ops is set. In the case of asynchronous operation, the invocation returns early (with ARM_DRIVER_OK) and results in a completion callback later. If ARM_STORAGE_CAPABILITIES::asynchronous_ops is not set, then all such APIs execute synchronously, and control returns to the caller with a status code only after the completion of the operation (or the discovery of a failure condition).

If ARM_STORAGE_CAPABILITIES::asynchronous_ops is set, a storage driver may still choose to execute asynchronous operations in a synchronous manner. If so, the driver returns a positive value to indicate successful synchronous completion (or an error code in case of failure) and no further invocation of completion callback should be expected. The expected return value for synchronous completion of such asynchronous operations varies depending on the operation. For operations involving data access, it often equals the amount of data transferred or affected. For non data-transfer operations, such as EraseAll or Initialize, it is usually 1.

Here's a code snippet to suggest how asynchronous APIs might be used by callers to handle both synchronous and asynchronous execution by the underlying storage driver:

     ASSERT(ARM_DRIVER_OK == 0); // this is a precondition; it doesn't need to be put in code
     int32_t returnValue = drv->asynchronousAPI(...);
     if (returnValue < ARM_DRIVER_OK) {
         // handle error.
     } else if (returnValue == ARM_DRIVER_OK) {
         ASSERT(drv->GetCapabilities().asynchronous_ops == 1);
         // handle early return from asynchronous execution; remainder of the work is done in the callback handler.
     } else {
         ASSERT(returnValue == EXPECTED_RETURN_VALUE_FOR_SYNCHRONOUS_COMPLETION);
         // handle synchronous completion.
     }

Driver Version.

General power states.

A storage block is a range of memory with uniform attributes.

Storage blocks combine to make up the address map of a storage controller.

Attributes of the storage range within a storage block.

typedef void(* ARM_Storage_Callback_t)(int32_t status, ARM_STORAGE_OPERATION operation)

Declaration of the callback-type for command completion.

Parameters:
[in]statusA code to indicate the status of the completed operation. For data transfer operations, the status field is overloaded in case of success to return the count of items successfully transferred; this can be done safely because error codes are negative values.
[in]operationThe command op-code. This value isn't essential for the callback in the presence of the command instance-id, but it is expected that this information could be a quick and useful filter.

Definition at line 242 of file Driver_Storage.h.

Storage Driver API Capabilities.

This data structure is designed to fit within a single word so that it can be fetched cheaply using a call to driver->GetCapabilities().

Storage information.

This contains device-metadata. It is the return value from calling GetInfo() on the storage driver.

These fields serve a different purpose than the ones contained in ARM_STORAGE_CAPABILITIES, which is another structure containing device-level metadata. ARM_STORAGE_CAPABILITIES describes the API capabilities, whereas ARM_STORAGE_INFO describes the device. Furthermore ARM_STORAGE_CAPABILITIES fits within a single word, and is designed to be passed around by value; ARM_STORAGE_INFO, on the other hand, contains metadata which doesn't fit into a single word and requires the use of pointers to be moved around.

Command opcodes for Storage.

Completion callbacks use these codes to refer to completing commands. Refer to ARM_Storage_Callback_t.

Device Data Security Protection Features.

Applicable mostly to EXTERNAL_NVM.

Operating status of the storage controller.

typedef struct buffer_s buffer_t

Generic buffer structure.

CRC Polynomial value.

Different polynomial values supported

typedef struct dac_s dac_t

Analogout hal structure.

dac_s is declared in the target's hal

Definition at line 34 of file analogout_api.h.

typedef struct gpio_irq_s gpio_irq_t

GPIO IRQ HAL structure.

gpio_irq_s is declared in the target's HAL

Definition at line 42 of file gpio_irq_api.h.

typedef struct i2c_s i2c_t

Non-asynch I2C HAL structure.

Definition at line 58 of file i2c_api.h.

typedef struct port_s port_t

Port HAL structure.

port_s is declared in the target's HAL

Definition at line 33 of file port_api.h.

typedef struct pwmout_s pwmout_t

Pwmout hal structure.

pwmout_s is declared in the target's hal

Definition at line 34 of file pwmout_api.h.

typedef struct serial_s serial_t

Non-asynch serial HAL structure.

Definition at line 103 of file serial_api.h.

typedef struct spi_s spi_t

Non-asynch SPI HAL structure.

Definition at line 52 of file spi_api.h.

Ticker's event structure.

typedef uint32_t timestamp_t

Legacy format representing a timestamp in us.

Given it is modeled as a 32 bit integer, this type can represent timestamp up to 4294 seconds (71 minutes). Prefer using us_timestamp_t which store timestamp as 64 bits integer.

Definition at line 33 of file ticker_api.h.

typedef struct trng_s trng_t

TRNG HAL structure.

trng_s is declared in the target's HAL

Definition at line 30 of file trng_api.h.

typedef uint64_t us_timestamp_t

A us timestamp stored in a 64 bit integer.

Can store timestamp up to 584810 years.

Definition at line 39 of file ticker_api.h.


Enumeration Type Documentation

General power states.

Enumerator:
ARM_POWER_OFF 

Power off: no operation possible.

ARM_POWER_LOW 

Low Power mode: retain state, detect and signal wake-up events.

ARM_POWER_FULL 

Power on: full operation at maximum performance.

Definition at line 52 of file Driver_Common.h.

Command opcodes for Storage.

Completion callbacks use these codes to refer to completing commands. Refer to ARM_Storage_Callback_t.

Definition at line 211 of file Driver_Storage.h.

enum CANFormat

Values that represent CAN Format.

Definition at line 35 of file can_helper.h.

enum CANType

Values that represent CAN Type.

Definition at line 48 of file can_helper.h.

CRC Polynomial value.

Different polynomial values supported

Enumerator:
POLY_7BIT_SD 

x7+x3+1

POLY_8BIT_CCITT 

x8+x2+x+1

POLY_16BIT_CCITT 

x16+x12+x5+1

POLY_16BIT_IBM 

x16+x15+x2+1

POLY_32BIT_ANSI 

x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1

Definition at line 30 of file crc_api.h.

GPIO IRQ events.

Definition at line 34 of file gpio_irq_api.h.

enum SerialIrq

Serial interrupt sources.

Enumerator:
RxIrq 

Receive Data Register Full.

TxIrq 

Transmit Data Register Empty.

Definition at line 75 of file serial_api.h.


Function Documentation

const PinMap* can_rd_pinmap ( void   )

Get the pins that support CAN RD.

Return a PinMap array of pins that support CAN RD. The array is terminated with {NC, NC, 0}.

Returns:
PinMap array
const PinMap* can_td_pinmap ( void   )

Get the pins that support CAN TD.

Return a PinMap array of pins that support CAN TD. The array is terminated with {NC, NC, 0}.

Returns:
PinMap array
const ticker_data_t* get_lp_ticker_wrapper_data ( const ticker_data_t data )

Get wrapped lp ticker data.

Parameters:
datahardware low power ticker object
Returns:
wrapped low power ticker object

Definition at line 95 of file mbed_lp_ticker_wrapper.cpp.

USBPhy* get_usb_phy (  )

Return a the USBPhy instance for this hardware.

For details on adding support for a USBPhy see the specification in USBPhy.h.

Returns:
A pointer to a USBPhy instance
Note:
Calling this function on platforms without a USBPhy will result in an error

Definition at line 24 of file mbed_usb_phy.cpp.

void lp_ticker_wrapper_irq_handler ( ticker_irq_handler_type  handler )

Interrupt handler for the wrapped lp ticker.

Parameters:
handlerthe function which would normally be called by the lp ticker handler when it is not wrapped

Definition at line 81 of file mbed_lp_ticker_wrapper.cpp.

void lp_ticker_wrapper_resume ( void   )

Resume the wrapper layer code.

Resume operation of the wrapper layer. Interrupts will be filtered as normal and the microsecond timer will be used for interrupts scheduled too quickly back-to-back.

Definition at line 119 of file mbed_lp_ticker_wrapper.cpp.

void lp_ticker_wrapper_suspend ( void   )

Suspend the wrapper layer code.

Pass through all interrupts to the low power ticker and stop using the microsecond ticker.

Warning:
: Make sure to suspend the LP ticker first (call ticker_suspend()), otherwise the behavior is undefined.

Definition at line 109 of file mbed_lp_ticker_wrapper.cpp.

const char* pinmap_ff_arduino_pin_to_string ( PinName  pin )

Get the string representation of a form factor pin.

Parameters:
pinPin to get a string for
Returns:
String representing the form factor pin

Definition at line 52 of file mbed_pinmap_default.c.

const PinList* pinmap_ff_arduino_pins ( void   )

Get the pin list of the Arduino form factor.

Returns:
Pointer to the Arduino pin list

Definition at line 47 of file mbed_pinmap_default.c.

const char* pinmap_ff_default_pin_to_string ( PinName  pin )

Get the string representation of a form factor pin.

This is an alias to whichever form factor is set to be the default.

Parameters:
pinPin to get a string for
Returns:
String representing the form factor pin
const PinList* pinmap_ff_default_pins ( void   )

Get the pin list of the default form factor.

This is an alias to whichever form factor is set to be the default.

Returns:
Pointer to the default pin list
bool pinmap_find_peripheral_pins ( const PinList *  whitelist,
const PinList *  blacklist,
int  per,
const PinMap *const *  maps,
PinName **  pins,
uint32_t  count 
)

Find a combination of pins suitable for use given the constraints.

This function finds pins which meet these specific properties:

  • The pin is part of the form factor
  • The pin is not in the restricted list
  • The pin is contained within the respective pinmap
  • The pin belongs to the given peripheral
  • Each pin found is distinct; in the example below mosi and miso will never be assigned the same pin

Example:

 #include "mbed.h"
 #include "pinmap.h"

 int main()
 {
     int per = spi_master_cs_pinmap()->peripheral;
     const PinList *pins_ff = pinmap_ff_default_pins();
     const PinList *pins_avoid = pinmap_restricted_pins();
     PinName mosi = NC;
     PinName miso = NC;
     PinName sclk = NC;
     PinName ssel = NC;
     const PinMap *maps[] = {
         spi_master_mosi_pinmap(),
         spi_master_miso_pinmap(),
         spi_master_clk_pinmap(),
         spi_master_cs_pinmap()
     };
     PinName *pins[] = {
         &mosi,
         &miso,
         &sclk,
         &ssel
     };
     if (pinmap_find_peripheral_pins(pins_ff, pins_avoid, per, maps, pins, sizeof(maps) / sizeof(maps[0]))) {
         printf("Found SPI pins to test instance %i with:\n"
                "  mosi=%s\n"
                "  miso=%s\n"
                "  sclk=%s\n"
                "  ssel=%s\n", per,
                pinmap_ff_default_pin_to_string(mosi),
                pinmap_ff_default_pin_to_string(miso),
                pinmap_ff_default_pin_to_string(sclk),
                pinmap_ff_default_pin_to_string(ssel));
     } else {
         printf("Could not find SPI combination to test %i\n", per);
     }
     return 0;
 }
Parameters:
whitelistList of pins to choose from
blacklistList of pins which cannot be used
perPeripheral to which the pins belong
mapsAn array of pin maps to select from
pinsAn array of pins to find. Pins already set to a value will be left unchanged. Only pins initialized to NC will be updated by this function
countThe size of maps and pins
Returns:
true if a suitable combination of pins was found and written to the pins array, otherwise false

Definition at line 107 of file mbed_pinmap_common.c.

bool pinmap_list_has_peripheral ( const PeripheralList *  list,
int  peripheral 
)

Check if the peripheral is in the list.

Parameters:
listperipheral list to check
peripheralperipheral to check for in the list
Returns:
true if the peripheral is in the list, false otherwise

Definition at line 180 of file mbed_pinmap_common.c.

bool pinmap_list_has_pin ( const PinList *  list,
PinName  pin 
)

Check if the pin is in the list.

Parameters:
listpin list to check
pinpin to check for in the list
Returns:
true if the pin is in the list, false otherwise

Definition at line 170 of file mbed_pinmap_common.c.

const PeripheralList* pinmap_restricted_peripherals ( void   )

Get the pin list of peripherals to avoid during testing.

The restricted peripheral list is used to indicate to testing that a peripheral should be skipped due to some caveat about it. For example, using the USB serial port during tests will interfere with the test runner and should be avoided.

Targets should override the weak implementation of this function if they have peripherals which should be skipped during testing.

Note:
Some targets use the same value for multiple different types of peripherals. For example SPI 0 and UART 0 may both be identified by the peripheral value 0. If your target does this then do not use this function to skip peripherals, as this will unintentionally cause all peripherals with that value to be skipped. Instead these entries should be removed from the peripheral PinMap itself.
Returns:
Pointer to a peripheral list of peripheral to avoid

Definition at line 81 of file mbed_pinmap_default.c.

const PinList* pinmap_restricted_pins ( void   )

Get the pin list of pins to avoid during testing.

The restricted pin list is used to indicate to testing that a pin should be skipped due to some caveat about it. For example, using USBRX and USBTX during tests will interfere with the test runner and should be avoided.

Targets should override the weak implementation of this function if they have additional pins which should be skipped during testing.

Returns:
Pointer to a pin list of pins to avoid

Definition at line 68 of file mbed_pinmap_default.c.