AMS AS5048 Eval-Kit Manual del kit - Página 10
Navegue en línea o descargue pdf Manual del kit para Placa base AMS AS5048 Eval-Kit. AMS AS5048 Eval-Kit 16 páginas. 14-bit rotary position sensor with digital angle (interface) and pwm output
También para AMS AS5048 Eval-Kit: Manual de instrucciones (10 páginas), Manual del usuario (12 páginas)
AS5048 Adapter Board
5
Software example source code
The following source code shows a 4-wire SPI application case.
/*!
*****************************************************************************
*
\brief
Reads out chip data via SPI interface
*
*
This function is used to read out cordic value from chips supporting SPI
*
interface.
*
After calling this function the data can be displayed using #displayData.
*
*
\param[in] die : index of the die to read out.
*
\param[out] dd : Buffer of type #t_displayData where the read out data
*
will be written to.
*
*****************************************************************************
*/
static void
spiReadData(u8
{
umword
i;
u16
dat;
u16
agcreg;
#ifdef
AS5048_CHIPDESCRIPTION
u16 magreg;
#endif
PARAMETER_UNUSED(die);
dd->angleprec
= 0;
/* read agc value */
for
(i = 0; i < 2; i++)
{
/* the result is available only just in the second transfer.
transfers must be separated by chip selects */
dat
= SPI_CMD_READ | SPI_REG_AGC;
dat |= spiCalcEvenParity(dat);
spiTransfer((u8*)&dat, sizeof(u16));
}
agcreg = dat;
#ifdef
AS5048_CHIPDESCRIPTION
for
(i = 0; i < 2; i++)
{
/* the result is available only just in the second transfer.
transfers must be separated by chip selects */
dat
= SPI_CMD_READ | SPI_REG_MAG;
ams Eval Kit Manual, Confidential
[v1-3] 2014-Aug-01
die,
t_displayData
* dd)
Page 10
Document Feedback