beautypg.com

PNI RM3000-F Sensor Suite User Manual

Page 43

background image

PNI Sensor Corporation

Doc #1016102 r04

RM3000-f & RM2000-f Sensor Suite User Manual

Page 43

/*************************************************************************
* Function Name : spi_1_go_0_phase_0_pol
* Description : changes phase and polarity of the SPI bus to 0/0
* Input : None
* Output : None
* Return : None
*************************************************************************/
void spi_1_go_0_phase_0_pol(void)
{

//Set SPI Clock Phase and Polarity to 0/0

}
/*************************************************************************
* Function Name : spi_1_go_1_phase_1_pol
* Description : changes phase and polarity of the SPI bus to 1/1
* Input : None
* Output : None
* Return : None
*************************************************************************/
void spi_1_go_1_phase_1_pol(void)
{

//Set SPI Clock Phase and Polarity to 1/1

}


/*************************************************************************
* Function Name : ThreeD_magic_setup
* Description : sets up the 3D MagIC to make a multi-axis measurement
* Input : None
* Output : None
* Return : None
*************************************************************************/
void ThreeD_magic_setup(void)
{

//

// change the phase and polarity to be 1/1

//

spi_1_go_0_phase_0_pol();


SPI_tom_CS_LOW();

usec_delay(1);

//Sending 0x82 to initiate a sensor measurement

tom_first_byte=SPI_read_write(0x82);

usec_delay(1);

//Sending 0x01 on MOSI pin, and select X, Y, & Z axes

SPI_read_write(0x01);

usec_delay(1);

SPI_tom_CS_HIGH();


//

// change the phase and polarity to be 1/1

//

spi_1_go_1_phase_1_pol();

}