CrossWorks Device Library

Size: px
Start display at page:

Download "CrossWorks Device Library"

Transcription

1 Version: Rowley Associates Limited

2 2

3 Contents Contents Protocol API Reference <ctl_bus.h> CTL_PARALLEL_BUS_t ctl_bus_lock ctl_bus_lock_ex ctl_bus_read ctl_bus_read_bit ctl_bus_set_direction ctl_bus_set_input_mode ctl_bus_set_output_mode ctl_bus_unlock ctl_bus_write ctl_bus_write_bit ctl_bus_write_bits ctl_parallel_bus_initialize <ctl_i2c.h> CTL_I2C_BUS_t CTL_I2C_FAST_MODE_PLUS_SPEED CTL_I2C_FAST_MODE_SPEED CTL_I2C_REQUEST_t CTL_I2C_STANDARD_SPEED ctl_i2c_lock_bus

4 Contents ctl_i2c_lock_bus_ex ctl_i2c_read ctl_i2c_set_speed ctl_i2c_unlock_bus ctl_i2c_write ctl_i2c_write_read <ctl_spi.h> CTL_SPI_BUS_t CTL_SPI_DEVICE_t CTL_SPI_EXCHANGE_FN_t CTL_SPI_MODE_t CTL_SPI_PROTOCOL_t CTL_SPI_SET_PROTOCOL_FN_t ctl_spi_attach_device ctl_spi_deselect_device ctl_spi_detach_device ctl_spi_exchange ctl_spi_get ctl_spi_issue_deselected_clocks ctl_spi_lock_bus ctl_spi_lock_bus_ex ctl_spi_put ctl_spi_put_get ctl_spi_read ctl_spi_select_device ctl_spi_set_idle ctl_spi_set_mode ctl_spi_set_protocol ctl_spi_set_speed ctl_spi_set_width ctl_spi_unlock_bus ctl_spi_write <ctl_sensors.h> CTL_ACCELEROMETER_t CTL_AXIS_TRANSFORMATION CTL_GYROSCOPE_t CTL_HUMIDITY_SENSOR_t CTL_IMU_t CTL_LIGHT_SENSOR_t CTL_MAGNETOMETER_t CTL_PRESSURE_SENSOR_t

5 Contents CTL_TEMPERATURE_SENSOR_t ctl_accelerometer_measure ctl_accelerometer_set_bandwidth ctl_accelerometer_set_range ctl_forward_transform_axes ctl_generate_axis_transform ctl_gyroscope_measure ctl_gyroscope_set_bandwidth ctl_gyroscope_set_range ctl_humidity_sensor_measure ctl_light_sensor_measure ctl_magnetometer_measure ctl_magnetometer_set_bandwidth ctl_pressure_sensor_measure ctl_temperature_sensor_measure ctl_temperature_sensor_set_resolution <ctl_transport.h> CTL_TRANSPORT_BUS_t CTL_TRANSPORT_t ctl_transport_initialize_i2c ctl_transport_initialize_spi ctl_transport_lock ctl_transport_read_16b_register ctl_transport_read_24b_register ctl_transport_read_32b_register ctl_transport_read_8b_register ctl_transport_read_registers ctl_transport_read_registers_fail ctl_transport_read_registers_i2c ctl_transport_rmw_16b_register ctl_transport_rmw_24b_register ctl_transport_rmw_32b_register ctl_transport_rmw_8b_register ctl_transport_unlock ctl_transport_write_16b_register ctl_transport_write_24b_register ctl_transport_write_32b_register ctl_transport_write_8b_register ctl_transport_write_registers ctl_transport_write_registers_fail ctl_transport_write_registers_i2c

6 Contents <ctl_uart.h> ctl_uart_getc ctl_uart_getc_nb ctl_uart_putc ctl_uart_puts Device API Reference Analog <adc101s021.h> adc101s021_init adc101s021_measure_raw <ltc2309.h> LTC2309_I2C_ADDR ltc2309_init_i2c ltc2309_sample_differential_bipolar ltc2309_sample_differential_unipolar ltc2309_sample_single_ended_bipolar ltc2309_sample_single_ended_unipolar Digital <mcp23016.h> MCP23016_I2C_ADDR mcp23016_initialize_i2c <mcp23x08.h> MCP23008_I2C_ADDR mcp23x08_initialize_i2c mcp23x08_initialize_spi <mcp23x17.h> MCP23017_I2C_ADDR mcp23x17_initialize_i2c mcp23x17_initialize_spi <pca9532.h> PCA9532_I2C_ADDR pca9532_initialize_i2c pca9532_led_mode pca9532_set_duty_cycle pca9532_set_led_mode pca9532_set_pwm_frequency <pca9672.h> pca9672_initialize_i2c <pcf8575.h> PCF8575_I2C_ADDR pcf8575_initialize_i2c

7 Contents Clock <ltc6904.h> LTC6904_I2C_ADDR_ADR LTC6904_I2C_ADDR_ADR LTC6904_MODE_CLK_OFF_nCLK_ON LTC6904_MODE_CLK_ON_nCLK_OFF LTC6904_MODE_CLK_ON_nCLK_ON LTC6904_MODE_POWER_DOWN LTC6904_OSCILLATOR_t ltc6904_get_selected_frequency ltc6904_init_i2c ltc6904_set_frequency ltc6904_set_mode Environmental <adt7410.h> ADT7410_I2C_ADDR adt7410_initialize_i2c <bmp085.h> BMP085_BAROMETER_t BMP085_I2C_ADDR bmp085_initialize_i2c bmp085_set_resolution <dht.h> dht_read_humidity <hih6130.h> HIH6130_I2C_ADDR hih6130_initialize_i2c <isl29023.h> ISL29023_DRIVER_t ISL29023_I2C_ADDR isl29023_initialize_i2c isl29023_set_range isl29023_set_resolution_bits <lm75.h> LM75_I2C_ADDR lm75_initialize_i2c lm75_initialize_i2c_ex <lps331ap.h> LPS331AP_I2C_ADDR lps331ap_initialize_i2c <ltr501als.h>

8 Contents LTR501ALS_I2C_ADDR ltr501als_initialize_i2c <max6675.h> max6675_initialize_spi <mpl115a.h> MPL115A2_I2C_ADDRESS mpl115a_initialize_i2c mpl115a_initialize_spi <mpl3115a2.h> MPL3115A2_I2C_ADDRESS mpl3115a2_initialize_i2c <sht1x.h> SHT1X_HIGH_RESOLUTION SHT1X_LOW_RESOLUTION sht1x_initialize sht1x_read_linear_humidity sht1x_read_raw_humidity sht1x_read_raw_temperature sht1x_read_status sht1x_read_temperature sht1x_read_true_humidity sht1x_set_resolution sht1x_set_supply_voltage sht1x_soft_reset sht1x_write_status <sht2x.h> SHT2x_I2C_ADDR SHT2x_RESOLUTION_t sht2x_get_resolution sht2x_initialize_i2c sht2x_read_user sht2x_set_resolution sht2x_write_user <si7005.h> SI7005_I2C_ADDR si7005_initialize_i2c <tmp100.h> TMP100_I2C_ADDR tmp100_initialize_i2c <tmp102.h> TMP102_I2C_ADDR

9 Contents TMP275_I2C_ADDR tmp102_initialize_i2c tmp102_set_extended_mode <tsl2561.h> TSL2561_DRIVER_t TSL2561_I2C_ADDR_FLOAT TSL2561_I2C_ADDR_GND TSL2561_I2C_ADDR_VDD tsl2561_initialize_i2c tsl2561_set_integration_time HMI <ads7846.h> ads7846_init <hd44780.h> HD44780_4BIT_INTERFACE HD44780_ANSI_DRIVER_t HD44780_BIDIRECTIONAL_DBUS HD44780_DRIVER_t hd44780_ansi_init hd44780_clear hd44780_cursor_off hd44780_cursor_on hd44780_display_off hd44780_display_on hd44780_putc hd44780_puts hd44780_reset hd44780_send_cmd hd44780_set_backlight hd44780_set_cursor_position hd44780_write <mpr121.h> MPR121_ADDRESS_SCL MPR121_ADDRESS_SDA MPR121_ADDRESS_VDD MPR121_ADDRESS_VSS <wii_controller.h> WII_CLASSIC_REPORT_t WII_NUNCHUK_REPORT_t wii_classic_sample wii_extension_controller_initialize

10 Contents wii_extension_controller_read_memory wii_extension_controller_write_memory_byte wii_nunchuk_accelerometer_interface wii_nunchuk_sample Magnetics <ak8975.h> AK8975_I2C_ADDR ak8975_initialize_i2c ak8975_initialize_transport <bmm150.h> BMM150_I2C_ADDR bmm150_initialize_i2c bmm150_initialize_spi <fxos8700cq.h> FXOS8700CQ_I2C_ADDR FXOS8700CQ_t fxos8700cq_initialize_i2c <hmc5843.h> HMC5843_I2C_ADDR hmc5843_initialize_i2c <hmc5883l.h> HMC5883L_I2C_ADDR hmc5883l_initialize_i2c hmc5883l_initialize_transport <hmc6343.h> HMC6343_I2C_ADDR hmc6343_read_heading <hmc6352.h> HMC6352_I2C_ADDR hmc6352_read_heading <mag3110.h> MAG3110_I2C_ADDR mag3110_initialize_i2c mag3110_read_die_temperature mag3110_set_oversampling_ratio Motion <adxl345.h> ADXL345_I2C_ADDR_ALTERNATE ADXL345_I2C_ADDR_DEFAULT adxl345_initialize_i2c adxl345_initialize_spi

11 Contents <adxl362.h> adxl362_initialize_spi <atavrsbin1.h> ATAVRSBIN1_t atavrsbin1_initialize_i2c <atavrsbin2.h> ATAVRSBIN2_t atavrsbin2_initialize_i2c <bma150.h> BMA150_I2C_ADDR bma150_initialize_i2c bma150_initialize_spi bma150_read_chip_id bma150_read_die_temperature bma150_soft_reset <bma250.h> BMA250_I2C_ADDR bma250_initialize_i2c bma250_initialize_spi bma250_read_chip_id bma250_read_die_temperature <imu3000.h> IMU3000_I2C_ADDR imu3000_initialize_i2c imu3000_read_die_temperature <imu3000_combo.h> IMU3000_COMBO_t imu3000_combo_initialize_i2c <itg3200.h> ITG3200_I2C_ADDR itg3200_initialize_i2c itg3200_read_die_temperature <kxp84.h> KXP84_I2C_ADDR kxp84_initialize_i2c kxp84_initialize_spi <kxtf9.h> KXTF9_I2C_ADDR kxtf9_initialize_i2c <l3g4200d.h> L3G4200D_I2C_ADDR

