Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages

These macros manage the common features of the pipes.

Macros

#define Host_ack_all_errors(p)
 acks all pipe error More...
 
#define Host_ack_bad_data_toggle(p)   (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_DATATGL_MASK))
 acks bad data toggle More...
 
#define Host_ack_control_in_received()   (AVR32_USBB_upstaxclr(P_CONTROL) = AVR32_USBB_UPSTAXCLR_RXINIC_MASK)
 acks control IN More...
 
#define Host_ack_control_in_received_free()   (Host_ack_control_in_received(), Host_free_control_in())
 acks control IN and frees current bank More...
 
#define Host_ack_control_out_ready()   (AVR32_USBB_upstaxclr(P_CONTROL) = AVR32_USBB_UPSTAXCLR_TXOUTIC_MASK)
 acks control OUT More...
 
#define Host_ack_control_out_ready_send()   (Host_ack_control_out_ready(), Host_send_control_out())
 acks control OUT and sends current bank More...
 
#define Host_ack_crc16_error(p)   (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_CRC16_MASK))
 acks CRC16 error More...
 
#define Host_ack_crc_error(p)   (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_RXSTALLDIC_MASK)
 acks CRC ERROR ISO IN detected More...
 
#define Host_ack_data_pid_error(p)   (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_DATAPID_MASK))
 acks data PID error More...
 
#define Host_ack_fifocon(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_FIFOCONC_MASK)
 clears FIFOCON bit More...
 
#define Host_ack_in_received(p)   (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_RXINIC_MASK)
 acks IN reception More...
 
#define Host_ack_in_received_free(p)   (Host_ack_in_received(p), Host_free_in(p))
 acks IN reception and frees current bank More...
 
#define Host_ack_nak_received(p)   (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_NAKEDIC_MASK)
 acks NAK received More...
 
#define Host_ack_out_ready(p)   (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_TXOUTIC_MASK)
 acks OUT sent More...
 
#define Host_ack_out_ready_send(p)   (Host_ack_out_ready(p), Host_send_out(p))
 acks OUT sent and sends current bank More...
 
#define Host_ack_overflow_interrupt(p)   (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_OVERFIC_MASK)
 acks pipe overflow interrupt More...
 
#define Host_ack_pid_error(p)   (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_PID_MASK))
 acks PID error More...
 
#define Host_ack_pipe_error(p)   (AVR32_USBB_upstaxset(p) = (Is_host_pipe_error(p)) ? AVR32_USBB_UPSTAXSET_PERRIS_MASK : 0)
 acks pipe error More...
 
#define Host_ack_setup_ready()   (AVR32_USBB_upstaxclr(P_CONTROL) = AVR32_USBB_UPSTAXCLR_TXSTPIC_MASK)
 acks setup More...
 
#define Host_ack_setup_ready_send()   (Host_ack_setup_ready(), Host_send_setup())
 acks setup and sends current bank More...
 
#define Host_ack_short_packet(p)   (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_SHORTPACKETIC_MASK)
 acks SHORT PACKET received More...
 
#define Host_ack_stall(p)   (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_RXSTALLDIC_MASK)
 acks STALL reception More...
 
#define Host_ack_timeout_error(p)   (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_TIMEOUT_MASK))
 acks time-out error More...
 
#define Host_ack_underflow_interrupt(p)   (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_TXSTPIC_MASK)
 acks pipe underflow interrupt More...
 
#define Host_allocate_memory(p)   (Set_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_ALLOC_MASK))
 allocates the configuration x in DPRAM memory More...
 
#define Host_byte_count(p)   (Rd_bitfield(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_PBYCT_MASK))
 returns the byte count More...
 
#define Host_clear_error_counter(p)   (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_COUNTER_MASK))
 clears the error counter More...
 
#define Host_configure_pipe(p, freq, ep_num, type, token, size, bank)
 configures selected pipe in one step More...
 
#define Host_configure_pipe_bank(p, bank)   (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PBK_MASK, bank))
 configures the selected pipe number of banks More...
 
#define Host_configure_pipe_endpoint_number(p, ep_num)   (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PEPNUM_MASK, ep_num))
 configures the selected pipe endpoint number More...
 
#define Host_configure_pipe_int_req_freq(p, freq)   (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_INTFRQ_MASK, freq))
 configures the interrupt pipe request frequency (period in ms) for the selected pipe More...
 
#define Host_configure_pipe_size(p, size)   (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PSIZE_MASK, Host_format_pipe_size(size)))
 configures the selected pipe size More...
 
#define Host_configure_pipe_token(p, token)   (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PTOKEN_MASK, token))
 configures the selected pipe token More...
 
#define Host_configure_pipe_type(p, type)   (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PTYPE_MASK, type))
 configures the selected pipe type More...
 
#define Host_current_bank(p)   (Rd_bitfield(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_CURRBK_MASK))
 returns the number of the current bank More...
 
#define Host_data_toggle(p)   (Rd_bitfield(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_DTSEQ_MASK))
 returns data toggle More...
 
#define Host_disable_bank_interrupt(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_NBUSYBKEC_MASK)
 disables all banks full (IN) or free (OUT) interrupt More...
 
#define Host_disable_continuous_in_mode(p)   (Clr_bits(AVR32_USBB_upinrqx(p), AVR32_USBB_UPINRQX_INMODE_MASK))
 disables continuous IN mode More...
 
#define Host_disable_control_in_received_interrupt()   (AVR32_USBB_upconxclr(P_CONTROL) = AVR32_USBB_UPCONXCLR_RXINEC_MASK)
 disables IN control pipe reception interrupt More...
 
#define Host_disable_control_out_ready_interrupt()   (AVR32_USBB_upconxclr(P_CONTROL) = AVR32_USBB_UPCONXCLR_TXOUTEC_MASK)
 disables OUT control pipe ready interrupt More...
 
#define Host_disable_crc_error_interrupt(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_RXSTALLDEC_MASK)
 disables CRC ERROR ISO IN detected interrupt More...
 
#define Host_disable_in_received_interrupt(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_RXINEC_MASK)
 disables IN pipe reception interrupt More...
 
#define Host_disable_nak_received_interrupt(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_NAKEDEC_MASK)
 disables NAK received interrupt More...
 
#define Host_disable_out_ready_interrupt(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_TXOUTEC_MASK)
 disables OUT pipe ready interrupt More...
 
#define Host_disable_overflow_interrupt(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_OVERFIEC_MASK)
 disables overflow interrupt More...
 
#define Host_disable_pipe(p)   (Clr_bits(AVR32_USBB_uprst, AVR32_USBB_UPRST_PEN0_MASK << (p)))
 disables the selected pipe More...
 
#define Host_disable_pipe_bank_autoswitch(p)   (Clr_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_AUTOSW_MASK))
 disables the bank autoswitch for the selected pipe More...
 
#define Host_disable_pipe_error_interrupt(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_PERREC_MASK)
 disables pipe error interrupt More...
 
#define Host_disable_pipe_interrupt(p)   (AVR32_USBB_uhinteclr = AVR32_USBB_UHINTECLR_P0INTEC_MASK << (p))
 disables the selected pipe interrupt More...
 
