You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.2 KiB

/* vim: set ts=4 sw=4 et fdm=marker: */
#ifndef __BSP_API___
#define __BSP_API___
#include <vxWorks.h>
#ifdef __cplusplus
extern "C" {
#endif
/* {{{ SM2130 */
#define __SM2130__IOC_MAGIC ('S' << 16)
#define XFER_TYPE_WR (1)
#define XFER_TYPE_RD (2)
#define FIOC_SM2130_WR (__SM2130__IOC_MAGIC | XFER_TYPE_WR)
#define FIOC_SM2130_RD (__SM2130__IOC_MAGIC | XFER_TYPE_RD)
#define FIOC_SM2130_MEM (__SM2130__IOC_MAGIC | (XFER_TYPE_WR + XFER_TYPE_RD))
struct sm2130_xfer {
UINT8 reg;
UINT16 val;
};
typedef struct sm2130_xfer SM2130_XFER;
struct sm2130_xfer_mem {
int type;
int count;
UINT8 *regbuf;
UINT16 *membuf;
};
typedef struct sm2130_xfer_mem SM2130_MEM_XFER;
/* }}} */
/* {{{ spidev FIO_SPIXFER msgs */
#define FIO_XFER_TX (1 << 0)
#define FIO_XFER_RX (1 << 1)
#define FIO_XFER_DUPLEX ((FIO_XFER_TX) | (FIO_XFER_RX))
/* ioctl */
#define FIO_SPIXFER (('P' << 16) | 0x1001)
struct spi_xfer {
int len;
int xferDir;
UINT8 *txbuf;
UINT8 *rxbuf;
};
struct spi_xfer_msg {
int count;
struct spi_xfer *xfer;
};
/* }}} */
/* functions */
int envInit();
int bspLoadUserApp();
int updateVxWorks(const char *file, int pos);
#ifdef __cplusplus
}
#endif
#endif