Loading...
Searching...
No Matches
devicelist.h
1
5
6// ALLOW FORMATTING
7#ifndef _DEVICELIST_H
8#define _DEVICELIST_H
9
16
17typedef struct {
18 char *deviceName; // Name of device
19 void *device; // Pointer to device struct
21
22typedef enum {
23 DEVICE_ACCEL_HIGH, // High range accelerometer
24 DEVICE_ACCEL_LOW, // Low range accelerometer
25 DEVICE_ACCEL, // Current accelerometer
26 DEVICE_GYRO, // Gyroscope
27 DEVICE_BARO, // Barometer
28 DEVICE_FLASH, // Flash storage
29 DEVICE_LORA, // LoRa transceiver
30 DEVICE_GPS, // GPS module
31 DEVICE_UART_USB, // UART via FTDI
32 DEVICE_MAX_KEYS
33} DeviceKey;
34
35void DeviceList_init(DeviceHandle_t deviceList[DEVICE_MAX_KEYS]);
40
41#endif
42
void DeviceList_init(DeviceHandle_t deviceList[DEVICE_MAX_KEYS])
Initialise all system devices.
Definition devicelist.c:23
DeviceHandle_t DeviceList_getDeviceHandleFromName(char *)
Retrieve device handle from list by name.
Definition devicelist.c:55
DeviceHandle_t DeviceList_getDeviceHandle(DeviceKey)
Retrieve device handle from list by key.
Definition devicelist.c:36
void DeviceList_printDevices()
Print out names of all devices in list.
Definition devicelist.c:101
DeviceHandle_t * DeviceList_getDeviceHandlePointer(DeviceKey)
Retrieve device handle pointer from list by key.
Definition devicelist.c:86