#define Host_disable_setup_ready_interrupt()   (AVR32_USBB_upconxclr(P_CONTROL) = AVR32_USBB_UPCONXCLR_TXSTPEC_MASK)
 disables SETUP pipe ready interrupt More...
 
#define Host_disable_short_packet_interrupt(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_SHORTPACKETIEC_MASK)
 disables SHORT PACKET received interrupt More...
 
#define Host_disable_stall_interrupt(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_RXSTALLDEC_MASK)
 disables STALL received interrupt More...
 
#define Host_disable_underflow_interrupt(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_TXSTPEC_MASK)
 disables underflow interrupt More...
 
#define Host_enable_bank_interrupt(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_NBUSYBKES_MASK)
 enables all banks full (IN) or free (OUT) interrupt More...
 
#define Host_enable_continuous_in_mode(p)   (Set_bits(AVR32_USBB_upinrqx(p), AVR32_USBB_UPINRQX_INMODE_MASK))
 enables continuous IN mode More...
 
#define Host_enable_control_in_received_interrupt()   (AVR32_USBB_upconxset(P_CONTROL) = AVR32_USBB_UPCONXSET_RXINES_MASK)
 enables IN control pipe reception interrupt More...
 
#define Host_enable_control_out_ready_interrupt()   (AVR32_USBB_upconxset(P_CONTROL) = AVR32_USBB_UPCONXSET_TXOUTES_MASK)
 enables OUT control pipe ready interrupt More...
 
#define Host_enable_crc_error_interrupt(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_RXSTALLDES_MASK)
 enables CRC ERROR ISO IN detected interrupt More...
 
#define Host_enable_in_received_interrupt(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_RXINES_MASK)
 enables IN pipe reception interrupt More...
 
#define Host_enable_nak_received_interrupt(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_NAKEDES_MASK)
 enables NAK received interrupt More...
 
#define Host_enable_out_ready_interrupt(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_TXOUTES_MASK)
 enables OUT pipe ready interrupt More...
 
#define Host_enable_overflow_interrupt(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_OVERFIES_MASK)
 enables overflow interrupt More...
 
#define Host_enable_ping(p)   (Set_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PINGEN_MASK))
 Enable PING management for the endpoint p. More...
 
#define Host_enable_pipe(p)   (Set_bits(AVR32_USBB_uprst, AVR32_USBB_UPRST_PEN0_MASK << (p)))
 enables the selected pipe More...
 
#define Host_enable_pipe_bank_autoswitch(p)   (Set_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_AUTOSW_MASK))
 enables the bank autoswitch for the selected pipe More...
 
#define Host_enable_pipe_error_interrupt(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_PERRES_MASK)
 enables pipe error interrupt More...
 
#define Host_enable_pipe_interrupt(p)   (AVR32_USBB_uhinteset = AVR32_USBB_UHINTESET_P0INTES_MASK << (p))
 enables the selected pipe interrupt More...
 
#define Host_enable_setup_ready_interrupt()   (AVR32_USBB_upconxset(P_CONTROL) = AVR32_USBB_UPCONXSET_TXSTPES_MASK)
 enables SETUP pipe ready interrupt More...
 
#define Host_enable_short_packet_interrupt(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_SHORTPACKETIES_MASK)
 enables SHORT PACKET received interrupt More...
 
#define Host_enable_stall_interrupt(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_RXSTALLDES_MASK)
 enables STALL received interrupt More...
 
#define Host_enable_underflow_interrupt(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_TXSTPES_MASK)
 enables underflow interrupt More...
 
#define Host_error_status(p)
 tests if error occurs on pipe More...
 
#define Host_force_bank_interrupt(p)   (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_NBUSYBKS_MASK)
 forces all banks full (OUT) or free (IN) interrupt More...
 
#define Host_format_pipe_size(size)   (32 - clz(((U32)min(max(size, 8), 1024) << 1) - 1) - 1 - 3)
 Bounds given integer size to allowed range and rounds it up to the nearest available greater size, then applies register format of USBB controller for pipe size bit-field. More...
 
#define Host_free_control_in()   (Host_ack_fifocon(P_CONTROL))
 frees current bank for IN control pipe More...
 
#define Host_free_in(p)   (Host_ack_fifocon(p))
 frees current bank for IN pipe More...
 
#define Host_freeze_pipe(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_PFREEZES_MASK)
 freezes the pipe More...
 
#define Host_get_error_counter(p)   (Rd_bitfield(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_COUNTER_MASK))
 
#define Host_get_in_request_number(p)   (Rd_bitfield(AVR32_USBB_upinrqx(p), AVR32_USBB_UPINRQX_INRQ_MASK) + 1)
 returns number of remaining IN requests More...
 
#define Host_get_interrupt_pipe_number()
 returns the lowest pipe number generating a pipe interrupt or MAX_PEP_NB if none More...
 
#define Host_get_pipe_bank(p)   (Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PBK_MASK))
 gets the configured selected pipe number of banks More...
 
#define Host_get_pipe_endpoint_number(p)   (Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PEPNUM_MASK))
 gets the configured selected pipe endpoint number More...
 
#define Host_get_pipe_fifo_access(p, scale)   (AVR32_USBB_FIFOX_DATA(p, scale))
 Get 64-, 32-, 16- or 8-bit access to FIFO data register of selected pipe. More...
 
#define Host_get_pipe_int_req_freq(p)   (Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_INTFRQ_MASK))
 gets the configured interrupt pipe request frequency (period in ms) for the selected pipe More...
 
#define Host_get_pipe_size(p)   (8 << Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PSIZE_MASK))
 gets the configured selected pipe size More...
 
#define Host_get_pipe_token(p)   (Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PTOKEN_MASK))
 gets the configured selected pipe token More...
 
#define Host_get_pipe_type(p)   (Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PTYPE_MASK))
 gets the configured selected pipe type More...
 
#define Host_in_request_number(p, in_num)   (Wr_bitfield(AVR32_USBB_upinrqx(p), AVR32_USBB_UPINRQX_INRQ_MASK, (in_num) - 1))
 sets number of IN requests to perform before freeze More...
 
#define Host_nb_busy_bank(p)   (Rd_bitfield(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_NBUSYBK_MASK))
 returns the number of busy banks More...
 
#define Host_raise_control_in_received()   (AVR32_USBB_upstaxset(P_CONTROL) = AVR32_USBB_UPSTAXSET_RXINIS_MASK)
 raises control IN More...
 
#define Host_raise_control_out_ready()   (AVR32_USBB_upstaxset(P_CONTROL) = AVR32_USBB_UPSTAXSET_TXOUTIS_MASK)
 raises control OUT More...
 
#define Host_raise_crc_error(p)   (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_RXSTALLDIS_MASK)
 raises CRC ERROR ISO IN detected More...
 
#define Host_raise_in_received(p)   (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_RXINIS_MASK)
 raises IN reception More...
 
#define Host_raise_nak_received(p)   (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_NAKEDIS_MASK)
 raises NAK received More...
 
#define Host_raise_out_ready(p)   (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_TXOUTIS_MASK)
 raises OUT sent More...
 
#define Host_raise_overflow_interrupt(p)   (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_OVERFIS_MASK)
 raises pipe overflow interrupt More...
 
