30 #ifndef CODEBASE_HAL_HAL_TWIM_H_ 31 #define CODEBASE_HAL_HAL_TWIM_H_ 36 #error TWIM peripheral is not present in the nRF51 SoC 39 #if SYS_CFG_PRESENT == 1 40 #include "sys_config.h" 42 #ifndef HAL_TWIM_PERIPH_USED 43 #define HAL_TWIM_PERIPH_USED 0 48 #define TWIM_USED HAL_TWIM_PERIPH_USED 87 #define TWIM_TX_DONE_MSK (1<<TWIM_TX) 88 #define TWIM_RX_DONE_MSK (1<<TWIM_RX) 89 #define TWIM_TX_RX_DONE_MSK (1<<TWIM_TX_RX) 147 uint8_t * rx_ptr, uint32_t rx_len);
uint32_t irq_priority
Interrupt priority.
uint32_t evt_mask
Event Mask for specifying which successful transfer type calls the handler.
hal_twim_freq_t frequency
TWI frequency.
twim_ret_status hal_twim_rx(uint8_t *rx_ptr, uint32_t rx_len)
Start a Rx only TWI transfer.
The TWIM peripheral is not initialized.
The slave device generated an error on the data bytes.
twim_transfer_t
Defines for the types of transfers possible.
uint32_t hal_twim_get_current_adrs(void)
Get the current specified address of the I2C slave.
hal_twim_freq_t
Defines for TWI master clock frequency.
The slave device generated an error on the address bytes.
void hal_twim_uninit(void)
Function for uninitializing and disabling one of the TWIM peripheral.
twim_err_t
Defines for the types of errors possible during TWI transactions.
A Tx transfer followed by Rx with a repeated start.
twim_ret_status
Defines for the return values for the transfer calls.
No error for this transfer.
twim_ret_status hal_twim_tx_rx(uint8_t *tx_ptr, uint32_t tx_len, uint8_t *rx_ptr, uint32_t rx_len)
Start a Tx TWI transfer followed by a Rx by repeated start.
A transfer is already happening.
Transfer successfully started.
Structure for the TWI master driver initialization.
uint32_t scl
SCL pin number.
uint32_t sda
SDA pin number.
void hal_twim_init(hal_twim_init_config_t *config)
Function for initializing and enabling one of the TWIM peripheral.
twim_ret_status hal_twim_tx(uint8_t *tx_ptr, uint32_t tx_len)
Start a Tx only TWI transfer.