18 #ifndef __BBBANDROIDHAL_H__
19 #define __BBBANDROIDHAL_H__
26 extern int openBBBAndroidHAL(
void);
27 extern int closeBBBAndroidHAL(
void);
30 extern int openGPIO(
const int useMmap);
31 extern int readGPIO(
const unsigned int header,
const unsigned int pin);
32 extern int writeGPIO(
const unsigned int header,
const unsigned int pin,
33 const unsigned int value);
37 extern int pwmSetPeriod(
const uint8_t channel,
const uint32_t period_ns);
39 extern int pwmSetDutyCycle(
const uint8_t channel,
const uint32_t duration_ns);
41 extern int pwmSetPolarity(
const uint8_t channel,
const uint8_t polarity);
43 extern int pwmRun(
const uint8_t channel);
44 extern int pwmStop(
const uint8_t channel);
48 extern int readADC(
const uint8_t channel);
52 extern int i2cSetSlave(
const int i2cFD,
const uint8_t address);
53 extern void i2cClose(
const int i2cFD);
55 extern int i2cWriteByte(
const int i2cFD,
const uint8_t add,
const uint8_t byte);
56 extern int i2cWriteBytes(
const int i2cFD,
const uint8_t add,
const int length,
const uint8_t *bytes);
57 extern int i2cReadByte(
const int i2cFD,
const uint8_t add);
58 extern int i2cReadBytes(
const int i2cFD,
const uint8_t add,
const int length, uint8_t *buff);
61 extern int spiTransfer(
const int spiFD,
const uint8_t tx[],
const uint8_t rx[],
const int len);
62 extern int spiOpen(
const uint8_t bus,
const uint8_t device,
const uint32_t speed,
const uint8_t mode,
const uint8_t bpw);
63 extern int spiReadByte(
const int spiFD,
const uint8_t regAdd);
64 extern unsigned char*
spiReadBytes(
const int spiFD,
const int len,
const uint8_t startAdd);
65 extern int spiWriteRegByte(
const int spiFD,
const uint8_t regAdd,
const uint8_t data);
66 extern int spiWriteBytes(
const int spiFD,
const uint8_t data[],
const int len);
67 extern int spiSetMode(
const int spiFD,
const uint8_t mode);
68 extern int spiSetSpeed(
const int spiFD,
const uint32_t speed);
70 extern void spiClose(
const int spiFD);
73 extern int canOpenSocket(
const int socket_type,
const int protocol);
75 extern unsigned char*
canReadBytes(
const int fd,
int *length);
76 extern int canSendBytes(
const int canFD,
const int no_bytes,
const uint8_t data[]);
77 extern void canClose(
const int canFD);
80 extern int uartOpen(
const uint8_t device,
const uint32_t bdrate);
81 extern int uartWrite(
const int uartFD,
const int length,
const uint8_t *bytes);
82 extern int uartRead(
const int uartFD,
const int length, uint8_t *bytes);
88 extern int usbGetDevices(
int ids[][8],
unsigned char strings[][3][256]);
int uartRead(const int uartFD, const int length, uint8_t *bytes)
Definition: uart.c:146
int writeGPIO(const unsigned int header, const unsigned int pin, const unsigned int value)
Definition: gpio.c:361
int pwmSetDutyCycle(const uint8_t channel, const uint32_t duration_ns)
Definition: pwm.c:84
int spiSetBitsPerWord(const int spiFD, const uint8_t bpw)
Definition: spi.c:195
int pwmStop(const uint8_t channel)
Definition: pwm.c:217
int i2cWriteByte(const int i2cFD, const uint8_t add, const uint8_t byte)
Definition: i2c.c:90
int pwmRunCheck(const uint8_t channel)
Definition: pwm.c:243
int readADC(const uint8_t channel)
Definition: adc.c:30
void i2cClose(const int i2cFD)
Definition: i2c.c:178
int i2cSetSlave(const int i2cFD, const uint8_t address)
Definition: i2c.c:53
int pwmGetPolarity(const uint8_t channel)
Definition: pwm.c:164
int canOpenRaw(const char *port)
Definition: can.c:61
int pwmSetPolarity(const uint8_t channel, const uint8_t polarity)
Definition: pwm.c:138
void spiClose(const int spiFD)
Definition: spi.c:246
int pwmRun(const uint8_t channel)
Definition: pwm.c:191
ssize_t usbInit()
Definition: usb.c:30
int canOpenSocket(const int socket_type, const int protocol)
Definition: can.c:40
unsigned char * canReadBytes(const int fd, int *length)
Definition: can.c:93
void canClose(const int canFD)
Definition: can.c:165
int pwmGetDutyCycle(const uint8_t channel)
Definition: pwm.c:110
int i2cReadBytes(const int i2cFD, const uint8_t add, const int length, uint8_t *buff)
Definition: i2c.c:160
void closeGPIO(void)
Definition: gpio.c:396
int i2cOpenAdaptor(const uint8_t adaptorNumber)
Definition: i2c.c:29
int spiSetSpeed(const int spiFD, const uint32_t speed)
Definition: spi.c:172
int usbGetDevices(int ids[][8], unsigned char strings[][3][256])
Definition: usb.c:57
int i2cWriteBytes(const int i2cFD, const uint8_t add, const int length, const uint8_t *bytes)
Definition: i2c.c:115
int spiOpen(const uint8_t bus, const uint8_t device, const uint32_t speed, const uint8_t mode, const uint8_t bpw)
Definition: spi.c:221
int pwmSetPeriod(const uint8_t channel, const uint32_t period_ns)
Definition: pwm.c:30
void usbClose()
Definition: usb.c:162
unsigned char * spiReadBytes(const int spiFD, const int len, const uint8_t startAdd)
Definition: spi.c:88
int uartOpen(const uint8_t device, const uint32_t bdrate)
Definition: uart.c:78
int i2cSetAddress(const int i2cFD, const uint8_t add)
Definition: i2c.c:71
int spiWriteRegByte(const int spiFD, const uint8_t regAdd, const uint8_t data)
Definition: spi.c:111
int readGPIO(const unsigned int header, const unsigned int pin)
Definition: gpio.c:320
void uartClose(const int uartFD)
Definition: uart.c:161
int canSendBytes(const int canFD, const int no_bytes, const uint8_t data[])
Definition: can.c:139
int spiReadByte(const int spiFD, const uint8_t regAdd)
Definition: spi.c:65
int spiWriteBytes(const int spiFD, const uint8_t data[], const int len)
Definition: spi.c:132
int openGPIO(const int useMmap)
Definition: gpio.c:169
int pwmGetPeriod(const uint8_t channel)
Definition: pwm.c:56
int spiSetMode(const int spiFD, const uint8_t mode)
Definition: spi.c:149
int uartWrite(const int uartFD, const int length, const uint8_t *bytes)
Definition: uart.c:127
int spiTransfer(const int spiFD, const uint8_t tx[], const uint8_t rx[], const int len)
Definition: spi.c:39
int i2cReadByte(const int i2cFD, const uint8_t add)
Definition: i2c.c:135