#define Host_raise_pipe_error(p)   (AVR32_USBB_upstaxset(p) = (Is_host_pipe_error(p)) ? 0 : AVR32_USBB_UPSTAXSET_PERRIS_MASK)
 raises pipe error More...
 
#define Host_raise_setup_ready()   (AVR32_USBB_upstaxset(P_CONTROL) = AVR32_USBB_UPSTAXSET_TXSTPIS_MASK)
 raises setup More...
 
#define Host_raise_short_packet(p)   (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_SHORTPACKETIS_MASK)
 raises SHORT PACKET received More...
 
#define Host_raise_stall(p)   (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_RXSTALLDIS_MASK)
 raises STALL reception More...
 
#define Host_raise_underflow_interrupt(p)   (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_TXSTPIS_MASK)
 raises pipe underflow interrupt More...
 
#define Host_read_pipe_data(p, scale)
 Read 64-, 32-, 16- or 8-bit data from FIFO data register of selected pipe. More...
 
#define Host_read_pipe_indexed_data(p, scale, index)   (AVR32_USBB_FIFOX_DATA(p, scale)[(index)])
 Read 64-, 32-, 16- or 8-bit indexed data from FIFO data register of selected pipe. More...
 
#define Host_reset_data_toggle(p)   (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_RSTDTS_MASK)
 resets the data toggle sequence More...
 
#define Host_reset_pipe(p)
 resets the selected pipe More...
 
#define Host_reset_pipe_fifo_access(p)   (pep_fifo[(p)].u64ptr = Host_get_pipe_fifo_access(p, 64))
 Reset known position inside FIFO data register of selected pipe. More...
 
#define Host_send_control_out()   (Host_ack_fifocon(P_CONTROL))
 sends current bank for OUT control pipe More...
 
#define Host_send_out(p)   (Host_ack_fifocon(p))
 sends current bank for OUT pipe More...
 
#define Host_send_setup()   (Host_ack_fifocon(P_CONTROL))
 sends current bank for SETUP pipe More...
 
#define Host_unallocate_memory(p)   (Clr_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_ALLOC_MASK))
 un-allocates the configuration x in DPRAM memory More...
 
#define Host_unforce_bank_interrupt(p)   (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_NBUSYBKS_MASK)
 unforces all banks full (OUT) or free (IN) interrupt More...
 
#define Host_unfreeze_pipe(p)   (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_PFREEZEC_MASK)
 unfreezees the pipe More...
 
#define Host_write_pipe_data(p, scale, data)
 Write 64-, 32-, 16- or 8-bit data to FIFO data register of selected pipe. More...
 
#define Host_write_pipe_indexed_data(p, scale, index, data)   (AVR32_USBB_FIFOX_DATA(p, scale)[(index)] = (data))
 Write 64-, 32-, 16- or 8-bit indexed data to FIFO data register of selected pipe. More...
 
#define Is_host_bad_data_toggle(p)   (Tst_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_DATATGL_MASK))
 
#define Is_host_bank_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_NBUSYBKE_MASK))
 tests if all banks full (IN) or free (OUT) interrupt is enabled More...
 
#define Is_host_continuous_in_mode_enabled(p)   (Tst_bits(AVR32_USBB_upinrqx(p), AVR32_USBB_UPINRQX_INMODE_MASK))
 tests if continuous IN mode is enabled More...
 
#define Is_host_control_in_filled()   (Is_host_fifocon(P_CONTROL))
 tests if IN received in current bank for control pipe More...
 
#define Is_host_control_in_received()   (Tst_bits(AVR32_USBB_upstax(P_CONTROL), AVR32_USBB_UPSTAX_RXINI_MASK))
 tests if control IN has been received More...
 
#define Is_host_control_in_received_interrupt_enabled()   (Tst_bits(AVR32_USBB_upconx(P_CONTROL), AVR32_USBB_UPCONX_RXINE_MASK))
 tests if IN control pipe reception interrupt is enabled More...
 
#define Is_host_control_out_ready()   (Tst_bits(AVR32_USBB_upstax(P_CONTROL), AVR32_USBB_UPSTAX_TXOUTI_MASK))
 tests if control OUT has been sent More...
 
#define Is_host_control_out_ready_interrupt_enabled()   (Tst_bits(AVR32_USBB_upconx(P_CONTROL), AVR32_USBB_UPCONX_TXOUTE_MASK))
 tests if OUT control pipe ready interrupt is enabled More...
 
#define Is_host_control_out_sent()   (Is_host_fifocon(P_CONTROL))
 tests if current bank sent for OUT control pipe More...
 
#define Is_host_crc16_error(p)   (Tst_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_CRC16_MASK))
 
#define Is_host_crc_error(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_RXSTALLDI_MASK))
 tests if CRC ERROR ISO IN detected More...
 
#define Is_host_crc_error_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_RXSTALLDE_MASK))
 tests if CRC ERROR ISO IN detected interrupt is enabled More...
 
#define Is_host_data_pid_error(p)   (Tst_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_DATAPID_MASK))
 
#define Is_host_data_toggle_reset(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_RSTDT_MASK))
 tests if the data toggle sequence is being reset More...
 
#define Is_host_fifocon(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_FIFOCON_MASK))
 tests if FIFOCON bit set More...
 
#define Is_host_in_filled(p)   (Is_host_fifocon(p))
 tests if IN received in current bank More...
 
#define Is_host_in_received(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_RXINI_MASK))
 tests if IN received More...
 
#define Is_host_in_received_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_RXINE_MASK))
 tests if IN pipe reception interrupt is enabled More...
 
#define Is_host_memory_allocated(p)   (Tst_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_ALLOC_MASK))
 
#define Is_host_nak_received(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_NAKEDI_MASK))
 tests if NAK handshake has been received More...
 
#define Is_host_nak_received_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_NAKEDE_MASK))
 tests if NAK received interrupt is enabled More...
 
#define Is_host_out_ready(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_TXOUTI_MASK))
 tests if OUT has been sent More...
 
#define Is_host_out_ready_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_TXOUTE_MASK))
 tests if OUT pipe ready interrupt is enabled More...
 
#define Is_host_out_sent(p)   (Is_host_fifocon(p))
 tests if current bank sent for OUT pipe More...
 
#define Is_host_overflow(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_OVERFI_MASK))
 tests if an overflow occurs More...
 
#define Is_host_overflow_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_OVERFIE_MASK))
 tests if overflow interrupt is enabled More...
 
#define Is_host_pid_error(p)   (Tst_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_PID_MASK))
 
#define Is_host_pipe_bank_autoswitch_enabled(p)   (Tst_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_AUTOSW_MASK))
 
#define Is_host_pipe_configured(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_CFGOK_MASK))
 tests if current pipe is configured More...
 
#define Is_host_pipe_enabled(p)   (Tst_bits(AVR32_USBB_uprst, AVR32_USBB_UPRST_PEN0_MASK << (p)))
 tests if the selected pipe is enabled More...
 
#define Is_host_pipe_error(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_PERRI_MASK))
 tests if an error occurs on current pipe More...
 
#define Is_host_pipe_error_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_PERRE_MASK))
 tests if pipe error interrupt is enabled More...
 
#define Is_host_pipe_frozen(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_PFREEZE_MASK))
 tests if the current pipe is frozen More...
 
