@@ -233,7 +233,7 @@ static DisplayJDIDevice s_display = {
233233};
234234
235235DisplayJDIDevice * const DISPLAY = & s_display ;
236- IRQ_MAP (LCDC1 , jdi_lpm015m135a_irq_handler , DISPLAY );
236+ // IRQ_MAP(LCDC1, jdi_lpm015m135a_irq_handler, DISPLAY);
237237
238238#ifdef NIMBLE_HCI_SF32LB52_TRACE_BINARY
239239static UARTDeviceState s_hci_trace_uart_state = {
@@ -334,7 +334,7 @@ static I2CBus s_i2c_bus_1 = {
334334
335335I2CBus * const I2C1_BUS = & s_i2c_bus_1 ;
336336
337- IRQ_MAP (I2C1 , i2c_irq_handler , I2C1_BUS );
337+ // IRQ_MAP(I2C1, i2c_irq_handler, I2C1_BUS);
338338
339339static I2CDeviceState s_i2c_device_state_2 = {
340340 .int_enabled = true,
@@ -384,7 +384,7 @@ static I2CBus s_i2c_bus_2 = {
384384
385385I2CBus * const I2C2_BUS = & s_i2c_bus_2 ;
386386
387- IRQ_MAP (I2C2 , i2c_irq_handler , I2C2_BUS );
387+ // IRQ_MAP(I2C2, i2c_irq_handler, I2C2_BUS);
388388
389389static const I2CSlavePort s_i2c_lsm6d = {
390390 .bus = & s_i2c_bus_2 ,
@@ -469,7 +469,7 @@ static I2CBus s_i2c_bus_3 = {
469469};
470470
471471I2CBus * const I2C3_BUS = & s_i2c_bus_3 ;
472- IRQ_MAP (I2C3 , i2c_irq_handler , I2C3_BUS );
472+ // IRQ_MAP(I2C3, i2c_irq_handler, I2C3_BUS);
473473
474474static const I2CSlavePort s_i2c_cst816 = {
475475 .bus = I2C3_BUS ,
@@ -542,7 +542,7 @@ const BoardConfigButton BOARD_CONFIG_BUTTON = {
542542 .timer = GPTIM1 ,
543543 .timer_irqn = GPTIM1_IRQn ,
544544};
545- IRQ_MAP (GPTIM1 , debounced_button_irq_handler , GPTIM1 );
545+ // IRQ_MAP(GPTIM1, debounced_button_irq_handler, GPTIM1);
546546
547547static MicDeviceState mic_state = {
548548 .hdma = {
@@ -574,8 +574,8 @@ static const MicDevice mic_device = {
574574 .channel_depth = 16 ,
575575};
576576const MicDevice * MIC = & mic_device ;
577- IRQ_MAP (PDM1 , pdm1_data_handler , MIC );
578- IRQ_MAP (DMAC1_CH5 , pdm1_l_dma_handler , MIC );
577+ // IRQ_MAP(PDM1, pdm1_data_handler, MIC);
578+ // IRQ_MAP(DMAC1_CH5, pdm1_l_dma_handler, MIC);
579579
580580static AudioDeviceState audio_state ;
581581static const AudioDevice audio_device = {
@@ -594,8 +594,8 @@ static const AudioDevice audio_device = {
594594 .active_high = true,
595595 },
596596};
597- const AudioDevice * AUDIO = & audio_device ;
598- IRQ_MAP (DMAC1_CH4 , audec_dac0_dma_irq_handler , AUDIO );
597+ // const AudioDevice* AUDIO = &audio_device;
598+ // IRQ_MAP(DMAC1_CH4, audec_dac0_dma_irq_handler, AUDIO);
599599
600600uint32_t BSP_GetOtpBase (void ) {
601601 return MPI2_MEM_BASE ;
@@ -642,8 +642,11 @@ static void gpio_pm_disable(int pin)
642642
643643 gpiox = GPIO_GetInstance (hwp_gpio1 , pin , & offset );
644644 * (& (hwp_pinmux1 -> PAD_PA00 ) + pin ) &= ~((1 << 6 ) | (1 << 4 )); // Clear IE, PE
645+ // *(&(hwp_pinmux1->PAD_PA00) + pin) &= ~(1 << 6); // Clear IE
646+ // *(&(hwp_pinmux1->PAD_PA00) + pin) |= (1 << 4); // Set PE
645647 CLEAR_OPEN_DRAIN_FLAG (gpiox , (1UL << offset ));
646- gpiox -> DOECR &= ~(1 << offset );
648+ gpiox -> DOESR |= (1 << offset );
649+ // gpiox->DOSR |= (1 << offset);
647650}
648651
649652void board_early_init (void ) {
@@ -719,76 +722,78 @@ void board_early_init(void) {
719722 HAL_RCC_DisableModule (RCC_MOD_I2S1 );
720723 HAL_RCC_DisableModule (RCC_MOD_SDMMC1 );
721724
722- // HAL_RCC_DisableModule(RCC_MOD_I2C1);
725+ HAL_RCC_DisableModule (RCC_MOD_I2C1 );
723726 HAL_RCC_DisableModule (RCC_MOD_I2C2 );
724727 HAL_RCC_DisableModule (RCC_MOD_I2C3 );
725- // HAL_RCC_DisableModule(RCC_MOD_GPTIM1);
726- // HAL_RCC_DisableModule(RCC_MOD_GPTIM2);
727- // HAL_RCC_DisableModule(RCC_MOD_BTIM2);
728+ HAL_RCC_DisableModule (RCC_MOD_GPTIM1 );
729+ HAL_RCC_DisableModule (RCC_MOD_GPTIM2 );
730+ HAL_RCC_DisableModule (RCC_MOD_BTIM2 );
728731// HAL_RCC_DisableModule(RCC_MOD_MPI2);
729- // HAL_RCC_DisableModule(RCC_MOD_PDM1);
730- // HAL_RCC_DisableModule(RCC_MOD_AUDPRC);
731- // HAL_RCC_DisableModule(RCC_MOD_AUDCODEC);
732+ HAL_RCC_DisableModule (RCC_MOD_PDM1 );
733+ HAL_RCC_DisableModule (RCC_MOD_AUDPRC );
734+ HAL_RCC_DisableModule (RCC_MOD_AUDCODEC );
732735
733736 // display
734- gpio_pm_disable (40 );
735- gpio_pm_disable (8 );
736- gpio_pm_disable (39 );
737- gpio_pm_disable (7 );
738- gpio_pm_disable (6 );
739- gpio_pm_disable (41 );
740- gpio_pm_disable (5 );
741- gpio_pm_disable (42 );
742- gpio_pm_disable (4 );
743- gpio_pm_disable (43 );
744- gpio_pm_disable (3 );
737+ gpio_pm_disable (0 );
738+ gpio_pm_disable (1 );
745739 gpio_pm_disable (2 );
740+ gpio_pm_disable (3 );
741+ gpio_pm_disable (4 );
742+ gpio_pm_disable (5 );
743+ gpio_pm_disable (6 );
744+ gpio_pm_disable (7 );
745+ gpio_pm_disable (8 );
746+ gpio_pm_disable (9 );
747+ gpio_pm_disable (10 );
748+ gpio_pm_disable (11 );
749+
750+ // gpio_pm_disable(18);
751+ // gpio_pm_disable(19);
752+
753+ gpio_pm_disable (20 );
754+
755+ gpio_pm_disable (22 );
756+ gpio_pm_disable (23 );
746757 gpio_pm_disable (24 );
747758 gpio_pm_disable (25 );
748-
749759 gpio_pm_disable (26 );
750-
751- // touch
752760 gpio_pm_disable (27 );
753-
754- // buttons
761+ gpio_pm_disable (28 );
762+ gpio_pm_disable (29 );
763+ gpio_pm_disable (30 );
764+ gpio_pm_disable (31 );
765+ gpio_pm_disable (32 );
766+ gpio_pm_disable (33 );
755767 gpio_pm_disable (34 );
756768 gpio_pm_disable (35 );
757769 gpio_pm_disable (36 );
758770 gpio_pm_disable (37 );
759-
760- // pwm
761- gpio_pm_disable (28 );
762- gpio_pm_disable (29 );
771+ gpio_pm_disable (38 );
772+ gpio_pm_disable (39 );
773+ gpio_pm_disable (40 );
774+ gpio_pm_disable (41 );
775+ gpio_pm_disable (42 );
776+ gpio_pm_disable (43 );
763777 gpio_pm_disable (44 );
764778
765- // i2c1, still used by pmic
766- // gpio_pm_disable(10);
767- // gpio_pm_disable(11);
768-
769- // i2c2
770- gpio_pm_disable (32 );
771- gpio_pm_disable (33 );
772- // i2c3
773- gpio_pm_disable (30 );
774- gpio_pm_disable (31 );
775-
776- // clear IE, OE, PE for PA24~27
777- hwp_rtc -> PBR0R &= ((1 << 1 ) | (1 << 2 ) | (1 << 3 ));
778- hwp_rtc -> PBR1R &= ((1 << 1 ) | (1 << 2 ) | (1 << 3 ));
779- hwp_rtc -> PBR2R &= ((1 << 1 ) | (1 << 2 ) | (1 << 3 ));
780- hwp_rtc -> PBR3R &= ((1 << 1 ) | (1 << 2 ) | (1 << 3 ));
781-
782- gpio_pm_disable (28 );
783- gpio_pm_disable (29 );
784-
785-
779+ // clear IE, PE for PA24~27
780+ hwp_rtc -> PBR0R &= ~((1 << 2 ) | ((1 << 3 )));
781+ hwp_rtc -> PBR1R &= ~((1 << 2 ) | ((1 << 3 )));
782+ hwp_rtc -> PBR2R &= ~((1 << 2 ) | ((1 << 3 )));
783+ hwp_rtc -> PBR3R &= ~((1 << 2 ) | ((1 << 3 )));
784+ // set OE for PA24~27
785+ hwp_rtc -> PBR0R |= (1 << 1 ) ;
786+ hwp_rtc -> PBR1R |= (1 << 1 ) ;
787+ hwp_rtc -> PBR2R |= (1 << 1 ) ;
788+ hwp_rtc -> PBR3R |= (1 << 1 ) ;
789+
790+ hwp_rtc -> PAWK1R = 0 ;
786791}
787792
788793void board_init (void ) {
789- i2c_init (I2C1_BUS );
794+ // i2c_init(I2C1_BUS);
790795// i2c_init(I2C2_BUS);
791796// i2c_init(I2C3_BUS);
792797
793- mic_init (MIC );
798+ // mic_init(MIC);
794799}
0 commit comments