Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(PeriphDrivers): Add MAX32657 I3C driver #1026

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions Libraries/CMSIS/Device/Maxim/MAX32657/Include/i3c_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -864,9 +864,27 @@ typedef struct {

#define MXC_F_I3C_TARG_CAP1_CCCH_POS 12 /**< TARG_CAP1_CCCH Position */
#define MXC_F_I3C_TARG_CAP1_CCCH ((uint32_t)(0xFUL << MXC_F_I3C_TARG_CAP1_CCCH_POS)) /**< TARG_CAP1_CCCH Mask */
#define MXC_V_I3C_TARG_CAP1_CCCH_BASIC ((uint32_t)0x1UL) /**< TARG_CAP1_CCCH_BASIC Value */
#define MXC_S_I3C_TARG_CAP1_CCCH_BASIC (MXC_V_I3C_TARG_CAP1_CCCH_BASIC << MXC_F_I3C_TARG_CAP1_CCCH_POS) /**< TARG_CAP1_CCCH_BASIC Setting */
#define MXC_V_I3C_TARG_CAP1_CCCH_LIMITS ((uint32_t)0x2UL) /**< TARG_CAP1_CCCH_LIMITS Value */
#define MXC_S_I3C_TARG_CAP1_CCCH_LIMITS (MXC_V_I3C_TARG_CAP1_CCCH_LIMITS << MXC_F_I3C_TARG_CAP1_CCCH_POS) /**< TARG_CAP1_CCCH_LIMITS Setting */
#define MXC_V_I3C_TARG_CAP1_CCCH_INTACT ((uint32_t)0x4UL) /**< TARG_CAP1_CCCH_INTACT Value */
#define MXC_S_I3C_TARG_CAP1_CCCH_INTACT (MXC_V_I3C_TARG_CAP1_CCCH_INTACT << MXC_F_I3C_TARG_CAP1_CCCH_POS) /**< TARG_CAP1_CCCH_INTACT Setting */
#define MXC_V_I3C_TARG_CAP1_CCCH_VENDOR ((uint32_t)0x8UL) /**< TARG_CAP1_CCCH_VENDOR Value */
#define MXC_S_I3C_TARG_CAP1_CCCH_VENDOR (MXC_V_I3C_TARG_CAP1_CCCH_VENDOR << MXC_F_I3C_TARG_CAP1_CCCH_POS) /**< TARG_CAP1_CCCH_VENDOR Setting */

#define MXC_F_I3C_TARG_CAP1_IBI_EVENTS_POS 16 /**< TARG_CAP1_IBI_EVENTS Position */
#define MXC_F_I3C_TARG_CAP1_IBI_EVENTS ((uint32_t)(0x1FUL << MXC_F_I3C_TARG_CAP1_IBI_EVENTS_POS)) /**< TARG_CAP1_IBI_EVENTS Mask */
#define MXC_V_I3C_TARG_CAP1_IBI_EVENTS_IBI ((uint32_t)0x1UL) /**< TARG_CAP1_IBI_EVENTS_IBI Value */
#define MXC_S_I3C_TARG_CAP1_IBI_EVENTS_IBI (MXC_V_I3C_TARG_CAP1_IBI_EVENTS_IBI << MXC_F_I3C_TARG_CAP1_IBI_EVENTS_POS) /**< TARG_CAP1_IBI_EVENTS_IBI Setting */
#define MXC_V_I3C_TARG_CAP1_IBI_EVENTS_PAYLOAD ((uint32_t)0x2UL) /**< TARG_CAP1_IBI_EVENTS_PAYLOAD Value */
#define MXC_S_I3C_TARG_CAP1_IBI_EVENTS_PAYLOAD (MXC_V_I3C_TARG_CAP1_IBI_EVENTS_PAYLOAD << MXC_F_I3C_TARG_CAP1_IBI_EVENTS_POS) /**< TARG_CAP1_IBI_EVENTS_PAYLOAD Setting */
#define MXC_V_I3C_TARG_CAP1_IBI_EVENTS_CONTREQ ((uint32_t)0x4UL) /**< TARG_CAP1_IBI_EVENTS_CONTREQ Value */
#define MXC_S_I3C_TARG_CAP1_IBI_EVENTS_CONTREQ (MXC_V_I3C_TARG_CAP1_IBI_EVENTS_CONTREQ << MXC_F_I3C_TARG_CAP1_IBI_EVENTS_POS) /**< TARG_CAP1_IBI_EVENTS_CONTREQ Setting */
#define MXC_V_I3C_TARG_CAP1_IBI_EVENTS_HJ ((uint32_t)0x8UL) /**< TARG_CAP1_IBI_EVENTS_HJ Value */
#define MXC_S_I3C_TARG_CAP1_IBI_EVENTS_HJ (MXC_V_I3C_TARG_CAP1_IBI_EVENTS_HJ << MXC_F_I3C_TARG_CAP1_IBI_EVENTS_POS) /**< TARG_CAP1_IBI_EVENTS_HJ Setting */
#define MXC_V_I3C_TARG_CAP1_IBI_EVENTS_BAMATCH ((uint32_t)0x10UL) /**< TARG_CAP1_IBI_EVENTS_BAMATCH Value */
#define MXC_S_I3C_TARG_CAP1_IBI_EVENTS_BAMATCH (MXC_V_I3C_TARG_CAP1_IBI_EVENTS_BAMATCH << MXC_F_I3C_TARG_CAP1_IBI_EVENTS_POS) /**< TARG_CAP1_IBI_EVENTS_BAMATCH Setting */

#define MXC_F_I3C_TARG_CAP1_TIMECTRL_POS 21 /**< TARG_CAP1_TIMECTRL Position */
#define MXC_F_I3C_TARG_CAP1_TIMECTRL ((uint32_t)(0x1UL << MXC_F_I3C_TARG_CAP1_TIMECTRL_POS)) /**< TARG_CAP1_TIMECTRL Mask */
Expand Down Expand Up @@ -1066,9 +1084,9 @@ typedef struct {
#define MXC_S_I3C_CONT_STATUS_IBITYPE_NONE (MXC_V_I3C_CONT_STATUS_IBITYPE_NONE << MXC_F_I3C_CONT_STATUS_IBITYPE_POS) /**< CONT_STATUS_IBITYPE_NONE Setting */
#define MXC_V_I3C_CONT_STATUS_IBITYPE_IBI ((uint32_t)0x1UL) /**< CONT_STATUS_IBITYPE_IBI Value */
#define MXC_S_I3C_CONT_STATUS_IBITYPE_IBI (MXC_V_I3C_CONT_STATUS_IBITYPE_IBI << MXC_F_I3C_CONT_STATUS_IBITYPE_POS) /**< CONT_STATUS_IBITYPE_IBI Setting */
#define MXC_V_I3C_CONT_STATUS_IBITYPE_CONT_REQ ((uint32_t)0x1UL) /**< CONT_STATUS_IBITYPE_CONT_REQ Value */
#define MXC_V_I3C_CONT_STATUS_IBITYPE_CONT_REQ ((uint32_t)0x2UL) /**< CONT_STATUS_IBITYPE_CONT_REQ Value */
#define MXC_S_I3C_CONT_STATUS_IBITYPE_CONT_REQ (MXC_V_I3C_CONT_STATUS_IBITYPE_CONT_REQ << MXC_F_I3C_CONT_STATUS_IBITYPE_POS) /**< CONT_STATUS_IBITYPE_CONT_REQ Setting */
#define MXC_V_I3C_CONT_STATUS_IBITYPE_HOTJOIN_REQ ((uint32_t)0x1UL) /**< CONT_STATUS_IBITYPE_HOTJOIN_REQ Value */
#define MXC_V_I3C_CONT_STATUS_IBITYPE_HOTJOIN_REQ ((uint32_t)0x3UL) /**< CONT_STATUS_IBITYPE_HOTJOIN_REQ Value */
#define MXC_S_I3C_CONT_STATUS_IBITYPE_HOTJOIN_REQ (MXC_V_I3C_CONT_STATUS_IBITYPE_HOTJOIN_REQ << MXC_F_I3C_CONT_STATUS_IBITYPE_POS) /**< CONT_STATUS_IBITYPE_HOTJOIN_REQ Setting */

#define MXC_F_I3C_CONT_STATUS_TARG_START_POS 8 /**< CONT_STATUS_TARG_START Position */
Expand Down
6 changes: 6 additions & 0 deletions Libraries/CMSIS/Device/Maxim/MAX32657/Include/max32657.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ We may want to handle GET_IRQ better...

/******************************************************************************/
/* I3C */
#define MXC_CFG_I3C_INSTANCES (1)
#define MXC_I3C_FIFO_DEPTH (8)

/* Non-secure Mapping */
Expand All @@ -647,6 +648,11 @@ We may want to handle GET_IRQ better...
#define MXC_I3C MXC_I3C_NS
#endif

#define MXC_I3C_GET_BASE(i) ((i) == 0 ? MXC_BASE_I3C : 0)
#define MXC_I3C_GET_I3C(i) ((i) == 0 ? MXC_I3C : 0)
#define MXC_I3C_GET_IRQ(i) (IRQn_Type)((i) == 0 ? I3C_IRQn : 0)
#define MXC_I3C_GET_IDX(p) ((p) == MXC_I3C_NS ? 0 : (p) == MXC_I3C_S ? 0 : -1)

/******************************************************************************/
/* DMA */
#define MXC_DMA_CHANNELS (4)
Expand Down
55 changes: 52 additions & 3 deletions Libraries/CMSIS/Device/Maxim/MAX32657/Include/max32657.svd
Original file line number Diff line number Diff line change
Expand Up @@ -4865,11 +4865,60 @@
<name>CCCH</name>
<description>CCC Handled by IP.</description>
<bitRange>[15:12]</bitRange>
<enumeratedValues>
<enumeratedValue>
<name>BASIC</name>
<description>Basic CCCs.</description>
<value>1</value>
</enumeratedValue>
<enumeratedValue>
<name>LIMITS</name>
<description>CCCs related to maximum transfer lengths and speed.</description>
<value>2</value>
</enumeratedValue>
<enumeratedValue>
<name>INTACT</name>
<description>Pending Interrupt and Activity Mode fields of GETSTATUS CCC.</description>
<value>4</value>
</enumeratedValue>
<enumeratedValue>
<name>VENDOR</name>
<description>Vendor Reserved field of GETSTATUS CCC.</description>
<value>8</value>
</enumeratedValue>
</enumeratedValues>
</field>
<field>
<name>IBI_EVENTS</name>
<description>Supported IBI events.</description>
<bitRange>[20:16]</bitRange>
<enumeratedValues>
<enumeratedValue>
<name>IBI</name>
<description>IBI support.</description>
<value>1</value>
</enumeratedValue>
<enumeratedValue>
<name>PAYLOAD</name>
<description>IBI has payload.</description>
<value>2</value>
</enumeratedValue>
<enumeratedValue>
<name>CONTREQ</name>
<description>Controller request support.</description>
<value>4</value>
</enumeratedValue>
<enumeratedValue>
<name>HJ</name>
<description>Hot-Join support.</description>
<value>8</value>
</enumeratedValue>
<enumeratedValue>
<name>BAMATCH</name>
<description>Use BAMATCH field of CONFIG register to measure 1us Bus Available timing.</description>
<value>16</value>
</enumeratedValue>
</enumeratedValues>
</field>
<field>
<name>TIMECTRL</name>
Expand Down Expand Up @@ -5234,12 +5283,12 @@
<enumeratedValue>
<name>CONT_REQ</name>
<description>Controller request.</description>
<value>1</value>
<value>2</value>
</enumeratedValue>
<enumeratedValue>
<name>HOTJOIN_REQ</name>
<description>Hot-Join request.</description>
<value>1</value>
<value>3</value>
</enumeratedValue>
</enumeratedValues>
</field>
Expand Down Expand Up @@ -12060,4 +12109,4 @@
</peripheral>

</peripherals>
</device>
</device>
Loading
Loading