RA Flexible Software Package Documentation  Release v5.2.0

 
OPAMP Interface

Detailed Description

Interface for Operational Amplifiers.

Summary

The OPAMP interface provides standard operational amplifier functionality, including starting and stopping the amplifier.

Data Structures

struct  opamp_trim_args_t
 
struct  opamp_info_t
 
struct  opamp_status_t
 
struct  opamp_cfg_t
 
struct  opamp_api_t
 
struct  opamp_instance_t
 

Typedefs

typedef void opamp_ctrl_t
 

Enumerations

enum  opamp_trim_cmd_t
 
enum  opamp_trim_input_t
 

Data Structure Documentation

◆ opamp_trim_args_t

struct opamp_trim_args_t

OPAMP trim arguments.

Data Fields
uint8_t channel Channel.
opamp_trim_input_t input Which input of the channel above.

◆ opamp_info_t

struct opamp_info_t

OPAMP information.

Data Fields
uint32_t min_stabilization_wait_us Minimum stabilization wait time in microseconds.

◆ opamp_status_t

struct opamp_status_t

OPAMP status.

Data Fields
uint32_t operating_channel_mask Bitmask of channels currently operating.

◆ opamp_cfg_t

struct opamp_cfg_t

OPAMP general configuration.

Data Fields
void const * p_extend Extension parameter for hardware specific settings.

◆ opamp_api_t

struct opamp_api_t

OPAMP functions implemented at the HAL layer will follow this API.

Data Fields

fsp_err_t(* open )(opamp_ctrl_t *const p_ctrl, opamp_cfg_t const *const p_cfg)
 
fsp_err_t(* start )(opamp_ctrl_t *const p_ctrl, uint32_t const channel_mask)
 
fsp_err_t(* stop )(opamp_ctrl_t *const p_ctrl, uint32_t const channel_mask)
 
fsp_err_t(* trim )(opamp_ctrl_t *const p_ctrl, opamp_trim_cmd_t const cmd, opamp_trim_args_t const *const p_args)
 
fsp_err_t(* infoGet )(opamp_ctrl_t *const p_ctrl, opamp_info_t *const p_info)
 
fsp_err_t(* statusGet )(opamp_ctrl_t *const p_ctrl, opamp_status_t *const p_status)
 
fsp_err_t(* close )(opamp_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* opamp_api_t::open) (opamp_ctrl_t *const p_ctrl, opamp_cfg_t const *const p_cfg)

Initialize the operational amplifier.

Parameters
[in]p_ctrlPointer to instance control block
[in]p_cfgPointer to configuration

◆ start

fsp_err_t(* opamp_api_t::start) (opamp_ctrl_t *const p_ctrl, uint32_t const channel_mask)

Start the op-amp(s).

Parameters
[in]p_ctrlPointer to instance control block
[in]channel_maskBitmask of channels to start

◆ stop

fsp_err_t(* opamp_api_t::stop) (opamp_ctrl_t *const p_ctrl, uint32_t const channel_mask)

Stop the op-amp(s).

Parameters
[in]p_ctrlPointer to instance control block
[in]channel_maskBitmask of channels to stop

◆ trim

fsp_err_t(* opamp_api_t::trim) (opamp_ctrl_t *const p_ctrl, opamp_trim_cmd_t const cmd, opamp_trim_args_t const *const p_args)

Trim the op-amp(s). Not supported on all MCUs. See implementation for procedure details.

Parameters
[in]p_ctrlPointer to instance control block
[in]cmdTrim command
[in]p_argsPointer to arguments for the command

◆ infoGet

fsp_err_t(* opamp_api_t::infoGet) (opamp_ctrl_t *const p_ctrl, opamp_info_t *const p_info)

Provide information such as the recommended minimum stabilization wait time.

Parameters
[in]p_ctrlPointer to instance control block
[out]p_infoOPAMP information stored here

◆ statusGet

fsp_err_t(* opamp_api_t::statusGet) (opamp_ctrl_t *const p_ctrl, opamp_status_t *const p_status)

Provide status of each op-amp channel.

Parameters
[in]p_ctrlPointer to instance control block
[out]p_statusStatus stored here

◆ close

fsp_err_t(* opamp_api_t::close) (opamp_ctrl_t *const p_ctrl)

Close the specified OPAMP unit by ending any scan in progress, disabling interrupts, and removing power to the specified A/D unit.

Parameters
[in]p_ctrlPointer to instance control block

◆ opamp_instance_t

struct opamp_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
opamp_ctrl_t * p_ctrl Pointer to the control structure for this instance.
opamp_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
opamp_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ opamp_ctrl_t

typedef void opamp_ctrl_t

OPAMP control block. Allocate using driver instance control structure from driver instance header file.

Enumeration Type Documentation

◆ opamp_trim_cmd_t

Includes board and MCU related header files. Trim command.

Enumerator
OPAMP_TRIM_CMD_START 

Initialize trim state machine.

OPAMP_TRIM_CMD_NEXT_STEP 

Move to next step in state machine.

OPAMP_TRIM_CMD_CLEAR_BIT 

Clear trim bit.

◆ opamp_trim_input_t

Trim input.

Enumerator
OPAMP_TRIM_INPUT_PCH 

Trim non-inverting (+) input.

OPAMP_TRIM_INPUT_NCH 

Trim inverting (-) input.