2 Copyright (c), 2004-2005,2007-2010 Trident Microsystems, Inc.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
8 * Redistributions of source code must retain the above copyright notice,
9 this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright notice,
11 this list of conditions and the following disclaimer in the documentation
12 and/or other materials provided with the distribution.
13 * Neither the name of Trident Microsystems nor Hauppauge Computer Works
14 nor the names of its contributors may be used to endorse or promote
15 products derived from this software without specific prior written
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 POSSIBILITY OF SUCH DAMAGE.
31 /*******************************************************************************
32 * FILENAME: $Id: drx_dap_fasi.c,v 1.7 2009/12/28 14:36:21 carlo Exp $
36 * Data access protocol: Fast Access Sequential Interface (fasi)
37 * Fast access, because of short addressing format (16 instead of 32 bits addr)
38 * Sequential, because of I2C.
39 * These functions know how the chip's memory and registers are to be accessed,
42 * These functions should not need adapting to a new platform.
50 *******************************************************************************/
52 #include "drx_dap_fasi.h"
53 #include "bsp_host.h" /* for DRXBSP_HST_Memcpy() */
55 /*============================================================================*/
57 /* Function prototypes */
58 static DRXStatus_t
DRXDAP_FASI_WriteBlock (
59 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
60 DRXaddr_t addr
, /* address of register/memory */
61 u16_t datasize
, /* size of data */
62 pu8_t data
, /* data to send */
63 DRXflags_t flags
); /* special device flags */
65 static DRXStatus_t
DRXDAP_FASI_ReadBlock (
66 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
67 DRXaddr_t addr
, /* address of register/memory */
68 u16_t datasize
, /* size of data */
69 pu8_t data
, /* data to send */
70 DRXflags_t flags
); /* special device flags */
72 static DRXStatus_t
DRXDAP_FASI_WriteReg8 (
73 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
74 DRXaddr_t addr
, /* address of register */
75 u8_t data
, /* data to write */
76 DRXflags_t flags
); /* special device flags */
78 static DRXStatus_t
DRXDAP_FASI_ReadReg8 (
79 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
80 DRXaddr_t addr
, /* address of register */
81 pu8_t data
, /* buffer to receive data */
82 DRXflags_t flags
); /* special device flags */
84 static DRXStatus_t
DRXDAP_FASI_ReadModifyWriteReg8 (
85 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
86 DRXaddr_t waddr
, /* address of register */
87 DRXaddr_t raddr
, /* address to read back from */
88 u8_t datain
, /* data to send */
89 pu8_t dataout
); /* data to receive back */
91 static DRXStatus_t
DRXDAP_FASI_WriteReg16 (
92 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
93 DRXaddr_t addr
, /* address of register */
94 u16_t data
, /* data to write */
95 DRXflags_t flags
); /* special device flags */
97 static DRXStatus_t
DRXDAP_FASI_ReadReg16 (
98 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
99 DRXaddr_t addr
, /* address of register */
100 pu16_t data
, /* buffer to receive data */
101 DRXflags_t flags
); /* special device flags */
103 static DRXStatus_t
DRXDAP_FASI_ReadModifyWriteReg16 (
104 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
105 DRXaddr_t waddr
, /* address of register */
106 DRXaddr_t raddr
, /* address to read back from */
107 u16_t datain
, /* data to send */
108 pu16_t dataout
); /* data to receive back */
110 static DRXStatus_t
DRXDAP_FASI_WriteReg32 (
111 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
112 DRXaddr_t addr
, /* address of register */
113 u32_t data
, /* data to write */
114 DRXflags_t flags
); /* special device flags */
116 static DRXStatus_t
DRXDAP_FASI_ReadReg32 (
117 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
118 DRXaddr_t addr
, /* address of register */
119 pu32_t data
, /* buffer to receive data */
120 DRXflags_t flags
); /* special device flags */
122 static DRXStatus_t
DRXDAP_FASI_ReadModifyWriteReg32 (
123 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
124 DRXaddr_t waddr
, /* address of register */
125 DRXaddr_t raddr
, /* address to read back from */
126 u32_t datain
, /* data to send */
127 pu32_t dataout
); /* data to receive back */
129 /* The version structure of this protocol implementation */
130 char drxDapFASIModuleName
[] = "FASI Data Access Protocol";
131 char drxDapFASIVersionText
[] = "";
133 DRXVersion_t drxDapFASIVersion
=
135 DRX_MODULE_DAP
, /**< type identifier of the module */
136 drxDapFASIModuleName
, /**< name or description of module */
138 0, /**< major version number */
139 0, /**< minor version number */
140 0, /**< patch version number */
141 drxDapFASIVersionText
/**< version as text string */
144 /* The structure containing the protocol interface */
145 DRXAccessFunc_t drxDapFASIFunct_g
=
148 DRXDAP_FASI_WriteBlock
, /* Supported */
149 DRXDAP_FASI_ReadBlock
, /* Supported */
150 DRXDAP_FASI_WriteReg8
, /* Not supported */
151 DRXDAP_FASI_ReadReg8
, /* Not supported */
152 DRXDAP_FASI_ReadModifyWriteReg8
, /* Not supported */
153 DRXDAP_FASI_WriteReg16
, /* Supported */
154 DRXDAP_FASI_ReadReg16
, /* Supported */
155 DRXDAP_FASI_ReadModifyWriteReg16
, /* Supported */
156 DRXDAP_FASI_WriteReg32
, /* Supported */
157 DRXDAP_FASI_ReadReg32
, /* Supported */
158 DRXDAP_FASI_ReadModifyWriteReg32
/* Not supported */
161 /*============================================================================*/
163 /* Functions not supported by protocol*/
165 static DRXStatus_t
DRXDAP_FASI_WriteReg8 (
166 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
167 DRXaddr_t addr
, /* address of register */
168 u8_t data
, /* data to write */
169 DRXflags_t flags
) /* special device flags */
171 return DRX_STS_ERROR
;
174 static DRXStatus_t
DRXDAP_FASI_ReadReg8 (
175 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
176 DRXaddr_t addr
, /* address of register */
177 pu8_t data
, /* buffer to receive data */
178 DRXflags_t flags
) /* special device flags */
180 return DRX_STS_ERROR
;
183 static DRXStatus_t
DRXDAP_FASI_ReadModifyWriteReg8 (
184 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
185 DRXaddr_t waddr
, /* address of register */
186 DRXaddr_t raddr
, /* address to read back from */
187 u8_t datain
, /* data to send */
188 pu8_t dataout
) /* data to receive back */
190 return DRX_STS_ERROR
;
193 static DRXStatus_t
DRXDAP_FASI_ReadModifyWriteReg32 (
194 pI2CDeviceAddr_t devAddr
, /* address of I2C device */
195 DRXaddr_t waddr
, /* address of register */
196 DRXaddr_t raddr
, /* address to read back from */
197 u32_t datain
, /* data to send */
198 pu32_t dataout
) /* data to receive back */
200 return DRX_STS_ERROR
;
203 /*============================================================================*/
205 /******************************
207 * DRXStatus_t DRXDAP_FASI_ReadBlock (
208 * pI2CDeviceAddr_t devAddr, -- address of I2C device
209 * DRXaddr_t addr, -- address of chip register/memory
210 * u16_t datasize, -- number of bytes to read
211 * pu8_t data, -- data to receive
212 * DRXflags_t flags) -- special device flags
214 * Read block data from chip address. Because the chip is word oriented,
215 * the number of bytes to read must be even.
217 * Make sure that the buffer to receive the data is large enough.
219 * Although this function expects an even number of bytes, it is still byte
220 * oriented, and the data read back is NOT translated to the endianness of
221 * the target platform.
224 * - DRX_STS_OK if reading was successful
225 * in that case: data read is in *data.
226 * - DRX_STS_ERROR if anything went wrong
228 ******************************/
230 static DRXStatus_t
DRXDAP_FASI_ReadBlock ( pI2CDeviceAddr_t devAddr
,
239 u16_t overheadSize
= 0;
241 /* Check parameters ********************************************************/
242 if ( devAddr
== NULL
)
244 return DRX_STS_INVALID_ARG
;
247 overheadSize
= (IS_I2C_10BIT (devAddr
->i2cAddr
) ? 2 : 1) +
248 (DRXDAP_FASI_LONG_FORMAT(addr
) ? 4 : 2 );
250 if ( ( DRXDAP_FASI_OFFSET_TOO_LARGE(addr
) ) ||
251 ( ( !(DRXDAPFASI_LONG_ADDR_ALLOWED
) ) &&
252 DRXDAP_FASI_LONG_FORMAT( addr
) ) ||
253 (overheadSize
> (DRXDAP_MAX_WCHUNKSIZE
)) ||
254 ((datasize
!=0) && (data
==NULL
)) ||
255 ((datasize
& 1)==1 ) )
257 return DRX_STS_INVALID_ARG
;
260 /* ReadModifyWrite & mode flag bits are not allowed */
261 flags
&= (~DRXDAP_FASI_RMW
& ~DRXDAP_FASI_MODEFLAGS
);
262 #if DRXDAP_SINGLE_MASTER
263 flags
|= DRXDAP_FASI_SINGLE_MASTER
;
266 /* Read block from I2C *****************************************************/
268 u16_t todo
= ( datasize
< DRXDAP_MAX_RCHUNKSIZE
?
269 datasize
: DRXDAP_MAX_RCHUNKSIZE
);
273 addr
&= ~DRXDAP_FASI_FLAGS
;
276 #if ( ( DRXDAPFASI_LONG_ADDR_ALLOWED==1 ) && \
277 ( DRXDAPFASI_SHORT_ADDR_ALLOWED==1 ) )
278 /* short format address preferred but long format otherwise */
279 if ( DRXDAP_FASI_LONG_FORMAT(addr
) )
282 #if ( DRXDAPFASI_LONG_ADDR_ALLOWED==1 )
283 buf
[bufx
++] = (u8_t
) (((addr
<< 1) & 0xFF)|0x01);
284 buf
[bufx
++] = (u8_t
) ((addr
>> 16) & 0xFF);
285 buf
[bufx
++] = (u8_t
) ((addr
>> 24) & 0xFF);
286 buf
[bufx
++] = (u8_t
) ((addr
>> 7) & 0xFF);
288 #if ( ( DRXDAPFASI_LONG_ADDR_ALLOWED==1 ) && \
289 ( DRXDAPFASI_SHORT_ADDR_ALLOWED==1 ) )
292 #if ( DRXDAPFASI_SHORT_ADDR_ALLOWED==1 )
293 buf
[bufx
++] = (u8_t
) ((addr
<< 1) & 0xFF);
294 buf
[bufx
++] = (u8_t
) ( ((addr
>> 16) & 0x0F) | ((addr
>> 18) & 0xF0) );
296 #if ( ( DRXDAPFASI_LONG_ADDR_ALLOWED==1 ) && \
297 ( DRXDAPFASI_SHORT_ADDR_ALLOWED==1 ) )
304 #if DRXDAP_SINGLE_MASTER
306 * In single master mode, split the read and write actions.
307 * No special action is needed for write chunks here.
309 rc
= DRXBSP_I2C_WriteRead (devAddr
, bufx
, buf
, 0, 0, 0);
310 if (rc
== DRX_STS_OK
)
312 rc
= DRXBSP_I2C_WriteRead (0, 0, 0, devAddr
, todo
, data
);
315 /* In multi master mode, do everything in one RW action */
316 rc
= DRXBSP_I2C_WriteRead (devAddr
, bufx
, buf
, devAddr
, todo
, data
);
321 } while (datasize
&& rc
== DRX_STS_OK
);
329 /******************************
331 * DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg16 (
332 * pI2CDeviceAddr_t devAddr, -- address of I2C device
333 * DRXaddr_t waddr, -- address of chip register/memory
334 * DRXaddr_t raddr, -- chip address to read back from
335 * u16_t wdata, -- data to send
336 * pu16_t rdata) -- data to receive back
338 * Write 16-bit data, then read back the original contents of that location.
339 * Requires long addressing format to be allowed.
341 * Before sending data, the data is converted to little endian. The
342 * data received back is converted back to the target platform's endianness.
344 * WARNING: This function is only guaranteed to work if there is one
345 * master on the I2C bus.
348 * - DRX_STS_OK if reading was successful
349 * in that case: read back data is at *rdata
350 * - DRX_STS_ERROR if anything went wrong
352 ******************************/
354 static DRXStatus_t
DRXDAP_FASI_ReadModifyWriteReg16 ( pI2CDeviceAddr_t devAddr
,
360 DRXStatus_t rc
=DRX_STS_ERROR
;
362 #if ( DRXDAPFASI_LONG_ADDR_ALLOWED==1 )
365 return DRX_STS_INVALID_ARG
;
368 rc
= DRXDAP_FASI_WriteReg16 (devAddr
, waddr
, wdata
, DRXDAP_FASI_RMW
);
369 if (rc
== DRX_STS_OK
)
371 rc
= DRXDAP_FASI_ReadReg16 (devAddr
, raddr
, rdata
, 0);
381 /******************************
383 * DRXStatus_t DRXDAP_FASI_ReadReg16 (
384 * pI2CDeviceAddr_t devAddr, -- address of I2C device
385 * DRXaddr_t addr, -- address of chip register/memory
386 * pu16_t data, -- data to receive
387 * DRXflags_t flags) -- special device flags
389 * Read one 16-bit register or memory location. The data received back is
390 * converted back to the target platform's endianness.
393 * - DRX_STS_OK if reading was successful
394 * in that case: read data is at *data
395 * - DRX_STS_ERROR if anything went wrong
397 ******************************/
399 static DRXStatus_t
DRXDAP_FASI_ReadReg16 ( pI2CDeviceAddr_t devAddr
,
404 u8_t buf
[sizeof (*data
)];
409 return DRX_STS_INVALID_ARG
;
411 rc
= DRXDAP_FASI_ReadBlock (devAddr
, addr
, sizeof (*data
), buf
, flags
);
412 *data
= buf
[0] + (((u16_t
) buf
[1]) << 8);
419 /******************************
421 * DRXStatus_t DRXDAP_FASI_ReadReg32 (
422 * pI2CDeviceAddr_t devAddr, -- address of I2C device
423 * DRXaddr_t addr, -- address of chip register/memory
424 * pu32_t data, -- data to receive
425 * DRXflags_t flags) -- special device flags
427 * Read one 32-bit register or memory location. The data received back is
428 * converted back to the target platform's endianness.
431 * - DRX_STS_OK if reading was successful
432 * in that case: read data is at *data
433 * - DRX_STS_ERROR if anything went wrong
435 ******************************/
437 static DRXStatus_t
DRXDAP_FASI_ReadReg32 ( pI2CDeviceAddr_t devAddr
,
442 u8_t buf
[sizeof (*data
)];
447 return DRX_STS_INVALID_ARG
;
449 rc
= DRXDAP_FASI_ReadBlock (devAddr
, addr
, sizeof (*data
), buf
, flags
);
450 *data
= (((u32_t
) buf
[0]) << 0) +
451 (((u32_t
) buf
[1]) << 8) +
452 (((u32_t
) buf
[2]) << 16) +
453 (((u32_t
) buf
[3]) << 24);
460 /******************************
462 * DRXStatus_t DRXDAP_FASI_WriteBlock (
463 * pI2CDeviceAddr_t devAddr, -- address of I2C device
464 * DRXaddr_t addr, -- address of chip register/memory
465 * u16_t datasize, -- number of bytes to read
466 * pu8_t data, -- data to receive
467 * DRXflags_t flags) -- special device flags
469 * Write block data to chip address. Because the chip is word oriented,
470 * the number of bytes to write must be even.
472 * Although this function expects an even number of bytes, it is still byte
473 * oriented, and the data being written is NOT translated from the endianness of
474 * the target platform.
477 * - DRX_STS_OK if writing was successful
478 * - DRX_STS_ERROR if anything went wrong
480 ******************************/
482 static DRXStatus_t
DRXDAP_FASI_WriteBlock ( pI2CDeviceAddr_t devAddr
,
488 u8_t buf
[ DRXDAP_MAX_WCHUNKSIZE
];
489 DRXStatus_t st
= DRX_STS_ERROR
;
490 DRXStatus_t firstErr
= DRX_STS_OK
;
491 u16_t overheadSize
= 0;
494 /* Check parameters ********************************************************/
495 if ( devAddr
== NULL
)
497 return DRX_STS_INVALID_ARG
;
500 overheadSize
= (IS_I2C_10BIT (devAddr
->i2cAddr
) ? 2 : 1) +
501 (DRXDAP_FASI_LONG_FORMAT(addr
) ? 4 : 2 );
503 if ( ( DRXDAP_FASI_OFFSET_TOO_LARGE(addr
) ) ||
504 ( ( !(DRXDAPFASI_LONG_ADDR_ALLOWED
) ) &&
505 DRXDAP_FASI_LONG_FORMAT( addr
) ) ||
506 (overheadSize
> (DRXDAP_MAX_WCHUNKSIZE
)) ||
507 ((datasize
!=0) && (data
==NULL
)) ||
508 ((datasize
& 1)==1 ) )
510 return DRX_STS_INVALID_ARG
;
513 flags
&= DRXDAP_FASI_FLAGS
;
514 flags
&= ~DRXDAP_FASI_MODEFLAGS
;
515 #if DRXDAP_SINGLE_MASTER
516 flags
|= DRXDAP_FASI_SINGLE_MASTER
;
519 /* Write block to I2C ******************************************************/
520 blockSize
= ( (DRXDAP_MAX_WCHUNKSIZE
) - overheadSize
) & ~1;
526 /* Buffer device address */
527 addr
&= ~DRXDAP_FASI_FLAGS
;
529 #if ( ( (DRXDAPFASI_LONG_ADDR_ALLOWED)==1 ) && \
530 ( (DRXDAPFASI_SHORT_ADDR_ALLOWED)==1 ) )
531 /* short format address preferred but long format otherwise */
532 if ( DRXDAP_FASI_LONG_FORMAT(addr
) )
535 #if ( (DRXDAPFASI_LONG_ADDR_ALLOWED)==1 )
536 buf
[bufx
++] = (u8_t
) (((addr
<< 1) & 0xFF)|0x01);
537 buf
[bufx
++] = (u8_t
) ((addr
>> 16) & 0xFF);
538 buf
[bufx
++] = (u8_t
) ((addr
>> 24) & 0xFF);
539 buf
[bufx
++] = (u8_t
) ((addr
>> 7) & 0xFF);
541 #if ( ( (DRXDAPFASI_LONG_ADDR_ALLOWED)==1 ) && \
542 ( (DRXDAPFASI_SHORT_ADDR_ALLOWED)==1 ) )
545 #if ( (DRXDAPFASI_SHORT_ADDR_ALLOWED)==1 )
546 buf
[bufx
++] = (u8_t
) ((addr
<< 1) & 0xFF);
547 buf
[bufx
++] = (u8_t
) ( ((addr
>> 16) & 0x0F) | ((addr
>> 18) & 0xF0) );
549 #if ( ( (DRXDAPFASI_LONG_ADDR_ALLOWED)==1 ) && \
550 ( (DRXDAPFASI_SHORT_ADDR_ALLOWED)==1 ) )
555 In single master mode blockSize can be 0. In such a case this I2C
556 sequense will be visible: (1) write address {i2c addr,
557 4 bytes chip address} (2) write data {i2c addr, 4 bytes data }
558 (3) write address (4) write data etc...
559 Addres must be rewriten because HI is reset after data transport and
562 todo
= (blockSize
< datasize
? blockSize
: datasize
);
565 u16_t overheadSizeI2cAddr
= 0;
566 u16_t dataBlockSize
= 0;
568 overheadSizeI2cAddr
= (IS_I2C_10BIT (devAddr
->i2cAddr
) ? 2 : 1);
569 dataBlockSize
= ( DRXDAP_MAX_WCHUNKSIZE
- overheadSizeI2cAddr
) & ~1;
571 /* write device address */
572 st
= DRXBSP_I2C_WriteRead( devAddr
,
575 (pI2CDeviceAddr_t
)(NULL
),
579 if ( ( st
!= DRX_STS_OK
) && ( firstErr
== DRX_STS_OK
) )
581 /* at the end, return the first error encountered */
585 todo
= (dataBlockSize
< datasize
? dataBlockSize
: datasize
);
587 DRXBSP_HST_Memcpy (&buf
[bufx
], data
, todo
);
588 /* write (address if can do and) data */
589 st
= DRXBSP_I2C_WriteRead( devAddr
,
590 (u16_t
)(bufx
+ todo
),
592 (pI2CDeviceAddr_t
)(NULL
),
596 if ( ( st
!= DRX_STS_OK
) && ( firstErr
== DRX_STS_OK
) )
598 /* at the end, return the first error encountered */
612 /******************************
614 * DRXStatus_t DRXDAP_FASI_WriteReg16 (
615 * pI2CDeviceAddr_t devAddr, -- address of I2C device
616 * DRXaddr_t addr, -- address of chip register/memory
617 * u16_t data, -- data to send
618 * DRXflags_t flags) -- special device flags
620 * Write one 16-bit register or memory location. The data being written is
621 * converted from the target platform's endianness to little endian.
624 * - DRX_STS_OK if writing was successful
625 * - DRX_STS_ERROR if anything went wrong
627 ******************************/
629 static DRXStatus_t
DRXDAP_FASI_WriteReg16 ( pI2CDeviceAddr_t devAddr
,
634 u8_t buf
[sizeof (data
)];
636 buf
[0] = (u8_t
) ( (data
>> 0 ) & 0xFF );
637 buf
[1] = (u8_t
) ( (data
>> 8 ) & 0xFF );
639 return DRXDAP_FASI_WriteBlock (devAddr
, addr
, sizeof (data
), buf
, flags
);
645 /******************************
647 * DRXStatus_t DRXDAP_FASI_WriteReg32 (
648 * pI2CDeviceAddr_t devAddr, -- address of I2C device
649 * DRXaddr_t addr, -- address of chip register/memory
650 * u32_t data, -- data to send
651 * DRXflags_t flags) -- special device flags
653 * Write one 32-bit register or memory location. The data being written is
654 * converted from the target platform's endianness to little endian.
657 * - DRX_STS_OK if writing was successful
658 * - DRX_STS_ERROR if anything went wrong
660 ******************************/
662 static DRXStatus_t
DRXDAP_FASI_WriteReg32 ( pI2CDeviceAddr_t devAddr
,
667 u8_t buf
[sizeof (data
)];
669 buf
[0] = (u8_t
) ( (data
>> 0 ) & 0xFF );
670 buf
[1] = (u8_t
) ( (data
>> 8 ) & 0xFF );
671 buf
[2] = (u8_t
) ( (data
>> 16) & 0xFF );
672 buf
[3] = (u8_t
) ( (data
>> 24) & 0xFF );
674 return DRXDAP_FASI_WriteBlock (devAddr
, addr
, sizeof (data
), buf
, flags
);