Functions | |
struct seq_s * | seq_open (int type, int bustype) |
void | seq_close (struct seq_s *seq) |
int | seq_read (struct seq_s *seq, int fifoid, char *buffer, int length) |
int | seq_ioctl (struct seq_s *seq, int fifoid, int cmd, unsigned long arg) |
int | seq_setinstruction (struct seq_s *seq, const uint16_t *inst, uint16_t nr_insts) |
void | seq_setsample (struct seq_s *seq, uint8_t sample, uint8_t offset, uint8_t elemsize, bool swapbyte) |
void | seq_setaddress (struct seq_s *seq, uint32_t slave_addr) |
int | scu_spitransfer (int slavesel, uint16_t *inst, uint32_t nr_insts, uint8_t *buffer, int len) |
int | scu_i2ctransfer (int port, int slave, uint16_t *inst, uint32_t nr_insts, uint8_t *buffer, int len) |
void | scu_initialize (void) |
void | scu_uninitialize (void) |
struct seq_s * seq_open | ( | int | type, |
int | bustype | ||
) |
Open sequencer
[in] | type | : Sequencer type. Set one of the following definitions. |
[in] | bustype | : Bustype. Set one of the foollowing definitions. |
void seq_close | ( | struct seq_s * | seq | ) |
Close sequencer device
[in] | seq | : Sequencer instance |
int seq_read | ( | struct seq_s * | seq, |
int | fifoid, | ||
char * | buffer, | ||
int | length | ||
) |
Read sequencer FIFO data
[in] | seq | : Sequencer instance |
[in] | fifoid | : FIFO ID (decimator only) |
[out] | buffer | : Pointer to data receive buffer |
[in] | length | : Buffer length |
int seq_ioctl | ( | struct seq_s * | seq, |
int | fifoid, | ||
int | cmd, | ||
unsigned long | arg | ||
) |
Sequencer specific ioctl
This API should be called from each sensor driver ioctl().
[in] | seq | : Sequencer instance |
[in] | fifoid | : FIFO ID (decimator only) |
[in] | cmd | : ioctl commands (SCUIOC_*). |
[in,out] | arg | : Argument for each commands |
int seq_setinstruction | ( | struct seq_s * | seq, |
const uint16_t * | inst, | ||
uint16_t | nr_insts | ||
) |
Set cyclic sequencer instruction
[in] | seq | : Sequencer instance |
[in] | inst | : Pointer to instruction array |
[in] | nr_insts | : Number of instructions |
void seq_setsample | ( | struct seq_s * | seq, |
uint8_t | sample, | ||
uint8_t | offset, | ||
uint8_t | elemsize, | ||
bool | swapbyte | ||
) |
Set sample data format
[in] | seq | : Sequencer instance |
[in] | sample | : Bytes per sample |
[in] | offset | : Start offset of sampling data |
[in] | elemsize | : Bytes of 1 element in sample |
[in] | swapbyte | : Enable/Disable byte swapping |
void seq_setaddress | ( | struct seq_s * | seq, |
uint32_t | slave_addr | ||
) |
Set slave ID or address
[in] | seq | : An instance of sequencer |
[in] | slave_addr | : In SPI, slave select ID. In I2C, bus address. |
int scu_spitransfer | ( | int | slavesel, |
uint16_t * | inst, | ||
uint32_t | nr_insts, | ||
uint8_t * | buffer, | ||
int | len | ||
) |
SPI data transfer via sequencer.
This function use 'oneshot' feature on SCU. So user unnecessary to specify any opened sequencer. This function useful for accessing register directly.
[in] | slavesel | : Slave select |
[in] | inst | : Sequencer instruction |
[in] | nr_insts | : Number of instructions |
[out] | buffer | : Pointer to receive buffer, if no need to receive, then NULL. |
[in] | len | : buffer length (ignored when buffer is NULL), up to 16 bytes. |
int scu_i2ctransfer | ( | int | port, |
int | slave, | ||
uint16_t * | inst, | ||
uint32_t | nr_insts, | ||
uint8_t * | buffer, | ||
int | len | ||
) |
I2C data transfer via sequencer
This function use 'oneshot' feature on SCU. So user unnecessary to specify any opened sequencer. This function useful for accessing register directly.
[in] | port | : I2C port (0 or 1) |
[in] | slave | : Slave address |
[in] | inst | : Sequencer instruction |
[in] | nr_insts | : Number of instructions |
[out] | buffer | : Pointer to receive buffer, if no need to receive, then NULL. |
[in] | len | : buffer length (ignored when buffer is NULL), up to 16 bytes. |
void scu_initialize | ( | void | ) |
Initialize SCU
void scu_uninitialize | ( | void | ) |
Uninitialize SCU