38 #include <pruss_intc_mapping.h> 47 #include <sys/select.h> 51 #include <sys/types.h> 71 #define WAKEUP 0x02000000 72 #define STANDBY 0x04000000 73 #define RESET 0x06000000 74 #define START 0x08000000 75 #define STOP 0x0A000000 76 #define OFFSETCAL 0x1A000000 77 #define RDATAC 0x10000000 78 #define SDATAC 0x11000000 79 #define RDATA 0x12000000 80 #define RREG 0x20000000 81 #define WREG 0x40000000 87 #define CONFIG1 0x01000000 88 #define CONFIG2 0x02000000 89 #define CONFIG3 0x03000000 90 #define CH1SET 0x05000000 91 #define CH2SET 0x06000000 92 #define CH3SET 0x07000000 93 #define CH4SET 0x08000000 94 #define CH5SET 0x09000000 95 #define CH6SET 0x0A000000 96 #define CH7SET 0x0B000000 97 #define CH8SET 0x0C000000 104 #define GAIN12 0x6000 120 #define CONFIG1DEFAULT 0x9000 121 #define CONFIG2DEFAULT 0xE000 122 #define CONFIG3DEFAULT 0xE800 127 #define MMAP_FILE "/sys/class/uio/uio0/maps/map1/" 128 #define PRU_CODE "/lib/firmware/rocketlogger_spi.bin" 137 #define PRECISION_HIGH 24 138 #define PRECISION_LOW 16 147 #define VALID_MASK 0x1 148 #define BINARY_MASK 0xE 152 #define PRU_TIMEOUT 3 164 #define NUMBER_ADC_COMMANDS 12 198 uint32_t avg_factor);
int pru_wait_event_timeout(unsigned int event, unsigned int timeout)
rl_pru_state state
Current PRU state.
#define NUMBER_ADC_COMMANDS
Number of ADC commands.
int pru_sample(FILE *data, FILE *ambient_file, struct rl_conf *conf, char *file_comment)
enum pru_state rl_pru_state
Continuous sampling mode.
uint32_t buffer_size
Shared buffer size.
uint32_t number_commands
Number of ADC commands to send.
uint32_t sample_limit
Samples to take (0 for continuous)
uint32_t sample_size
Sample size in shared memory.
int pru_data_setup(struct pru_data_struct *pru, struct rl_conf *conf, uint32_t avg_factor)
uint32_t precision
ADC precision (in bit)
void pru_set_state(rl_pru_state state)
uint32_t buffer0_location
Pointer to shared buffer 0.
uint32_t buffer1_location
Pointer to shared buffer 1.
uint32_t commands[NUMBER_ADC_COMMANDS]
ADC commands to send.
void * pru_wait_event(void *voidEvent)