llvm-mos-sdk
|
Go to the source code of this file.
Macros | |
#define | NEO_UART_PROTOCOL_8N1 0 |
Typedefs | |
typedef enum neo_uext_direction | neo_uext_direction_t |
Enumerations | |
enum | neo_uext_direction { NEO_UEXT_INPUT = 1, NEO_UEXT_OUTPUT = 2, NEO_UEXT_ANALOGUE_INPUT = 3 } |
Functions | |
void | neo_uext_init (void) |
Initialise the UExt I/O system. More... | |
void | neo_uext_gpio_write (uint8_t pin, uint8_t value) |
Write the specified value to the output latch for the specified UEXT pin. More... | |
uint8_t | neo_uext_gpio_read (uint8_t pin) |
Reads the value on the specified UEXT pin. More... | |
void | neo_uext_gpio_set_direction (uint8_t pin, uint8_t direction) |
Set the direction of the specified UEXT pin. More... | |
void | neo_uext_i2c_write (uint8_t device, uint8_t reg, uint8_t value) |
Write to an I2C device. More... | |
uint8_t | neo_uext_i2c_read (uint8_t device, uint8_t reg) |
Read from an I2C device. More... | |
uint16_t | neo_uext_analogue_read (uint8_t pin) |
Read from an analogue input pin. More... | |
uint8_t | neo_uext_i2c_status (uint8_t device) |
Query the I2C device status. More... | |
void | neo_uext_i2c_block_read (uint8_t device, void *dest, uint16_t len) |
Read a block from an I2C device. More... | |
void | neo_uext_i2c_block_write (uint8_t device, const void *src, uint16_t len) |
Write a block to an I2C device. More... | |
void | neo_uext_spi_block_read (uint8_t device, void *dest, uint16_t len) |
Read a block from an SPI device. More... | |
void | neo_uext_spi_block_write (uint8_t device, const void *src, uint16_t len) |
Write a block to an SPI device. More... | |
void | neo_uext_uart_block_read (uint8_t device, void *dest, uint16_t len) |
Read a block from an UART device. More... | |
void | neo_uext_uart_block_write (uint8_t device, const void *src, uint16_t len) |
Write a block to an UART device. More... | |
void | neo_uext_uart_configure (uint32_t baudrate, uint8_t protocol) |
Configure the UART baud rate and protocol. More... | |
void | neo_uext_uart_write (uint8_t value) |
Write a byte to UART. More... | |
uint8_t | neo_uext_uart_read (void) |
Read a byte from UART. More... | |
bool | neo_uext_uart_available (void) |
Check if a byte can be read from UART. More... | |
#define NEO_UART_PROTOCOL_8N1 0 |
typedef enum neo_uext_direction neo_uext_direction_t |
enum neo_uext_direction |
uint16_t neo_uext_analogue_read | ( | uint8_t | pin | ) |
uint8_t neo_uext_gpio_read | ( | uint8_t | pin | ) |
Reads the value on the specified UEXT pin.
If the pin is set to input, this will read the level on the pin. If the pin is set to output, this will read the value set on the output latch.
Check errors with
void neo_uext_gpio_set_direction | ( | uint8_t | pin, |
uint8_t | direction | ||
) |
Set the direction of the specified UEXT pin.
Check errors with
void neo_uext_gpio_write | ( | uint8_t | pin, |
uint8_t | value | ||
) |
Write the specified value to the output latch for the specified UEXT pin.
This will only be output if the pin is enabled and its direction set to output.
Check errors with
void neo_uext_i2c_block_read | ( | uint8_t | device, |
void * | dest, | ||
uint16_t | len | ||
) |
void neo_uext_i2c_block_write | ( | uint8_t | device, |
const void * | src, | ||
uint16_t | len | ||
) |
uint8_t neo_uext_i2c_read | ( | uint8_t | device, |
uint8_t | reg | ||
) |
uint8_t neo_uext_i2c_status | ( | uint8_t | device | ) |
void neo_uext_i2c_write | ( | uint8_t | device, |
uint8_t | reg, | ||
uint8_t | value | ||
) |
void neo_uext_init | ( | void | ) |
Initialise the UExt I/O system.
Set all UEXT pins to I/O pins, inputs and enabled.
void neo_uext_spi_block_read | ( | uint8_t | device, |
void * | dest, | ||
uint16_t | len | ||
) |
void neo_uext_spi_block_write | ( | uint8_t | device, |
const void * | src, | ||
uint16_t | len | ||
) |
bool neo_uext_uart_available | ( | void | ) |
Check if a byte can be read from UART.
void neo_uext_uart_block_read | ( | uint8_t | device, |
void * | dest, | ||
uint16_t | len | ||
) |
void neo_uext_uart_block_write | ( | uint8_t | device, |
const void * | src, | ||
uint16_t | len | ||
) |
void neo_uext_uart_configure | ( | uint32_t | baudrate, |
uint8_t | protocol | ||
) |
Configure the UART baud rate and protocol.
uint8_t neo_uext_uart_read | ( | void | ) |
Read a byte from UART.
void neo_uext_uart_write | ( | uint8_t | value | ) |
Write a byte to UART.