12 Contents l3g4200d_initialize_i2c <l3gd20.h> L3GD20_I2C_ADDR l3gd20_initialize_i2c <lis302dl.h> LIS302DL_I2C_ADDR lis302dl_initialize_i2c lis302dl_initialize_spi <lis331dlh.h> LIS331DLH_I2C_ADDR lis331dlh_initialize_i2c lis331dlh_initialize_spi <lis331hh.h> LIS331HH_I2C_ADDR lis331hh_initialize_i2c lis331hh_initialize_spi <lis3dsh.h> LIS3DSH_I2C_ADDR lis3dsh_initialize_i2c lis3dsh_initialize_spi <lis3lv02dl.h> LIS3LV02DL_I2C_ADDR lis3lv02dl_initialize_i2c lis3lv02dl_initialize_spi <mma7455l.h> MMA7455_I2C_ADDR mma7455l_initialize_i2c mma7455l_initialize_spi <mma7660fc.h> MMA7660FC_I2C_ADDR mma7660fc_initialize_i2c <mma845xq.h> MMA8451Q_I2C_ADDR mma8451q_initialize_i2c <mma8491q.h> MMA8491Q_I2C_ADDR mma8491q_initialize_i2c <mpu6000.h> MPU6000_I2C_ADDR MPU6000_t mpu6000_aux_transport_setup

13 Contents mpu6000_initialize_i2c mpu6000_initialize_spi mpu6000_read_die_temperature mpu6000_revision <sca3000.h> sca3000_initialize_i2c sca3000_initialize_spi

14 Contents 14

15 The contains pre-written, tested device driver software to interact with a range of common sensors and devices. This library will be extended over time, as more devices become available and are considered for inclusion in the library. The device library is split into two parts: Protocol API: provides an abstract interface to common industry protocols, such as I2C and SPI, along with an API for generic sensor functions. Device API: provides specific device implementations for the generic sensor functions and drivers for unique or special devices. Architecture The is one part of the CrossWorks Target Library. Many of the low-level functions provided by the target library are built using features of the CrossWorks Tasking Library for multi-threaded operation. Delivery format The is delivered in source form. License The source files in this package are not public domain and are not open source. They represent a substantial investment undertaken by Rowley Associates to assist CrossWorks customers in prototyping solutions using well-written, tested drivers. 15

16 If you hold a paid-for CrossWorks Version 3 or later commercial license, you are free to compile this package and incorporate the resulting object code in your own products without royalties and without additional license fees. Customers holding a CrossWorks Version 1 or 2 commercial license are required to upgrade to CrossWorks Version 3 to use this software. If you hold a paid-for CrossWorks Version 3 or later non-commercial license, you are free to compile this package and incorporate the resulting object code in your own projects, for your own use, without royalties and without additional license fees. You are, however, prohibited from distributing the linked code, incorporating the object code from this library, in binary form. Customers holding a CrossWorks Version 1 or 2 non-commercial license are required to purchase CrossWorks Version 3 to use this software. Feedback This facility is a work in progress and may undergo rapid change. If you have comments, observations, suggestions, or problems, please feel free to air them on the CrossWorks Target and Platform API discussion forum. 16

17 <ctl_bus.h> Overview Abstract parallel digital bus. The types and functions in <ctl_i2c.h> provide a high-level set of services that implement a parallel bus. The provides drivers for the following devices that implement a parallel bus but are connected using I2C or SPI: MCP23x08 MCP23016 MCP23x17 PCF8575 PCA9672 API Summary Bus CTL_PARALLEL_BUS_t ctl_bus_lock ctl_bus_lock_ex ctl_bus_unlock ctl_parallel_bus_initialize Configuration ctl_bus_set_direction ctl_bus_set_input_mode ctl_bus_set_output_mode I/O ctl_bus_read ctl_bus_read_bit ctl_bus_write ctl_bus_write_bit ctl_bus_write_bits Abstract parallel bus interface Acquire exclusive bus lock Acquire exclusive bus lock (extended) Release exclusive bus lock Initialize structure Set bus input-output direction Set selected bus bits to input direction Set selected bus bits to output direction Read entire bus Read a single bit from bus Write entire bus output Write a single bit to bus Write bits to bus through a mask 17

18 CTL_PARALLEL_BUS_t typedef struct { CTL_TRANSPORT_t transport; CTL_STATUS_t (*set_direction)(ctl_parallel_bus_s *, unsigned); CTL_STATUS_t (*write)(ctl_parallel_bus_s *, unsigned); CTL_STATUS_t (*read)(ctl_parallel_bus_s *); CTL_MUTEX_t *mutex; unsigned width; unsigned output; unsigned direction; unsigned mask; } CTL_PARALLEL_BUS_t; CTL_PARALLEL_BUS_t contains the bus state and methods that implement a parallel bus. Clients that use the parallel bus should consider all data in this structure private. Structure transport Underlying transport for parallel buses realized by I2C or SPI devices. set_direction Method to set the bus direction. write Method to set the bus pins. read Method to read the bus pins. width The bus width, in bits. output The bus output state. direction The bus direction. mask The bus mask corresponding to width. 18

19 ctl_bus_lock void ctl_bus_lock(ctl_parallel_bus_t *self); ctl_bus_lock acquires the bus lock mutex of the bus self. If there is no mutex associated with the bus self, ctl_bus_lock returns immediately indicating success. All locks of the bus by ctl_bus_lock must be paired with a call to ctl_bus_unlock to release the lock. Note Because mutexes can be locked multiple times, you can use ctl_bus_lock to acquire the bus to issue a sequence of transactions to the bus that cannot be interrupted by another task. See Also ctl_bus_unlock, ctl_bus_lock_ex 19

20 ctl_bus_lock_ex unsigned ctl_bus_lock_ex(ctl_parallel_bus_t *self, CTL_TIMEOUT_t type, CTL_TIME_t time); ctl_bus_lock_ex acquires the bus lock mutex of the bus self using the timeout specified with type and time. If there is no mutex associated with the bus self, ctl_bus_lock_ex returns immediately indicating success. ctl_bus_lock_ex returns a non-zero value if the mutex is acquired within the timeout specification and zero if it is not. All successful locks of the bus by ctl_bus_lock_ex must be paired with a call to ctl_bus_unlock to release the lock. See Also ctl_bus_unlock_bus, ctl_bus_lock 20

21 ctl_bus_read CTL_STATUS_t ctl_bus_read(ctl_parallel_bus_t *self); ctl_bus_read reads the state of the bus self. Note that reading bits configured as output is highly device dependent and the effect of doing so is not specified by this interface. Thread Safety ctl_bus_read is thread-safe if a mutex is associated with the bus self. 21

22 ctl_bus_read_bit CTL_STATUS_t ctl_bus_read_bit(ctl_parallel_bus_t *self, unsigned bit); ctl_bus_read_bit reads bit number bit from the bus self. Return Value ctl_bus_read_bit returns an extended status code: 0 if the port bit is low, 1 if the port bit is high, and a negative value indicating an error. Thread Safety ctl_bus_read_bit is thread-safe if a mutex is associated with the bus self. 22

23 ctl_bus_set_direction CTL_STATUS_t ctl_bus_set_direction(ctl_parallel_bus_t *self, unsigned direction); ctl_bus_set_direction configures the entire bus for input mode or output mode. A bit set to one in direction sets the corresponding bus bit to input mode, and a bit set to zero in direction sets the corresponding bus bit to output mode. The state of the bus outputs corresponding to direction is indeterminate after setting the bus direction. Return Value ctl_bus_set_direction returns a standard status code. Thread Safety ctl_bus_set_direction is thread-safe if a mutex is associated with the bus self. 23

24 ctl_bus_set_input_mode CTL_STATUS_t ctl_bus_set_input_mode(ctl_parallel_bus_t *self, unsigned mask); ctl_bus_set_input_mode sets all corresponding one-bits in mask to input mode for the bus self. If a bit is zero in mask, the input-output direction of that bit is unchanged. Return Value ctl_bus_set_input_mode returns a standard status code. Thread Safety ctl_bus_set_input_mode is thread-safe if a mutex is associated with the bus self. 24

25 ctl_bus_set_output_mode CTL_STATUS_t ctl_bus_set_output_mode(ctl_parallel_bus_t *self, unsigned mask); ctl_bus_set_output_mode sets all corresponding one-bits in mask to output mode for the bus self. If a bit is zero in mask, the input-output direction of that bit is unchanged. The state of bus outputs for bits that are changed from input mode to output mode is undefined after setting the bus direction. Return Value ctl_bus_set_output_mode returns a standard status code. Thread Safety ctl_bus_set_output_mode is thread-safe if a mutex is associated with the bus self. 25

26 ctl_bus_unlock void ctl_bus_unlock(ctl_parallel_bus_t *self); ctl_bus_unlock releases a mutex that was successfully locked using ctl_bus_lock. If there is no mutex associated with the bus self, ctl_bus_unlock returns immediately. It is an error to release a lock that was not acquired successfully. See Also ctl_bus_lock, ctl_bus_lock_ex 26

27 ctl_bus_write CTL_STATUS_t ctl_bus_write(ctl_parallel_bus_t *self, unsigned output); ctl_bus_write writes output to the bus self. Note that writing to output bits configured as inputs is highly device dependent and the effect of doing so is not specified by this interface. Return Value ctl_bus_write returns a standard status code. Thread Safety ctl_bus_write is thread-safe if a mutex is associated with the bus self. 27

28 ctl_bus_write_bit CTL_STATUS_t ctl_bus_write_bit(ctl_parallel_bus_t *self, unsigned bit, unsigned value); ctl_bus_write_bit sets bit bit on the bus self to value. If value is zero, the corresponding bit is cleared to zero and if value is non-zero, the corresponding bit is set to one. Note that writing to output bits configured as inputs is highly device dependent and the effect of doing so is not specified by this interface. Return Value ctl_bus_write_bit returns a standard status code. Thread Safety ctl_bus_write_bit is thread-safe if a mutex is associated with the bus self. 28

29 ctl_bus_write_bits CTL_STATUS_t ctl_bus_write_bits(ctl_parallel_bus_t *self, unsigned mask, unsigned value); ctl_bus_write_bits writes the bits in value to the bus self. Only the bits that are set to one in mask are written to the bus which allows the client to both set and clear bits in a single operation. Return Value ctl_bus_write_bits returns a standard status code. Thread Safety ctl_bus_write_bits is thread-safe if a mutex is associated with the bus self. 29

30 ctl_parallel_bus_initialize void ctl_parallel_bus_initialize(ctl_parallel_bus_t *self); ctl_parallel_bus_initialize initializes the parallel bus self by setting all members to zero. 30

