ir 2.0.0.0
|
API for configuring and manipulating IR Click driver. More...
Topics | |
IR Device Settings | |
Settings for registers of IR Click driver. | |
IR MikroBUS Map | |
MikroBUS pin mapping of IR Click driver. | |
Functions | |
void | ir_cfg_setup (ir_cfg_t *cfg) |
IR configuration object setup function. | |
void | ir_drv_interface_selection (ir_cfg_t *cfg, ir_drv_t drv_sel) |
IR driver interface setup function. | |
err_t | ir_init (ir_t *ctx, ir_cfg_t *cfg) |
IR initialization function. | |
err_t | ir_generic_write (ir_t *ctx, char *data_buf, uint16_t len) |
IR data writing function. | |
err_t | ir_generic_read (ir_t *ctx, char *data_buf, uint16_t max_len) |
IR data reading function. | |
uint8_t | ir_get_an_state (ir_t *ctx) |
IR get AN pin state function. | |
void | ir_nec_send_command (ir_t *ctx, uint8_t address, uint8_t command) |
IR NEC send data function. | |
err_t | ir_nec_read_command (ir_t *ctx, uint8_t *address, uint8_t *command) |
IR NEC data reading function. | |
API for configuring and manipulating IR Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void ir_cfg_setup | ( | ir_cfg_t * | cfg | ) |
IR configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ir_cfg_t object definition for detailed explanation. |
IR driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See ir_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See ir_drv_t object definition for detailed explanation. |
err_t ir_generic_read | ( | ir_t * | ctx, |
char * | data_buf, | ||
uint16_t | max_len ) |
IR data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See ir_t object definition for detailed explanation. |
[out] | data_buf | : Output read data. |
[in] | max_len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer.err_t ir_generic_write | ( | ir_t * | ctx, |
char * | data_buf, | ||
uint16_t | len ) |
IR data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See ir_t object definition for detailed explanation. |
[in] | data_buf | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error.uint8_t ir_get_an_state | ( | ir_t * | ctx | ) |
IR get AN pin state function.
This function reads a state of the AN pin, when AN is low there is IR signal receaved by TSOP38338 IR receiver module.
[in] | ctx | : Click context object. See ir_t object definition for detailed explanation. |
IR initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See ir_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See ir_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t ir_nec_read_command | ( | ir_t * | ctx, |
uint8_t * | address, | ||
uint8_t * | command ) |
IR NEC data reading function.
This function reads a byte of address and command data by using NEC protocol.
[in] | ctx | : Click context object. See ir_t object definition for detailed explanation. |
[out] | address | : Output read address data. |
[out] | command | : Output read command data. |
0
- Success, -1
- Error.void ir_nec_send_command | ( | ir_t * | ctx, |
uint8_t | address, | ||
uint8_t | command ) |
IR NEC send data function.
This function sends a 8-bit command to a 8-bit address using NEC protocol.
[in] | ctx | : Click context object. See ir_t object definition for detailed explanation. |
[in] | address | : Input address data. |
[in] | command | : Input command data. |