mini board PCU9669 (and PCA9665) sample code

Dependencies:   mbed PCU9669 utility PCA9665 I2C_slaves parallel_bus

Fork of mini_board_PCU9669_old by InetrfaceProducts NXP

Sample code for PCU9669 (PCU9661, PCA9663, PCA9661 and PCA9665) evaluation board.

PCU9669 evaluation board: Mini board PCU9669
User manual is available -> http://www.nxp.com/documents/user_manual/UM10580.pdf

Committer:
nxp_ip
Date:
Wed Mar 28 04:32:50 2012 +0000
Revision:
8:6120bbbe3636
correction for comment on header part of each files (date: 26-Mar-2011 --> 26-Mar-2012)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nxp_ip 8:6120bbbe3636 1 /** A sample code for "mini board PCU9669/PCA9665"
nxp_ip 8:6120bbbe3636 2 *
nxp_ip 8:6120bbbe3636 3 * @author Akifumi (Tedd) OKANO, NXP Semiconductors
nxp_ip 8:6120bbbe3636 4 * @version 1.0
nxp_ip 8:6120bbbe3636 5 * @date 26-Mar-2012
nxp_ip 8:6120bbbe3636 6 *
nxp_ip 8:6120bbbe3636 7 * Released under the MIT License: http://mbed.org/license/mit
nxp_ip 8:6120bbbe3636 8 *
nxp_ip 8:6120bbbe3636 9 * An operation sample of PCU9669/PCA9665 I2C bus controller.
nxp_ip 8:6120bbbe3636 10 * The mbed accesses the bus controller's parallel port (8/2 bit address and 8 bit data) by bit-banging.
nxp_ip 8:6120bbbe3636 11 * The bit-banging is poerformed by PortInOut function of mbed library.
nxp_ip 8:6120bbbe3636 12 *
nxp_ip 8:6120bbbe3636 13 * To make the code porting easier, all codes are partitioned into layers to abstract other parts.
nxp_ip 8:6120bbbe3636 14 * The mbed specific parts are concentrated in lowest layer: "hardware_abs.*".
nxp_ip 8:6120bbbe3636 15 * This module may need to be modified for the porting.
nxp_ip 8:6120bbbe3636 16 *
nxp_ip 8:6120bbbe3636 17 * All other upper layers are writen in standard-C.
nxp_ip 8:6120bbbe3636 18 *
nxp_ip 8:6120bbbe3636 19 * base code is written from 05-Sep-2011 to 09-Sep-2011.
nxp_ip 8:6120bbbe3636 20 * And demo code has been build on 11-Sep-2011.
nxp_ip 8:6120bbbe3636 21 * Debug and code adjustment has been done on 08-Sep-2011.
nxp_ip 8:6120bbbe3636 22 * Small sanitization for main.cpp. All mbed related codes are moved in to "hardware_abs.*". 13-Oct-2011
nxp_ip 8:6120bbbe3636 23 * hardware_abs are moved into parallel_bus library folder, 3 LED driver operation sample 13-Feb.-2012
nxp_ip 8:6120bbbe3636 24 * PCU9669 and PCA9665 codes are packed in a project 14-Feb-2012.
nxp_ip 8:6120bbbe3636 25 *
nxp_ip 8:6120bbbe3636 26 * Before builidng the code, please edit the file mini_board_PCU9669/config.h
nxp_ip 8:6120bbbe3636 27 * Un-comment the target name what you want to target.
nxp_ip 8:6120bbbe3636 28 */
nxp_ip 8:6120bbbe3636 29
nxp_ip 8:6120bbbe3636 30 #include "utility.h"
nxp_ip 8:6120bbbe3636 31 #include "mbed.h" // for printf
nxp_ip 8:6120bbbe3636 32
nxp_ip 8:6120bbbe3636 33 void dump_read_data( char *data, char length ) {
nxp_ip 8:6120bbbe3636 34 int i;
nxp_ip 8:6120bbbe3636 35
nxp_ip 8:6120bbbe3636 36 printf( "\r\ndump @ %p for %d bytes", data, length );
nxp_ip 8:6120bbbe3636 37 for ( i = 0; i < length; i++ )
nxp_ip 8:6120bbbe3636 38 {
nxp_ip 8:6120bbbe3636 39 if ( !(i % 8) )
nxp_ip 8:6120bbbe3636 40 printf( "\r\n%08p (%03d, 0x%02X) : 0x", data + i, i, i );
nxp_ip 8:6120bbbe3636 41
nxp_ip 8:6120bbbe3636 42 printf( "%02X ", data[ i ] );
nxp_ip 8:6120bbbe3636 43 }
nxp_ip 8:6120bbbe3636 44 printf( "\r\n" );
nxp_ip 8:6120bbbe3636 45 }