31 <ctl_i2c.h> Overview Abstract I2C bus interface. The types and functions in <ctl_i2c.h> provide a high-level set of services for a bus master to read and write data over one or more I2C buses. Additional features, such as sensor drivers and so on, build upon the services that the I2C interface offers. In addition, all I2C-interfaced devices in the CrossWorks Micro-Graphics Library use the I2C functions here for I/O to LCD and OLED displays. The I2C interface in this library is abstract in the sense that there is no concrete implementation within the library. Rather, implementations of the I2C interface are offered by the many driver packages that you can install as a CrossWorks package. To see examples of this API in use, please install the CrossWorks demonstration package for your particular board and open up its contents in the Project Explorer and take a look around. API Summary Bus CTL_I2C_BUS_t ctl_i2c_lock_bus ctl_i2c_lock_bus_ex ctl_i2c_set_speed ctl_i2c_unlock_bus I/O ctl_i2c_read ctl_i2c_write ctl_i2c_write_read Implementation CTL_I2C_REQUEST_t Constants CTL_I2C_FAST_MODE_PLUS_SPEED CTL_I2C_FAST_MODE_SPEED CTL_I2C_STANDARD_SPEED Abstract I2C bus interface Acquire exclusive bus lock Acquire exclusive bus lock (extended) Set I2C bus speed Release exclusive bus lock Read data from I2C bus Write data to I2C bus Write to then read from I2C bus I/O request block I2C fast-mode+ bus speed I2C fast-mode bus speed I2C standard bus speed 31

32 CTL_I2C_BUS_t typedef struct { CTL_STATUS_t (*transaction)(ctl_i2c_bus_t *, CTL_I2C_REQUEST_t *); CTL_STATUS_t (*set_speed)(ctl_i2c_bus_t *, unsigned); unsigned long speed; CTL_MUTEX_t *mutex; } CTL_I2C_BUS_t; CTL_I2C_BUS_t defines the interface to the device-independent I2C bus driver. Structure transaction Private method to execute an I/O transaction on the I2C bus. set_speed Private method to set the operating speed of the I2C bus. speed Consider this a read-only variable that indicates the selected speed of the I2C bus. mutex If this mutex is non-zero, the I2C functions will acquire the mutex before proceeding to use the I2C bus. For systems that do not share the I2C bus between tasks, the mutex can be zero and it's the user's responsibility to ensure mutual exclusion on the I2C bus. 32

33 CTL_I2C_FAST_MODE_PLUS_SPEED #define CTL_I2C_FAST_MODE_PLUS_SPEED UL // 1 MHz CTL_I2C_FAST_MODE_PLUS_SPEED defines the standard I2C fast-mode+ bus speed of 1 MHz. 33

34 CTL_I2C_FAST_MODE_SPEED #define CTL_I2C_FAST_MODE_SPEED UL // 400 khz CTL_I2C_FAST_MODE_SPEED defines the standard I2C fast-mode bus speed of 400 khz. 34

35 CTL_I2C_REQUEST_t typedef struct { unsigned address; const unsigned char *tx; size_t txlen; unsigned char *rx; size_t rxlen; } CTL_I2C_REQUEST_t; CTL_I2C_REQUEST_t is an I/O request block for an I2C transaction. Clients are not required to use this request block directly from the I2C API, but I2C drivers are required to implement I/O requests according to the block's members: Write-Read request: If both tx and rx are non-null, the I/O request first writes the slave address and data specified by tx and txlen to the bus, issues a repeated start, and reads rxlen bytes from the bus into rx, and finally issues a stop. Write request: If tx is non-null and rx is null, the I/O request writes the slave address and data specified by tx and txlen to the bus, and then issues a stop. Read request: If tx is null and rx is non-null, the I/O request writes the slave address to the bus, reads rxlen bytes from the bus to rx, and issues a stop. Structure address 8-bit address for the I/O request. The low order bit is undefined when passed to the low-level I2C driver, and the I2C driver must correctly set or reset the R/W bit according to the request phase. tx A pointer to the data to write to the bus after the slave address is transmitted. If tx is zero, the driver must skip the write part of the I/O request. txlen The number of bytes to transfer as payload in the write part of the I/O request. rx A pointer to the data to read from the bus after the slave address is transmitted. If rx is zero, the driver must skip the read part of the I/O request. rxlen The number of bytes to transfer as payload in the read part of the I/O request. 35

36 CTL_I2C_STANDARD_SPEED #define CTL_I2C_STANDARD_SPEED UL // 100 khz CTL_I2C_STANDARD_SPEED defines the standard I2C bus speed of 100 khz. 36

37 ctl_i2c_lock_bus void ctl_i2c_lock_bus(ctl_i2c_bus_t *self); ctl_i2c_lock_bus acquires the bus lock mutex of the I2C bus self. If there is no mutex associated with the bus self, ctl_i2c_lock_bus returns immediately indicating success. All locks of the I2C bus by ctl_i2c_lock_bus must be paired with a call to ctl_i2c_unlock_bus to release the lock. Note Because mutexes can be locked multiple times, you can use ctl_i2c_lock_bus to acquire the bus to issue a sequence of I2C transactions to the bus that cannot be interrupted by another task. However, locking the bus this way does not guarantee that other masters, in a multi-master system, are excluded from issuing transactions on the bus. See Also ctl_i2c_unlock_bus, ctl_i2c_lock_bus_ex 37

38 ctl_i2c_lock_bus_ex unsigned ctl_i2c_lock_bus_ex(ctl_i2c_bus_t *self, CTL_TIMEOUT_t type, CTL_TIME_t time); ctl_i2c_lock_bus_ex acquires the bus lock mutex of the I2C bus self using the timeout specified with type and time. If there is no mutex associated with the bus self, ctl_i2c_lock_bus_ex returns immediately indicating success. ctl_i2c_lock_bus_ex returns a non-zero value if the mutex is acquired within the timeout specification and zero if it is not. All successful locks of the I2C bus by ctl_i2c_lock_bus_ex must be paired with a call to ctl_i2c_unlock_bus to release the lock. Note Because mutexes can be locked multiple times, you can use ctl_i2c_lock_bus_ex to acquire the bus to issue a sequence of I2C transactions to the bus that cannot be interrupted by another task. However, locking the bus this way does not guarantee that other masters, in a multi-master system, are excluded from issuing transactions on the bus. See Also ctl_i2c_unlock_bus, ctl_i2c_lock_bus 38

39 ctl_i2c_read CTL_STATUS_t ctl_i2c_read(ctl_i2c_bus_t *self, unsigned address, void *rx, size_t len); ctl_i2c_read locks the I2C bus self using ctl_i2c_lock_bus and proceeds to read len bytes from the device with 8-bit slave address address and writes them to the object pointed to by rx which must be at least len bytes in size. ctl_i2c_read waits unconditionally for the write and read to complete, unlocks the bus using ctl_i2c_unlock_bus, and returns a standard status code. For exact I2C transaction details, see CTL_I2C_REQUEST_t. Thread Safety This function is thread-safe if a mutex is associated with the I2C bus self. See Also CTL_I2C_REQUEST_t. 39

40 ctl_i2c_set_speed CTL_STATUS_t ctl_i2c_set_speed(ctl_i2c_bus_t *self, unsigned long speed); ctl_i2c_set_speed sets the operating speed of the I2C bus self to speed hertz. If the bus does not support the requested speed, the speed closest to, but not exceeding, speed is selected. Return Value ctl_i2c_set_speed returns a standard status code. Thread Safety ctl_i2c_set_speed is thread-safe if a mutex is associated with the I2C bus self. 40

41 ctl_i2c_unlock_bus void ctl_i2c_unlock_bus(ctl_i2c_bus_t *self); ctl_i2c_unlock_bus releases a mutex that was successfully locked using ctl_i2c_lock_bus. If there is no mutex associated with the bus self, ctl_i2c_unlock_bus returns immediately. It is an error to release a lock that was not acquired successfully. See Also ctl_i2c_lock_bus, ctl_i2c_lock_bus_ex 41

42 ctl_i2c_write CTL_STATUS_t ctl_i2c_write(ctl_i2c_bus_t *self, unsigned address, const void *tx, size_t len); ctl_i2c_write locks the I2C bus self using ctl_i2c_lock_bus and proceeds to write the object pointed to by tx with size len bytes to the device with 8-bit slave address address. ctl_i2c_write waits unconditionally for the write and read to complete, unlocks the bus using ctl_i2c_unlock_bus, and returns a standard status code. For exact I2C transaction details, see CTL_I2C_REQUEST_t. See Also CTL_I2C_REQUEST_t. 42

43 ctl_i2c_write_read CTL_STATUS_t ctl_i2c_write_read(ctl_i2c_bus_t *self, unsigned address, const void *tx, size_t txlen, void *rx, size_t rxlen); ctl_i2c_write_read locks the I2C bus self using ctl_i2c_lock_bus and proceeds to write the object pointed to by tx with size txlen bytes to device with 8-bit slave address address. ctl_i2c_write_read then issues a repeated start to the same slave address and reads len bytes from the slave and writes them to the object pointed to by rx which must be at least rxlen bytes in size. ctl_i2c_write_read waits unconditionally for the write and read to complete, unlocks the bus using ctl_i2c_unlock_bus, and returns a standard status code. For exact I2C transaction details, see CTL_I2C_REQUEST_t. Thread Safety This function is thread-safe if a mutex is associated with the I2C bus self. See Also CTL_I2C_REQUEST_t. 43

44 <ctl_spi.h> Overview Abstract SPI bus interface. The types and functions in <ctl_spi.h> provide a high-level set of services for a bus master to read and write data over one or more SPI buses. Additional features, such as sensor drivers and so on, build upon the services that the SPI interface offers. In addition, all SPI-interfaced devices in the CrossWorks Micro-Graphics Library use the SPI functions here for I/O to LCD and OLED display. The SPI interface in this library is abstract in the sense that there is no concrete implementation within the library. Rather, implementations of the SPI interface are offered by the many driver packages that you can install as a CrossWorks package. To see examples of this API in use, please install the CrossWorks demonstration package for your particular board and open up its contents in the Project Explorer and take a look around. API Summary Bus CTL_SPI_BUS_t ctl_spi_attach_device ctl_spi_deselect_device ctl_spi_detach_device ctl_spi_lock_bus ctl_spi_lock_bus_ex ctl_spi_select_device ctl_spi_unlock_bus Device CTL_SPI_DEVICE_t CTL_SPI_MODE_t CTL_SPI_PROTOCOL_t ctl_spi_exchange ctl_spi_get ctl_spi_issue_deselected_clocks ctl_spi_put ctl_spi_put_get ctl_spi_read Abstract SPI bus interface Attach device to SPI bus Deselect a device from SPI bus Detach device from SPI bus Lock SPI bus Lock SPI bus (extended) Select a device onto SPI bus Unlock SPI bus SPI device instance SPI device mode SPI device configuration Exchange data with SPI device Read one frame from SPI device Issue clocks to SPI bus with device deselected Write one frame to SPI device Exchange one frame with SPI device Read from SPI device 44

45 ctl_spi_set_idle ctl_spi_set_mode ctl_spi_set_protocol ctl_spi_set_speed ctl_spi_set_width ctl_spi_write Implementation CTL_SPI_EXCHANGE_FN_t CTL_SPI_SET_PROTOCOL_FN_t Set SPI device idle state Set SPI device mode Set SPI device operating parameters Set SPI device clock speed Set SPI device frame width Write to SPI device Exchange method prototype Set bus protocol prototype 45

