Software APIs
Typedefs | Functions
dif_sensor_ctrl.h File Reference

(8a1a5fe)

Sensor Controller Device Interface Functions More...

#include <stdint.h>
#include "sw/device/lib/base/macros.h"
#include "sw/device/lib/base/mmio.h"
#include "sw/device/lib/dif/dif_base.h"
#include "sw/device/lib/dif/autogen/dif_sensor_ctrl_autogen.h"

Go to the source code of this file.

Typedefs

typedef uint32_t dif_sensor_ctrl_event_idx_t
 An event, identified by a numeric id.
 
typedef uint32_t dif_sensor_ctrl_events_t
 A vector of AST events, where each bit represents one event.
 
typedef uint32_t dif_sensor_ctrl_io_power_status_t
 IO power status Each bit represents the current status of a particular IO rail.
 

Functions

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_lock_cfg (const dif_sensor_ctrl_t *sensor_ctrl)
 Locks sensor control configuration from further updates. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_get_ast_event_trigger (const dif_sensor_ctrl_t *sensor_ctrl, dif_sensor_ctrl_event_idx_t event_idx, dif_toggle_t *enable)
 Gets the value of a particular AST event trigger. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_set_ast_event_trigger (const dif_sensor_ctrl_t *sensor_ctrl, dif_sensor_ctrl_event_idx_t event_idx, dif_toggle_t enable)
 Sets the value for a particular AST event trigger. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_set_alert_en (const dif_sensor_ctrl_t *sensor_ctrl, dif_sensor_ctrl_event_idx_t event_idx, dif_toggle_t en)
 Enable a particular alert event. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_set_alert_fatal (const dif_sensor_ctrl_t *sensor_ctrl, dif_sensor_ctrl_event_idx_t event_idx, dif_toggle_t en_fatal)
 Sets the fatality configuration of a particular event. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_get_recov_events (const dif_sensor_ctrl_t *sensor_ctrl, dif_sensor_ctrl_events_t *events)
 Gets the current vector of recoverable events. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_clear_recov_event (const dif_sensor_ctrl_t *sensor_ctrl, dif_sensor_ctrl_event_idx_t event_idx)
 Clears the specified recoverable events. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_get_fatal_events (const dif_sensor_ctrl_t *sensor_ctrl, dif_sensor_ctrl_events_t *events)
 Gets the current vector of fatal events. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_get_ast_init_done_status (const dif_sensor_ctrl_t *sensor_ctrl, dif_toggle_t *done)
 Gets the current ast init done status. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_get_io_power_status (const dif_sensor_ctrl_t *sensor_ctrl, dif_sensor_ctrl_io_power_status_t *io_status)
 Gets the current io power status. More...
 

Detailed Description

Sensor Controller Device Interface Functions

Definition in file dif_sensor_ctrl.h.

Function Documentation

◆ dif_sensor_ctrl_clear_recov_event()

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_clear_recov_event ( const dif_sensor_ctrl_t sensor_ctrl,
dif_sensor_ctrl_event_idx_t  event_idx 
)

Clears the specified recoverable events.

Parameters
sensor_ctrlA sensor_ctrl handle.
event_idxThe event to clear.
Returns
'kDifBadArg' if handle is null or 'event_idx' is larger than the number of events supported..

Definition at line 132 of file dif_sensor_ctrl.c.

◆ dif_sensor_ctrl_get_ast_event_trigger()

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_get_ast_event_trigger ( const dif_sensor_ctrl_t sensor_ctrl,
dif_sensor_ctrl_event_idx_t  event_idx,
dif_toggle_t enable 
)

Gets the value of a particular AST event trigger.

Parameters
sensor_ctrlA sensor_ctrl handle.
event_idxThe event to read.
[out]enableThe current trigger enable status.
Returns
'kDifBadArg' if sensor_ctrl or enable are null, or if event_idx is larger than the number of events supported.

Definition at line 46 of file dif_sensor_ctrl.c.

◆ dif_sensor_ctrl_get_ast_init_done_status()

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_get_ast_init_done_status ( const dif_sensor_ctrl_t sensor_ctrl,
dif_toggle_t done 
)

