Skip to main content

pamoja_pca9685_new

Function pamoja_pca9685_new 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_pca9685_new( bus: *const PamojaI2cBus, address: u8, settings: PamojaPca9685Settings, out_driver: *mut *mut PamojaPca9685, ) -> PamojaStatus
Expand description

Creates a PCA9685 driver on a bus. Nothing is sent until pamoja_pca9685_init or the first channel is loaded.

§Arguments

  • bus - the bus the part is on; the driver holds its own share.
  • address - the address the A5 to A0 pins select, 0x40 with all six low.
  • settings - the frequency, the oscillator, and the output wiring; see pamoja_pca9685_settings_default.
  • out_driver - receives the driver.

§Returns

PamojaStatus::Ok with the driver in out_driver, or PamojaStatus::InvalidArgument for a null argument.

§Safety

bus must be a live handle or null, and out_driver a writable pointer or null.