46 CTL_SPI_BUS_t typedef struct { CTL_MUTEX_t *mutex; CTL_SPI_SET_PROTOCOL_FN_t set_protocol; CTL_SPI_EXCHANGE_FN_t exchange; CTL_SPI_DEVICE_t * head; CTL_SPI_DEVICE_t * dev; CTL_SPI_PROTOCOL_t protocol; } CTL_SPI_BUS_t; CTL_SPI_BUS_t contains the bus state and methods that implement an SPI bus. Clients that use the SPI bus should consider all data in this structure private. Structure mutex If this mutex is non-zero, the SPI functions will acquire the mutex proceeding to use the SPI bus. For systems that do not share the SPI bus between tasks, the mutex can be zero and it's the user's responsibility to ensure mutual exclusion on the SPI bus. set_protocol Private method to set the SPI bus protocol for a selected device. Client code must not call this method directly. See CTL_SPI_SET_PROTOCOL_FN_t. exchange Private method to exchange data over the SPI bus. Client code must not call this method directly. See CTL_SPI_EXCHANGE_FN_t. head Private member which is the head of the chain of devices attached to this SPI bus. dev Private member that stores the currently-selected device on the SPI bus; if null, no device is selected. protocol Private member that stores the protocol that the SPI bus is currently configured for. 46

47 CTL_SPI_DEVICE_t typedef struct { int addr; void *extra; void (*select)(ctl_spi_device_s *, int); CTL_SPI_DEVICE_s * next; CTL_SPI_PROTOCOL_t protocol; CTL_SPI_BUS_t * bus; } CTL_SPI_DEVICE_t; CTL_SPI_DEVICE_t defines the device selection method and protocol to use when communicating with a device on an SPI bus. Structure addr Client-side data. If you are using a single method to select multiple devices, you can use the addr member of each SPI device structure to distinguish the device. extra Client-side data. You can use this member to point to additional data associated with the SPI device. select Method to select the device. When the API requires a device to become selected, it calls select with the appropriate SPI device instance and state as 0. When a device needs to be deselected, it calls select with the device instance and state non-zero. next Private member that links SPI device instances attached to the same SPI bus. protocol Private member that contains the SPI protocol associated with the device instance. bus Private member that points to the bus the SPI device is attached to. If the device is not attached to a bus, this member is null. 47

48 CTL_SPI_EXCHANGE_FN_t typedef void (*CTL_SPI_EXCHANGE_FN_t)(CTL_SPI_BUS_t *, const void *, void *, size_t); CTL_SPI_EXCHANGE_FN_t is the prototype for the implementation of data exchange on an SPI bus. 48

49 CTL_SPI_MODE_t typedef enum { CTL_SPI_CPOL_0, CTL_SPI_CPOL_1, CTL_SPI_CPHA_0, CTL_SPI_CPHA_1, CTL_SPI_MODE0, CTL_SPI_MODE1, CTL_SPI_MODE2, CTL_SPI_MODE3 } CTL_SPI_MODE_t; CTL_SPI_MODE_t defines the four operating modes of the SPI bus, 0 through 3. 49

50 CTL_SPI_PROTOCOL_t typedef struct { unsigned char mode; unsigned char width; unsigned short idle; unsigned short options; unsigned long speed; } CTL_SPI_PROTOCOL_t; CTL_SPI_PROTOCOL_t defines the protocol that an SPI device is configured for, or the current configuration of the SPI bus. Structure mode Operating mode of the SPI bus, 0 through 3. width Width of one frame over the SPI bus. Some SPI drivers support only fixed frame widths, or a subset of frame widths, so refer to the documentation of your device to determine the supported frame widths. idle Either 0 or 0xffff which indicates the state MOSI is driven to when reading from the SPI bus. Some SPI devices require that MOSI is driven either high or low when reading from the bus. options Additional options private to the SPI driver. Typically this is used for storing DMA configuration. speed The operating speed of the SPI bus or SPI device, in hertz. 50

51 CTL_SPI_SET_PROTOCOL_FN_t typedef CTL_STATUS_t (*CTL_SPI_SET_PROTOCOL_FN_t)(CTL_SPI_BUS_t *); CTL_SPI_SET_PROTOCOL_FN_t is the prototype for setting the SPI bus protocol (phase, polarity, bus speed, idle state) prior to selecting the device. 51

52 ctl_spi_attach_device CTL_STATUS_t ctl_spi_attach_device(ctl_spi_bus_t *self, CTL_SPI_DEVICE_t *dev); ctl_spi_attach_device attaches the device dev to the SPI bus self. It is an error to operate an SPI device using SPI functions without first attaching it to a bus. Thread Safety ctl_spi_attach_device is thread-safe. See Also ctl_spi_detach_device. 52

53 ctl_spi_deselect_device void ctl_spi_deselect_device(ctl_spi_device_t *self); ctl_spi_deselect_device deselects the device self on the bus that it is attached to. To do this, the device's select method is invoked with a non-zero state, and releases the lock on the SPI bus. Deselecting a deselected device acts as a no-operation. 53

54 ctl_spi_detach_device CTL_STATUS_t ctl_spi_detach_device(ctl_spi_device_t *self); ctl_spi_detach_device removes the device self from the bus it's attached to. If the device is already detached this is a no-operation. Thread Safety ctl_spi_detach_device is thread-safe. See Also ctl_spi_attach_device. 54

55 ctl_spi_exchange CTL_STATUS_t ctl_spi_exchange(ctl_spi_device_t *self, const void *tx, void *rx, size_t items); ctl_spi_exchange simultaneously writes to and reads from the SPI device self which must have been selected onto the bus by ctl_spi_select_device. If the selected frame width for the device self is eight bits or narrower, items bytes are written from tx and items bytes are read from the SPI bus to rx. If the transfer width is nine bits or wider then shorts are used rather than bytes. If tx is zero, the set idle-pattern is written to the SPI device (if the the underlying driver supports such a null transfer). Note that some SPI drivers which use DMA may not support null transfers. If rx is zero, data are read from the SPI bus and discarded if the underlying driver supports such a null transfer. Note that some SPI drivers which use DMA may not support null transfers. 55

56 ctl_spi_get CTL_STATUS_t ctl_spi_get(ctl_spi_device_t *self); ctl_spi_get reads a single frame from the SPI device self which must have been previously selected onto the bus by ctl_spi_select_device. The idle value set in the device's protocol is written to the SPI bus when exchanging data with the device. Return Value The value returned is the frame read from the SPI bus; negative values are standard status codes. 56

57 ctl_spi_issue_deselected_clocks CTL_STATUS_t ctl_spi_issue_deselected_clocks(ctl_spi_device_t *self, size_t items); ctl_spi_issue_deselected_clocks locks the SPI bus associated with the device self and sets the bus protocol to communicate with the device. However, the device is not selected onto the bus and remains deselected. ctl_spi_issue_deselected_clocks then issues items frames of clock pulses to the SPI bus, unlocks the SPI bus, and returns. This function is provided primarily for initializing SD and MMC cards into SPI mode. ctl_spi_issue_deselected_clocks returns a standard status code. 57

58 ctl_spi_lock_bus void ctl_spi_lock_bus(ctl_spi_bus_t *self); ctl_spi_lock_bus acquires the bus lock mutex of the SPI bus self. If there is no mutex associated with the bus self, ctl_spi_lock_bus returns immediately. All locks of the SPI bus by ctl_spi_lock_bus must be paired with a call to ctl_spi_unlock_bus to release the lock. Note Because mutexes can be locked multiple times, you can use ctl_spi_lock_bus to ensure exclusive use of the bus in order to issue a sequence sequence of SPI transactions without interruption. See Also ctl_spi_unlock_bus, ctl_spi_lock_bus_ex 58

59 ctl_spi_lock_bus_ex unsigned ctl_spi_lock_bus_ex(ctl_spi_bus_t *self, CTL_TIMEOUT_t type, CTL_TIME_t time); ctl_spi_lock_bus_ex acquires the bus lock mutex of the SPI bus self using the timeout specified with type and time. If there is no mutex associated with the bus self, ctl_spi_lock_bus_ex returns immediately indicating success. ctl_spi_lock_bus_ex returns a non-zero value if the mutex is acquired within the timeout specification and zero if it is not. All successful locks of the SPI bus by ctl_spi_lock_bus_ex must be paired with a call to ctl_spi_unlock_bus to release the lock. Note Because mutexes can be locked multiple times, you can use ctl_spi_lock_bus_ex to ensure exclusive use of the bus in order to issue a sequence sequence of SPI transactions without interruption. See Also ctl_spi_unlock_bus, ctl_spi_lock_bus 59

60 ctl_spi_put CTL_STATUS_t ctl_spi_put(ctl_spi_device_t *self, unsigned u); ctl_spi_put writes the single frame u to the SPI device self which must have been previously selected onto the bus by ctl_spi_select_device. 60

61 ctl_spi_put_get CTL_STATUS_t ctl_spi_put_get(ctl_spi_device_t *self, unsigned u); ctl_spi_put_get writes the single frame u to the SPI device self which must have been previously selected onto the bus by ctl_spi_select_device and returns the data read when shifting the frame out. 61

62 ctl_spi_read CTL_STATUS_t ctl_spi_read(ctl_spi_device_t *self, void *rx, size_t items); ctl_spi_read read data from the SPI device self which must have been selected onto the bus by ctl_spi_select_device. If the selected transfer width for the device dev is eight bits or narrower then items bytes are read from the SPI bus to rx. If the transfer width is nine bits or wider then item shorts are read from from SPI bus and written to rx. If rx is zero, data are read from the SPI bus and discarded if the underlying driver supports such a null transfer. Note that some SPI drivers which use DMA may not support null transfers. 62

63 ctl_spi_select_device CTL_STATUS_t ctl_spi_select_device(ctl_spi_device_t *self); ctl_spi_select_device selects the device self on the bus that it is attached to and locks access to the bus so other devices cannot use the bus. Once the bus is locked, the device's select method is invoked. The device remains selected until ctl_spi_deselect_device deselects the device and releases the lock on the SPI bus. ctl_spi_select_device returns a standard status code indicating the status of setting the device's SPI protocol. 63

64 ctl_spi_set_idle CTL_STATUS_t ctl_spi_set_idle(ctl_spi_device_t *self, int idle); ctl_spi_set_idle sets the SPI bus idle value when reading from the device self to idle. Please refer to ctl_spi_set_protocol for a description of when protocol parameters are validated. ctl_spi_set_idle returns a standard status code. See Also ctl_spi_set_protocol 64

65 ctl_spi_set_mode CTL_STATUS_t ctl_spi_set_mode(ctl_spi_device_t *self, int mode); ctl_spi_set_mode sets the SPI bus mode to use for the device self to mode. Please refer to ctl_spi_set_protocol for a description of when protocol parameters are validated. ctl_spi_set_mode returns a standard status code. See Also ctl_spi_set_protocol 65

