34#define MS2100_DIVISOR_128 2
35#define MS2100_DIVISOR_256 3
36#define MS2100_DIVISOR_512 4
37#define MS2100_DIVISOR_1024 5
40#define MS2100_DIVISOR MS2100_DIVISOR_1024
60 ms->req_trans.slave_idx = slave_idx;
62 ms->req_trans.output_buf =
ms->req_buf;
63 ms->req_trans.output_length = 1;
64 ms->req_trans.input_buf =
NULL;
65 ms->req_trans.input_length = 0;
77 ms->read_trans.slave_idx = slave_idx;
79 ms->read_trans.output_buf =
NULL;
80 ms->read_trans.output_length = 0;
81 ms->read_trans.input_buf =
ms->read_buf;
82 ms->read_trans.input_length = 2;
83 ms->read_trans.before_cb =
NULL;
84 ms->read_trans.after_cb =
NULL;
103#define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))
132 if (
ms->cur_axe > 2) {
#define INT_VECT3_ZERO(_v)
enum SPIStatus status
internal state of the peripheral
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
@ SPICpolIdleLow
CPOL = 0.
@ SPISelectUnselect
slave is selected before transaction and unselected after
SPI peripheral structure.
void ms2100_event(struct Ms2100 *ms)
void ms2100_init(struct Ms2100 *ms, struct spi_periph *spi_p, uint8_t slave_idx)
void ms2100_read(struct Ms2100 *ms)
send request to read next axis
#define Int16FromBuf(_buf, _idx)
Driver for the ms2100 magnetic sensor from PNI.
struct spi_periph * spi_p
void ms2100_arch_init(void)
void ms2100_reset_cb(struct spi_transaction *t)
Reset callback.
Architecture independent SPI (Serial Peripheral Interface) API.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.