add getsock(), setsock()
Fork of WIZnetInterface by
Diff: arch/ext/W5500.h
- Revision:
- 6:94a81e80c675
- Parent:
- 5:f432ae8f8708
- Child:
- 8:4c02de1dbf3a
--- a/arch/ext/W5500.h Mon Jun 15 22:39:51 2015 +0900 +++ b/arch/ext/W5500.h Mon Jun 15 22:44:54 2015 +0900 @@ -621,131 +621,6 @@ /** * @ingroup Common_register_access_function - * @brief Set @ref PTIMER register - * @param (uint8_t)ptimer Value to set @ref PTIMER register. - * @sa getPTIMER() - */ - void setPTIMER(uint8_t ptimer) { - reg_wr<uint8_t>(PTIMER, ptimer); - } - -/** - * @ingroup Common_register_access_function - * @brief Get @ref PTIMER register - * @return uint8_t. Value of @ref PTIMER register. - * @sa setPTIMER() - */ - uint8_t getPTIMER() { - return reg_rd<uint8_t>(PTIMER); - } - -/** - * @ingroup Common_register_access_function - * @brief Set @ref PMAGIC register - * @param (uint8_t)pmagic Value to set @ref PMAGIC register. - * @sa getPMAGIC() - */ -/* -#define setPMAGIC(pmagic) \ - WIZCHIP_WRITE(PMAGIC, pmagic) -*/ - void setPMAGIC(uint8_t pmagic) { - reg_wr<uint8_t>(PMAGIC, pmagic ); - } -/** - * @ingroup Common_register_access_function - * @brief Get @ref PMAGIC register - * @return uint8_t. Value of @ref PMAGIC register. - * @sa setPMAGIC() - */ -/* -#define getPMAGIC() \ - WIZCHIP_READ(PMAGIC) -*/ - uint8_t getPMAGIC(uint8_t pmagic) { - return reg_rd<uint8_t>(PMAGIC, pmagic); - } -/** - * @ingroup Common_register_access_function - * @brief Set PHAR address - * @param (uint8_t*)phar Pointer variable to set PPP destination MAC register address. It should be allocated 6 bytes. - * @sa getPHAR() - */ - void setPHAR(uint8_t * phar) { - reg_wr_mac(PHAR, phar); - } - -/** - * @ingroup Common_register_access_function - * @brief Get local IP address - * @param (uint8_t*)phar Pointer variable to PPP destination MAC register address. It should be allocated 6 bytes. - * @sa setPHAR() - */ - void getPHAR(uint8_t * phar) { - reg_rd_mac(PHAR, phar); - } - -/** - * @ingroup Common_register_access_function - * @brief Set @ref PSID register - * @param (uint16_t)psid Value to set @ref PSID register. - * @sa getPSID() - */ - void setPSID(uint16_t psid) { - reg_wr<uint16_t>(PSID, psid ); - } - -/** - * @ingroup Common_register_access_function - * @brief Get @ref PSID register - * @return uint16_t. Value of @ref PSID register. - * @sa setPSID() - */ -//uint16_t getPSID(void); - uint16_t getPSID() { - return reg_rd<uint16_t>(PSID); - } - -/** - * @ingroup Common_register_access_function - * @brief Set @ref PMRU register - * @param (uint16_t)pmru Value to set @ref PMRU register. - * @sa getPMRU() - */ - void setPMRU(uint16_t pmru) { - reg_wr<uint16_t>(PMRU, pmru); - } - -/** - * @ingroup Common_register_access_function - * @brief Get @ref PMRU register - * @return uint16_t. Value of @ref PMRU register. - * @sa setPMRU() - */ - uint16_t getPMRU() { - return reg_rd<uint16_t>(PMRU); - } - -/** - * @ingroup Common_register_access_function - * @brief Get unreachable IP address - * @param (uint8_t*)uipr Pointer variable to get unreachable IP address. It should be allocated 4 bytes. - */ - void getUIPR(uint8_t * uipr) { - reg_rd_ip_byte(UIPR,uipr); - } - -/** - * @ingroup Common_register_access_function - * @brief Get @ref UPORTR register - * @return uint16_t. Value of @ref UPORTR register. - */ - uint16_t getUPORTR() { - return reg_rd<uint16_t>(UPORTR); - } - -/** - * @ingroup Common_register_access_function * @brief Set @ref PHYCFGR register * @param (uint8_t)phycfgr Value to set @ref PHYCFGR register. * @sa getPHYCFGR() @@ -764,14 +639,6 @@ return reg_rd<uint8_t>(PHYCFGR); } -/** - * @ingroup Common_register_access_function - * @brief Get @ref VERSIONR register - * @return uint8_t. Value of @ref VERSIONR register. - */ - uint8_t getVERSIONR() { - return reg_rd<uint8_t>(VERSIONR); - } ///////////////////////////////////// @@ -964,73 +831,6 @@ return sreg<uint16_t>(sn, Sn_DPORT); } -/** - * @ingroup Socket_register_access_function - * @brief Set @ref Sn_MSSR register - * @param (uint8_t)sn Socket number. It should be <b>0 ~ 7</b>. - * @param (uint16_t)mss Value to set @ref Sn_MSSR - * @sa setSn_MSSR() - */ - void setSn_MSSR(uint8_t sn, uint16_t mss) { - sreg<uint16_t>(sn, Sn_MSSR, mss); - } - -/** - * @ingroup Socket_register_access_function - * @brief Get @ref Sn_MSSR register - * @param (uint8_t)sn Socket number. It should be <b>0 ~ 7</b>. - * @return uint16_t. Value of @ref Sn_MSSR. - * @sa setSn_MSSR() - */ - uint16_t getSn_MSSR(uint16_t sn) { - return sreg<uint16_t>(sn, Sn_MSSR); - } - -/** - * @ingroup Socket_register_access_function - * @brief Set @ref Sn_TOS register - * @param (uint8_t)sn Socket number. It should be <b>0 ~ 7</b>. - * @param (uint8_t)tos Value to set @ref Sn_TOS - * @sa getSn_TOS() - */ - void setSn_TOS(uint8_t sn, uint8_t tos) { - sreg<uint8_t>(sn, Sn_TOS, tos); - } - -/** - * @ingroup Socket_register_access_function - * @brief Get @ref Sn_TOS register - * @param (uint8_t)sn Socket number. It should be <b>0 ~ 7</b>. - * @return uint8_t. Value of Sn_TOS. - * @sa setSn_TOS() - */ - uint8_t getSn_TOS(uint8_t sn) { - return sreg<uint8_t>(sn, Sn_TOS); - } - -/** - * @ingroup Socket_register_access_function - * @brief Set @ref Sn_TTL register - * @param (uint8_t)sn Socket number. It should be <b>0 ~ 7</b>. - * @param (uint8_t)ttl Value to set @ref Sn_TTL - * @sa getSn_TTL() - */ - void setSn_TTL(uint8_t sn, uint8_t ttl) { - sreg<uint8_t>(sn, Sn_TTL, ttl); - } - - -/** - * @ingroup Socket_register_access_function - * @brief Get @ref Sn_TTL register - * @param (uint8_t)sn Socket number. It should be <b>0 ~ 7</b>. - * @return uint8_t. Value of @ref Sn_TTL. - * @sa setSn_TTL() - */ - uint8_t getSn_TTL(uint8_t sn) { - return sreg<uint8_t>(sn, Sn_TTL); - } - /** * @ingroup Socket_register_access_function @@ -1165,50 +965,6 @@ } -/** - * @ingroup Socket_register_access_function - * @brief Set @ref Sn_FRAG register - * @param (uint8_t)sn Socket number. It should be <b>0 ~ 7</b>. - * @param (uint16_t)frag Value to set @ref Sn_FRAG - * @sa getSn_FRAD() - */ - void setSn_FRAG(uint8_t sn, uint16_t frag) { - sreg<uint16_t>(sn, Sn_FRAG, frag ); - } - -/** - * @ingroup Socket_register_access_function - * @brief Get @ref Sn_FRAG register - * @param (uint8_t)sn Socket number. It should be <b>0 ~ 7</b>. - * @return uint16_t. Value of @ref Sn_FRAG. - * @sa setSn_FRAG() - */ - uint16_t getSn_FRAG(uint8_t sn) { - return sreg<uint16_t>(sn, Sn_FRAG); - } - -/** - * @ingroup Socket_register_access_function - * @brief Set @ref Sn_KPALVTR register - * @param (uint8_t)sn Socket number. It should be <b>0 ~ 7</b>. - * @param (uint8_t)kpalvt Value to set @ref Sn_KPALVTR - * @sa getSn_KPALVTR() - */ - void setSn_KPALVTR(uint8_t sn, uint8_t kpalvt) { - sreg<uint8_t>(sn, Sn_KPALVTR, kpalvt); - } - -/** - * @ingroup Socket_register_access_function - * @brief Get @ref Sn_KPALVTR register - * @param (uint8_t)sn Socket number. It should be <b>0 ~ 7</b>. - * @return uint8_t. Value of @ref Sn_KPALVTR. - * @sa setSn_KPALVTR() - */ - uint8_t getSn_KPALVTR(uint8_t sn) { - return sreg<uint8_t>(sn, Sn_KPALVTR); - } - ////////////////////////////////////// /////////////////////////////////////