Low-level driver for the ADS7843 touch controller.
This driver provides access to the main features of the ADS7843 controller.
Functions | |
void | ads7843_disable_interrupt (void) |
Disable interrupts on touch event. More... | |
void | ads7843_enable_interrupt (void) |
Enable interrupts on touch event. More... | |
void | ads7843_get_raw_point (uint32_t *p_x, uint32_t *p_y) |
Get the touch raw coordinates. More... | |
uint32_t | ads7843_init (void) |
Initialize the SPI communication with the ADS7843 controller. More... | |
uint32_t | ads7843_is_pressed (void) |
Return the touch screen status, pressed or not. More... | |
void | ads7843_set_handler (void(*p_handler)(uint32_t, uint32_t)) |
Set the touch interrupt handler. More... | |
Disable interrupts on touch event.
Disable the interrupt
References BOARD_ADS7843_IRQ_GPIO, and pio_disable_pin_interrupt().
Enable interrupts on touch event.
Enable the interrupt
References BOARD_ADS7843_IRQ_GPIO, and pio_enable_pin_interrupt().
void ads7843_get_raw_point | ( | uint32_t * | p_x, |
uint32_t * | p_y | ||
) |
Get the touch raw coordinates.
p_x | Pointer to an integer representing the X value. |
p_y | Pointer to an integer representing the Y value. |
Disable interrupt to quickly evaluate the coordinates
Get X position
Get Y position
Switch to full power mode
Re-enable interrupt
References ads7843_send_cmd(), BOARD_ADS7843_IRQ_GPIO, CMD_ENABLE_PENIRQ, CMD_X_POSITION, CMD_Y_POSITION, pio_disable_pin_interrupt(), and pio_enable_pin_interrupt().
uint32_t ads7843_init | ( | void | ) |
Initialize the SPI communication with the ADS7843 controller.
Board specific chip select configuration
References ads7843_send_cmd(), ADS7843_SPI_BAUDRATE, BOARD_ADS7843_SPI_BASE, BOARD_ADS7843_SPI_NPCS, CMD_ENABLE_PENIRQ, spi_device::id, spi_enable(), spi_master_init(), spi_master_setup_device(), SPI_MODE_0, and spi_select_device().
uint32_t ads7843_is_pressed | ( | void | ) |
Return the touch screen status, pressed or not.
References BOARD_ADS7843_IRQ_GPIO, ioport_get_pin_level(), and IOPORT_PIN_LEVEL_LOW.
Set the touch interrupt handler.
p_handler | Interrupt handler function pointer. |
Initialize interrupts
Enable the interrupt
References BOARD_ADS7843_IRQ_FLAGS, BOARD_ADS7843_IRQ_GPIO, pio_enable_pin_interrupt(), and pio_handler_set_pin().