beautypg.com

3 platform dependent macros, Platform dependent macros – Maxim Integrated 73M1866B/73M1966B Reference Driver User Manual

Page 93

background image

UG_1x66B_015

73M1866B/73M1966B Reference Driver User Guide

Rev. 2.7

93

8.3 Platform Dependent Macros

The following macros are used in the driver code (defined in drv_config_user.h). These macros
must be defined according to the specific hardware environment and platform. It is expected that the use
of the driver will provide these macros workable with their environment.

/*================================================*/
/* INT =======================================*/
/*================================================*/
#define IRQ_NUMBER …

/*================================================*/
/* USER SPECIFIC FUNCTION ========================*/
/*================================================*/
#define M1966_SPI_MODE_16BIT
#define M1966_DETECT_OFH_POLARITY_CHG
#define M1966_DETECT_OFH_BATT

/*================================================*/
/* PCM CLK =======================================*/
/*================================================*/
/*================================================*/
/* define PCM clock initialization macro */
#define CONFIG_HOST_PCM(void) do { \
… \
} while(0)
/*================================================*/

/*================================================*/
/* FXO Reset =====================================*/
/*================================================*/
#define FXO_RESET(void) do { \
printk(“\nPerform FXO RESET\n”); \
… \
} while(0)
/*================================================*/

/*================================================*/
/* SPI =====================================*/
/*================================================*/
/*================================================*/
/* Define SPI chip select macros */
#define SPI_CS_SET_LOW(devNr) …
#define SPI_CS_SET_HIGH(devNr) …

/*================================================*/
#define SPI_WAIT_FOR_READY(status) do { \
… \
} while(0)

#define SPI_LL_READ_WRITE(connid,txptr,txsize,rxptr,rxsize) …

/*================================================*/
/*================================================*/
#define M1966_SPI_WRITE_BYTE(global,byte_ptr) do { \
int status; \
SPI_WAIT_FOR_READY (status); \
SPI_CS_SET_LOW (0); \
SPI_LL_READ_WRITE (byte_ptr, 1, 0, 0); \