void wizchip_setinterruptmask(intr_kind intr) { uint8_t imr = (uint8_t)intr; uint8_t simr = (uint8_t)((uint16_t)intr >> 8); #if _WIZCHIP_ < 5500 imr &= ~(1<<4); // IK_WOL #endif #if _WIZCHIP_ == 5200 imr &= ~(1 << 6); #endif #if _WIZCHIP_ < 5200 simr &= 0x0F; #endif #if _WIZCHIP_ == 5100 imr |= simr; setIMR(imr); #else setIMR(imr); setSIMR(simr); #endif }
void wizchip_setinterruptmask(intr_kind intr) { uint8_t imr = (uint8_t)intr; uint8_t simr = (uint8_t)((uint16_t)intr >> 8); #if _WIZCHIP_ < 5500 imr &= ~(1<<4); // IK_WOL #endif #if _WIZCHIP_ == 5200 imr &= ~(1 << 6); #endif #if _WIZCHIP_ == 5100 simr &= 0x0F; imr |= simr; setIMR(imr); //A20150601 : For integrating with W5300 #elif _WIZCHIP_ == 5300 setIMR( ((((uint16_t)imr) << 8) | (((uint16_t)simr) & 0x00FF)) ); #else setIMR(imr); setSIMR(simr); #endif }
/** @brief This function set the network option. @return None. */ void SetSocketOption(uint8 option_type, uint16 option_value) { switch(option_type) { case 0: setRTR(option_value); // set retry duration for data transmission, connection, closing ... break; case 1: setRCR((uint8)(option_value&0x00FF)); // set retry count (above the value, assert timeout interrupt) break; case 2: setIMR((uint8)(option_value&0x00FF)); // set interrupt mask. break; default: break; } }