pub fn new(led_count: i32, pin: i32) -> Result<Self, WS2811Error> {
        unsafe {
            let mut ret = Self { c_struct: mem::zeroed() };

            ret.c_struct.freq = 800_000;
            ret.c_struct.dmanum = 10;
            ret.c_struct.channel[0] = ChannelBuilder::new()
                                     .pin(pin)
                                     .count(led_count)
                                     .strip_type(StripType::Ws2811Rgb)
                                     .brightness(255)
                                     .build();
            let res: Result<(), WS2811Error> = bindings::ws2811_init(&mut ret.c_struct).into();

            match res {
                Ok(_) => {}
                Err(e) => return Err(e),
            }
            return Ok(ret);
        }

    }
/// Use ws2812 devices via rpi-ws281x library
Use ws2812 devices via rpi-ws281x library
Use ws2812 devices via rpi - ws281x library
pub fn new(led_count: i32, pin: i32) -> Result<Self, WS2811Error> {
        unsafe {
            let mut ret = Self { c_struct: mem::zeroed() };
            ret.c_struct.freq = 800_000;
            ret.c_struct.dmanum = 10;
            ret.c_struct.channel[0] = ChannelBuilder::new()
                                     .pin(pin)
                                     .count(led_count)
                                     .strip_type(StripType::Ws2811Rgb)
                                     .brightness(255)
                                     .build();
            let res: Result<(), WS2811Error> = bindings::ws2811_init(&mut ret.c_struct).into();
            match res {
                Ok(_) => {}
                Err(e) => return Err(e),
            }
            return Ok(ret);
        }
    }
pub fn new ( led_count : i32 , pin : i32 ) -> Result < Self , WS2811Error > { unsafe { let mut ret = Self { c_struct : mem :: zeroed ( ) } ; ret . c_struct . freq = 800_000 ; ret . c_struct . dmanum = 10 ; ret . c_struct . channel [ 0 ] = ChannelBuilder :: new ( ) . pin ( pin ) . count ( led_count ) . strip_type ( StripType :: Ws2811Rgb ) . brightness ( 255 ) . build ( ) ; let res : Result < ( ) , WS2811Error > = bindings :: ws2811_init ( & mut ret . c_struct ) . into ( ) ; match res { Ok ( _ ) => { } Err ( e ) => return Err ( e ) , } return Ok ( ret ) ; } }
Use ws2812 devices via rpi-ws281x library
Use ws2812 devices via rpi - ws281x library
led_count
i32
pin
i32
led_count
i32
pin
i32