*
* @return Result of operation
*/
- maa_result_t isr_exit() {
+ maa_result_t isrExit() {
return maa_gpio_isr_exit(m_gpio);
}
/**
*
* @return Char read from the bus
*/
- unsigned char read_byte() {
+ unsigned char readByte() {
return (unsigned char) maa_i2c_read_byte(m_i2c);
}
/**
* @param data The byte to send on the bus
* @return Result of operation
*/
- maa_result_t write_byte(const unsigned char data) {
+ maa_result_t write(const unsigned char data) {
return maa_i2c_write_byte(m_i2c, data);
}
private:
* @param length size of buffer to send
* @return char* data received on the miso line. Same length as passed in
*/
- unsigned char* write_buf(uint8_t* data, int length) {
+ unsigned char* write(uint8_t* data, int length) {
return (unsigned char*) maa_spi_write_buf(m_spi, data, length);
}
/**
* @param bits bits per word
* @return Result of operation
*/
- maa_result_t bit_per_word(unsigned int bits) {
+ maa_result_t bitPerWord(unsigned int bits) {
return maa_spi_bit_per_word(m_spi, bits);
}
private:
while (running == 0) {
i2c->address(HMC5883L_I2C_ADDR);
- i2c->write_byte(HMC5883L_DATA_REG);
+ i2c->write(HMC5883L_DATA_REG);
i2c->address(HMC5883L_I2C_ADDR);
i2c->read(rx_tx_buf, DATA_REG_SIZE);
int i;
for (i = 90; i < 130; i++) {
data[1] = i;
- recv = spi->write_buf(data, 2);
+ recv = spi->write(data, 2);
printf("Writing -%i",i);
printf("RECIVED-%i-%i\n",recv[0],recv[1]);
usleep(100000);
}
for (i = 130; i > 90; i--) {
data[1] = i;
- recv = spi->write_buf(data, 2);
+ recv = spi->write(data, 2);
printf("Writing -%i",i);
printf("RECIVED-%i-%i\n",recv[0],recv[1]);
usleep(100000);