#define Is_host_pipe_interrupt(p)   (Tst_bits(AVR32_USBB_uhint, AVR32_USBB_UHINT_P0INT_MASK << (p)))
 tests if an interrupt is triggered by the selected pipe More...
 
#define Is_host_pipe_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_uhinte, AVR32_USBB_UHINTE_P0INTE_MASK << (p)))
 tests if the selected pipe interrupt is enabled More...
 
#define Is_host_read_enabled(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_RWALL_MASK))
 tests if pipe read allowed More...
 
#define Is_host_resetting_pipe(p)   (Tst_bits(AVR32_USBB_uprst, AVR32_USBB_UPRST_PRST0_MASK << (p)))
 tests if the selected pipe is being reset More...
 
#define Is_host_setup_ready()   (Tst_bits(AVR32_USBB_upstax(P_CONTROL), AVR32_USBB_UPSTAX_TXSTPI_MASK))
 tests if SETUP has been sent More...
 
#define Is_host_setup_ready_interrupt_enabled()   (Tst_bits(AVR32_USBB_upconx(P_CONTROL), AVR32_USBB_UPCONX_TXSTPE_MASK))
 tests if SETUP pipe ready interrupt is enabled More...
 
#define Is_host_setup_sent()   (Is_host_fifocon(P_CONTROL))
 tests if current bank sent for SETUP pipe More...
 
#define Is_host_short_packet(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_SHORTPACKETI_MASK))
 tests if SHORT PACKET received More...
 
#define Is_host_short_packet_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_SHORTPACKETIE_MASK))
 tests if SHORT PACKET received interrupt is enabled More...
 
#define Is_host_stall(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_RXSTALLDI_MASK))
 tests if a STALL has been received More...
 
#define Is_host_stall_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_RXSTALLDE_MASK))
 tests if STALL received interrupt is enabled More...
 
#define Is_host_timeout_error(p)   (Tst_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_TIMEOUT_MASK))
 
#define Is_host_underflow(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_TXSTPI_MASK))
 tests if an underflow occurs More...
 
#define Is_host_underflow_interrupt_enabled(p)   (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_TXSTPE_MASK))
 tests if underflow interrupt is enabled More...
 
#define Is_host_write_enabled(p)   (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_RWALL_MASK))
 tests if pipe write allowed More...
 

#define Host_ack_all_errors (   p)
Value:
#define Clr_bits(lvalue, mask)
Clears the bits of a C lvalue specified by a given bit-mask.
Definition: compiler.h:487
#define AVR32_USBB_UPERRX_PID_MASK
Definition: usbb.h:627
#define AVR32_USBB_UPERRX_DATAPID_MASK
Definition: usbb.h:623
#define AVR32_USBB_UPERRX_DATATGL_MASK
Definition: usbb.h:619
#define AVR32_USBB_UPERRX_TIMEOUT_MASK
Definition: usbb.h:631
#define AVR32_USBB_UPERRX_CRC16_MASK
Definition: usbb.h:615
#define AVR32_USBB_UPERRX_COUNTER_MASK
Definition: usbb.h:611
#define AVR32_USBB_uperrx(x)
Definition: usbb.h:1235

acks all pipe error

Referenced by host_get_data(), host_send_data(), host_transfer_control(), and usb_pipe_interrupt().

#define Host_ack_bad_data_toggle (   p)    (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_DATATGL_MASK))

acks bad data toggle

#define Host_ack_control_in_received ( )    (AVR32_USBB_upstaxclr(P_CONTROL) = AVR32_USBB_UPSTAXCLR_RXINIC_MASK)

acks control IN

Referenced by host_transfer_control().

#define Host_ack_control_in_received_free ( )    (Host_ack_control_in_received(), Host_free_control_in())

acks control IN and frees current bank

Referenced by host_transfer_control().

#define Host_ack_control_out_ready ( )    (AVR32_USBB_upstaxclr(P_CONTROL) = AVR32_USBB_UPSTAXCLR_TXOUTIC_MASK)

acks control OUT

Referenced by host_transfer_control().

#define Host_ack_control_out_ready_send ( )    (Host_ack_control_out_ready(), Host_send_control_out())

acks control OUT and sends current bank

Referenced by host_transfer_control().

#define Host_ack_crc16_error (   p)    (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_CRC16_MASK))

acks CRC16 error

#define Host_ack_crc_error (   p)    (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_RXSTALLDIC_MASK)

acks CRC ERROR ISO IN detected

#define Host_ack_data_pid_error (   p)    (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_DATAPID_MASK))

acks data PID error

#define Host_ack_fifocon (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_FIFOCONC_MASK)

clears FIFOCON bit

#define Host_ack_in_received_free (   p)    (Host_ack_in_received(p), Host_free_in(p))

acks IN reception and frees current bank

#define Host_ack_out_ready (   p)    (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_TXOUTIC_MASK)
#define Host_ack_out_ready_send (   p)    (Host_ack_out_ready(p), Host_send_out(p))

acks OUT sent and sends current bank

Referenced by host_send_data().

#define Host_ack_overflow_interrupt (   p)    (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_OVERFIC_MASK)

acks pipe overflow interrupt

#define Host_ack_pid_error (   p)    (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_PID_MASK))

acks PID error

#define Host_ack_pipe_error (   p)    (AVR32_USBB_upstaxset(p) = (Is_host_pipe_error(p)) ? AVR32_USBB_UPSTAXSET_PERRIS_MASK : 0)

acks pipe error

#define Host_ack_setup_ready ( )    (AVR32_USBB_upstaxclr(P_CONTROL) = AVR32_USBB_UPSTAXCLR_TXSTPIC_MASK)

acks setup

Referenced by host_transfer_control().

#define Host_ack_setup_ready_send ( )    (Host_ack_setup_ready(), Host_send_setup())

acks setup and sends current bank

#define Host_ack_short_packet (   p)    (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_SHORTPACKETIC_MASK)

acks SHORT PACKET received

#define Host_ack_timeout_error (   p)    (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_TIMEOUT_MASK))

acks time-out error

#define Host_ack_underflow_interrupt (   p)    (AVR32_USBB_upstaxclr(p) = AVR32_USBB_UPSTAXCLR_TXSTPIC_MASK)

acks pipe underflow interrupt

#define Host_allocate_memory (   p)    (Set_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_ALLOC_MASK))

allocates the configuration x in DPRAM memory

#define Host_clear_error_counter (   p)    (Clr_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_COUNTER_MASK))

clears the error counter