66 ctl_spi_set_protocol CTL_STATUS_t ctl_spi_set_protocol(ctl_spi_device_t *self, int mode, int width, unsigned long speed, int idle); ctl_spi_set_protocol sets the SPI parameters parameters for the device self. You can set the operating parameters of a device whether it is attached to an SPI bus or not. ctl_spi_set_protocol returns a standard status code. Protocol parameter validation If the device is already attached to a bus and is selected, ctl_spi_set_protocol will change the operating parameters of the bus immediately. In this case, if the parameters are invalid or cannot be honored by the underlying SPI bus, ctl_spi_set_protocol will return an error indication immediately. If the device is not attached to a bus or is not selected, the parameters are stored and the bus protocol set when the device is selected. In this case, ctl_spi_set_protocol will return a success indication, leaving validation of the parameters to the time when the device is selected onto the bus using ctl_spi_select_device. 66

67 ctl_spi_set_speed CTL_STATUS_t ctl_spi_set_speed(ctl_spi_device_t *self, unsigned long speed); ctl_spi_set_speed sets the SPI bus frequency to use for the device self to speed hertz. Please refer to ctl_spi_set_protocol for a description of when protocol parameters are validated. ctl_spi_set_speed returns a standard status code. See Also ctl_spi_set_protocol 67

68 ctl_spi_set_width CTL_STATUS_t ctl_spi_set_width(ctl_spi_device_t *self, int width); ctl_spi_set_width sets the SPI bus frame width to use for the device self to width. Please refer to ctl_spi_set_protocol for a description of when protocol parameters are validated. ctl_spi_set_width returns a standard status code. See Also ctl_spi_set_protocol 68

69 ctl_spi_unlock_bus void ctl_spi_unlock_bus(ctl_spi_bus_t *self); ctl_spi_unlock_bus unlocks the previously-locked the SPI bus self. 69

70 ctl_spi_write CTL_STATUS_t ctl_spi_write(ctl_spi_device_t *self, const void *tx, size_t items); ctl_spi_write writes data to the SPI device self which must have been previously selected onto the bus by ctl_spi_select_device. If the selected transfer width for the device self is eight bits or narrower then items bytes are written from tx. If the transfer width is wider than eight bits then item shorts are written from tx. If tx is zero, the set idle-pattern is written to the SPI device (if the the underlying driver supports such a null transfer). Note that some SPI drivers which use DMA may not support null transfers. 70

71 <ctl_sensors.h> Overview Interfaces to a variety of common sensor classes. The types and functions in <ctl_sensors.h> provide a high-level set of services for a variety of common sensor classes such as motion sensors, environmental sensors, and so on. Each sensor class is abstracted to the essential set of features that all sensors of that class provide: Accelerometer: measures linear acceleration in up to three axes, with the abstract interface CTL_ACCELEROMETER_t. Gyroscope: measures rotation rate in up to three axes with the abstract interface CTL_GYROSCOPE_t. Magnetometer: measures magnetic field strength in up to three axes, with the abstract interface CTL_MAGNETOMETER_t. Pressure sensor: measures barometric air pressure, with the abstract interface CTL_PRESSURE_SENSOR_t. Temperature sensor: measures temperature, with the abstract interface CTL_TEMPERATURE_SENSOR_t. Light sensor: measures ambient light level, with the abstract interface CTL_LIGHT_SENSOR_t. Humidity sensor: measures relative humidity and, optionally, temperature, with the abstract interface CTL_HUMIDITY_SENSOR_t. The appropriate interface is initialized by calling the device-specific initialization code, for a particular sensor, in the sensor library. For instance, to initialize an accelerometer interface that uses an ADXL345 acceleration sensor, you would call adxl345_initialize_i2c. Once initialized, you can use the accelerometer-related functions in your own code. API Summary Accelerometer CTL_ACCELEROMETER_t ctl_accelerometer_measure ctl_accelerometer_set_bandwidth ctl_accelerometer_set_range Gyroscope CTL_GYROSCOPE_t ctl_gyroscope_measure ctl_gyroscope_set_bandwidth ctl_gyroscope_set_range An abstract accelerometer Sample accelerometer axes Set accelerometer bandwidth Set accelerometer range An abstract gyroscope Sample gyroscope axes Set gyroscope bandwidth Set gyroscope range 71

72 Magnetometer CTL_MAGNETOMETER_t ctl_magnetometer_measure ctl_magnetometer_set_bandwidth IMU CTL_IMU_t Temperature CTL_TEMPERATURE_SENSOR_t ctl_temperature_sensor_measure ctl_temperature_sensor_set_resolution Pressure Light Humidity CTL_HUMIDITY_SENSOR_t ctl_humidity_sensor_measure Utility CTL_AXIS_TRANSFORMATION ctl_forward_transform_axes ctl_generate_axis_transform Pressure CTL_PRESSURE_SENSOR_t ctl_pressure_sensor_measure Light CTL_LIGHT_SENSOR_t ctl_light_sensor_measure An abstract magnetometer Sample magnetometer axes Set magnetometer bandwidth An abstract IMU sensor collection An abstract temperature sensor Sample temperature sensor Set temperature sensor resolution An abstract humidity sensor Sample relative humidity Single axis transformation Apply axis transformation Generate an axis transform from components An abstract pressure sensor Sample barometric pressure An abstract light sensor Sample ambient light level 72

73 CTL_ACCELEROMETER_t typedef struct { CTL_TRANSPORT_t transport; CTL_STATUS_t (*measure)(ctl_accelerometer_s *, float *); CTL_STATUS_t (*set_range)(ctl_accelerometer_s *, int); CTL_STATUS_t (*set_bandwidth)(ctl_accelerometer_s *, float); float bias[]; float gain[]; int range; float bandwidth; void *extra; unsigned mode; } CTL_ACCELEROMETER_t; CTL_ACCELEROMETER_t is an abstract accelerometer interface that provides clients with a means to set the range and bandwidth of the accelerometer and to sample acceleration in up to three axes. Structure transport The underlying transport for the accelerometer which provides, typically, an I2C or SPI connection to the device and a means to read one or more registers from the device. bias The zero offset for the x, y, and z axes, in g. Client software may alter these to provide more accurate calibration of the accelerometer. gain The gain for the x, y, and z axes, in g per count. Client software may alter these to provide more accurate calibration of the accelerometer. range Current range selected for the accelerometer, in g, and is read only. bandwidth Current bandwidth selected for the accelerometer, in hertz, and is read only. extra Client-side data. You can use this to store additional information relating to the accelerometer instance. mode Private working storage for the driver. measure Method to sample the x, y, and z axes of the accelerometer. 73

74 set_range Method to set the range of the accelerometer. set_bandwidth Method to set the bandwidth of the accelerometer. 74

75 CTL_AXIS_TRANSFORMATION typedef enum { AXIS_UNCHANGED, AXIS_POSITIVE_X, AXIS_POSITIVE_Y, AXIS_POSITIVE_Z, AXIS_NEGATED, AXIS_NEGATIVE_X, AXIS_NEGATIVE_Y, AXIS_NEGATIVE_Z } CTL_AXIS_TRANSFORMATION; CTL_AXIS_TRANSFORMATION describes the generates an axis transform by specifying the individual transformations for the x, y, and z axes. 75

76 CTL_GYROSCOPE_t typedef struct { CTL_TRANSPORT_t transport; CTL_STATUS_t (*measure)(ctl_gyroscope_s *, float *); CTL_STATUS_t (*set_range)(ctl_gyroscope_s *, int); CTL_STATUS_t (*set_bandwidth)(ctl_gyroscope_s *, float); float gain[]; float bias[]; int range; float bandwidth; void *extra; } CTL_GYROSCOPE_t; CTL_GYROSCOPE_t is an abstract gyroscope interface that provides clients with a means to set the range and bandwidth of the gyroscope and to sample rotation in up to three axes. Structure transport The underlying transport for the gyroscope which provides, typically, an I2C or SPI connection to the device and a means to read one or more registers from the device. bias The zero offset for the x, y, and z axes, in degrees per second. Client software may alter these to provide more accurate calibration of the gyroscope. gain The gain for the x, y, and z axes, in degrees per second per count. Client software may alter these to provide more accurate calibration of the gyroscope. range Current range selected for the gyroscope, in degrees per second, and is read only. bandwidth Current bandwidth selected for the gyroscope, in hertz, and is read only. extra Client-side data. You can use this to store additional information relating to the gyroscope instance. measure Method to sample the x, y, and z axes of the gyroscope. set_range Method to set the range of the gyroscope. 76

CrossWorks Tools Library

CrossWorks Tools Library Version: 3.1 2014 Rowley Associates Limited 2 Contents Contents... 9 User Manual... 11 Introduction... 11 API Reference... 12 ... 12 CTL_BYTE_SWAP_16b_LIT... 15 CTL_BYTE_SWAP_32b_LIT... 16

More information

ADC to I 2 C. Data Sheet. 10 Channel Analog to Digital Converter. with output via I 2 C

ADC to I 2 C. Data Sheet. 10 Channel Analog to Digital Converter. with output via I 2 C Data Sheet 10 Channel Analog to Digital Converter with output via I 2 C Introduction Many microcontroller projects involve the use of sensors like Accelerometers, Gyroscopes, Temperature, Compass, Barometric,

More information

Serial Peripheral Interface Bus SPI

Serial Peripheral Interface Bus SPI Serial Peripheral Interface Bus SPI SPI Bus Developed by Motorola in the mid 1980 s Full-duplex, master-slave serial bus suited to data streaming applications for embedded systems Existing peripheral busses

More information

Tizen Sensors (Tizen Ver. 2.3)

Tizen Sensors (Tizen Ver. 2.3) Tizen Sensors (Tizen Ver. 2.3) Spring 2015 Soo Dong Kim, Ph.D. Professor, Department of Computer Science Software Engineering Laboratory Soongsil University Office 02-820-0909 Mobile 010-7392-2220 sdkim777@gmail.com

More information

CrossWorks Platform Library

CrossWorks Platform Library Version: 3.7 2015 Rowley Associates Limited 2 Contents Contents... 9 User Manual... 11 Introduction... 11 Blinking one LED... 12 Blinking all LEDs... 13 API Reference... 15 ... 15 PLATFORM_BUTTON_ATTRIBUTE_t...

More information

Temperature Sensor TMP2 PMOD Part 1

Temperature Sensor TMP2 PMOD Part 1 Temperature Sensor TMP2 PMOD Part 1 Overview of the Temperature Sensor and I 2 C Interfacing Reference Sites: Diligent Temp2 PMOD: http://www.digilentinc.com/products/detail.cfm?navpath=2,401,961&prod=pmod-tmp2

More information

17. I 2 C communication channel

17. I 2 C communication channel 17. I 2 C communication channel Sometimes sensors are distant to the microcontroller. In such case it might be impractical to send analog signal from the sensor to the ADC included in the microcontroller

More information

Arduino Uno. Power & Interface. Arduino Part 1. Introductory Medical Device Prototyping. Digital I/O Pins. Reset Button. USB Interface.

