Contiki 3.x
|
Platform specific functions for LIS3DH accelerometer on the Mulle platform.More...
#include "lis3dh.h"
#include "K60.h"
#include "interrupt.h"
#include "power-control.h"
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Functions | |
void | lis3dh_write_byte (const lis3dh_reg_addr_t addr, const uint8_t value) |
Write a single byte to the LIS3DH. More... | |
uint8_t | lis3dh_read_byte (const lis3dh_reg_addr_t addr) |
Read a single byte from the LIS3DH. More... | |
int16_t | lis3dh_read_int16 (const lis3dh_reg_addr_t lsb_addr) |
Read a 16-bit integer from the LIS3DH. More... | |
void | lis3dh_memcpy_from_device (const lis3dh_reg_addr_t start_address, uint8_t *buffer, uint8_t count) |
Read multiple bytes from the LIS3DH. More... | |
void | lis3dh_memcpy_to_device (const lis3dh_reg_addr_t start_address, const uint8_t *buffer, uint8_t count) |
Write multiple bytes to the LIS3DH. More... | |
void | lis3dh_arch_init () |
Perform the platform specific part of the initialization process of the LIS3DH. More... | |
Platform specific functions for LIS3DH accelerometer on the Mulle platform.
Definition in file lis3dh-arch.c.
void lis3dh_arch_init | ( | ) |
Perform the platform specific part of the initialization process of the LIS3DH.
This function is expected to set up the SPI module for the LIS3DH.
Definition at line 231 of file lis3dh-arch.c.
References PORTD, SIM, and SPI0.
Referenced by lis3dh_init().
void lis3dh_memcpy_from_device | ( | const lis3dh_reg_addr_t | start_address, |
uint8_t * | buffer, | ||
uint8_t | count | ||
) |
Read multiple bytes from the LIS3DH.
start_address | The lower address of the source registers. |
buffer | A buffer to write the read values into. |
count | Number of bytes to read. |
Definition at line 160 of file lis3dh-arch.c.
References LIS3DH_SPI_ADDRESS_MASK, LIS3DH_SPI_MULTI_MASK, and LIS3DH_SPI_READ_MASK.
Referenced by lis3dh_read_xyz().
void lis3dh_memcpy_to_device | ( | const lis3dh_reg_addr_t | start_address, |
const uint8_t * | buffer, | ||
uint8_t | count | ||
) |
Write multiple bytes to the LIS3DH.
start_address | The lower address of the target registers. |
buffer | A buffer to read the values from. |
count | Number of bytes to write. |
Definition at line 197 of file lis3dh-arch.c.
References LIS3DH_SPI_ADDRESS_MASK, and LIS3DH_SPI_MULTI_MASK.
uint8_t lis3dh_read_byte | ( | const lis3dh_reg_addr_t | addr | ) |
Read a single byte from the LIS3DH.
addr | The source register. |
Definition at line 109 of file lis3dh-arch.c.
References LIS3DH_SPI_ADDRESS_MASK, LIS3DH_SPI_READ_MASK, and LIS3DH_SPI_SINGLE_MASK.
Referenced by lis3dh_clear_bits(), lis3dh_init(), lis3dh_set_bits(), and lis3dh_write_bits().
int16_t lis3dh_read_int16 | ( | const lis3dh_reg_addr_t | lsb_addr | ) |
Read a 16-bit integer from the LIS3DH.
lsb_addr | The lower address of the two source registers. |
Definition at line 127 of file lis3dh-arch.c.
References LIS3DH_SPI_ADDRESS_MASK, LIS3DH_SPI_MULTI_MASK, and LIS3DH_SPI_READ_MASK.
Referenced by lis3dh_read_aux_adc1(), lis3dh_read_aux_adc2(), lis3dh_read_aux_adc3(), lis3dh_read_xaxis(), lis3dh_read_yaxis(), and lis3dh_read_zaxis().
void lis3dh_write_byte | ( | const lis3dh_reg_addr_t | addr, |
const uint8_t | value | ||
) |
Write a single byte to the LIS3DH.
addr | The target register. |
value | The value to write. |
Definition at line 95 of file lis3dh-arch.c.
References LIS3DH_SPI_ADDRESS_MASK, and LIS3DH_SPI_SINGLE_MASK.
Referenced by lis3dh_clear_bits(), lis3dh_init(), lis3dh_set_bits(), and lis3dh_write_bits().