40 #ifndef CASCODA_SENSORIF_H
41 #define CASCODA_SENSORIF_H
52 #define SENSORIF_I2C_TIMEOUT 100
53 #define SENSORIF_I2C_CLK_FREQUENCY 100000
54 #define SENSORIF_INT_PULLUPS 0
55 #define SENSORIF_SPI_CLK_FREQUENCY 4000000
56 #define SENSORIF_SPI_DATA_WIDTH 8
57 #define UART_SENSORIF_BAUDRATE 115200
59 #if defined(CASCODA_CHILI2_CONFIG)
The main ca821x-api include file.
u8_t SENSORIF_SPI_Chip_Select()
Definition: cascoda_sensorif_m2351.c:136
__NONSECURE_ENTRY void SENSORIF_SECURE_SPI_Config(u32_t portnum)
Definition: cascoda_sensorif_secure.c:188
__NONSECURE_ENTRY void SENSORIF_SECURE_I2C_Config(u32_t portnum)
Definition: cascoda_sensorif_secure.c:175
__NONSECURE_ENTRY void SENSORIF_SECURE_UART_Config(u32_t portnum)
Definition: cascoda_sensorif_secure.c:202
Type definitions used by Cascoda baremetal drivers.
unsigned long u32_t
Definition: cascoda_types.h:50
unsigned char u8_t
Definition: cascoda_types.h:46
void SENSORIF_I2C_Init(void)
Initialises and enables I2C interface.
Definition: cascoda_sensorif_nano120.c:201
enum sensorif_i2c_status SENSORIF_I2C_Read(u8_t slaveaddr, u8_t *pdata, u32_t *plen)
Reads bytes from I2C slave.
Definition: cascoda_sensorif_nano120.c:132
ca_error SENSORIF_SPI_Write(u8_t out_data)
Writes bytes to SPI slave.
Definition: cascoda_sensorif_m2351.c:333
enum sensorif_i2c_status SENSORIF_I2C_Write(u8_t slaveaddr, u8_t *data, u32_t *len)
Writes bytes to I2C slave.
Definition: cascoda_sensorif_nano120.c:70
u32_t SENSORIF_UART_Read(u8_t *in_data, u32_t readbytes)
Read bytes to UART slave.
Definition: cascoda_sensorif_m2351.c:421
void SENSORIF_PWM_Deinit(void)
Deinitialises and disables PWM.
Definition: cascoda_sensorif_secure.c:518
ca_error SENSORIF_PWM_Init(u8_t pin, u32_t u32Frequency, u32_t u32DutyCycle)
Initialises and enables PWM for the specified frequency and duty cycle.
Definition: cascoda_sensorif_secure.c:463
void SENSORIF_UART_Init(void)
Initialises and enables UART interface.
Definition: cascoda_sensorif_secure.c:431
void SENSORIF_I2C_Deinit(void)
Disables I2C interface.
Definition: cascoda_sensorif_nano120.c:238
sensorif_i2c_status
I2C master status enumerations.
Definition: cascoda_sensorif.h:74
void SENSORIF_UART_Deinit(void)
Disables UART interface.
Definition: cascoda_sensorif_secure.c:456
void SENSORIF_SPI_WRITE_THEN_READ(u8_t *RxBuf, u8_t *TxBuf, u8_t RxLen, u8_t TxLen)
Exchange bytes between SPI slave and master.
Definition: cascoda_sensorif_m2351.c:354
u32_t SENSORIF_UART_Write(u8_t *out_data, u32_t writebytes)
Writes bytes to UART slave.
Definition: cascoda_sensorif_m2351.c:405
void SENSORIF_UART_Config(u32_t portnum)
Set UART Configuration.
Definition: cascoda_sensorif_m2351.c:177
void SENSORIF_SPI_Init(bool is_eink_display_present)
Initialises and enables SPI interface.
Definition: cascoda_sensorif_secure.c:340
PWM_type_t
Definition: cascoda_sensorif.h:98
void SENSORIF_SPI_Deinit(void)
Disables SPI interface.
Definition: cascoda_sensorif_secure.c:420
void SENSORIF_SPI_FULL_DUPLEX_RXONLY(u8_t *RxBuf, u8_t RxLen)
Read data in the RX while sending IDLE data to TX.
Definition: cascoda_sensorif_m2351.c:345
void SENSORIF_SPI_Config(u32_t portnum)
Set SPI Configuration.
Definition: cascoda_sensorif_m2351.c:156
void SENSORIF_PWM_SetDutyCycle(u32_t u32DutyCycle)
Changes the duty cycle of the PWM.
Definition: cascoda_sensorif_secure.c:544
void SENSORIF_I2C_Config(u32_t portnum)
Set I2C Configuration.
Definition: cascoda_sensorif_nano120.c:60
@ SENSORIF_I2C_ST_BUS_ERROR
bus error re-mapped from 0x00 for status return
Definition: cascoda_sensorif.h:93
@ SENSORIF_I2C_ST_START
start
Definition: cascoda_sensorif.h:75
@ SENSORIF_I2C_ST_TX_AD_NACK
transmit address NACKed
Definition: cascoda_sensorif.h:78
@ SENSORIF_I2C_ST_RELEASED
bus released
Definition: cascoda_sensorif.h:88
@ SENSORIF_I2C_ST_TX_DT_ACK
transmit data ACKed
Definition: cascoda_sensorif.h:79
@ SENSORIF_I2C_ST_RX_AD_ACK
receive address ACKed
Definition: cascoda_sensorif.h:82
@ SENSORIF_I2C_ST_RX_DT_NACK
receive data NACKed
Definition: cascoda_sensorif.h:85
@ SENSORIF_I2C_ST_RX_DT_ACK
receive data ACKed
Definition: cascoda_sensorif.h:84
@ SENSORIF_I2C_ST_ARB_LOST
arbitration lost
Definition: cascoda_sensorif.h:81
@ SENSORIF_I2C_ST_RX_AD_NACK
receive address NACKed
Definition: cascoda_sensorif.h:83
@ SENSORIF_I2C_ST_TX_AD_ACK
transmit address ACKed
Definition: cascoda_sensorif.h:77
@ SENSORIF_I2C_ST_STOP
on reset or stop
Definition: cascoda_sensorif.h:87
@ SENSORIF_I2C_ST_RSTART
repeat start
Definition: cascoda_sensorif.h:76
@ SENSORIF_I2C_ST_SUCCESS
successful transfer
Definition: cascoda_sensorif.h:91
@ SENSORIF_I2C_ST_TX_DT_NACK
transmit data NACKed
Definition: cascoda_sensorif.h:80
@ SENSORIF_I2C_ST_BUS_ERROR_RAW
bus error code transmitted over wire
Definition: cascoda_sensorif.h:86
@ SENSORIF_I2C_ST_NOT_IMPLEMENTED
not implemented
Definition: cascoda_sensorif.h:90
@ SENSORIF_I2C_ST_TIMEOUT
bus access time-out
Definition: cascoda_sensorif.h:92
@ USING_EPWM
Definition: cascoda_sensorif.h:101
@ USING_BPWM
Definition: cascoda_sensorif.h:100
@ NOT_INITIALISED
Definition: cascoda_sensorif.h:99
ca_error
Cascoda error type.
Definition: ca821x_error.h:51