#define Host_configure_pipe (   p,
  freq,
  ep_num,
  type,
  token,
  size,
  bank 
)
Value:
(\
)
#define AVR32_USBB_UPCFGX_PSIZE_OFFSET
Definition: usbb.h:441
#define AVR32_USBB_UPCFGX_INTFRQ_OFFSET
Definition: usbb.h:414
#define Is_host_pipe_configured(p)
tests if current pipe is configured
Definition: usb_drv.h:1228
#define AVR32_USBB_upcfgx(x)
Definition: usbb.h:1187
#define AVR32_USBB_UPCFGX_PTYPE_OFFSET
Definition: usbb.h:456
uint32_t U32
32-bit unsigned integer.
Definition: compiler.h:225
#define AVR32_USBB_UPCFGX_PTYPE_MASK
Definition: usbb.h:455
#define Host_enable_pipe(p)
enables the selected pipe
Definition: usb_drv.h:1109
#define AVR32_USBB_UPCFGX_PTOKEN_MASK
Definition: usbb.h:445
#define Host_format_pipe_size(size)
Bounds given integer size to allowed range and rounds it up to the nearest available greater size...
Definition: usb_drv.h:1152
JHUFF_TBL long freq[]
Definition: jchuff.h:47
#define AVR32_USBB_UPCFGX_PEPNUM_OFFSET
Definition: usbb.h:425
#define AVR32_USBB_UPCFGX_PEPNUM_MASK
Definition: usbb.h:424
#define AVR32_USBB_UPCFGX_PSIZE_MASK
Definition: usbb.h:440
#define Host_allocate_memory(p)
allocates the configuration x in DPRAM memory
Definition: usb_drv.h:1162
#define AVR32_USBB_UPCFGX_PBK_MASK
Definition: usbb.h:418
#define AVR32_USBB_UPCFGX_INTFRQ_MASK
Definition: usbb.h:413
#define AVR32_USBB_UPCFGX_PTOKEN_OFFSET
Definition: usbb.h:446
#define AVR32_USBB_UPCFGX_PBK_OFFSET
Definition: usbb.h:419
#define Wr_bits(lvalue, mask, bits)
Writes the bits of a C lvalue specified by a given bit-mask.
Definition: compiler.h:468

configures selected pipe in one step

Referenced by host_check_class(), and usb_host_task().

#define Host_configure_pipe_bank (   p,
  bank 
)    (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PBK_MASK, bank))

configures the selected pipe number of banks

#define Host_configure_pipe_endpoint_number (   p,
  ep_num 
)    (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PEPNUM_MASK, ep_num))

configures the selected pipe endpoint number

#define Host_configure_pipe_int_req_freq (   p,
  freq 
)    (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_INTFRQ_MASK, freq))

configures the interrupt pipe request frequency (period in ms) for the selected pipe

Referenced by host_check_class().

#define Host_configure_pipe_size (   p,
  size 
)    (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PSIZE_MASK, Host_format_pipe_size(size)))

configures the selected pipe size

#define Host_configure_pipe_token (   p,
  token 
)    (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PTOKEN_MASK, token))
#define Host_configure_pipe_type (   p,
  type 
)    (Wr_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PTYPE_MASK, type))

configures the selected pipe type

#define Host_current_bank (   p)    (Rd_bitfield(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_CURRBK_MASK))

returns the number of the current bank

#define Host_data_toggle (   p)    (Rd_bitfield(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_DTSEQ_MASK))

returns data toggle

#define Host_disable_bank_interrupt (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_NBUSYBKEC_MASK)

disables all banks full (IN) or free (OUT) interrupt

#define Host_disable_continuous_in_mode (   p)    (Clr_bits(AVR32_USBB_upinrqx(p), AVR32_USBB_UPINRQX_INMODE_MASK))

disables continuous IN mode

Referenced by host_transfer_control().

#define Host_disable_control_in_received_interrupt ( )    (AVR32_USBB_upconxclr(P_CONTROL) = AVR32_USBB_UPCONXCLR_RXINEC_MASK)

disables IN control pipe reception interrupt

#define Host_disable_control_out_ready_interrupt ( )    (AVR32_USBB_upconxclr(P_CONTROL) = AVR32_USBB_UPCONXCLR_TXOUTEC_MASK)

disables OUT control pipe ready interrupt

#define Host_disable_crc_error_interrupt (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_RXSTALLDEC_MASK)

disables CRC ERROR ISO IN detected interrupt

#define Host_disable_in_received_interrupt (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_RXINEC_MASK)

disables IN pipe reception interrupt

#define Host_disable_nak_received_interrupt (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_NAKEDEC_MASK)

disables NAK received interrupt

#define Host_disable_out_ready_interrupt (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_TXOUTEC_MASK)

disables OUT pipe ready interrupt

#define Host_disable_overflow_interrupt (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_OVERFIEC_MASK)

disables overflow interrupt

#define Host_disable_pipe (   p)    (Clr_bits(AVR32_USBB_uprst, AVR32_USBB_UPRST_PEN0_MASK << (p)))

disables the selected pipe

Referenced by host_check_class(), host_disable_all_pipes(), and usb_host_task().

#define Host_disable_pipe_bank_autoswitch (   p)    (Clr_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_AUTOSW_MASK))

disables the bank autoswitch for the selected pipe

#define Host_disable_pipe_error_interrupt (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_PERREC_MASK)

disables pipe error interrupt

#define Host_disable_pipe_interrupt (   p)    (AVR32_USBB_uhinteclr = AVR32_USBB_UHINTECLR_P0INTEC_MASK << (p))

disables the selected pipe interrupt

Referenced by host_disable_all_pipes().

#define Host_disable_setup_ready_interrupt ( )    (AVR32_USBB_upconxclr(P_CONTROL) = AVR32_USBB_UPCONXCLR_TXSTPEC_MASK)

disables SETUP pipe ready interrupt

#define Host_disable_short_packet_interrupt (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_SHORTPACKETIEC_MASK)

disables SHORT PACKET received interrupt

#define Host_disable_stall_interrupt (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_RXSTALLDEC_MASK)

disables STALL received interrupt

#define Host_disable_underflow_interrupt (   p)    (AVR32_USBB_upconxclr(p) = AVR32_USBB_UPCONXCLR_TXSTPEC_MASK)

disables underflow interrupt

#define Host_enable_bank_interrupt (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_NBUSYBKES_MASK)

enables all banks full (IN) or free (OUT) interrupt

#define Host_enable_continuous_in_mode (   p)    (Set_bits(AVR32_USBB_upinrqx(p), AVR32_USBB_UPINRQX_INMODE_MASK))
#define Host_enable_control_in_received_interrupt ( )    (AVR32_USBB_upconxset(P_CONTROL) = AVR32_USBB_UPCONXSET_RXINES_MASK)

enables IN control pipe reception interrupt

#define Host_enable_control_out_ready_interrupt ( )    (AVR32_USBB_upconxset(P_CONTROL) = AVR32_USBB_UPCONXSET_TXOUTES_MASK)

enables OUT control pipe ready interrupt

#define Host_enable_crc_error_interrupt (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_RXSTALLDES_MASK)

enables CRC ERROR ISO IN detected interrupt

#define Host_enable_in_received_interrupt (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_RXINES_MASK)

enables IN pipe reception interrupt

Referenced by host_get_data_interrupt().

#define Host_enable_nak_received_interrupt (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_NAKEDES_MASK)

enables NAK received interrupt

Referenced by host_get_data_interrupt(), and host_send_data_interrupt().

#define Host_enable_out_ready_interrupt (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_TXOUTES_MASK)

enables OUT pipe ready interrupt

Referenced by host_send_data_interrupt().

#define Host_enable_overflow_interrupt (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_OVERFIES_MASK)

enables overflow interrupt

#define Host_enable_ping (   p)    (Set_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PINGEN_MASK))

Enable PING management for the endpoint p.

Referenced by host_check_class().

#define Host_enable_pipe (   p)    (Set_bits(AVR32_USBB_uprst, AVR32_USBB_UPRST_PEN0_MASK << (p)))

