SemiDrive SSDK Appication Program Interface PTG3.0
sdrv_common.h
Go to the documentation of this file.
1
8#ifndef SDRV_COMMON_H_
9#define SDRV_COMMON_H_
10
11#include <types.h>
12
17#define SDRV_ERROR_STATUS(group, code) (-((group) * (1000U) + (code)))
18
21{
22 SDRV_STATUS_GROUP_COMMON = 0, /* Group number for common status code */
23 SDRV_STATUS_GROUP_RESET = 1, /* Group number for RESET status codes */
24 SDRV_STATUS_GROUP_CLK = 2, /* Group number for CLK status code */
25 SDRV_STATUS_GROUP_VIC = 3, /* Group number for VIC status code */
26 SDRV_STATUS_GROUP_PINCTRL = 4, /* Group number for PINCTRL status codes */
27 SDRV_STATUS_GROUP_GPIO = 5, /* Group number for GPIO status code */
28 SDRV_STATUS_GROUP_DMA = 6, /* Group number for DMA status code */
29 SDRV_STATUS_GROUP_BTM = 7, /* Group number for BTM status code */
30 SDRV_STATUS_GROUP_FUSE = 8, /* Group number for FUSE status code.*/
31 SDRV_STATUS_GROUP_WATCHDOG = 9, /* Group number for WATCHDOG status code */
32 SDRV_STATUS_GROUP_CRYPTO = 10, /* Group number for CRYPTO status code */
33 SDRV_STATUS_GROUP_UART = 11, /* Group number for UART status code */
34 SDRV_STATUS_GROUP_FLEXCAN = 12, /* Group number for FLEXCAN status code.*/
35 SDRV_STATUS_GROUP_LIN = 13, /* Group number for LIN status code */
36 SDRV_STATUS_GROUP_I2C = 14, /* Group number for I2C status code */
37 SDRV_STATUS_GROUP_SPI = 15, /* Group number for SPI status code */
38 SDRV_STATUS_GROUP_ETH = 16, /* Group number for ETH status code */
39 SDRV_STATUS_GROUP_I2S = 17, /* Group number for I2S status code */
40 SDRV_STATUS_GROUP_PDM = 18, /* Group number for PDM status codes */
41 SDRV_STATUS_GROUP_EPWM = 19, /* Group number for EPWM status codes */
42 SDRV_STATUS_GROUP_ETIMER = 20, /* Group number for ETIMER status code.*/
43 SDRV_STATUS_GROUP_XTRG = 21, /* Group number for XTRG status code */
44 SDRV_STATUS_GROUP_ADC = 22, /* Group number for ADC status code */
45 SDRV_STATUS_GROUP_ACMP = 23, /* Group number for ACMP status code */
46 SDRV_STATUS_GROUP_ASW = 24, /* Group number for ASW status code */
47 SDRV_STATUS_GROUP_DISPSS = 25, /* Group number for DISPSS status code */
48 SDRV_STATUS_GROUP_CAMERA = 26, /* Group number for CAMERA status code */
49 SDRV_STATUS_GROUP_G2DLITE = 27, /* Group number for G2DLITE status code */
50 SDRV_STATUS_GROUP_PMU = 28, /* Group number for FLEXCOMM status codes */
51 SDRV_STATUS_GROUP_POWER = 29, /* Group number for POWER status codes */
52 SDRV_STATUS_GROUP_SMC = 30, /* Group number for SMC status code */
53 SDRV_STATUS_GROUP_RTC = 31, /* Group number for RTC status codes */
54 SDRV_STATUS_GROUP_SCR = 32, /* Group number for SCR status code */
55 SDRV_STATUS_GROUP_PVT = 33, /* Group number for PVT status codes */
56 SDRV_STATUS_GROUP_SDRAMC = 34, /* Group number for SDRAMC status code */
57 SDRV_STATUS_GROUP_MBOX = 35, /* Group number for MBOX status code */
58 SDRV_STATUS_GROUP_SEMAG = 36, /* Group number for SEMAG status code */
59 SDRV_STATUS_GROUP_XSPI = 37, /* Group number for XSPI status code */
60 SDRV_STATUS_GROUP_MMC = 38, /* Group number for MMC status codes */
61 SDRV_STATUS_GROUP_XSPI_MST_SLV = 39, /* Group number for XSPI_MST_SLV status code */
62 SDRV_STATUS_GROUP_FLEXRAY = 40, /* Group number for FLEXRAY status code */
63 SDRV_STATUS_GROUP_FIREWALL = 41, /* Group number for FIREWALL status code */
64 SDRV_STATUS_GROUP_OTHER = 42, /* Group number for other module status code */
65};
66
70enum
71{
73 SDRV_STATUS_FAIL = SDRV_ERROR_STATUS(SDRV_STATUS_GROUP_COMMON, 1), /* Common status for fail. */
74 SDRV_STATUS_BUSY = SDRV_ERROR_STATUS(SDRV_STATUS_GROUP_COMMON, 2), /* Common status for busy. */
75 SDRV_STATUS_TIMEOUT = SDRV_ERROR_STATUS(SDRV_STATUS_GROUP_COMMON, 3), /* Common status for timeout. */
76 SDRV_STATUS_INVALID_PARAM = SDRV_ERROR_STATUS(SDRV_STATUS_GROUP_COMMON, 4), /* Common status for invalid paramemt. */
77};
78
82typedef int32_t status_t;
83
84#endif /* SDRV_COMMON_H_ */
status_groups
Status group numbers.
Definition: sdrv_common.h:21
@ SDRV_STATUS_GROUP_CAMERA
Definition: sdrv_common.h:48
@ SDRV_STATUS_GROUP_MMC
Definition: sdrv_common.h:60
@ SDRV_STATUS_GROUP_GPIO
Definition: sdrv_common.h:27
@ SDRV_STATUS_GROUP_OTHER
Definition: sdrv_common.h:64
@ SDRV_STATUS_GROUP_FIREWALL
Definition: sdrv_common.h:63
@ SDRV_STATUS_GROUP_CRYPTO
Definition: sdrv_common.h:32
@ SDRV_STATUS_GROUP_PDM
Definition: sdrv_common.h:40
@ SDRV_STATUS_GROUP_LIN
Definition: sdrv_common.h:35
@ SDRV_STATUS_GROUP_PMU
Definition: sdrv_common.h:50
@ SDRV_STATUS_GROUP_VIC
Definition: sdrv_common.h:25
@ SDRV_STATUS_GROUP_MBOX
Definition: sdrv_common.h:57
@ SDRV_STATUS_GROUP_SEMAG
Definition: sdrv_common.h:58
@ SDRV_STATUS_GROUP_I2S
Definition: sdrv_common.h:39
@ SDRV_STATUS_GROUP_XSPI
Definition: sdrv_common.h:59
@ SDRV_STATUS_GROUP_SCR
Definition: sdrv_common.h:54
@ SDRV_STATUS_GROUP_SPI
Definition: sdrv_common.h:37
@ SDRV_STATUS_GROUP_COMMON
Definition: sdrv_common.h:22
@ SDRV_STATUS_GROUP_PVT
Definition: sdrv_common.h:55
@ SDRV_STATUS_GROUP_DMA
Definition: sdrv_common.h:28
@ SDRV_STATUS_GROUP_SMC
Definition: sdrv_common.h:52
@ SDRV_STATUS_GROUP_ETH
Definition: sdrv_common.h:38
@ SDRV_STATUS_GROUP_ASW
Definition: sdrv_common.h:46
@ SDRV_STATUS_GROUP_CLK
Definition: sdrv_common.h:24
@ SDRV_STATUS_GROUP_FLEXRAY
Definition: sdrv_common.h:62
@ SDRV_STATUS_GROUP_ACMP
Definition: sdrv_common.h:45
@ SDRV_STATUS_GROUP_ETIMER
Definition: sdrv_common.h:42
@ SDRV_STATUS_GROUP_ADC
Definition: sdrv_common.h:44
@ SDRV_STATUS_GROUP_UART
Definition: sdrv_common.h:33
@ SDRV_STATUS_GROUP_BTM
Definition: sdrv_common.h:29
@ SDRV_STATUS_GROUP_G2DLITE
Definition: sdrv_common.h:49
@ SDRV_STATUS_GROUP_XTRG
Definition: sdrv_common.h:43
@ SDRV_STATUS_GROUP_RTC
Definition: sdrv_common.h:53
@ SDRV_STATUS_GROUP_POWER
Definition: sdrv_common.h:51
@ SDRV_STATUS_GROUP_WATCHDOG
Definition: sdrv_common.h:31
@ SDRV_STATUS_GROUP_FLEXCAN
Definition: sdrv_common.h:34
@ SDRV_STATUS_GROUP_SDRAMC
Definition: sdrv_common.h:56
@ SDRV_STATUS_GROUP_FUSE
Definition: sdrv_common.h:30
@ SDRV_STATUS_GROUP_PINCTRL
Definition: sdrv_common.h:26
@ SDRV_STATUS_GROUP_XSPI_MST_SLV
Definition: sdrv_common.h:61
@ SDRV_STATUS_GROUP_I2C
Definition: sdrv_common.h:36
@ SDRV_STATUS_GROUP_DISPSS
Definition: sdrv_common.h:47
@ SDRV_STATUS_GROUP_RESET
Definition: sdrv_common.h:23
@ SDRV_STATUS_GROUP_EPWM
Definition: sdrv_common.h:41
int32_t status_t
Type used for all status and error return values.
Definition: sdrv_common.h:82
@ SDRV_STATUS_INVALID_PARAM
Definition: sdrv_common.h:76
@ SDRV_STATUS_FAIL
Definition: sdrv_common.h:73
@ SDRV_STATUS_OK
Definition: sdrv_common.h:72
@ SDRV_STATUS_TIMEOUT
Definition: sdrv_common.h:75
@ SDRV_STATUS_BUSY
Definition: sdrv_common.h:74
#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