NHS31xx SW API
i2cbbm_dft.h
1 /*
2  * Copyright 2017-2019 NXP
3  * This software is owned or controlled by NXP and may only be used strictly
4  * in accordance with the applicable license terms. By expressly accepting
5  * such terms or by downloading, installing, activating and/or otherwise using
6  * the software, you are agreeing that you have read, and that you agree to
7  * comply with and are bound by, such license terms. If you do not agree to
8  * be bound by the applicable license terms, then you may not retain, install,
9  * activate or otherwise use the software.
10  */
11 
29 #ifndef __I2CBBM_DFT_H_
30 #define __I2CBBM_DFT_H_
31 
32 #include "chip.h"
33 
44 #if (!defined(I2CBBM_MAX_CLK_STRETCH))
45  #define I2CBBM_MAX_CLK_STRETCH 100
46 #endif
47 
52 #if (!defined(I2CBBM_CLK_PIN))
53  #define I2CBBM_CLK_PIN IOCON_PIO0_4
54 #endif
55 
60 #if (!defined(I2CBBM_DAT_PIN))
61  #define I2CBBM_DAT_PIN IOCON_PIO0_5
62 #endif
63 
75 #if !I2CBBM_PULLUP_COUNT && !defined(I2CBBM_PULLUPS)
76  /* If these defines are not overridden, external pull-ups must be provided for the SCL and SDA lines. */
80  #define I2CBBM_PULLUP_COUNT 0
81 
85  #define I2CBBM_PULLUPS { -1 } /* {} seems more correct. This value avoids the warning 'ISO C forbids empty initializer braces [-Wpedantic]' */
86 #elif I2CBBM_PULLUP_COUNT && defined(I2CBBM_PULLUPS)
87  /* OK */
88 #else
89  #error Both I2CBBM_PULLUP_COUNT and I2CBBM_PULLUPS must be both defined or undefined.
90  #error Define I2CBBM_PULLUPS as an array of type IOCON_PIN_T and size I2CBBM_PULLUP_COUNT,
91  #error For example: #define I2CBBM_PULLUP_COUNT 3 and #define I2CBBM_PULLUPS = {IOCON_PIO0_x, IOCON_PIO0_y, IOCON_PIO0_z}
92 #endif
93 
104 #if (!defined(I2CBBM_PULSE_WIDTH))
105  #define I2CBBM_PULSE_WIDTH 1
106 #endif
107 
113 #if !defined(I2CBBM_DEFAULT_I2C_ADDRESS)
114  #define I2CBBM_DEFAULT_I2C_ADDRESS 0x7F
115 #endif
116 
124 #if !defined(I2CBBM_SYSTEM_CLOCK_DIVIDER)
125  #define I2CBBM_SYSTEM_CLOCK_DIVIDER 4
126 #endif
127 
128 #endif