enables the selected pipe

Referenced by host_check_class(), and usb_host_task().

#define Host_enable_pipe_bank_autoswitch (   p)    (Set_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_AUTOSW_MASK))

enables the bank autoswitch for the selected pipe

#define Host_enable_pipe_error_interrupt (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_PERRES_MASK)

enables pipe error interrupt

Referenced by host_get_data_interrupt(), and host_send_data_interrupt().

#define Host_enable_pipe_interrupt (   p)    (AVR32_USBB_uhinteset = AVR32_USBB_UHINTESET_P0INTES_MASK << (p))

enables the selected pipe interrupt

Referenced by host_get_data_interrupt(), and host_send_data_interrupt().

#define Host_enable_setup_ready_interrupt ( )    (AVR32_USBB_upconxset(P_CONTROL) = AVR32_USBB_UPCONXSET_TXSTPES_MASK)

enables SETUP pipe ready interrupt

#define Host_enable_short_packet_interrupt (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_SHORTPACKETIES_MASK)

enables SHORT PACKET received interrupt

#define Host_enable_stall_interrupt (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_RXSTALLDES_MASK)

enables STALL received interrupt

Referenced by host_get_data_interrupt(), and host_send_data_interrupt().

#define Host_enable_underflow_interrupt (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_TXSTPES_MASK)

enables underflow interrupt

#define Host_error_status (   p)
Value:
#define AVR32_USBB_UPERRX_PID_MASK
Definition: usbb.h:627
#define AVR32_USBB_UPERRX_DATAPID_MASK
Definition: usbb.h:623
#define AVR32_USBB_UPERRX_DATATGL_MASK
Definition: usbb.h:619
#define AVR32_USBB_UPERRX_TIMEOUT_MASK
Definition: usbb.h:631
#define AVR32_USBB_UPERRX_CRC16_MASK
Definition: usbb.h:615
#define Rd_bits(value, mask)
Reads the bits of a value specified by a given bit-mask.
Definition: compiler.h:458
#define AVR32_USBB_uperrx(x)
Definition: usbb.h:1235

tests if error occurs on pipe

Referenced by host_get_data(), host_send_data(), host_transfer_control(), and usb_pipe_interrupt().

#define Host_force_bank_interrupt (   p)    (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_NBUSYBKS_MASK)

forces all banks full (OUT) or free (IN) interrupt

#define Host_format_pipe_size (   size)    (32 - clz(((U32)min(max(size, 8), 1024) << 1) - 1) - 1 - 3)

Bounds given integer size to allowed range and rounds it up to the nearest available greater size, then applies register format of USBB controller for pipe size bit-field.

#define Host_free_control_in ( )    (Host_ack_fifocon(P_CONTROL))

frees current bank for IN control pipe

Referenced by host_transfer_control().

#define Host_free_in (   p)    (Host_ack_fifocon(p))

frees current bank for IN pipe

Referenced by host_audio_task(), host_cdc_task(), host_get_data(), host_mouse_hid_task(), and usb_pipe_interrupt().

#define Host_get_error_counter (   p)    (Rd_bitfield(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_COUNTER_MASK))
#define Host_get_in_request_number (   p)    (Rd_bitfield(AVR32_USBB_upinrqx(p), AVR32_USBB_UPINRQX_INRQ_MASK) + 1)

returns number of remaining IN requests

#define Host_get_interrupt_pipe_number ( )
Value:
(ctz(((AVR32_USBB_uhint >> AVR32_USBB_UHINT_P0INT_OFFSET) &\
(AVR32_USBB_uhinte >> AVR32_USBB_UHINTE_P0INTE_OFFSET)) |\
(1 << MAX_PEP_NB)))
#define AVR32_USBB_uhint
Definition: usbb.h:1131
#define ctz(u)
Counts the trailing zero bits of the given value considered as a 32-bit integer.
Definition: compiler.h:608
#define MAX_PEP_NB
Maximal number of USBB pipes/endpoints.
Definition: usb_drv.h:83
#define AVR32_USBB_uhinte
Definition: usbb.h:1149

returns the lowest pipe number generating a pipe interrupt or MAX_PEP_NB if none

Referenced by usb_general_interrupt().

#define Host_get_pipe_bank (   p)    (Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PBK_MASK))

gets the configured selected pipe number of banks

#define Host_get_pipe_endpoint_number (   p)    (Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PEPNUM_MASK))

gets the configured selected pipe endpoint number

Referenced by host_audio_task(), and host_ms_stall_management().

#define Host_get_pipe_fifo_access (   p,
  scale 
)    (AVR32_USBB_FIFOX_DATA(p, scale))

Get 64-, 32-, 16- or 8-bit access to FIFO data register of selected pipe.

Parameters
pPipe of which to access FIFO data register
scaleData scale in bits: 64, 32, 16 or 8
Returns
Volatile 64-, 32-, 16- or 8-bit data pointer to FIFO data register
Warning
It is up to the user of this macro to make sure that all accesses are aligned with their natural boundaries except 64-bit accesses which require only 32-bit alignment.
It is up to the user of this macro to make sure that used HSB addresses are identical to the DPRAM internal pointer modulo 32 bits.
#define Host_get_pipe_int_req_freq (   p)    (Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_INTFRQ_MASK))

gets the configured interrupt pipe request frequency (period in ms) for the selected pipe

#define Host_get_pipe_size (   p)    (8 << Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PSIZE_MASK))

gets the configured selected pipe size

Referenced by host_get_data(), host_set_p_txpacket(), host_transfer_control(), host_write_p_txpacket(), and usb_pipe_interrupt().

#define Host_get_pipe_token (   p)    (Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PTOKEN_MASK))

gets the configured selected pipe token

Referenced by host_check_class().

#define Host_get_pipe_type (   p)    (Rd_bitfield(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_PTYPE_MASK))

gets the configured selected pipe type

Referenced by host_check_class(), usb_general_interrupt(), and usb_pipe_interrupt().

#define Host_in_request_number (   p,
  in_num 
)    (Wr_bitfield(AVR32_USBB_upinrqx(p), AVR32_USBB_UPINRQX_INRQ_MASK, (in_num) - 1))

sets number of IN requests to perform before freeze

#define Host_nb_busy_bank (   p)    (Rd_bitfield(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_NBUSYBK_MASK))

returns the number of busy banks

Referenced by host_send_data().

#define Host_raise_control_in_received ( )    (AVR32_USBB_upstaxset(P_CONTROL) = AVR32_USBB_UPSTAXSET_RXINIS_MASK)

raises control IN

#define Host_raise_control_out_ready ( )    (AVR32_USBB_upstaxset(P_CONTROL) = AVR32_USBB_UPSTAXSET_TXOUTIS_MASK)

raises control OUT

#define Host_raise_crc_error (   p)    (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_RXSTALLDIS_MASK)

raises CRC ERROR ISO IN detected

#define Host_raise_in_received (   p)    (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_RXINIS_MASK)

raises IN reception

#define Host_raise_nak_received (   p)    (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_NAKEDIS_MASK)

raises NAK received

#define Host_raise_out_ready (   p)    (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_TXOUTIS_MASK)

raises OUT sent

#define Host_raise_overflow_interrupt (   p)    (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_OVERFIS_MASK)

