Technical information

CSI to SPI Peripheral Communication in V850ES Microcontrollers
** Filename : temper.c
** Abstract : This file implements functions for temperature sensors
**
** Device: uPD70F3318Y
**
** Compiler: NEC/CA850
**
*****************************************************************************
**
*/
/*
*****************************************************************************
**
** Include files
*****************************************************************************
**
*/
#include "macrodriver.h"
#include "serial.h" /* for CSI/SPI routines */
#include "timer.h" /* for timing routines */
#include "led_vkj1.h" /* for M-Station LED */
#include "temper.h" /* includes for this file */
/* define TEMP_DEBUG to 1 to use ANI00 input for temperature */
#define TEMP_DEBUG 0
#define TEMP1_CS_OFF (P9H.7 = 1) /* set P915 (P9H.7) high to deselect
sensor 1 */
#define TEMP1_CS_ON (P9H.7 = 0) /* set P915 (P9H.7) low to select
sensor 1 */
#define TEMP2_CS_OFF (P9H.6 = 0) /* set P914 (P9H.6) low to deselect
sensor 2 */
#define TEMP2_CS_ON (P9H.6 = 1) /* set P914 (P9H.6) high to select
sensor 2 */
/* global data - buffers for transmit and receive */
UCHAR rxbuf[8]; /* buffer for received data */
UCHAR txbuf[8]; /* buffer for transmit data */
/*
**---------------------------------------------------------------------------
--
** Abstract:
** Function to do Temperature Sensor Initialization
**
** Parameters: None
** Returns:
** TRUE if initialize is successful, FALSE if fails
**
**---------------------------------------------------------------------------
--
*/
MD_STATUS Temp_Init(void)
{
46