upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Functions | Macros
hal_aci_tl.cpp File Reference
Include dependency graph for hal_aci_tl.cpp:

Functions

void hal_aci_tl_debug_print (bool enable)
 Enable debug printing of all ACI commands sent and ACI events received. More...
 
void hal_aci_tl_pin_reset (void)
 Pin reset the nRF8001. More...
 
bool hal_aci_tl_event_peek (hal_aci_data_t *p_aci_data)
 Peek an ACI event from the event queue. More...
 
bool hal_aci_tl_event_get (hal_aci_data_t *p_aci_data)
 Process pending transactions. More...
 
void hal_aci_tl_init (aci_pins_t *a_pins, bool debug)
 ACI Transport Layer initialization. More...
 
bool hal_aci_tl_send (hal_aci_data_t *p_aci_cmd)
 Sends an ACI command to the radio. More...
 
bool hal_aci_tl_rx_q_empty (void)
 Return empty status of receive queue.
 
bool hal_aci_tl_rx_q_full (void)
 Return full status of transmit queue.
 
bool hal_aci_tl_tx_q_empty (void)
 Return empty status of transmit queue.
 
bool hal_aci_tl_tx_q_full (void)
 Return full status of receive queue.
 
void hal_aci_tl_q_flush (void)
 Flush the ACI command Queue and the ACI Event Queue. More...
 

Macros

#define HIGH   1
 
#define LOW   0
 
#define REVERSE_BITS(byte)   (((reverse_lookup[(byte & 0x0F)]) << 4) + reverse_lookup[((byte & 0xF0) >> 4)])
 

Function Documentation

void hal_aci_tl_debug_print ( bool  enable)

when the enable parameter is true. The debug printing is enabled on the Serial. When the enable parameter is false. The debug printing is disabled on the Serial. By default the debug printing is disabled.

Here is the caller graph for this function:

void hal_aci_tl_pin_reset ( void  )

The reset line of the nF8001 needs to kept low for 200 ns. Redbearlab shield v1.1 and v2012.07 are exceptions as they have a Power ON Reset circuit that works differently. The function handles the exceptions based on the board_name in aci_pins_t

Here is the caller graph for this function:

bool hal_aci_tl_event_peek ( hal_aci_data_t *  p_aci_data)

Call this function from the main context to peek an event from the ACI event queue. This is called by lib_aci_event_peek

Here is the caller graph for this function:

bool hal_aci_tl_event_get ( hal_aci_data_t *  p_aci_data)

The library code takes care of calling this function to check if the nRF8001 RDYN line indicates a pending transaction. It will send a pending message if there is one and return any receive message that was pending.

Returns
Points to data buffer for received data. Length byte in buffer is 0 if no data received.Get an ACI event from the event queue

Call this function from the main context to get an event from the ACI event queue This is called by lib_aci_event_get

Here is the caller graph for this function:

void hal_aci_tl_init ( aci_pins_t *  a_pins,
bool  debug 
)

This function initializes the transport layer, including configuring the SPI, creating message queues for Commands and Events and setting up interrupt if required.

Parameters
a_pinsPins on the MCU used to connect to the nRF8001
boolTrue if debug printing should be enabled on the Serial.

Here is the call graph for this function:

Here is the caller graph for this function:

bool hal_aci_tl_send ( hal_aci_data_t *  aci_buffer)

This function sends an ACI command to the radio. This queue up the message to send and lower the request line. When the device lowers the ready line, m_aci_spi_transfer() will send the data.

Parameters
aci_bufferPointer to the message to send.
Returns
True if the data was successfully queued for sending, false if there is no more space to store messages to send.

Here is the caller graph for this function:

void hal_aci_tl_q_flush ( void  )

Call this function in the main thread

Here is the caller graph for this function: