Overview

Driver for an NXP PCA9532 16-bit port expander / LED driver.

The PCA9532 is an 8-bit port expander where each of the bits can function as either an input or an output.

Resources

All correct at time of writing, but as always, manufacturers love to move things around on their website.

Web page

http://www.nxp.com/products/lighting_driver_and_controller_ics/i2c_led_display_control/series/PCA9532.html

Datasheet

http://www.nxp.com/documents/data_sheet/PCA9532.pdf

Test hardware

This code has been tested using an Embedded Artists base board with LPC1788-OEM module.

API Summary

Setup
PCA9532_I2C_ADDR 8-bit I2C address for PCA9532
pca9532_initialize_i2c Initialize bus expander on I2C bus
LEDs
pca9532_led_mode Get LED mode
pca9532_set_duty_cycle Set channel duty cycle
pca9532_set_led_mode Set LED mode
pca9532_set_pwm_frequency Set PWM frequency