libtropic
C library for TROPIC01 chip
Layer 1 functions

Used internally. More...

Files

file  lt_l1.h
 Layer 1 functions declarations.
 
file  lt_l1_port_wrap.h
 Layer 1 functions declarations.
 

Macros

#define CHIP_MODE_READY_bit   0x01
 
#define CHIP_MODE_ALARM_bit   0x02
 
#define CHIP_MODE_STARTUP_bit   0x04
 
#define LT_L1_READ_MAX_TRIES   10
 
#define LT_L1_READ_RETRY_DELAY   25
 
#define LT_L1_TIMEOUT_MS_MIN   5
 
#define LT_L1_TIMEOUT_MS_DEFAULT   70
 
#define LT_L1_TIMEOUT_MS_MAX   150
 
#define GET_RESPONSE_REQ_ID   0xAA
 

Functions

lt_ret_t lt_l1_read (lt_l2_state_t *s2, const uint32_t max_len, const uint32_t timeout_ms)
 Reads data from TROPIC01 into host platform. More...
 
lt_ret_t lt_l1_write (lt_l2_state_t *s2, const uint16_t len, const uint32_t timeout_ms)
 Writes data from host platform into TROPIC01. More...
 
lt_ret_t lt_l1_init (lt_l2_state_t *s2)
 Initializes handle and L1. More...
 
lt_ret_t lt_l1_deinit (lt_l2_state_t *s2)
 Wipes handle and deinitializes L1. This is wrapper for platform defined function. More...
 
lt_ret_t lt_l1_spi_csn_low (lt_l2_state_t *s2)
 Sets chip select pin low. This is wrapper for platform defined function. More...
 
lt_ret_t lt_l1_spi_csn_high (lt_l2_state_t *s2)
 Sets chip select pin high. This is wrapper for platform defined function. More...
 
lt_ret_t lt_l1_spi_transfer (lt_l2_state_t *s2, uint8_t offset, uint16_t tx_len, uint32_t timeout_ms)
 Does L1 transfer. This is wrapper for platform defined function. More...
 
lt_ret_t lt_l1_delay (lt_l2_state_t *s2, uint32_t ms)
 Platform's definition for delay, specifies what host platform should do when libtropic's functions need some delay. This is wrapper for platform defined function. More...
 
lt_ret_t lt_l1_delay_on_int (lt_l2_state_t *s2, uint32_t ms)
 Specifies what platform should do when waiting for signal from interrupt pin. More...
 

Detailed Description

Function used internally by libtropic during l1 operation.

Function used internally by libtropic during L1 operation.