// put the flash into deep sleep mode // important to do this by default void FLASH_M25P_DP() { // SIMO0, UCLK0 SET_SIMO0_DD_OUT(); SET_UCLK0_DD_OUT(); SET_FLASH_HOLD_DD_OUT(); SET_FLASH_CS_DD_OUT(); SET_FLASH_HOLD(); SET_FLASH_CS(); TOSH_wait(); // initiate sequence; CLR_FLASH_CS(); CLR_UCLK0(); FLASH_M25P_DP_bit(1); // 0 FLASH_M25P_DP_bit(0); // 1 FLASH_M25P_DP_bit(1); // 2 FLASH_M25P_DP_bit(1); // 3 FLASH_M25P_DP_bit(1); // 4 FLASH_M25P_DP_bit(0); // 5 FLASH_M25P_DP_bit(0); // 6 FLASH_M25P_DP_bit(1); // 7 SET_FLASH_CS(); SET_SIMO0(); SET_SIMO0_DD_IN(); SET_UCLK0_DD_IN(); CLR_FLASH_HOLD(); }
void GALSC_run_task() { while (GALSC_run_next_task()) ; TOSH_sleep(); TOSH_wait(); }
void TOSH_run_task() { while (TOSH_run_next_task()) ; TOSH_sleep(); TOSH_wait(); }