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. | |
Sensor Controller Device Interface Functions
Definition in file dif_sensor_ctrl.h.
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.
sensor_ctrl | A sensor_ctrl handle. |
event_idx | The event to clear. |
handle
is null or 'event_idx' is larger than the number of events supported.. Definition at line 132 of file dif_sensor_ctrl.c.
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.
sensor_ctrl | A sensor_ctrl handle. | |
event_idx | The event to read. | |
[out] | enable | The current trigger enable status. |
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.
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.
sensor_ctrl | A sensor_ctrl handle. | |
[out] | done | Current init_done status. |
handle
is null. Definition at line 160 of file dif_sensor_ctrl.c.
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.
sensor_ctrl | A sensor_ctrl handle. | |
[out] | events | The set of current fatal events. |
handle
is null. Definition at line 147 of file dif_sensor_ctrl.c.
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.
sensor_ctrl | A sensor_ctrl handle. | |
[out] | done | Current io power status. |
handle
is null. Definition at line 175 of file dif_sensor_ctrl.c.
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.
sensor_ctrl | A sensor_ctrl handle. | |
[out] | events | The set of current recoverable events |
handle
is null. Definition at line 119 of file dif_sensor_ctrl.c.
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.
sensor_ctrl | A sensor_ctrl handle. |
handle
is null. Definition at line 34 of file dif_sensor_ctrl.c.
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.
sensor_ctrl | A sensor_ctrl handle. |
event_idx | The event to configure. |
en | Whether an event is enabled or not. If kDifToggleEnabled , the event is enabled. Otherwise, it is disabled. |
handle
is null or event_idx
is larger than the number of events supported. Definition at line 78 of file dif_sensor_ctrl.c.
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.
sensor_ctrl | A sensor_ctrl handle. |
event_idx | The event to configure. |
en_fatal | The fatality enablement state of an event. If kDifToggleEnabled , the event is fatal. Otherwise, it is recoverable. |
handle
is null or event_idx
is larger than the number of events supported. Definition at line 98 of file dif_sensor_ctrl.c.
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.
sensor_ctrl | A sensor_ctrl handle. |
event_idx | The event to configure. |
enable | The toggle status to set. |
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.