Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
Loading...
Searching...
No Matches
led3_drv.h
Go to the documentation of this file.
1/****************************************************************************
2** Copyright (C) 2020 MikroElektronika d.o.o.
3** Contact: https://www.mikroe.com/contact
4**
5** Permission is hereby granted, free of charge, to any person obtaining a copy
6** of this software and associated documentation files (the "Software"), to deal
7** in the Software without restriction, including without limitation the rights
8** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9** copies of the Software, and to permit persons to whom the Software is
10** furnished to do so, subject to the following conditions:
11** The above copyright notice and this permission notice shall be
12** included in all copies or substantial portions of the Software.
13**
14** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20** USE OR OTHER DEALINGS IN THE SOFTWARE.
21****************************************************************************/
22
28#ifndef LED3_DRV_H
29#define LED3_DRV_H
30
31#include "drv_digital_in.h"
32#include "drv_digital_out.h"
33#include "drv_i2c_master.h"
34
39#define I2C_PORTNUM 1 // CLICK interface port for I2C
40
46#define LED3_SLAVE_ADDR 0x38
47
52typedef struct
53{
54 // Modules
55 i2c_master_t i2c;
56 // MODIFIED: excluded uart
57 // uart_t uart; /**< UART driver object. */
58
59 // I2C slave address
60 uint8_t slave_address;
62} led3_t;
63
68typedef struct
69{
70 pin_name_t scl;
71 pin_name_t sda;
73 uint32_t i2c_speed;
74 uint8_t i2c_address;
77
78#endif // LED3_DRV_H
79
// led3
81
82// ------------------------------------------------------------------------ END
LED3 Click configuration object.
Definition led3_drv.h:69
pin_name_t scl
Clock pin descriptor for I2C driver.
Definition led3_drv.h:70
uint32_t i2c_speed
I2C serial speed.
Definition led3_drv.h:73
uint8_t i2c_address
I2C slave address.
Definition led3_drv.h:74
pin_name_t sda
Bidirectional data pin descriptor for I2C driver.
Definition led3_drv.h:71
LED3 Click context object.
Definition led3_drv.h:53
uint8_t slave_address
Device slave address (used for I2C driver).
Definition led3_drv.h:60
i2c_master_t i2c
I2C driver object.
Definition led3_drv.h:55