SemiDrive SSDK Appication Program Interface PTG3.0
sdrv_scr.h
Go to the documentation of this file.
1
8#ifndef _SDRV_SCR_H_
9#define _SDRV_SCR_H_
10
11#include <sdrv_common.h>
12#include <types.h>
13
14/* SCR signal types. */
15#define TYPE_RW 0u
16#define TYPE_RO 1u
17#define TYPE_L16 2u
18#define TYPE_L31 3u
19#define TYPE_R16W16 4u
20
27typedef struct scr_signal {
29 uint16_t type;
31 uint16_t start_bit;
33 uint16_t width;
35
39typedef struct sdrv_scr {
40 paddr_t base;
42
46enum {
47 /* The signal is locked, so it cannot be updated. */
49 /* The signal is locked, or not L16/L31, so it cannot be locked. */
51 /* The signal isn't writeable. */
53};
54
62uint32_t scr_get(const sdrv_scr_t *scr, const scr_signal_t *signal);
63
73status_t scr_set(const sdrv_scr_t *scr, const scr_signal_t *signal, uint32_t value);
74
82status_t scr_lock(const sdrv_scr_t *scr, const scr_signal_t *signal);
83
91bool scr_is_locked(const sdrv_scr_t *scr, const scr_signal_t *signal);
92
93#endif /*_SDRV_SCR_H_*/
SemiDrive driver common header file.
@ SDRV_STATUS_GROUP_SCR
Definition: sdrv_common.h:54
int32_t status_t
Type used for all status and error return values.
Definition: sdrv_common.h:82
#define SDRV_ERROR_STATUS(group, code)
Construct a status code value from a group and code number. All the error statuses are negetive numbe...
Definition: sdrv_common.h:17
@ SDRV_SCR_CANNOT_WRITE
Definition: sdrv_scr.h:52
@ SDRV_SCR_LOCKED
Definition: sdrv_scr.h:48
@ SDRV_SCR_CANNOT_LOCK
Definition: sdrv_scr.h:50
uint32_t scr_get(const sdrv_scr_t *scr, const scr_signal_t *signal)
Get value of signal.
struct scr_signal scr_signal_t
SCR signal structure.
status_t scr_set(const sdrv_scr_t *scr, const scr_signal_t *signal, uint32_t value)
Set value of signal.
bool scr_is_locked(const sdrv_scr_t *scr, const scr_signal_t *signal)
Check the lock status of signal.
struct sdrv_scr sdrv_scr_t
SCR device structure.
status_t scr_lock(const sdrv_scr_t *scr, const scr_signal_t *signal)
Lock the given signal.
SCR signal structure.
Definition: sdrv_scr.h:27
uint16_t start_bit
Definition: sdrv_scr.h:31
uint16_t type
Definition: sdrv_scr.h:29
uint16_t width
Definition: sdrv_scr.h:33
SCR device structure.
Definition: sdrv_scr.h:39
paddr_t base
Definition: sdrv_scr.h:40