68 lines
1.7 KiB
C
68 lines
1.7 KiB
C
/*
|
|
* @Author: DaMing zxm5337@163.com
|
|
* @Date: 2024-04-09 16:22:51
|
|
* @LastEditors: 张小明 zxm5337@163.com
|
|
* @LastEditTime: 2024-05-27 09:42:58
|
|
* @FilePath: \Proxi_CheckBoard\User\App\ProximitySwitches.h
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
*/
|
|
#ifndef __PROXIMITYSWITCHES_H__
|
|
#define __PROXIMITYSWITCHES_H__
|
|
#include "data_type_def.h"
|
|
#include "adc.h"
|
|
|
|
#define ERR_SENOR1 0X0001
|
|
#define ERR_SENOR2 0X0002
|
|
#define ERR_SENOR3 0X0004
|
|
#define ERR_SENOR4 0X0008
|
|
#define ERR_SENOR5 0X0010
|
|
#define ERR_SENOR6 0X0020
|
|
#define ERR_SENOR7 0X0040
|
|
#define ERR_SENOR8 0X0080
|
|
#define ERR_SENOR9 0X0100
|
|
#define ERR_SENOR10 0X0200
|
|
#define ERR_NUMAR 0X0400
|
|
|
|
#define VREF 2.5f
|
|
|
|
#define ADC1_NUM_CHANNELS 12
|
|
#define ADC2_NUM_CHANNELS 2
|
|
#define ADC3_NUM_CHANNELS 8
|
|
|
|
#define NUM_SAMPLES_PER_CHANNEL 100
|
|
|
|
extern uint32_t dma_adc1_buffer[ADC1_NUM_CHANNELS * NUM_SAMPLES_PER_CHANNEL];
|
|
extern uint32_t dma_adc3_buffer[ADC3_NUM_CHANNELS * NUM_SAMPLES_PER_CHANNEL];
|
|
|
|
extern uint32_t dma_adc1_buffer_av[ADC1_NUM_CHANNELS];
|
|
extern uint32_t dma_adc3_buffer_av[ADC3_NUM_CHANNELS];
|
|
|
|
extern float prox_switch_A_vol[11];
|
|
extern float prox_switch_B_vol[11];
|
|
|
|
extern uint32_t prox_switch_A_t[4][10];
|
|
extern uint32_t prox_switch_B_t[4][10];
|
|
|
|
typedef struct
|
|
{
|
|
BOOL namur_oc;
|
|
uint16_t error;
|
|
} senors_error_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t act_Sn;
|
|
uint16_t act_freq;
|
|
uint16_t t_vol_ready_1;
|
|
uint16_t t_vol_ready_2;
|
|
uint16_t t_vol_overflow;
|
|
}proxi_switch_t;
|
|
|
|
extern proxi_switch_t proxi_switch_A[10];
|
|
extern proxi_switch_t proxi_switch_B[10];
|
|
|
|
void fun_ini_adc(void);
|
|
void fun_get_switch_vol(void);
|
|
|
|
#endif
|