pub struct PCA9685 { /* private fields */ }Implementations§
Source§impl PCA9685
impl PCA9685
pub fn default(board: &Board) -> Result<Self, Error>
pub fn new(board: &dyn Hardware, address: u8) -> Result<Self, Error>
pub fn get_address(&self) -> u8
pub fn get_frequency(&self) -> u16
pub fn set_frequency(&mut self, frequency: u16) -> Result<&Self, Error>
pub fn write_to_reg(&mut self, register: u8, value: u8) -> Result<(), Error>
pub fn read_from_reg(&mut self, register: u8) -> Result<u8, Error>
Trait Implementations§
Source§impl Hardware for PCA9685
impl Hardware for PCA9685
Source§fn get_protocol(&self) -> Box<dyn IoProtocol>
fn get_protocol(&self) -> Box<dyn IoProtocol>
Returns the protocol used.
Source§fn set_protocol(&mut self, protocol: Box<dyn IoProtocol>)
fn set_protocol(&mut self, protocol: Box<dyn IoProtocol>)
Sets the protocol.
@todo remove this when hermes_studio finds a way around.
Source§fn get_protocol_name(&self) -> &str
fn get_protocol_name(&self) -> &str
Returns the protocol name.
Source§impl IO for PCA9685
impl IO for PCA9685
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Checks if the communication is opened using the underlying protocol.
Source§fn servo_config(&mut self, pin: u8, pwm_range: Range<u16>) -> Result<(), Error>
fn servo_config(&mut self, pin: u8, pwm_range: Range<u16>) -> Result<(), Error>
Sends a SERVO_CONFIG command (0x70 - configure servo)
https://github.com/firmata/protocol/blob/master/servos.md
Source§fn i2c_config(&mut self, delay: u16) -> Result<(), Error>
fn i2c_config(&mut self, delay: u16) -> Result<(), Error>
Configures the
delay in microseconds for I2C devices that require a delay between when the
register is written to and the data in that register can be read.Source§impl IoProtocol for PCA9685
impl IoProtocol for PCA9685
Source§fn open(&mut self) -> Result<(), Error>
fn open(&mut self) -> Result<(), Error>
Opens the communication using the underlying protocol.
impl Expander for PCA9685
Auto Trait Implementations§
impl Freeze for PCA9685
impl !RefUnwindSafe for PCA9685
impl Send for PCA9685
impl Sync for PCA9685
impl Unpin for PCA9685
impl !UnwindSafe for PCA9685
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more