Arduino Uno. Power & Interface. Arduino Part 1. Introductory Medical Device Prototyping. Digital I/O Pins. Reset Button. USB Interface. Introductory Medical Device Prototyping Arduino Part 1, http://saliterman.umn.edu/ Department of Biomedical Engineering, University of Minnesota Arduino Uno Power & Interface Reset Button USB Interface

More information

EMBEDDED SYSTEMS WITH ROBOTICS AND SENSORS USING ERLANG

EMBEDDED SYSTEMS WITH ROBOTICS AND SENSORS USING ERLANG EMBEDDED SYSTEMS WITH ROBOTICS AND SENSORS USING ERLANG Adam Lindberg github.com/eproxus HARDWARE COMPONENTS SOFTWARE FUTURE Boot, Serial console, Erlang shell DEMO THE GRISP BOARD SPECS Hardware & specifications

More information

XDK HARDWARE OVERVIEW

XDK HARDWARE OVERVIEW XDK HARDWARE OVERVIEW Agenda 1 General Overview 2 3 4 Sensors Communications Extension Board 2 General Overview 1. General Overview What is the XDK? The Cross-Domain Development Kit, or XDK, is a battery

More information

Pedometer 3 Click. PID: MIKROE 3259 Weight: 24 g

Pedometer 3 Click. PID: MIKROE 3259 Weight: 24 g Pedometer 3 Click PID: MIKROE 3259 Weight: 24 g The Pedometer 3 click is a tri-axis acceleration sensing Click board utilizing the KX126-1063. An advanced three-axis acceleration sensor, the KX126-1063

More information

