User`s guide
Aironet Wireless Communications, Inc. 7-19 Confidential and Proprietary
Sample C-code
bap0_setup(u16 rid, u16 offset) // this example uses SELECT0/OFFSET0/DATA0
{
OUT4500(SELECT0, rid);
OUT4500(OFFSET0, offset);
while (1) {
status = IN4500(OFFSET0);
if (status & BAP_BUSY) {
if (timeout) { // suggested timeout of 500 usec minimum
push_interrupt_enable_state(); // save interrupt enable state
disable_interrupts(); // disable interrupts
OUT4500(SELECT0, rid);
OUT4500(OFFSET0, offset);
pop_interrupt_enable_state(); // restore interrupt enable state
restart_timeout();
}
continue;
}
if (status & BAP_ERR) { // invalid rid or offset
return ERROR;
}
if (status & BAP_DONE) { // success
return SUCCESS;
}
// -- PC4500 missed it, try again
OUT4500(SELECT0, rid);
OUT4500(OFFSET0, offset);
}
}
// requires call to bap0_setup() first
bap0_read(u16 *pu16Dst, int bytelen)
{
bytelen = (bytelen + 1) & (~1); // round up to even value
while (bytelen > 0) { // each access to DATA0 will auto-increment
*pu16Dst++ = IN4500(DATA0); // to the next word
bytelen -= 2;
}
return SUCCESS;
}
// requires call to bap0_setup() first
bap0_write(u16 *pu16Src, int bytelen)
{
bytelen = (bytelen + 1) & (~1); // round up to even value
while (bytelen > 0) { // each access to DATA0 will auto-increment
OUT4500(DATA0, *pu16Src++); // to the next word
bytelen -= 2;
}
return SUCCESS;
}