189 #ifndef __CHIRP_BSP_H_
190 #define __CHIRP_BSP_H_
void chbsp_set_int1_dir_in(ch_dev_t *dev_ptr)
Configure the Chirp sensor INT1 pin as an input for one sensor.
int chbsp_spi_mem_read_nb(ch_dev_t *dev_ptr, uint16_t mem_addr, uint8_t *data, uint16_t num_bytes)
Read bytes from an SPI slave using memory addressing, non-blocking.
void chbsp_group_set_int2_dir_out(ch_group_t *grp_ptr)
Configure the Chirp sensor INT2 pin as an output for a group of sensors.
void chbsp_set_int2_dir_in(ch_dev_t *dev_ptr)
Configure the Chirp sensor INT2 pin as an input for one sensor.
uint8_t chbsp_i2c_get_info(ch_group_t *grp_ptr, uint8_t dev_num, ch_i2c_info_t *info_ptr)
Return I2C information for a sensor port on the board.
void chbsp_print_str(const char *str)
Output a text string via serial interface.
void chbsp_group_int2_clear(ch_group_t *grp_ptr)
Set the INT2 pins as inactive for a group of sensors.
void chbsp_debug_on(uint8_t dbg_pin_num)
Turn on a debug indicator pin.
void chbsp_int1_interrupt_disable(ch_dev_t *dev_ptr)
Disable the INT1 interrupt for one sensor.
void chbsp_event_notify(uint32_t event_mask)
Notify an interrupt event for the selected device.
void chbsp_external_irq_handler(chdrv_transaction_t *trans)
Interrupt handler callout for external devices sharing the SPI/I2C bus.
void chbsp_reset_release(void)
Deassert the reset pin for all sensors.
int chbsp_i2c_read_nb(ch_dev_t *dev_ptr, uint8_t *data, uint16_t num_bytes)
Read bytes from an I2C slave, non-blocking.
void chbsp_event_wait_setup(uint32_t event_mask)
Prepare the mechanism to wait for an event.
void chbsp_int1_interrupt_enable(ch_dev_t *dev_ptr)
Enable the INT1 interrupt for one sensor.
void chbsp_int2_set(ch_dev_t *dev_ptr)
Set the INT2 pin high for one sensor.
void chbsp_delay_us(uint32_t us)
Delay for specified number of microseconds.
uint32_t chbsp_timestamp_ms(void)
Return a free-running counter value in milliseconds.
void chbsp_group_int1_interrupt_disable(ch_group_t *grp_ptr)
Disable INT1 interrupts for a group of sensors.
void chbsp_spi_cs_on(ch_dev_t *dev_ptr)
Assert the SPI chip select line for a device.
int chbsp_i2c_write(ch_dev_t *dev_ptr, const uint8_t *data, uint16_t num_bytes)
Write bytes to an I2C slave.
void chbsp_debug_toggle(uint8_t dbg_pin_num)
Toggle a debug indicator pin.
void chbsp_debug_off(uint8_t dbg_pin_num)
Turn off a debug indicator pin.
void chbsp_i2c_reset(ch_dev_t *dev_ptr)
Reset I2C bus associated with device.
int chbsp_spi_write(ch_dev_t *dev_ptr, const uint8_t *data, uint16_t num_bytes)
Write bytes to an SPI slave.
void chbsp_spi_cs_off(ch_dev_t *dev_ptr)
De-assert the SPI chip select line for a device.
void chbsp_reset_assert(void)
Assert the reset pin for all sensors.
uint8_t chbsp_event_wait(uint16_t time_out_ms, uint32_t event_mask)
Wait for any interrupt event.
void chbsp_group_set_int1_dir_out(ch_group_t *grp_ptr)
Configure the Chirp sensor INT1 pin as an output for a group of sensors.
void chbsp_int2_interrupt_enable(ch_dev_t *dev_ptr)
Enable the INT2 interrupt for one sensor.
int chbsp_i2c_read(ch_dev_t *dev_ptr, uint8_t *data, uint16_t num_bytes)
Read bytes from an I2C slave.
void chbsp_int1_set(ch_dev_t *dev_ptr)
Set the INT1 pin high for one sensor.
void chbsp_group_int2_interrupt_enable(ch_group_t *grp_ptr)
Enable INT2 interrupts for a group of sensors.
int chbsp_i2c_mem_read(ch_dev_t *dev_ptr, uint16_t mem_addr, uint8_t *data, uint16_t num_bytes)
Read bytes from an I2C slave using memory addressing.
int chbsp_i2c_init(void)
Initialize the host's I2C hardware.
void chbsp_group_set_int2_dir_in(ch_group_t *grp_ptr)
Configure the Chirp sensor INT2 pins as inputs for a group of sensors.
void chbsp_program_disable(ch_dev_t *dev_ptr)
Deassert the PROG pin.
void chbsp_group_int1_set(ch_group_t *grp_ptr)
Set the INT1 pins high for a group of sensors.
void chbsp_int2_clear(ch_dev_t *dev_ptr)
Set the INT2 pin as inactive for one sensor.
void chbsp_group_int1_clear(ch_group_t *grp_ptr)
Set the INT1 pins low for a group of sensors.
void chbsp_set_int2_dir_out(ch_dev_t *dev_ptr)
Configure the Chirp sensor INT2 pin as an output for one sensor.
void chbsp_delay_ms(uint32_t ms)
Delay for specified number of milliseconds.
void chbsp_int2_interrupt_disable(ch_dev_t *dev_ptr)
Disable the INT2 interrupt for one sensor.
void chbsp_group_int1_interrupt_enable(ch_group_t *grp_ptr)
Enable INT1 interrupts for a group of sensors.
void chbsp_program_enable(ch_dev_t *dev_ptr)
Assert the PROG pin.
int chbsp_spi_read(ch_dev_t *dev_ptr, uint8_t *data, uint16_t num_bytes)
Read bytes from an SPI slave.
void chbsp_group_set_int1_dir_in(ch_group_t *grp_ptr)
Configure the Chirp sensor INT1 pins as inputs for a group of sensors.
int chbsp_i2c_mem_write_nb(ch_dev_t *dev_ptr, uint16_t mem_addr, uint8_t *data, uint16_t num_bytes)
Write bytes to an I2C slave using memory addressing, non-blocking.
void chbsp_int1_clear(ch_dev_t *dev_ptr)
Set the INT1 pin low for one sensor.
int chbsp_i2c_mem_read_nb(ch_dev_t *dev_ptr, uint16_t mem_addr, uint8_t *data, uint16_t num_bytes)
Read bytes from an I2C slave using memory addressing, non-blocking.
void chbsp_group_int2_set(ch_group_t *grp_ptr)
Set the INT2 pins high for a group of sensors.
void chbsp_group_int2_interrupt_disable(ch_group_t *grp_ptr)
Disable INT2 interrupts for a group of sensors.
void chbsp_set_int1_dir_out(ch_dev_t *dev_ptr)
Configure the Chirp sensor INT1 pin as an output for one sensor.
int chbsp_i2c_mem_write(ch_dev_t *dev_ptr, uint16_t mem_addr, uint8_t *data, uint16_t num_bytes)
Write bytes to an I2C slave using memory addressing.
SonicLib public API and support functions for TDK/InvenSense ultrasonic sensors (originally developed...
Chirp sensor device descriptor structure.
Definition: soniclib.h:732
Chirp sensor group descriptor structure.
Definition: soniclib.h:704
I2C info structure.
Definition: soniclib.h:413
Transaction control structure.
Definition: ch_driver.h:104