|
23 | 23 | #define ADC_PRIORITY 12
|
24 | 24 | #define CAN_PRIORITY 12
|
25 | 25 | #define CANFD_PRIORITY 12
|
| 26 | +#define I2S_PRIORITY 12 |
26 | 27 | #define FIRST_INT_SLOT_FREE 0
|
27 | 28 |
|
28 | 29 | IRQManager::IRQManager() : last_interrupt_index{0} {
|
@@ -1006,6 +1007,41 @@ bool IRQManager::addPeripheral(Peripheral_t p, void *cfg) {
|
1006 | 1007 | }
|
1007 | 1008 | }
|
1008 | 1009 | #endif
|
| 1010 | + |
| 1011 | +#if I2S_HOWMANY > 0 |
| 1012 | + /* ********************************************************************** |
| 1013 | + I2S |
| 1014 | + ********************************************************************** */ |
| 1015 | + else if(p == IRQ_I2S && cfg != NULL) { |
| 1016 | + i2s_cfg_t *i2s_cfg = (i2s_cfg_t *)cfg; |
| 1017 | + |
| 1018 | + if(i2s_cfg->txi_irq == FSP_INVALID_VECTOR) { |
| 1019 | + i2s_cfg->txi_irq = (IRQn_Type)last_interrupt_index; |
| 1020 | + i2s_cfg->txi_ipl = I2S_PRIORITY; |
| 1021 | + *(irq_ptr + last_interrupt_index) = (uint32_t)ssi_txi_isr; |
| 1022 | + R_ICU->IELSR[last_interrupt_index] = BSP_PRV_IELS_ENUM(EVENT_SSI0_TXI); |
| 1023 | + R_FSP_IsrContextSet(i2s_cfg->txi_irq, (void*)i2s_cfg->p_context); |
| 1024 | + last_interrupt_index++; |
| 1025 | + } |
| 1026 | + if(i2s_cfg->rxi_irq == FSP_INVALID_VECTOR) { |
| 1027 | + i2s_cfg->rxi_irq = (IRQn_Type)last_interrupt_index; |
| 1028 | + i2s_cfg->rxi_ipl = I2S_PRIORITY; |
| 1029 | + *(irq_ptr + last_interrupt_index) = (uint32_t)ssi_rxi_isr; |
| 1030 | + R_ICU->IELSR[last_interrupt_index] = BSP_PRV_IELS_ENUM(EVENT_SSI0_RXI); |
| 1031 | + R_FSP_IsrContextSet(i2s_cfg->rxi_irq, (void*)i2s_cfg->p_context); |
| 1032 | + last_interrupt_index++; |
| 1033 | + } |
| 1034 | + if(i2s_cfg->int_irq == FSP_INVALID_VECTOR) { |
| 1035 | + i2s_cfg->int_irq = (IRQn_Type)last_interrupt_index; |
| 1036 | + i2s_cfg->idle_err_ipl = I2S_PRIORITY; |
| 1037 | + *(irq_ptr + last_interrupt_index) = (uint32_t)ssi_int_isr; |
| 1038 | + R_ICU->IELSR[last_interrupt_index] = BSP_PRV_IELS_ENUM(EVENT_SSI0_INT); |
| 1039 | + R_FSP_IsrContextSet(i2s_cfg->int_irq, (void*)i2s_cfg->p_context); |
| 1040 | + last_interrupt_index++; |
| 1041 | + } |
| 1042 | + } |
| 1043 | +#endif |
| 1044 | + |
1009 | 1045 | else {
|
1010 | 1046 | rv = false;
|
1011 | 1047 | }
|
|
0 commit comments