Lines Matching refs:context
49 static void lr1110_board_init_tcxo_io( const void* context );
51 void lr1110_board_init_io( const void* context ) in lr1110_board_init_io() argument
53 …GpioInit( &( ( lr1110_t* ) context )->reset, RADIO_RESET, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, … in lr1110_board_init_io()
54 …GpioInit( &( ( lr1110_t* ) context )->spi.Nss, RADIO_NSS, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, … in lr1110_board_init_io()
55 …GpioInit( &( ( lr1110_t* ) context )->dio_1, RADIO_DIO_1, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 0… in lr1110_board_init_io()
56 …GpioInit( &( ( lr1110_t* ) context )->busy, RADIO_BUSY, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 0 ); in lr1110_board_init_io()
59 void lr1110_board_deinit_io( const void* context ) in lr1110_board_deinit_io() argument
61 …GpioInit( &( ( lr1110_t* ) context )->reset, RADIO_RESET, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, … in lr1110_board_deinit_io()
62 …GpioInit( &( ( lr1110_t* ) context )->spi.Nss, RADIO_NSS, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, … in lr1110_board_deinit_io()
63 …GpioInit( &( ( lr1110_t* ) context )->dio_1, RADIO_DIO_1, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 0… in lr1110_board_deinit_io()
64 …GpioInit( &( ( lr1110_t* ) context )->busy, RADIO_BUSY, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 0 ); in lr1110_board_deinit_io()
67 void lr1110_board_init_dbg_io( const void* context ) in lr1110_board_init_dbg_io() argument
75 void lr1110_board_set_rf_tx_power( const void* context, int8_t power ) in lr1110_board_set_rf_tx_power() argument
92 lr1110_radio_set_tx_params( context, power, LR1110_RADIO_RAMP_TIME_40U ); in lr1110_board_set_rf_tx_power()
95 uint32_t lr1110_board_get_tcxo_wakeup_time( const void* context ) in lr1110_board_get_tcxo_wakeup_time() argument
100 uint32_t lr1110_get_dio_1_pin_state( const void* context ) in lr1110_get_dio_1_pin_state() argument
102 return GpioRead( &( ( lr1110_t* ) context )->dio_1 ); in lr1110_get_dio_1_pin_state()
105 void lr1110_board_init( const void* context, lr1110_dio_irq_handler dio_irq ) in lr1110_board_init() argument
107 lr1110_system_reset( context ); in lr1110_board_init()
108 lr1110_hal_set_operating_mode( context, LR1110_HAL_OP_MODE_STDBY_RC ); in lr1110_board_init()
111 …GpioSetInterrupt( &( ( lr1110_t* ) context )->dio_1, IRQ_RISING_EDGE, IRQ_HIGH_PRIORITY, dio_irq ); in lr1110_board_init()
116 lr1110_system_get_status( context, &stat1, &stat2, &irq ); in lr1110_board_init()
118 lr1110_system_get_version( context, &version ); in lr1110_board_init()
120 lr1110_system_get_errors( context, &errors ); in lr1110_board_init()
121 lr1110_system_clear_errors( context ); in lr1110_board_init()
124 lr1110_board_init_tcxo_io( context ); in lr1110_board_init()
135 lr1110_system_set_dio_as_rf_switch( context, &rf_switch_configuration ); in lr1110_board_init()
143 lr1110_radio_set_pa_config( context, &paConfig ); in lr1110_board_init()
147 lr1110_radio_set_packet_type( context, packet_type ); in lr1110_board_init()
150 static void lr1110_board_init_tcxo_io( const void* context ) in lr1110_board_init_tcxo_io() argument
153 lr1110_system_set_tcxo_mode( context, LR1110_SYSTEM_TCXO_SUPPLY_VOLTAGE_1_8V, in lr1110_board_init_tcxo_io()
154 ( lr1110_board_get_tcxo_wakeup_time( context ) * 1000 ) / 30.52 ); in lr1110_board_init_tcxo_io()
159 lr1110_system_calibrate( context, calib_params ); in lr1110_board_init_tcxo_io()
167 static lr1110_hal_status_t lr1110_hal_wait_on_busy( const void* context );
169 lr1110_hal_status_t lr1110_hal_write( const void* context, const uint8_t* command, const uint16_t c… in lr1110_hal_write() argument
173 if( lr1110_hal_wakeup( context ) == LR1110_HAL_STATUS_OK ) in lr1110_hal_write()
175 GpioWrite( &( ( lr1110_t* ) context )->spi.Nss, 0 ); in lr1110_hal_write()
178 SpiInOut( &( ( lr1110_t* ) context )->spi, command[i] ); in lr1110_hal_write()
182 SpiInOut( &( ( lr1110_t* ) context )->spi, data[i] ); in lr1110_hal_write()
184 GpioWrite( &( ( lr1110_t* ) context )->spi.Nss, 1 ); in lr1110_hal_write()
189 return lr1110_hal_wait_on_busy( context ); in lr1110_hal_write()
199 lr1110_hal_status_t lr1110_hal_read( const void* context, const uint8_t* command, const uint16_t co… in lr1110_hal_read() argument
202 if( lr1110_hal_wakeup( context ) == LR1110_HAL_STATUS_OK ) in lr1110_hal_read()
204 GpioWrite( &( ( lr1110_t* ) context )->spi.Nss, 0 ); in lr1110_hal_read()
208 SpiInOut( &( ( lr1110_t* ) context )->spi, command[i] ); in lr1110_hal_read()
211 GpioWrite( &( ( lr1110_t* ) context )->spi.Nss, 1 ); in lr1110_hal_read()
213 lr1110_hal_wait_on_busy( context ); in lr1110_hal_read()
216 GpioWrite( &( ( lr1110_t* ) context )->spi.Nss, 0 ); in lr1110_hal_read()
218 SpiInOut( &( ( lr1110_t* ) context )->spi, 0 ); in lr1110_hal_read()
222 data[i] = SpiInOut( &( ( lr1110_t* ) context )->spi, 0 ); in lr1110_hal_read()
225 GpioWrite( &( ( lr1110_t* ) context )->spi.Nss, 1 ); in lr1110_hal_read()
227 return lr1110_hal_wait_on_busy( context ); in lr1110_hal_read()
232 lr1110_hal_status_t lr1110_hal_write_read( const void* context, const uint8_t* command, uint8_t* da… in lr1110_hal_write_read() argument
235 if( lr1110_hal_wakeup( context ) == LR1110_HAL_STATUS_OK ) in lr1110_hal_write_read()
237 GpioWrite( &( ( lr1110_t* ) context )->spi.Nss, 0 ); in lr1110_hal_write_read()
241 data[i] = SpiInOut( &( ( lr1110_t* ) context )->spi, command[i] ); in lr1110_hal_write_read()
244 GpioWrite( &( ( lr1110_t* ) context )->spi.Nss, 1 ); in lr1110_hal_write_read()
249 return lr1110_hal_wait_on_busy( context ); in lr1110_hal_write_read()
259 void lr1110_hal_reset( const void* context ) in lr1110_hal_reset() argument
261 GpioWrite( &( ( lr1110_t* ) context )->reset, 0 ); in lr1110_hal_reset()
263 GpioWrite( &( ( lr1110_t* ) context )->reset, 1 ); in lr1110_hal_reset()
266 lr1110_hal_status_t lr1110_hal_wakeup( const void* context ) in lr1110_hal_wakeup() argument
268 if( ( lr1110_hal_get_operating_mode( context ) == LR1110_HAL_OP_MODE_SLEEP ) || in lr1110_hal_wakeup()
269 ( lr1110_hal_get_operating_mode( context ) == LR1110_HAL_OP_MODE_RX_DC ) ) in lr1110_hal_wakeup()
272 GpioWrite( &( ( lr1110_t* ) context )->spi.Nss, 0 ); in lr1110_hal_wakeup()
273 GpioWrite( &( ( lr1110_t* ) context )->spi.Nss, 1 ); in lr1110_hal_wakeup()
276 ( ( lr1110_t* ) context )->op_mode = LR1110_HAL_OP_MODE_STDBY_RC; in lr1110_hal_wakeup()
280 return lr1110_hal_wait_on_busy( context ); in lr1110_hal_wakeup()
283 static lr1110_hal_status_t lr1110_hal_wait_on_busy( const void* context ) in lr1110_hal_wait_on_busy() argument
285 while( GpioRead( &( ( lr1110_t* ) context )->busy ) == 1 ) in lr1110_hal_wait_on_busy()
292 lr1110_hal_operating_mode_t lr1110_hal_get_operating_mode( const void* context ) in lr1110_hal_get_operating_mode() argument
294 return ( ( lr1110_t* ) context )->op_mode; in lr1110_hal_get_operating_mode()
297 void lr1110_hal_set_operating_mode( const void* context, lr1110_hal_operating_mode_t op_mode ) in lr1110_hal_set_operating_mode() argument
299 ( ( lr1110_t* ) context )->op_mode = op_mode; in lr1110_hal_set_operating_mode()