Hardware Abstraction Layer for FreeRTOS
adcs747x.h
Go to the documentation of this file.
1 #ifndef ADCS747X_H_
2 #define ADCS747X_H_
3 
4 #include <adc.h>
5 #define ADC_PRV
6 #include <adc_prv.h>
7 #include <spi.h>
8 #include <FreeRTOS.h>
9 #include <task.h>
10 extern const struct adc_ops adcs747x_adc_ops;
11 struct adc_adcs747x {
12  struct adc_generic gen;
13  bool running;
14  uint32_t ticks;
15  uint32_t bits;
16  uint32_t channelID;
17  OS_DEFINE_TASK(task, 500);
18  struct spi_slave *slave;
19  bool (*callback)(struct adc *adc, uint32_t channel, int32_t value, void *data);
20  void *data;
21 };
23 int32_t adcs747x_connect(struct adc *a, struct spi *spi, uint8_t cs, uint16_t gpio);
24 #define ADD_ADCS747X(_channelID) \
25  struct adc_adcs747x adcs747x_##_channelID = { \
26  ADC_INIT_DEV(adcs747x) \
27  HAL_NAME("TI ADCS747x Channel " #_channelID) \
28  .channelID = _channelID, \
29  };\
30  ADC_ADDDEV(adcs747x, adcs747x_##_channelID)
31 #define ADCS747X_ID(_channelID) HAL_GET_ID(adc, adcs747x, adcs747x_##_channelID)
32 #endif
spi.h
adc.h
adc_prv.h
OS_DEFINE_TASK
#define OS_DEFINE_TASK(name, stackSize)
Definition: os.h:52
adcs747x_connect
int32_t adcs747x_connect(struct adc *a, struct spi *spi, uint8_t cs, uint16_t gpio)
adc_generic
Definition: adc.h:45