Browse Source

add lib/config.h

Signed-off-by: surenyi <surenyi82@163.com>
master
surenyi 6 years ago
parent
commit
8a65e463a4
  1. 57
      lib/config.h
  2. 8
      lib/iic.h
  3. 4
      lib/iis.h
  4. 28
      lib/serial.h
  5. 0
      targets/fk407/target.h
  6. 0
      targets/stm32f429-disc/target.h
  7. 0
      targets/vocoder/target.h

57
lib/config.h

@ -0,0 +1,57 @@
#ifndef __CONFIG_H__
#define __CONFIG_H__
#ifdef __cplusplus
extern "C" {
#endif
/* include each target's configuration */
#include "target.h"
/* serial config */
#ifndef TARGET_HAS_USART1
#define TARGET_HAS_USART1 0
#endif
#ifndef TARGET_HAS_USART2
#define TARGET_HAS_USART2 0
#endif
#ifndef TARGET_HAS_USART3
#define TARGET_HAS_USART3 0
#endif
#ifndef TARGET_HAS_USART4
#define TARGET_HAS_USART4 0
#endif
#ifndef TARGET_HAS_USART5
#define TARGET_HAS_USART5 0
#endif
#ifndef TARGET_HAS_USART6
#define TARGET_HAS_USART6 0
#endif
#ifndef TARGET_HAS_USART7
#define TARGET_HAS_USART7 0
#endif
/* I2C */
#ifndef TARGET_HAS_I2C1
#define TARGET_HAS_I2C1 0
#endif
#ifndef TARGET_HAS_I2C3
#define TARGET_HAS_I2C3 0
#endif
/* I2S */
#ifndef TARGET_HAS_I2S0
#define TARGET_HAS_I2S0 0
#endif
#ifdef __cplusplus
}
#endif
#endif

8
lib/iic.h

@ -6,14 +6,6 @@ extern "C" {
#include "config.h"
#ifndef TARGET_HAS_I2C1
#define TARGET_HAS_I2C1 0
#endif
#ifndef TARGET_HAS_I2C3
#define TARGET_HAS_I2C3 0
#endif
typedef struct iic_descr * iic_t;
/*

4
lib/iis.h

@ -27,10 +27,6 @@ size_t iis_send_blocking(struct iis_tag *tag, const void* _data, size_t num_byte
void iis_set_tx_completion(struct iis_tag *tag, void (*callback)(struct iis_tag *, void *), void *user);
#ifndef TARGET_HAS_I2S0
#define TARGET_HAS_I2S0 0
#endif
#if (TARGET_HAS_I2S0)
#ifndef TARGET_I2S0_TX_BUFFER_SIZE

28
lib/serial.h

@ -8,34 +8,6 @@
extern "C" {
#endif
#ifndef TARGET_HAS_USART1
#define TARGET_HAS_USART1 0
#endif
#ifndef TARGET_HAS_USART2
#define TARGET_HAS_USART2 0
#endif
#ifndef TARGET_HAS_USART3
#define TARGET_HAS_USART3 0
#endif
#ifndef TARGET_HAS_USART4
#define TARGET_HAS_USART4 0
#endif
#ifndef TARGET_HAS_USART5
#define TARGET_HAS_USART5 0
#endif
#ifndef TARGET_HAS_USART6
#define TARGET_HAS_USART6 0
#endif
#ifndef TARGET_HAS_USART7
#define TARGET_HAS_USART7 0
#endif
#define TX_BUFFER_SIZE 128
#define RX_BUFFER_SIZE 256

0
targets/fk407/config.h → targets/fk407/target.h

0
targets/stm32f429-disc/config.h → targets/stm32f429-disc/target.h

0
targets/vocoder/config.h → targets/vocoder/target.h

Loading…
Cancel
Save