Socket APIs
|
Common register access functions
These are functions to access common registers. More...
Macros | |
#define | setIR(ir) WIZCHIP_WRITE(IR, ir & 0xF0FF) |
Set Mode Register. More... | |
#define | getIR() (WIZCHIP_READ(IR) & 0xF0FF) |
Get IR register. More... | |
#define | setIMR(imr) WIZCHIP_WRITE(_IMR_, imr & 0xF0FF) |
Set IMR register. More... | |
#define | getIMR() (WIZCHIP_READ(_IMR_) & 0xF0FF) |
Get IMR register. More... | |
#define | setSHAR(shar) |
Set local MAC address. More... | |
#define | setGAR(gar) |
Set gateway IP address. More... | |
#define | getGAR(gar) |
Get gateway IP address. More... | |
#define | setSUBR(subr) |
Set subnet mask address. More... | |
#define | getSUBR(subr) |
Get subnet mask address. More... | |
#define | setSIPR(sipr) |
Set local IP address. More... | |
#define | getSIPR(sipr) |
Get local IP address. More... | |
#define | setRTR(rtr) WIZCHIP_WRITE(_RTR_, rtr) |
Set RTR register. More... | |
#define | getRTR() WIZCHIP_READ(_RTR_) |
Get RTR register. More... | |
#define | setRCR(rcr) WIZCHIP_WRITE(_RCR_, ((uint16_t)rcr)&0x00FF) |
Set RCR register. More... | |
#define | getRCR() ((uint8_t)(WIZCHIP_READ(_RCR_) & 0x00FF)) |
Get RCR register. More... | |
#define | setTMS01R(tms01r) WIZCHIP_WRITE(TMS01R,tms01r) |
Set TMS01R register. More... | |
#define | getTMS01R() WIZCHIP_READ(TMS01R) |
Get TMS01R register. More... | |
#define | setTMS23R(tms23r) WIZCHIP_WRITE(TMS23R,tms23r) |
Set TMS23R register. More... | |
#define | getTMS23R() WIZCHIP_READ(TMS23R) |
Get TMS23R register. More... | |
#define | setTMS45R(tms45r) WIZCHIP_WRITE(TMS45R,tms45r) |
Set TMS45R register. More... | |
#define | getTMS45R() WIZCHIP_READ(TMS45R) |
Get TMS45R register. More... | |
#define | setTMS67R(tms67r) WIZCHIP_WRITE(TMS67R,tms67r) |
Set TMS67R register. More... | |
#define | getTMS67R() WIZCHIP_READ(TMS67R) |
Get TMS67R register. More... | |
#define | setRMS01R(rms01r) WIZCHIP_WRITE(RMS01R,rms01r) |
Set RMS01R register. More... | |
#define | getRMS01R() WIZCHIP_READ(RMS01R) |
Get RMS01R register. More... | |
#define | setRMS23R(rms23r) WIZCHIP_WRITE(RMS23R,rms23r) |
Set RMS23R register. More... | |
#define | getRMS23R() WIZCHIP_READ(RMS23R) |
Get RMS23R register. More... | |
#define | setRMS45R(rms45r) WIZCHIP_WRITE(RMS45R,rms45r) |
Set RMS45R register. More... | |
#define | getRMS45R() WIZCHIP_READ(RMS45R) |
Get RMS45R register. More... | |
#define | setRMS67R(rms67r) WIZCHIP_WRITE(RMS67R,rms67r) |
Set RMS67R register. More... | |
#define | getRMS67R() WIZCHIP_READ(RMS67R) |
Get RMS67R register. More... | |
#define | setMTYPER(mtype) WIZCHIP_WRITE(MTYPER, mtype) |
Set MTYPER register. More... | |
#define | getMTYPER() WIZCHIP_READ(MTYPER) |
Get MTYPER register. More... | |
#define | getPATR() WIZCHIP_READ(PATR) |
Get RATR register. More... | |
#define | setPTIMER(ptimer) WIZCHIP_WRITE(PTIMER, ((uint16_t)ptimer) & 0x00FF) |
Set PTIMER register. More... | |
#define | getPTIMER() ((uint8_t)(WIZCHIP_READ(PTIMER) & 0x00FF)) |
Get PTIMER register. More... | |
#define | setPMAGIC(pmagic) WIZCHIP_WRITE(PMAGIC, ((uint16_t)pmagic) & 0x00FF) |
Set PMAGIC register. More... | |
#define | getPMAGIC() ((uint8_t)(WIZCHIP_READ(PMAGIC) & 0x00FF)) |
Get PMAGIC register. More... | |
#define | getPSIDR() WIZCHIP_READ(PSIDR) |
Get PSID register. More... | |
#define | getPDHAR(pdhar) |
Get PDHAR register. More... | |
#define | getUIPR(uipr) |
Get unreachable IP address. UIPR. More... | |
#define | getUPORTR() WIZCHIP_READ(UPORTR) |
Get UPORTR register. More... | |
#define | getFMTUR() WIZCHIP_READ(FMTUR) |
Get FMTUR register. More... | |
#define | getPn_BRDYR(p) ((uint8_t)(WIZCHIP_READ(Pn_BRDYR(p)) & 0x00FF)) |
Get Pn_BRDYR register. More... | |
#define | setPn_BRDYR(p, brdyr) WIZCHIP_WRITE(Pn_BRDYR(p), brdyr & 0x00E7) |
Set Pn_BRDYR register. More... | |
#define | getPn_BDPTHR(p) WIZCHIP_READ(Pn_BDPTHR(p)) |
Get Pn_BDPTHR register. More... | |
#define | setPn_BDPTHR(p, bdpthr) WIZCHIP_WRITE(Pn_BDPTHR(p),bdpthr) |
Set Pn_BDPTHR register. More... | |
#define | getIDR() WIZCHIP_READ(IDR) |
Get IDR register. More... | |
Functions | |
void | setTMSR (uint8_t sn, uint8_t tmsr) |
Set TMSR0 ~ TMSR7 register. More... | |
uint8_t | getTMSR (uint8_t sn) |
Get TMSR0 ~ TMSR7 register. More... | |
void | setRMSR (uint8_t sn, uint8_t rmsr) |
Set RMS01R ~ RMS67R register. More... | |
uint8_t | getRMSR (uint8_t sn) |
Get RMS01R ~ RMS67R register. More... | |
Detailed Description
These are functions to access common registers.
Macro Definition Documentation
#define setIR | ( | ir | ) | WIZCHIP_WRITE(IR, ir & 0xF0FF) |
#define getIR | ( | ) | (WIZCHIP_READ(IR) & 0xF0FF) |
#define setIMR | ( | imr | ) | WIZCHIP_WRITE(_IMR_, imr & 0xF0FF) |
#define getIMR | ( | ) | (WIZCHIP_READ(_IMR_) & 0xF0FF) |
#define setSHAR | ( | shar | ) |
Value:
{ \
WIZCHIP_WRITE(WIZCHIP_OFFSET_INC(SHAR,2), (((uint16_t)((shar)[2])) << 8) + (((uint16_t)((shar)[3])) & 0x00FF)); \
WIZCHIP_WRITE(WIZCHIP_OFFSET_INC(SHAR,4), (((uint16_t)((shar)[4])) << 8) + (((uint16_t)((shar)[5])) & 0x00FF)); \
}
Set local MAC address.
- Parameters
-
(uint8_t*)shar Pointer variable to set local MAC address. It should be allocated 6 bytes.
- See also
- getSHAR()
#define setGAR | ( | gar | ) |
Value:
{ \
WIZCHIP_WRITE(WIZCHIP_OFFSET_INC(GAR,2), (((uint16_t)((gar)[2])) << 8) + (((uint16_t)((gar)[3])) & 0x00FF)); \
}
Set gateway IP address.
- Parameters
-
(uint8_t*)gar Pointer variable to set gateway IP address. It should be allocated 4 bytes.
- See also
- getGAR()
#define getGAR | ( | gar | ) |
Value:
{ \
(gar)[0] = (uint8_t)(WIZCHIP_READ(GAR) >> 8); \
(gar)[1] = (uint8_t)(WIZCHIP_READ(GAR)); \
}
Get gateway IP address.
- Parameters
-
(uint8_t*)gar Pointer variable to get gateway IP address. It should be allocated 4 bytes.
- See also
- setGAR()
#define setSUBR | ( | subr | ) |
Value:
{ \
WIZCHIP_WRITE(WIZCHIP_OFFSET_INC(SUBR,2), (((uint16_t)((subr)[2])) << 8) + (((uint16_t)((subr)[3])) & 0x00FF)); \
}
Set subnet mask address.
- Parameters
-
(uint8_t*)subr Pointer variable to set subnet mask address. It should be allocated 4 bytes.
- See also
- getSUBR()
#define getSUBR | ( | subr | ) |
Value:
{ \
(subr)[0] = (uint8_t)(WIZCHIP_READ(SUBR) >> 8); \
(subr)[1] = (uint8_t)(WIZCHIP_READ(SUBR)); \
}
Get subnet mask address.
- Parameters
-
(uint8_t*)subr Pointer variable to get subnet mask address. It should be allocated 4 bytes.
- See also
- setSUBR()
#define setSIPR | ( | sipr | ) |
Value:
{ \
WIZCHIP_WRITE(WIZCHIP_OFFSET_INC(SIPR,2), (((uint16_t)((sipr)[2])) << 8) + (((uint16_t)((sipr)[3])) & 0x00FF)); \
}
Set local IP address.
- Parameters
-
(uint8_t*)sipr Pointer variable to set local IP address. It should be allocated 4 bytes.
- See also
- getSIPR()
#define getSIPR | ( | sipr | ) |
Value:
{ \
(sipr)[0] = (uint8_t)(WIZCHIP_READ(SIPR) >> 8); \
(sipr)[1] = (uint8_t)(WIZCHIP_READ(SIPR)); \
}
Get local IP address.
- Parameters
-
(uint8_t*)sipr Pointer variable to get local IP address. It should be allocated 4 bytes.
- See also
- setSIPR()
#define setRTR | ( | rtr | ) | WIZCHIP_WRITE(_RTR_, rtr) |
#define getRTR | ( | ) | WIZCHIP_READ(_RTR_) |
#define setRCR | ( | rcr | ) | WIZCHIP_WRITE(_RCR_, ((uint16_t)rcr)&0x00FF) |
#define getRCR | ( | ) | ((uint8_t)(WIZCHIP_READ(_RCR_) & 0x00FF)) |
#define setTMS01R | ( | tms01r | ) | WIZCHIP_WRITE(TMS01R,tms01r) |
Set TMS01R register.
- Parameters
-
(uint16_t)tms01r Value to set TMS01R register. The lower socket memory size is located at MSB of tms01r.
- See also
- getTMS01R()
#define getTMS01R | ( | ) | WIZCHIP_READ(TMS01R) |
#define setTMS23R | ( | tms23r | ) | WIZCHIP_WRITE(TMS23R,tms23r) |
Set TMS23R register.
- Parameters
-
(uint16_t)tms23r Value to set TMS23R register. The lower socket memory size is located at MSB of tms01r.
- See also
- getTMS23R()
#define getTMS23R | ( | ) | WIZCHIP_READ(TMS23R) |
#define setTMS45R | ( | tms45r | ) | WIZCHIP_WRITE(TMS45R,tms45r) |
Set TMS45R register.
- Parameters
-
(uint16_t)tms45r Value to set TMS45R register. The lower socket memory size is located at MSB of tms45r.
- See also
- getTMS45R()
#define getTMS45R | ( | ) | WIZCHIP_READ(TMS45R) |
#define setTMS67R | ( | tms67r | ) | WIZCHIP_WRITE(TMS67R,tms67r) |
Set TMS67R register.
- Parameters
-
(uint16_t)tms67r Value to set TMS67R register. The lower socket memory size is located at MSB of tms67r.
- See also
- getTMS67R()
#define getTMS67R | ( | ) | WIZCHIP_READ(TMS67R) |
#define setRMS01R | ( | rms01r | ) | WIZCHIP_WRITE(RMS01R,rms01r) |
Set RMS01R register.
- Parameters
-
(uint16_t)rms01r Value to set RMS01R register. The lower socket memory size is located at MSB of rms01r.
- See also
- getRMS01R()
#define getRMS01R | ( | ) | WIZCHIP_READ(RMS01R) |
#define setRMS23R | ( | rms23r | ) | WIZCHIP_WRITE(RMS23R,rms23r) |
Set RMS23R register.
- Parameters
-
(uint16_t)rms23r Value to set RMS23R register. The lower socket memory size is located at MSB of rms01r.
- See also
- getRMS23R()
#define getRMS23R | ( | ) | WIZCHIP_READ(RMS23R) |
#define setRMS45R | ( | rms45r | ) | WIZCHIP_WRITE(RMS45R,rms45r) |
Set RMS45R register.
- Parameters
-
(uint16_t)rms45r Value to set RMS45R register. The lower socket memory size is located at MSB of rms45r.
- See also
- getRMS45R()
#define getRMS45R | ( | ) | WIZCHIP_READ(RMS45R) |
#define setRMS67R | ( | rms67r | ) | WIZCHIP_WRITE(RMS67R,rms67r) |
Set RMS67R register.
- Parameters
-
(uint16_t)rms67r Value to set RMS67R register. The lower socket memory size is located at MSB of rms67r.
- See also
- getRMS67R()
#define getRMS67R | ( | ) | WIZCHIP_READ(RMS67R) |
#define setMTYPER | ( | mtype | ) | WIZCHIP_WRITE(MTYPER, mtype) |
#define getMTYPER | ( | ) | WIZCHIP_READ(MTYPER) |
#define getPATR | ( | ) | WIZCHIP_READ(PATR) |
#define setPTIMER | ( | ptimer | ) | WIZCHIP_WRITE(PTIMER, ((uint16_t)ptimer) & 0x00FF) |
#define getPTIMER | ( | ) | ((uint8_t)(WIZCHIP_READ(PTIMER) & 0x00FF)) |
#define setPMAGIC | ( | pmagic | ) | WIZCHIP_WRITE(PMAGIC, ((uint16_t)pmagic) & 0x00FF) |
#define getPMAGIC | ( | ) | ((uint8_t)(WIZCHIP_READ(PMAGIC) & 0x00FF)) |
#define getPSIDR | ( | ) | WIZCHIP_READ(PSIDR) |
#define getPDHAR | ( | pdhar | ) |
Value:
{ \
(pdhar)[0] = (uint8_t)(WIZCHIP_READ(PDHAR) >> 8); \
(pdhar)[1] = (uint8_t)(WIZCHIP_READ(PDHAR)); \
}
Get PDHAR register.
- Parameters
-
(uint8_t*)pdhar Pointer variable to PPP destination MAC register address. It should be allocated 6 bytes.
#define getUIPR | ( | uipr | ) |
Value:
{ \
(uipr)[0] = (uint8_t)(WIZCHIP_READ(UIPR) >> 8); \
(uipr)[1] = (uint8_t)(WIZCHIP_READ(UIPR)); \
}
Get unreachable IP address. UIPR.
- Parameters
-
(uint8_t*)uipr Pointer variable to get unreachable IP address. It should be allocated 4 bytes.
#define getUPORTR | ( | ) | WIZCHIP_READ(UPORTR) |
#define getFMTUR | ( | ) | WIZCHIP_READ(FMTUR) |
#define getPn_BRDYR | ( | p | ) | ((uint8_t)(WIZCHIP_READ(Pn_BRDYR(p)) & 0x00FF)) |
#define setPn_BRDYR | ( | p, | |
brdyr | |||
) | WIZCHIP_WRITE(Pn_BRDYR(p), brdyr & 0x00E7) |
Set Pn_BRDYR register.
- Parameters
-
p Pin number (p = 0,1,2,3) brdyr Set a value Pn_BRDYR(p).
#define getPn_BDPTHR | ( | p | ) | WIZCHIP_READ(Pn_BDPTHR(p)) |
#define setPn_BDPTHR | ( | p, | |
bdpthr | |||
) | WIZCHIP_WRITE(Pn_BDPTHR(p),bdpthr) |
#define getIDR | ( | ) | WIZCHIP_READ(IDR) |
Function Documentation
void setTMSR | ( | uint8_t | sn, |
uint8_t | tmsr | ||
) |
uint8_t getTMSR | ( | uint8_t | sn | ) |
void setRMSR | ( | uint8_t | sn, |
uint8_t | rmsr | ||
) |
Generated on Wed May 4 2016 16:44:00 for Socket APIs by 1.8.9.1