raises pipe overflow interrupt

#define Host_raise_pipe_error (   p)    (AVR32_USBB_upstaxset(p) = (Is_host_pipe_error(p)) ? 0 : AVR32_USBB_UPSTAXSET_PERRIS_MASK)

raises pipe error

#define Host_raise_setup_ready ( )    (AVR32_USBB_upstaxset(P_CONTROL) = AVR32_USBB_UPSTAXSET_TXSTPIS_MASK)

raises setup

#define Host_raise_short_packet (   p)    (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_SHORTPACKETIS_MASK)

raises SHORT PACKET received

#define Host_raise_stall (   p)    (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_RXSTALLDIS_MASK)

raises STALL reception

#define Host_raise_underflow_interrupt (   p)    (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_TXSTPIS_MASK)

raises pipe underflow interrupt

#define Host_read_pipe_data (   p,
  scale 
)
Value:
(*pep_fifo[(p)].TPASTE3(u, scale, ptr)\
TPASTE3(Pep_fifo_access_, scale, _post_inc)())
UnionVPtr pep_fifo[MAX_PEP_NB]
Pointers to the FIFO data registers of pipes/endpoints Use aggregated pointers to have several alignm...
Definition: usb_drv.c:60
#define TPASTE3(a, b, c)
Definition: tpaste.h:69

Read 64-, 32-, 16- or 8-bit data from FIFO data register of selected pipe.

Parameters
pPipe of which to access FIFO data register
scaleData scale in bits: 64, 32, 16 or 8
Returns
64-, 32-, 16- or 8-bit data read
Warning
It is up to the user of this macro to make sure that all accesses are aligned with their natural boundaries except 64-bit accesses which require only 32-bit alignment.
Note
This macro assures that used HSB addresses are identical to the DPRAM internal pointer modulo 32 bits.
Warning
Always call Host_reset_pipe_fifo_access before this macro when at FIFO beginning.
Do not mix calls to this macro with calls to indexed macros below.

Referenced by host_cdc_task().

#define Host_read_pipe_indexed_data (   p,
  scale,
  index 
)    (AVR32_USBB_FIFOX_DATA(p, scale)[(index)])

Read 64-, 32-, 16- or 8-bit indexed data from FIFO data register of selected pipe.

Parameters
pPipe of which to access FIFO data register
scaleData scale in bits: 64, 32, 16 or 8
indexIndex of scaled data array to access
Returns
64-, 32-, 16- or 8-bit data read
Warning
It is up to the user of this macro to make sure that all accesses are aligned with their natural boundaries except 64-bit accesses which require only 32-bit alignment.
It is up to the user of this macro to make sure that used HSB addresses are identical to the DPRAM internal pointer modulo 32 bits.
Do not mix calls to this macro with calls to non-indexed macros above.
#define Host_reset_data_toggle (   p)    (AVR32_USBB_upconxset(p) = AVR32_USBB_UPCONXSET_RSTDTS_MASK)

resets the data toggle sequence

Referenced by host_ms_stall_management().

#define Host_reset_pipe (   p)
Value:
(Set_bits(AVR32_USBB_uprst, AVR32_USBB_UPRST_PRST0_MASK << (p)),\
Clr_bits(AVR32_USBB_uprst, AVR32_USBB_UPRST_PRST0_MASK << (p)))
#define Clr_bits(lvalue, mask)
Clears the bits of a C lvalue specified by a given bit-mask.
Definition: compiler.h:487
#define Set_bits(lvalue, mask)
Sets the bits of a C lvalue specified by a given bit-mask.
Definition: compiler.h:496
#define AVR32_USBB_uprst
Access points to the USBB host pipe memory map with arrayed registers.
Definition: usbb.h:1181

resets the selected pipe

Referenced by host_disable_all_pipes(), host_get_data(), host_get_data_interrupt(), host_send_data(), host_send_data_interrupt(), host_transfer_control(), usb_general_interrupt(), and usb_pipe_interrupt().

#define Host_reset_pipe_fifo_access (   p)    (pep_fifo[(p)].u64ptr = Host_get_pipe_fifo_access(p, 64))

Reset known position inside FIFO data register of selected pipe.

Parameters
pPipe of which to reset known position
Warning
Always call this macro before any read/write macro/function when at FIFO beginning.

Referenced by host_cdc_task(), host_get_data(), host_mouse_hid_task(), host_send_data(), host_send_data_interrupt(), host_transfer_control(), usb_pipe_interrupt(), and usb_stream_input().

#define Host_send_control_out ( )    (Host_ack_fifocon(P_CONTROL))

sends current bank for OUT control pipe

Referenced by host_transfer_control().

#define Host_send_out (   p)    (Host_ack_fifocon(p))

sends current bank for OUT pipe

Referenced by host_send_data_interrupt(), and usb_pipe_interrupt().

#define Host_send_setup ( )    (Host_ack_fifocon(P_CONTROL))

sends current bank for SETUP pipe

Referenced by host_transfer_control().

#define Host_unallocate_memory (   p)    (Clr_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_ALLOC_MASK))

un-allocates the configuration x in DPRAM memory

Referenced by host_check_class(), host_disable_all_pipes(), and usb_host_task().

#define Host_unforce_bank_interrupt (   p)    (AVR32_USBB_upstaxset(p) = AVR32_USBB_UPSTAXSET_NBUSYBKS_MASK)

unforces all banks full (OUT) or free (IN) interrupt

#define Host_write_pipe_data (   p,
  scale,
  data 
)
Value:
(*pep_fifo[(p)].TPASTE3(u, scale, ptr)\
TPASTE3(Pep_fifo_access_, scale, _post_inc)() = (data))
UnionVPtr pep_fifo[MAX_PEP_NB]
Pointers to the FIFO data registers of pipes/endpoints Use aggregated pointers to have several alignm...
Definition: usb_drv.c:60
#define TPASTE3(a, b, c)
Definition: tpaste.h:69
uint8_t data[1]
First Status Command Register - Second Dummy Data.
Definition: spi_master_example.c:112

Write 64-, 32-, 16- or 8-bit data to FIFO data register of selected pipe.

Parameters
pPipe of which to access FIFO data register
scaleData scale in bits: 64, 32, 16 or 8
data64-, 32-, 16- or 8-bit data to write
Returns
64-, 32-, 16- or 8-bit data written
Warning
It is up to the user of this macro to make sure that all accesses are aligned with their natural boundaries except 64-bit accesses which require only 32-bit alignment.
Note
This macro assures that used HSB addresses are identical to the DPRAM internal pointer modulo 32 bits.
Warning
Always call Host_reset_pipe_fifo_access before this macro when at FIFO beginning.
Do not mix calls to this macro with calls to indexed macros below.

Referenced by host_transfer_control().

#define Host_write_pipe_indexed_data (   p,
  scale,
  index,
  data 
)    (AVR32_USBB_FIFOX_DATA(p, scale)[(index)] = (data))

Write 64-, 32-, 16- or 8-bit indexed data to FIFO data register of selected pipe.