Gets the current ast init done status.

Parameters
sensor_ctrlA sensor_ctrl handle.
[out]doneCurrent init_done status.
Returns
'kDifBadArg' if handle is null.

Definition at line 160 of file dif_sensor_ctrl.c.

◆ dif_sensor_ctrl_get_fatal_events()

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_get_fatal_events ( const dif_sensor_ctrl_t sensor_ctrl,
dif_sensor_ctrl_events_t events 
)

Gets the current vector of fatal events.

Parameters
sensor_ctrlA sensor_ctrl handle.
[out]eventsThe set of current fatal events.
Returns
'kDifBadArg' if handle is null.

Definition at line 147 of file dif_sensor_ctrl.c.

◆ dif_sensor_ctrl_get_io_power_status()

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_get_io_power_status ( const dif_sensor_ctrl_t sensor_ctrl,
dif_sensor_ctrl_io_power_status_t io_status 
)

Gets the current io power status.

Parameters
sensor_ctrlA sensor_ctrl handle.
[out]doneCurrent io power status.
Returns
'kDifBadArg' if handle is null.

Definition at line 175 of file dif_sensor_ctrl.c.

◆ dif_sensor_ctrl_get_recov_events()

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_get_recov_events ( const dif_sensor_ctrl_t sensor_ctrl,
dif_sensor_ctrl_events_t events 
)

Gets the current vector of recoverable events.

Parameters
sensor_ctrlA sensor_ctrl handle.
[out]eventsThe set of current recoverable events
Returns
'kDifBadArg' if handle is null.

Definition at line 119 of file dif_sensor_ctrl.c.

◆ dif_sensor_ctrl_lock_cfg()

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_lock_cfg ( const dif_sensor_ctrl_t sensor_ctrl)

Locks sensor control configuration from further updates.

Parameters
sensor_ctrlA sensor_ctrl handle.
Returns
'kDifBadArg' if handle is null.

Definition at line 34 of file dif_sensor_ctrl.c.

◆ dif_sensor_ctrl_set_alert_en()

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_set_alert_en ( const dif_sensor_ctrl_t sensor_ctrl,
dif_sensor_ctrl_event_idx_t  event_idx,
dif_toggle_t  en 
)

Enable a particular alert event.

Parameters
sensor_ctrlA sensor_ctrl handle.
event_idxThe event to configure.
enWhether an event is enabled or not. If kDifToggleEnabled, the event is enabled. Otherwise, it is disabled.
Returns
'kDifBadArg' if handle is null or event_idx is larger than the number of events supported.

Definition at line 78 of file dif_sensor_ctrl.c.

◆ dif_sensor_ctrl_set_alert_fatal()

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_set_alert_fatal ( const dif_sensor_ctrl_t sensor_ctrl,
dif_sensor_ctrl_event_idx_t  event_idx,
dif_toggle_t  en_fatal 
)

Sets the fatality configuration of a particular event.

An event can be configured to be either fatal or recoverable.

Parameters
sensor_ctrlA sensor_ctrl handle.
event_idxThe event to configure.
en_fatalThe fatality enablement state of an event. If kDifToggleEnabled, the event is fatal. Otherwise, it is recoverable.
Returns
'kDifBadArg' if handle is null or event_idx is larger than the number of events supported.

Definition at line 98 of file dif_sensor_ctrl.c.

◆ dif_sensor_ctrl_set_ast_event_trigger()

OT_WARN_UNUSED_RESULT dif_result_t dif_sensor_ctrl_set_ast_event_trigger ( const dif_sensor_ctrl_t sensor_ctrl,
dif_sensor_ctrl_event_idx_t  event_idx,
dif_toggle_t  enable 
)

Sets the value for a particular AST event trigger.

Parameters
sensor_ctrlA sensor_ctrl handle.
event_idxThe event to configure.
enableThe toggle status to set.
Returns
'kDifBadArg' if handle is null or if event_idx is larger than the number of events supported.

Definition at line 61 of file dif_sensor_ctrl.c.