130 #ifndef __CHIRP_BSP_H_ 131 #define __CHIRP_BSP_H_ void chbsp_reset_release(void)
Deassert the reset pin for all sensors.
void chbsp_led_off(uint8_t dev_num)
Turn off an LED on the board.
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.
int chbsp_i2c_write_nb(ch_dev_t *dev_ptr, uint8_t *data, uint16_t num_bytes)
Write bytes to an I2C slave, non-blocking.
void chbsp_program_enable(ch_dev_t *dev_ptr)
Assert the PROG pin.
uint8_t chbsp_periodic_timer_init(uint16_t interval_ms, ch_timer_callback_t callback_func_ptr)
Initialize periodic timer.
void chbsp_led_toggle(uint8_t dev_num)
Toggle an LED on the board.
int chbsp_i2c_read(ch_dev_t *dev_ptr, uint8_t *data, uint16_t num_bytes)
Read bytes from an I2C slave.
void chbsp_set_io_dir_out(ch_dev_t *dev_ptr)
Configure the Chirp sensor INT pin as an output for one sensor.
Chirp SonicLib public API and support functions for Chirp ultrasonic sensors.
void(* ch_timer_callback_t)(void)
Periodic timer callback routine pointer.
Definition: soniclib.h:320
void chbsp_io_callback_set(ch_io_int_callback_t callback_func_ptr)
Set callback routine for Chirp sensor I/O interrupt.
void chbsp_external_i2c_irq_handler(chdrv_i2c_transaction_t *trans)
Interrupt handler callout for external devices sharing the I2C bus.
void chbsp_set_io_dir_in(ch_dev_t *dev_ptr)
Configure the Chirp sensor INT pin as an input for one sensor.
void chbsp_group_io_clear(ch_group_t *grp_ptr)
Set the INT pins low for a group of sensors.
void chbsp_group_set_io_dir_out(ch_group_t *grp_ptr)
Configure the Chirp sensor INT pin as an output for a group of sensors.
Chirp sensor device structure.
Definition: soniclib.h:349
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(char *str)
Output a text string via serial interface.
void chbsp_group_io_interrupt_enable(ch_group_t *grp_ptr)
Enable interrupts for a group of sensors.
void chbsp_group_io_interrupt_disable(ch_group_t *grp_ptr)
Disable interrupts for a group of sensors.
void chbsp_io_set(ch_dev_t *dev_ptr)
Set the INT pin high for one sensor.
uint8_t chbsp_periodic_timer_stop(void)
Stop periodic timer.
void chbsp_io_interrupt_enable(ch_dev_t *dev_ptr)
Enable the interrupt for one sensor.
void chbsp_group_set_io_dir_in(ch_group_t *grp_ptr)
Configure the Chirp sensor INT pins as inputs for a group of sensors.
Chirp sensor group configuration structure.
Definition: soniclib.h:329
int chbsp_i2c_write(ch_dev_t *dev_ptr, uint8_t *data, uint16_t num_bytes)
Write bytes to an I2C slave.
I2C info structure.
Definition: soniclib.h:189
I2C transaction control structure.
Definition: ch_driver.h:102
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.
void chbsp_periodic_timer_handler(void)
Periodic timer handler.
uint8_t chbsp_periodic_timer_start(void)
Start periodic timer.
void chbsp_periodic_timer_irq_disable(void)
Disable periodic timer interrupt.
void chbsp_delay_ms(uint32_t ms)
Delay for specified number of milliseconds.
void chbsp_io_clear(ch_dev_t *dev_ptr)
Set the INT pin low for one sensor.
void chbsp_debug_toggle(uint8_t dbg_pin_num)
Toggle a debug indicator pin.
void chbsp_proc_sleep(void)
Put the processor into low-power sleep state.
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(* ch_io_int_callback_t)(ch_group_t *grp_ptr, uint8_t io_index)
Data-ready interrupt callback routine pointer.
Definition: soniclib.h:314
void chbsp_io_interrupt_disable(ch_dev_t *dev_ptr)
Disable the interrupt for one sensor.
uint32_t chbsp_timestamp_ms(void)
Return a free-running counter value in milliseconds.
int chbsp_i2c_deinit(void)
De-initialize the host's I2C hardware.
void chbsp_periodic_timer_irq_enable(void)
Enable periodic timer interrupt.
void chbsp_debug_off(uint8_t dbg_pin_num)
Turn off a debug indicator pin.
void chbsp_debug_on(uint8_t dbg_pin_num)
Turn on a debug indicator pin.
void chbsp_program_disable(ch_dev_t *dev_ptr)
Deassert the PROG pin.
void chbsp_board_init(ch_group_t *grp_ptr)
Main hardware initialization.
int chbsp_i2c_init(void)
Initialize the host's I2C hardware.
void chbsp_i2c_reset(ch_dev_t *dev_ptr)
Reset I2C bus associated with device.
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_reset_assert(void)
Assert the reset pin for all sensors.
void chbsp_group_io_set(ch_group_t *grp_ptr)
Set the INT pins high for a group of sensors.
void chbsp_group_pin_init(ch_group_t *grp_ptr)
Initialize the set of I/O pins for a group of sensors.
void chbsp_led_on(uint8_t dev_num)
Turn on an LED on the board.
void chbsp_delay_us(uint32_t us)
Delay for specified number of microseconds.
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.