Parameters
pPipe of which to access FIFO data register
scaleData scale in bits: 64, 32, 16 or 8
indexIndex of scaled data array to access
data64-, 32-, 16- or 8-bit data to write
Returns
64-, 32-, 16- or 8-bit data written
Warning
It is up to the user of this macro to make sure that all accesses are aligned with their natural boundaries except 64-bit accesses which require only 32-bit alignment.
It is up to the user of this macro to make sure that used HSB addresses are identical to the DPRAM internal pointer modulo 32 bits.
Do not mix calls to this macro with calls to non-indexed macros above.
#define Is_host_bad_data_toggle (   p)    (Tst_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_DATATGL_MASK))
#define Is_host_bank_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_NBUSYBKE_MASK))

tests if all banks full (IN) or free (OUT) interrupt is enabled

#define Is_host_continuous_in_mode_enabled (   p)    (Tst_bits(AVR32_USBB_upinrqx(p), AVR32_USBB_UPINRQX_INMODE_MASK))

tests if continuous IN mode is enabled

#define Is_host_control_in_filled ( )    (Is_host_fifocon(P_CONTROL))

tests if IN received in current bank for control pipe

#define Is_host_control_in_received ( )    (Tst_bits(AVR32_USBB_upstax(P_CONTROL), AVR32_USBB_UPSTAX_RXINI_MASK))

tests if control IN has been received

Referenced by host_transfer_control().

#define Is_host_control_in_received_interrupt_enabled ( )    (Tst_bits(AVR32_USBB_upconx(P_CONTROL), AVR32_USBB_UPCONX_RXINE_MASK))

tests if IN control pipe reception interrupt is enabled

#define Is_host_control_out_ready ( )    (Tst_bits(AVR32_USBB_upstax(P_CONTROL), AVR32_USBB_UPSTAX_TXOUTI_MASK))

tests if control OUT has been sent

Referenced by host_transfer_control().

#define Is_host_control_out_ready_interrupt_enabled ( )    (Tst_bits(AVR32_USBB_upconx(P_CONTROL), AVR32_USBB_UPCONX_TXOUTE_MASK))

tests if OUT control pipe ready interrupt is enabled

#define Is_host_control_out_sent ( )    (Is_host_fifocon(P_CONTROL))

tests if current bank sent for OUT control pipe

#define Is_host_crc16_error (   p)    (Tst_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_CRC16_MASK))
#define Is_host_crc_error (   p)    (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_RXSTALLDI_MASK))

tests if CRC ERROR ISO IN detected

#define Is_host_crc_error_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_RXSTALLDE_MASK))

tests if CRC ERROR ISO IN detected interrupt is enabled

#define Is_host_data_pid_error (   p)    (Tst_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_DATAPID_MASK))
#define Is_host_data_toggle_reset (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_RSTDT_MASK))

tests if the data toggle sequence is being reset

#define Is_host_fifocon (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_FIFOCON_MASK))

tests if FIFOCON bit set

#define Is_host_in_filled (   p)    (Is_host_fifocon(p))

tests if IN received in current bank

#define Is_host_in_received (   p)    (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_RXINI_MASK))
#define Is_host_in_received_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_RXINE_MASK))

tests if IN pipe reception interrupt is enabled

#define Is_host_memory_allocated (   p)    (Tst_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_ALLOC_MASK))
#define Is_host_nak_received_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_NAKEDE_MASK))

tests if NAK received interrupt is enabled

#define Is_host_out_ready (   p)    (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_TXOUTI_MASK))

tests if OUT has been sent

Referenced by host_send_data(), and usb_pipe_interrupt().

#define Is_host_out_ready_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_TXOUTE_MASK))

tests if OUT pipe ready interrupt is enabled

#define Is_host_out_sent (   p)    (Is_host_fifocon(p))

tests if current bank sent for OUT pipe

#define Is_host_overflow (   p)    (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_OVERFI_MASK))

tests if an overflow occurs

#define Is_host_overflow_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_OVERFIE_MASK))

tests if overflow interrupt is enabled

#define Is_host_pid_error (   p)    (Tst_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_PID_MASK))
#define Is_host_pipe_bank_autoswitch_enabled (   p)    (Tst_bits(AVR32_USBB_upcfgx(p), AVR32_USBB_UPCFGX_AUTOSW_MASK))
#define Is_host_pipe_configured (   p)    (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_CFGOK_MASK))

tests if current pipe is configured

#define Is_host_pipe_enabled (   p)    (Tst_bits(AVR32_USBB_uprst, AVR32_USBB_UPRST_PEN0_MASK << (p)))

tests if the selected pipe is enabled

Referenced by host_check_class(), and host_disable_all_pipes().

#define Is_host_pipe_error (   p)    (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_PERRI_MASK))

tests if an error occurs on current pipe

Referenced by host_get_data(), host_send_data(), host_transfer_control(), and usb_pipe_interrupt().

#define Is_host_pipe_error_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_PERRE_MASK))

tests if pipe error interrupt is enabled

#define Is_host_pipe_frozen (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_PFREEZE_MASK))

tests if the current pipe is frozen

#define Is_host_pipe_interrupt (   p)    (Tst_bits(AVR32_USBB_uhint, AVR32_USBB_UHINT_P0INT_MASK << (p)))

tests if an interrupt is triggered by the selected pipe

#define Is_host_pipe_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_uhinte, AVR32_USBB_UHINTE_P0INTE_MASK << (p)))

tests if the selected pipe interrupt is enabled

#define Is_host_read_enabled (   p)    (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_RWALL_MASK))

tests if pipe read allowed

#define Is_host_resetting_pipe (   p)    (Tst_bits(AVR32_USBB_uprst, AVR32_USBB_UPRST_PRST0_MASK << (p)))

tests if the selected pipe is being reset

Referenced by host_send_data_interrupt().

#define Is_host_setup_ready ( )    (Tst_bits(AVR32_USBB_upstax(P_CONTROL), AVR32_USBB_UPSTAX_TXSTPI_MASK))

tests if SETUP has been sent

Referenced by host_transfer_control().

#define Is_host_setup_ready_interrupt_enabled ( )    (Tst_bits(AVR32_USBB_upconx(P_CONTROL), AVR32_USBB_UPCONX_TXSTPE_MASK))

tests if SETUP pipe ready interrupt is enabled

#define Is_host_setup_sent ( )    (Is_host_fifocon(P_CONTROL))

tests if current bank sent for SETUP pipe

#define Is_host_short_packet (   p)    (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_SHORTPACKETI_MASK))

tests if SHORT PACKET received

#define Is_host_short_packet_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_SHORTPACKETIE_MASK))

tests if SHORT PACKET received interrupt is enabled

#define Is_host_stall_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_RXSTALLDE_MASK))

tests if STALL received interrupt is enabled

#define Is_host_timeout_error (   p)    (Tst_bits(AVR32_USBB_uperrx(p), AVR32_USBB_UPERRX_TIMEOUT_MASK))
#define Is_host_underflow (   p)    (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_TXSTPI_MASK))

tests if an underflow occurs

#define Is_host_underflow_interrupt_enabled (   p)    (Tst_bits(AVR32_USBB_upconx(p), AVR32_USBB_UPCONX_TXSTPE_MASK))

tests if underflow interrupt is enabled

#define Is_host_write_enabled (   p)    (Tst_bits(AVR32_USBB_upstax(p), AVR32_USBB_UPSTAX_RWALL_MASK))

tests if pipe write allowed