| 数据搜索系统,热门电子元器件搜索 |
|
AN2491 数据表(PDF) 5 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2491 数据表(HTML) 5 Page - STMicroelectronics |
|
5 / 32 page ![]() AN2491 STW8110x API package 5/32 1 STW8110x API package It is highly recommended to read the STW81101, STW81102 or STW81103 datasheet before continuing to read this document. This API is a simple abstraction of the principles presented in these datasheets. The STW8110x device has two embedded digital bus interfaces (I2C and SPI) which allow their internal registers to be programmed. Each of these interfaces has its own dedicated protocol which must be followed to program the device correctly. For details of the STW8110x register and SPI and I2C protocols, refer to the relevant datasheet. 1.1 Content Three files are available in this package. A fourth file must be created by the user with implementation of I2C and SPI functions according to the master interface. Figure 1. Files available with this package 1.1.1 Digital bus interface header file Contains declarations of functions to be implemented by the user (refer to Section 8 for a complete listing). This subsection describes the tasks that the functions must accomplish. For more details about the digital bus protocol flow and configuration to apply to your master interface (as frequency) please refer to the STW81101, STW81102 or STW81103 datasheet. I2C mode t_I2C_Ack I2C_Send_data(unsigned char *data, int nb_bytes) { // 1 - Send Start Bit // 2 - loop i=1 to i=nb_bytes // a - send data[i] // b - wait acknowledge of slave // 3 - Send Stop Bit // return ACK, or NO_ACK if acknowledge hasn’t been received } t_I2C_Ack I2C_Read_data(unsigned char Add, unsigned char *data) { // 1 - Send Start Bit // 2 - send Add // 3 - wait acknowledge of slave 1. Digital bus interface header file 2. STW8110x API header file 3. STW8110x API source file |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |