Revision:
3:e02ec42cf9c8
Parent:
2:1f10f8ab527b
--- a/LPC2368/drv/zg2100/zg_com.h	Thu Jul 22 11:31:59 2010 +0000
+++ b/LPC2368/drv/zg2100/zg_com.h	Fri Aug 06 10:42:05 2010 +0000
@@ -21,7 +21,10 @@
 THE SOFTWARE.
 */
 
-//ZG2100 Low-level communication functions (SPI, CS, Interrupt)
+/**
+@file 
+ZG2100 Low-level communication functions (SPI, CS, Interrupt)
+*/
 //Donatien Garnier 2010
 
 #ifndef ZG_COM_H
@@ -44,41 +47,46 @@
 class DigitalOut;
 class InterruptIn;
 */
+///Opens SPI interface with pins
 void zg_com_init(SPI* pSpi, DigitalOut* pCs, /*InterruptIn*/ DigitalIn* pInt, DigitalOut* pNrst);
 
 //Registers Access
-
+///Reads register
 uint32_t zg_register_read(uint32_t addr);
 
+///Writes register
 void zg_register_write(uint32_t addr, uint32_t reg);
 
 //Indexed Registers Access
-
+///Reads indexed register
 uint32_t zg_indexed_register_read(uint32_t addr);
 
+///writes indexed register
 void zg_indexed_register_write(uint32_t addr, uint32_t reg);
 
 //Fifos
-
+///Reads FIFO
 void zg_fifo_read( byte fifo, byte* pType, byte* pSubtype, byte* buf, int len );
 
+///Writes FIFO (can be chunked)
 void zg_fifo_write( byte fifo, byte type, byte subtype, byte* buf, int len, bool start = true, bool stop = true ); //Write by chunks
 
 //Spi
 
+///SPI transfers directions
 typedef enum __ZG_SPI_DIR
 {
-  ZG_SPI_READ,
-  ZG_SPI_WRITE,
-  ZG_SPI_TRF //Read & Write
+  ZG_SPI_READ, ///Read
+  ZG_SPI_WRITE, ///Write
+  ZG_SPI_TRF ///Read & Write
 } ZG_SPI_DIR;
 
-
+///Transfers SPI frame
 void zg_spi_trf(byte* buf, int len, bool resetCs = true, ZG_SPI_DIR dir = ZG_SPI_TRF);
 
+///Is there an interrupt to serve?
 bool zg_is_int();
 
-
 //Callbacks, must be implemented in zg_drv.c
 
 void zg_on_int(); //On data available interrupt