Parallax LSM9DS1 9-axis IMU Module (#28065)

Parallax LSM9DS1 9-axis IMU Module (#28065) Web Site: www.parallax.com Forums: forums.parallax.com Sales: sales@parallax.com Technical:support@parallax.com Office: (916) 624-8333 Fax: (916) 624-8003 Sales: (888) 512-1024 Tech Support: (888) 997-8267

More information

MPU 9250 C Library. Shivansh Singla

MPU 9250 C Library. Shivansh Singla MPU 9250 C Library Shivansh Singla PREFACE These application notes are used for communicating with MPU 9250 via I2C protocol based on the application notes [1] released by Daniel Fiske, Michael Lam and

More information

Gumstix Pi HAT Sensor board

Gumstix Pi HAT Sensor board Gumstix Pi HAT Sensor board TM Gumstix, Inc. shall have no liability of any kind, express or implied, arising out of the use of the Information in this document, including direct, indirect, special or

More information

SPI Framework Module Guide

SPI Framework Module Guide Application Note Introduction This module guide will enable you to effectively use a module in your own design. Upon completion of this guide, you will be able to add this module to your own design, configure

More information

SPI Lasers UK Limited. Serial Command Reference for the PRISM Laser Platform

SPI Lasers UK Limited. Serial Command Reference for the PRISM Laser Platform SPI Lasers UK Limited Serial Command Reference for the PRISM Laser Platform 1 of 89 Table of Contents Introduction... Connecting to the OEM Fibre Laser... Data Link Layer... Frame Structure... Data Element...

More information

USB-910H API DLL and Include File Reference Manual

USB-910H API DLL and Include File Reference Manual USB-910H API DLL and Include File Reference Manual APPLICABLE ADAPTERS This Application Note applies to the following Keterex products: KXUSB-910H. AN2101 Application Note INTRODUCTION The Keterex USB-910H

More information

FEATURES DESCRIPTION FEATURES

FEATURES DESCRIPTION FEATURES FEATURES Two High Speed Counters Two Pulse Train Outputs Two Pulse Width Modulation Outputs 24 Sinking or Sourcing Inputs 16 Outputs 1 RS232 Port 2 RS485 Ports Supports Modbus RTU Protocol Communicate

More information

Microcontrollers and Interfacing

Microcontrollers and Interfacing Microcontrollers and Interfacing Week 10 Serial communication with devices: Serial Peripheral Interconnect (SPI) and Inter-Integrated Circuit (I 2 C) protocols College of Information Science and Engineering

More information

The I2C BUS Interface

The I2C BUS Interface The I 2 C BUS Interface ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Università di Catania, Italy santoro@dmi.unict.it L.S.M. 1 Course What is I 2 C? I

More information

BNO055 Quick start guide

BNO055 Quick start guide BNO055 Quick start guide Bosch Sensortec Application note: BNO055 Quick start guide Document revision 1.0 Document release date Document number Mar.2015 BST-BNO055-AN007-00 Technical reference code 0 273

More information

#include "quaternionfilters.h" #include "MPU9250.h" data read #define SerialDebug true // Set to true to get Serial output for debugging

#include quaternionfilters.h #include MPU9250.h data read #define SerialDebug true // Set to true to get Serial output for debugging /*Hardware setup: MPU9250 Breakout --------- Arduino VDD ---------------------- 3.3V VDDI --------------------- 3.3V SDA ----------------------- A4 SCL ----------------------- A5 GND ----------------------

More information

CODE TIME TECHNOLOGIES. Abassi RTOS. I2C Support

CODE TIME TECHNOLOGIES. Abassi RTOS. I2C Support CODE TIME TECHNOLOGIES Abassi RTOS I2C Support Copyright Information This document is copyright Code Time Technologies Inc. 2015-2018 All rights reserved. No part of this document may be reproduced or

More information

Serial communications with SPI

Serial communications with SPI Serial communications with SPI DRAFT VERSION - This is part of a course slide set, currently under development at: http://mbed.org/cookbook/course-notes We welcome your feedback in the comments section

More information

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI. Laboratory Lesson 9: Serial Peripheral Interface (SPI)

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI. Laboratory Lesson 9: Serial Peripheral Interface (SPI) LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI Laboratory Lesson 9: Serial Peripheral Interface (SPI) Prof. Luca Benini Prof Davide Rossi

More information

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI Embedded Systems and Software Serial Interconnect Buses I 2 C (SMB) and SPI I2C, SPI, etc. Slide 1 Provide low-cost i.e., low wire/pin count connection between IC devices There are many of serial bus standards

More information

robotics/ openel.h File Reference Macros Macro Definition Documentation Typedefs Functions

robotics/ openel.h File Reference Macros Macro Definition Documentation Typedefs Functions openel.h File Reference Macros #define EL_TRUE 1 #define EL_FALSE 0 #define EL_NXT_PORT_A 0 #define EL_NXT_PORT_B 1 #define EL_NXT_PORT_C 2 #define EL_NXT_PORT_S1 0 #define EL_NXT_PORT_S2 1 #define EL_NXT_PORT_S3

More information

Using FlexIO to emulate communications and timing peripherals

Using FlexIO to emulate communications and timing peripherals NXP Semiconductors Document Number: AN12174 Application Note Rev. 0, 06/2018 Using FlexIO to emulate communications and timing peripherals 1. Introduction The FlexIO is a new on-chip peripheral available

More information

Fully Integrated Thermal Accelerometer MXC6225XU

Fully Integrated Thermal Accelerometer MXC6225XU Powerful Sensing Solutions for a Better Life Fully Integrated Thermal Accelerometer MXC6225XU Document Version 1.0 page 1 Features General Description Fully Integrated Thermal Accelerometer X/Y Axis, 8

More information

Mbed Microcontroller SPI. Spring, 2018 Prof. Jungkeun Park

Mbed Microcontroller SPI. Spring, 2018 Prof. Jungkeun Park Mbed Microcontroller SPI Spring, 2018 Prof. Jungkeun Park SPI Logic Signals Full duplex mode using a master-slave architecture Single master Originates the frame for reading and writing https://en.wikipedia.org/wiki/serial_peripheral_interface_bus

More information

Cross-Domain Development Kit XDK110 Platform for Application Development

Cross-Domain Development Kit XDK110 Platform for Application Development Sensor Guide Cross-Domain Development Kit Platform for Application Development Bosch Connected Devices and Solutions : Data Sheet Document revision 2.1 Document release date 05.10.17 Workbench version

More information

CPCI-HPDI32ALT High-speed 64 Bit Parallel Digital I/O PCI Board 100 to 400 Mbytes/s Cable I/O with PCI-DMA engine

CPCI-HPDI32ALT High-speed 64 Bit Parallel Digital I/O PCI Board 100 to 400 Mbytes/s Cable I/O with PCI-DMA engine CPCI-HPDI32ALT High-speed 64 Bit Parallel Digital I/O PCI Board 100 to 400 Mbytes/s Cable I/O with PCI-DMA engine Features Include: 200 Mbytes per second (max) input transfer rate via the front panel connector

More information

10 Degree of Freedom IMU Sensor +-16G, dps, +-8Gauss, hPa

10 Degree of Freedom IMU Sensor +-16G, dps, +-8Gauss, hPa DOF10W 10 Degree of Freedom IMU Sensor +-16G, +-2000 dps, +-8Gauss, 350-700hPa Technical Reference Manual PCB Rev 1.0 www.soc-robotics.com Copyright 2011. SOC Robotics, Inc. 1 Manual Rev 0.9 Warranty Statement

More information

Orbix TS Thread Library Reference

Orbix TS Thread Library Reference Orbix 6.3.9 TS Thread Library Reference Micro Focus The Lawn 22-30 Old Bath Road Newbury, Berkshire RG14 1QN UK http://www.microfocus.com Copyright Micro Focus 2017. All rights reserved. MICRO FOCUS, the

More information

Zymkey App Utils: C++

Zymkey App Utils: C++ Zymkey App Utils: C++ Generated by Doxygen 1.8.8 Tue Apr 3 2018 07:21:52 Contents 1 Intro 1 2 Hierarchical Index 5 2.1 Class Hierarchy............................................ 5 3 Class Index 7 3.1

More information

SPI bus communication with LDE/LME pressure sensors

SPI bus communication with LDE/LME pressure sensors This Application Note discusses methods and special considerations related to the Serial Peripheral Interface (SPI) protocol used to communicate digitally with LDE and LME series pressure sensors. 1. Scope

More information

EE4390 Microprocessors. Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System

EE4390 Microprocessors. Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System EE4390 Microprocessors Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System 1 Overview 68HC12 hardware overview Subsystems Memory System 2 68HC12 Hardware Overview "Copyright of Motorola,

More information

RC1000-PP. Function Reference Manual

RC1000-PP. Function Reference Manual RC1000-PP Function Reference Manual RC1000-PP Function Reference Manual Microsoft and MS-DOS are registered trademarks and Windows, Windows 95, Windows 98 and Windows NT are trademarks of Microsoft Corporation.

More information

17. Serial communication - I 2 C

17. Serial communication - I 2 C 7. Serial communication - I 2 C Two typical serial busses will be discussed and their use will be demonstrated in this and next chapter, these are I 2 C (Inter Integrated Circuit, IIC or I2C) and SPI (Serial

More information

ArduCAM USB Camera SDK

ArduCAM USB Camera SDK ArduCAM USB Camera SDK User Guide Rev 1.0, April 2017 Table of Contents 1 Introduction... 2 2 USB SDK Library... 2 3 Demo Code... 2 3.1 Thread.cpp... 2 3.2 USBTestDlg.cpp... 2 4 ArduCAM APIs... 2 4.1 Data

More information

BMF055 Example Project BSX Lite Integration

BMF055 Example Project BSX Lite Integration BMF055 Example Project BSX Lite Integration Application Note: Document Revision 1.0 Document Release October 2015 Document Number BST-BMF055-EX003-00 Technical Reference 0 273 141 235 Notes Data in this

More information

Microcontrollers and Interfacing week 10 exercises

Microcontrollers and Interfacing week 10 exercises 1 SERIAL PERIPHERAL INTERFACE (SPI) HARDWARE Microcontrollers and Interfacing week 10 exercises 1 Serial Peripheral Interface (SPI) hardware Complex devices (persistent memory and flash memory cards, D/A

More information

MMA axis digital accelerometer module

MMA axis digital accelerometer module MMA7455 3-axis digital accelerometer module Instruction The MMA7455L is a Digital Output (I2C/SPI), low power, low profile capacitive micromachined accelerometer featuring signal conditioning, a low pass

More information

SpiNNaker Application Programming Interface (API)

SpiNNaker Application Programming Interface (API) SpiNNaker Application Programming Interface (API) Version 2.0.0 10 March 2016 Application programming interface (API) Event-driven programming model The SpiNNaker API programming model is a simple, event-driven

More information

Raspberry Pi - I/O Interfaces

Raspberry Pi - I/O Interfaces ECE 1160/2160 Embedded Systems Design Raspberry Pi - I/O Interfaces Wei Gao ECE 1160/2160 Embedded Systems Design 1 I/O Interfaces Parallel I/O and Serial I/O Parallel I/O: multiple input/output simultaneously

More information

User-configurable Resolution. 9 to 12 bits (0.5 C to C)

User-configurable Resolution. 9 to 12 bits (0.5 C to C) AT30TS75A 9- to 12-bit Selectable, ±0.5 C Accurate Digital Temperature Sensor DATASHEET See Errata in Section 12. Features Single 1.7V to 5.5V Supply Measures Temperature -55 C to +125 C Highly Accurate

More information

Release Notes for ADuCM302x EZ-KIT Board Support Package 1.0.6

Release Notes for ADuCM302x EZ-KIT Board Support Package 1.0.6 Release Notes for ADuCM302x EZ-KIT Board Support Package 1.0.6 2017 Analog Devices, Inc. http://www.analog.com Contents 1 ADuCM302x EZ-KIT Board Support Package v1.0.6 Release Notes 5 1.1 Release Testing

More information

CAN Module Documentation

CAN Module Documentation CAN Module Documentation Thomas Craig twc22 12/11/2009 Overview Purpose To provide a standard and robust C-language ARM7 software interface to the Controller Area Network (CAN) busses that form the main

More information

PC104P--HPDI32A High-speed Parallel Digital I/O PMC Board 100 to 200 Mbytes/s Cable I/O with PCI-DMA engine

PC104P--HPDI32A High-speed Parallel Digital I/O PMC Board 100 to 200 Mbytes/s Cable I/O with PCI-DMA engine PC104P--HPDI32A High-speed Parallel Digital I/O PMC Board 100 to 200 Mbytes/s Cable I/O with PCI-DMA engine Similar Product Features Include: 100 Mbytes per second (max) input transfer rate via the front

More information

Gyroscope Module 3-Axis L3G4200D (#27911)

Gyroscope Module 3-Axis L3G4200D (#27911) Web Site: www.parallax.com Forums: forums.parallax.com Sales: sales@parallax.com Technical: support@parallax.com Office: (916) 624-8333 Fax: (916) 624-8003 Sales: (888) 512-1024 Tech Support: (888) 997-8267

More information

Multifunction Serial Interface (PDL_MFS) Features. General Description. When to Use a PDL_MFS Component. Quick Start 1.0

Multifunction Serial Interface (PDL_MFS) Features. General Description. When to Use a PDL_MFS Component. Quick Start 1.0 1.0 Features Configures the Multi-Function Serial (MFS) Interface to one of the following modes: UART (Asynchronous normal serial interface) Clock synchronous serial interface (SPI and I 2 S can be supported)

More information

Application Note, V1.0, Jul AP XC16x. Interfacing the XC16x Microcontroller to a Serial SPI EEPROM. Microcontrollers

Application Note, V1.0, Jul AP XC16x. Interfacing the XC16x Microcontroller to a Serial SPI EEPROM. Microcontrollers Application Note, V1.0, Jul. 2006 AP16095 XC16x Interfacing the XC16x Microcontroller to a Serial SPI EEPROM Microcontrollers Edition 2006-07-10 Published by Infineon Technologies AG 81726 München, Germany

More information

AT03255: SAM D/R/L/C Serial Peripheral Interface (SERCOM SPI) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AT03255: SAM D/R/L/C Serial Peripheral Interface (SERCOM SPI) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE SMART ARM-based Microcontrollers AT03255: SAM D/R/L/C Serial Peripheral Interface (SERCOM SPI) Driver APPLICATION NOTE Introduction This driver for Atmel SMART ARM -based microcontrollers provides an interface

More information

V ARIENSE SENSE Y O UR W ORLD. Inertial Measurement Unit VMU931. User Guide. Version 1.3. March VARIENSE INC.

V ARIENSE SENSE Y O UR W ORLD. Inertial Measurement Unit VMU931. User Guide. Version 1.3. March VARIENSE INC. V ARIENSE SENSE Y O UR W ORLD Inertial Measurement Unit VMU931 Version 1.3 March 2018 2017 VARIENSE INC. Contents 1 Product Overview 1 2 Safety 2 3 Setup 3 3.1 Mounting the sensor...........................................

More information

ECE 471 Embedded Systems Lecture 20

ECE 471 Embedded Systems Lecture 20 ECE 471 Embedded Systems Lecture 20 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 20 October 2017 Announcements Project coming Only one person was in class Wednesday due to Career

More information

Release Notes for ADuCM302x EZ-KIT Lite Board Support Package 1.0.3

Release Notes for ADuCM302x EZ-KIT Lite Board Support Package 1.0.3 Release Notes for ADuCM302x EZ-KIT Lite Board Support Package 1.0.3 2016 Analog Devices, Inc. http://www.analog.com processor.tools.support@analog.com Contents 1 ADuCM302x EZ-KIT Lite Board Support Package

More information

Mio- x AHRS. Attitude and Heading Reference System. Engineering Specifications

Mio- x AHRS. Attitude and Heading Reference System. Engineering Specifications General Description Mio- x AHRS Attitude and Heading Reference System Engineering Specifications Rev. G 2012-05-29 Mio-x AHRS is a tiny sensormodule consists of 9 degree of freedom motion sensors (3 accelerometers,

More information

Inter-Integrated Circuit Bus IIC I2C TWI

Inter-Integrated Circuit Bus IIC I2C TWI Inter-Integrated Circuit Bus IIC TWI Bus Synchronous, multi-master, multi-slave, packet switched, single ended serial bus Developed by Philips in the early 1980 s (prior to SPI) Intended for on-board communications

More information

CyberAtom X-202 USER MANUAL. Copyrights Softexor 2015 All Rights Reserved.

CyberAtom X-202 USER MANUAL. Copyrights Softexor 2015 All Rights Reserved. CyberAtom X-202 USER MANUAL Copyrights Softexor 2015 All Rights Reserved. X-202 Contents ii Contents About...5 Block Diagram... 5 Axes Conventions...5 System Startup... 6 Hardware Reset...6 LED indicator...

More information

XEN1210 Magnetic Sensor

XEN1210 Magnetic Sensor Features Single axis magnetic measurement One chip solution 15nT resolution Unmatched low offset (Sub-µT) and gain precision Wide magnetic field range (±63mT) No magnetic hysteresis Measurement rate up

More information

Use of ISP1880 Accelero-Magnetometer, Temperature and Barometer Sensor

Use of ISP1880 Accelero-Magnetometer, Temperature and Barometer Sensor Use of Accelero-Magnetometer, Temperature and Barometer Sensor Application Note AN181105 Introduction Scope This application note describes how to set up a Sensor demonstration with Sensors Board that

More information

Pmod modules are powered by the host via the interface s power and ground pins.

Pmod modules are powered by the host via the interface s power and ground pins. 1300 Henley Court Pullman, WA 99163 509.334.6306 www.store. digilent.com Digilent Pmod Interface Specification 1.2.0 Revised October 5, 2017 1 Introduction The Digilent Pmod interface is used to connect

More information

Wasp Embedded Controller

Wasp Embedded Controller Wasp Embedded Controller Wasp16/32/64 Hardware Reference Guide PCB Rev 1.0 WASP16 WASP32 WASP64 MC433 Hardware Reference Guide Manual Revision 0.85 Table of Contents Warranty Statement...2 1.0 Introduction....4

More information

BMF055 Example Project Interrupts

BMF055 Example Project Interrupts BMF055 Example Project Interrupts Application Note: Document Revision 1.1 Document Release October 2015 Document Number BST- BMF055-EX002-00 Technical Reference 0 273 141 235 Notes Data in this document

More information

JeeNode V2. A small *duino-ish MPU board with a wireless RF module. Jean-Claude Wippler jeelab.equi4.com March 2009

JeeNode V2. A small *duino-ish MPU board with a wireless RF module. Jean-Claude Wippler jeelab.equi4.com March 2009 JeeNode V2 A small *duino-ish MPU board with a wireless RF module Overview Jean-Claude Wippler jeelab.equi4.com March 2009 The JeeNode is a small micro-controller board which can be used for a variety

More information

Thinxtra Xkit Development Guide for Arduino

Thinxtra Xkit Development Guide for Arduino Thinxtra Xkit Development Guide for Arduino April 2017 www.thinxtra.com/xkit INSTRUCTIONS & PREREQUISITES This is a documentation to help you developing specific applications with the Thinxtra Xkit shield

More information

libquadflash API 1 General Operations

libquadflash API 1 General Operations libquadflash API IN THIS DOCUMENT General Operations Boot Partition s Data Partition s The libquadflash library provides functions for reading and writing data to Quad-SPI flash devices that use the xcore

More information

Growing Together Globally Serial Communication Design In Embedded System

Growing Together Globally Serial Communication Design In Embedded System Growing Together Globally Serial Communication Design In Embedded System Contents Serial communication introduction......... 01 The advantages of serial design......... 02 RS232 interface......... 04 RS422

More information

TS Thread Library Reference. Version 6.2, December 2004

TS Thread Library Reference. Version 6.2, December 2004 TS Thread Library Reference Version 6.2, December 2004 IONA, IONA Technologies, the IONA logo, Orbix, Orbix/E, Orbacus, Artix, Orchestrator, Mobile Orchestrator, Enterprise Integrator, Adaptive Runtime

More information

Special Topics for Embedded Programming

Special Topics for Embedded Programming 1 Special Topics for Embedded Programming ETH Zurich Fall 2018 Reference: The C Programming Language by Kernighan & Ritchie 1 2 Overview of Topics Microprocessor architecture Peripherals Registers Memory

More information

MiCOKit-3166 Development Kit Hardware Manual

MiCOKit-3166 Development Kit Hardware Manual Hardware Engineering Department Working Group Track Number: Jing Minhua MXCHIP Co., Ltd Version: 1.1 July 2017 Category: Reference Manual Open MiCOKit-3166 Development Kit Hardware Manual Abstract MiCOKit

More information

Tizen OAL Interface & Sensor

Tizen OAL Interface & Sensor Tizen OAL Interface & Sensor Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@rtcc.hanyang.ac.kr Contents Tizen OAL Overview Tizen Sensor Architecture Tizen OAL in sensor

More information

Supply voltage. Input current. Encoder supply. Memory SIMATIC S7-200, CPU 221 COMPACT UNIT, DC POWER SUPPLY 6 DI DC/4 DO DC, 4 KB CODE/2 KB DATA,

Supply voltage. Input current. Encoder supply. Memory SIMATIC S7-200, CPU 221 COMPACT UNIT, DC POWER SUPPLY 6 DI DC/4 DO DC, 4 KB CODE/2 KB DATA, Data sheet SIMATIC S7-200, CPU 221 COMPACT UNIT, DC POWER SUPPLY 6 DI DC/4 DO DC, 4 KB CODE/2 KB DATA, Supply voltage Rated value (DC) 24 V DC Load voltage L+ Rated value (DC) permissible range, lower

More information

LatticeMico32 GPIO. Version. Features

LatticeMico32 GPIO. Version. Features The LatticeMico32 GPIO is a general-purpose input/output core that provides a memory-mapped interface between a WISHBONE slave port and generalpurpose I/O ports. The I/O ports can connect to either on-chip

More information

1.3inch OLED User Manual

1.3inch OLED User Manual 1.3inch OLED User Manual 1. Key Parameters Table 1: Key Parameters Driver Chip SH1106 Interface 3-wire SPI 4-wire SPI I2C Resolution 128*64 Display Size 1.3 inch Dimension 29mm*33mm Colors Yellow, Blue

More information

XGATE Library: Signal Gateway Implementing CAN and LIN Signal Level Gateway

XGATE Library: Signal Gateway Implementing CAN and LIN Signal Level Gateway Freescale Semiconductor Application Note Document Number: AN3333 Rev. 0, 11/2006 XGATE Library: Signal Gateway Implementing CAN and LIN Signal Level Gateway by: Daniel Malik MCD Applications East Kilbride,

More information

Application Note Software Device Drivers for the M29Fxx Flash Memory Device

Application Note Software Device Drivers for the M29Fxx Flash Memory Device Introduction Application Note Software Device Drivers for the M29Fxx Flash Memory Device Introduction This application note provides library source code in C for the M29Fxx Flash memory using the Flash

More information

DMX512 Receiver Datasheet DMX512Rx V 1.0. Features and Overview

DMX512 Receiver Datasheet DMX512Rx V 1.0. Features and Overview Datasheet DMX512Rx V 1.0 001-14404 Rev. *G DMX512 Receiver Copyright 2007-2014 Cypress Semiconductor Corporation. All Rights Reserved. Resources PSoC Blocks API Memory (Bytes) Digital Analog CT Analog

More information

int fnvgetconfig(handle h, UINT32 id, const void *cfg, size_t sz);... 4

int fnvgetconfig(handle h, UINT32 id, const void *cfg, size_t sz);... 4 RP-VL-UTIL-V1 Developer s Guide [ Contents ] 1. Introduction... 1 2. Building Environment... 1 3. Operating Environment... 1 4. Function Explanation... 2 4.1. Common API for Transmitting and Receiving...

More information

#include <tobii/tobii.h> char const* tobii_error_message( tobii_error_t error );

#include <tobii/tobii.h> char const* tobii_error_message( tobii_error_t error ); tobii.h Thread safety The tobii.h header file collects the core API functions of stream engine. It contains functions to initialize the API and establish a connection to a tracker, as well as enumerating

More information

Putting it All Together

Putting it All Together EE445M/EE360L.12 Embedded and Real-Time Systems/ Real-Time Operating Systems : Commercial RTOS, Final Exam, Review 1 Putting it All Together Micrium μcos-ii Reference: www.micrium.com Application Note

More information

PMC-HPDI32A-ASYNC High-speed Serial I/O PCI Board

PMC-HPDI32A-ASYNC High-speed Serial I/O PCI Board PMC-HPDI32A-ASYNC High-speed Serial I/O PCI Board Features Include: Data rate of 5.0 megabits per second 8 Bits transmitter. LSB First. Software Selectable Even / Odd Parity. Software Selectable No Parity

More information

IMU06WP. What is the IMU06?

IMU06WP. What is the IMU06? IMU06 What is the IMU06? The IMU06 is a compact 6 degree of freedom inertial measurement unit. It provides 3 axis acceleration (maximum 10G) and angular velocities (maximum 300 degrees/s) on both CAN and

More information

Optidrive Applications Support Library

Optidrive Applications Support Library Optidrive Applications Support Library Application Note Title AN-ODV-3-038 Related Products Optidrive Eco Overview Level 3 Modbus RTU Control and Register Mapping 1 Fundamental - No previous experience

More information

Microcontroller basics

Microcontroller basics FYS3240 PC-based instrumentation and microcontrollers Microcontroller basics Spring 2017 Lecture #4 Bekkeng, 30.01.2017 Lab: AVR Studio Microcontrollers can be programmed using Assembly or C language In

More information

ECE 1160/2160 Embedded Systems Design. Midterm Review. Wei Gao. ECE 1160/2160 Embedded Systems Design

ECE 1160/2160 Embedded Systems Design. Midterm Review. Wei Gao. ECE 1160/2160 Embedded Systems Design ECE 1160/2160 Embedded Systems Design Midterm Review Wei Gao ECE 1160/2160 Embedded Systems Design 1 Midterm Exam When: next Monday (10/16) 4:30-5:45pm Where: Benedum G26 15% of your final grade What about:

More information

DS Wire Digital Thermometer and Thermostat

DS Wire Digital Thermometer and Thermostat www.maxim-ic.com FEATURES Temperature measurements require no external components with ±1 C accuracy Measures temperatures from -55 C to +125 C; Fahrenheit equivalent is -67 F to +257 F Temperature resolution

More information

Specification E2 Interface

Specification E2 Interface Specification E2 Interface Version 4.1 Name Date Created: Robert Mayr. 15.04.2011 Checked: Haider A. 15.04.2011 Approved: Reason for change: Text corrections TABLE OF CONTENTS 1 INTRODUCTION... 3 1.1 Overview..................................................................................................................

More information

EZ I 2 C Slave. Features. General Description. When to use a EZ I 2 C Slave 1.50

EZ I 2 C Slave. Features. General Description. When to use a EZ I 2 C Slave 1.50 PSoC Creator Component Data Sheet EZ I 2 C Slave 1.50 Features Industry standard Philips I 2 C bus compatible interface Emulates common I 2 C EEPROM interface Only two pins (SDA and SCL) required to interface

More information

Modern Robotics Inc. Sensor Documentation

Modern Robotics Inc. Sensor Documentation Sensor Documentation Version 1.0.1 September 9, 2016 Contents 1. Document Control... 3 2. Introduction... 4 3. Three-Wire Analog & Digital Sensors... 5 3.1. Program Control Button (45-2002)... 6 3.2. Optical

More information

AFRecorder 4800R Serial Port Programming Interface Description For Software Version 9.5 (Last Revision )

AFRecorder 4800R Serial Port Programming Interface Description For Software Version 9.5 (Last Revision ) AFRecorder 4800R Serial Port Programming Interface Description For Software Version 9.5 (Last Revision 8-27-08) Changes from Version 9.2 1. The communication baud rate is raised to 9600. 2. Testing with

More information

Industrial I/O and You: Nonsense Hacks! Matt Ranostay Konsulko Group

Industrial I/O and You: Nonsense Hacks! Matt Ranostay Konsulko Group Industrial I/O and You: Nonsense Hacks! Matt Ranostay Konsulko Group Brief Introduction Been a contributor to the Industrial I/O system for about two years Any weird sensors

More information

Product Technical Brief S3C2440X Series Rev 2.0, Oct. 2003

Product Technical Brief S3C2440X Series Rev 2.0, Oct. 2003 Product Technical Brief S3C2440X Series Rev 2.0, Oct. 2003 S3C2440X is a derivative product of Samsung s S3C24XXX family of microprocessors for mobile communication market. The S3C2440X s main enhancement

More information

Qwiic Shield for Arduino & Photon Hookup Guide

Qwiic Shield for Arduino & Photon Hookup Guide Page 1 of 7 Qwiic Shield for Arduino & Photon Hookup Guide Introduction The Qwiic Shield (for Arduino or Particle Photon) is the first step in getting acquainted with SparkFun s Qwiic connect ecosystem.

More information

AN-1025 APPLICATION NOTE

AN-1025 APPLICATION NOTE APPLICATION NOTE One Technology Way PO Box 9106 Norwood, MA 02062-9106, USA Tel: 7813294700 Fax: 7814613113 wwwanalogcom Utilization of the First In, First Out (FIFO) Buffer in Analog Devices, Inc Digital

More information

Sensor Toolbox (Part 2): Inertial Sensors

Sensor Toolbox (Part 2): Inertial Sensors November 2010 Sensor Toolbox (Part 2): Inertial Sensors AMF-ENT-T1118 Michael Steffen MCU & Sensor Field Application Engineer Expert Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, CoreNet, the Energy Efficient

More information

82V391x / 8V893xx WAN PLL Device Families Device Driver User s Guide

82V391x / 8V893xx WAN PLL Device Families Device Driver User s Guide 82V391x / 8V893xx WAN PLL Device Families Device Driver Version 1.2 April 29, 2014 Table of Contents 1. Introduction... 1 2. Software Architecture... 2 2.1. Overview... 2 2.2. Hardware Abstraction Layer

More information

Motor Objects. Methods

Motor Objects. Methods Motor Objects Motor Objects Introduction A Motor object manages a single motor on a controller. It represents the physical connections between the motor, drive, and associated I/O. The Motor object contains

More information

Thermo 6 click PID: MIKROE-2769

Thermo 6 click PID: MIKROE-2769 Thermo 6 click PID: MIKROE-2769 Thermo 6 click is a precise and versatile ambient temperature measurement click board, based on the Maxim Integrated MAX31875 temperature sensor. This sensor has a great

More information

RX Family APPLICATION NOTE. Simple I 2 C Module Using Firmware Integration Technology. Introduction. Target Device.

RX Family APPLICATION NOTE. Simple I 2 C Module Using Firmware Integration Technology. Introduction. Target Device. APPLICATION NOTE RX Family R01AN1691EJ0220 Rev. 2.20 Introduction This application note describes the simple I 2 C module using firmware integration technology (FIT) for communications between devices

More information