Mbed OS Reference
Loading...
Searching...
No Matches
Analogout hal functions

Functions

void analogout_init_direct (dac_t *obj, const PinMap *pinmap)
 Initialize the analogout peripheral. More...
 
void analogout_init (dac_t *obj, PinName pin)
 Initialize the analogout peripheral. More...
 
void analogout_free (dac_t *obj)
 Release the analogout object. More...
 
void analogout_write (dac_t *obj, float value)
 Set the output voltage, specified as a percentage (float) More...
 
void analogout_write_u16 (dac_t *obj, uint16_t value)
 Set the output voltage, specified as unsigned 16-bit. More...
 
float analogout_read (dac_t *obj)
 Read the current voltage value on the pin. More...
 
uint16_t analogout_read_u16 (dac_t *obj)
 Read the current voltage value on the pin, as a normalized unsigned 16bit value. More...
 
const PinMapanalogout_pinmap (void)
 Get the pins that support analogout. More...
 

Detailed Description

Defined behaviour

Undefined behaviour

Function Documentation

◆ analogout_init_direct()

void analogout_init_direct ( dac_t obj,
const PinMap pinmap 
)

Initialize the analogout peripheral.

Configures the pin used by analogout.

Parameters
objThe analogout object to initialize
pinmappointer to structure which holds static pinmap

◆ analogout_init()

void analogout_init ( dac_t obj,
PinName  pin 
)

Initialize the analogout peripheral.

Configures the pin used by analogout.

Parameters
objThe analogout object to initialize
pinThe analogout pin name

◆ analogout_free()

void analogout_free ( dac_t obj)

Release the analogout object.

Parameters
objThe analogout object

◆ analogout_write()

void analogout_write ( dac_t obj,
float  value 
)

Set the output voltage, specified as a percentage (float)

Parameters
objThe analogin object
valueThe floating-point output voltage to be set

◆ analogout_write_u16()

void analogout_write_u16 ( dac_t obj,
uint16_t  value 
)

Set the output voltage, specified as unsigned 16-bit.

Parameters
objThe analogin object
valueThe unsigned 16-bit output voltage to be set

◆ analogout_read()

float analogout_read ( dac_t obj)

Read the current voltage value on the pin.

Parameters
objThe analogin object
Returns
A floating-point value representing the current voltage on the pin, measured as a percentage

◆ analogout_read_u16()

uint16_t analogout_read_u16 ( dac_t obj)

Read the current voltage value on the pin, as a normalized unsigned 16bit value.

Parameters
objThe analogin object
Returns
An unsigned 16-bit value representing the current voltage on the pin

◆ analogout_pinmap()

const PinMap * analogout_pinmap ( void  )

Get the pins that support analogout.

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

Returns
PinMap array