pub fn endpoint_enable(&self, endpoint: u32, cfg: EndpointConfig) {
        self.state.map(|state| {
            // Record config in case of later reset
            match *state {
                State::Reset => {
                    client_err!("Not enabled");
                }
                State::Idle(Mode::Device { ref mut config, .. }) => {
                    *config = Some(cfg);
                }
                State::Active(Mode::Device { ref mut config, .. }) => {
                    *config = Some(cfg);
                }
                _ => {
                    client_err!("Not in Device mode");
                }
            }
        });

        // Enable the endpoint (meaning the controller will respond to requests)
        UERST.set_bit(endpoint);

        self.endpoint_configure(endpoint as usize, cfg);

        // Set EPnINTE, enabling interrupts for this endpoint
        UDINTESET.set_bit(12 + endpoint);

        debug!("Enabled endpoint {}", endpoint);
    }
/// Configure and enable an endpoint
/// (XX: include addr and packetsize?)
Configure and enable an endpoint
(XX: include addr and packetsize?)
Configure and enable an endpoint ( XX : include addr and packetsize? )
pub fn endpoint_enable(&self, endpoint: u32, cfg: EndpointConfig) {
        self.state.map(|state| {
            // Record config in case of later reset
            match *state {
                State::Reset => {
                    client_err!("Not enabled");
                }
                State::Idle(Mode::Device { ref mut config, .. }) => {
                    *config = Some(cfg);
                }
                State::Active(Mode::Device { ref mut config, .. }) => {
                    *config = Some(cfg);
                }
                _ => {
                    client_err!("Not in Device mode");
                }
            }
        });
        // Enable the endpoint (meaning the controller will respond to requests)
        UERST.set_bit(endpoint);
        self.endpoint_configure(endpoint as usize, cfg);
        // Set EPnINTE, enabling interrupts for this endpoint
        UDINTESET.set_bit(12 + endpoint);
        debug!("Enabled endpoint {}", endpoint);
    }
pub fn endpoint_enable ( & self , endpoint : u32 , cfg : EndpointConfig ) { self . state . map ( | state | { // Record config in case of later reset match * state { State :: Reset => { client_err ! ( " " ) ; } State :: Idle ( Mode :: Device { ref mut config , .. } ) => { * config = Some ( cfg ) ; } State :: Active ( Mode :: Device { ref mut config , .. } ) => { * config = Some ( cfg ) ; } _ => { client_err ! ( " " ) ; } } } ) ; // Enable the endpoint (meaning the controller will respond to requests) UERST . set_bit ( endpoint ) ; self . endpoint_configure ( endpoint as usize , cfg ) ; // Set EPnINTE, enabling interrupts for this endpoint UDINTESET . set_bit ( 12 + endpoint ) ; debug ! ( " " endpoint ) ; }
Configure and enable an endpoint
(XX: include addr and packetsize?)
Configure and enable an endpoint ( XX : include addr and packetsize? )
&self
endpoint
u32
cfg
EndpointConfig
&self
endpoint
u32
cfg
EndpointConfig